mirror of
https://github.com/alesimula/Murine-launcher.git
synced 2026-10-28 09:43:42 +00:00
BUGFIX - fix toolbar ripple effect by embedding it in the icon
This commit is contained in:
1 parent
571606d6c9
commit
d4168020c5
2 files changed
+22
No files matched your search
@@ -44,4 +44,14 @@
|
|||||||
android:pathData="M3.626,9L8.526,13.9C8.726,14.1 8.817,14.333 8.801,14.6C8.801,14.867 8.701,15.1 8.501,15.3C8.301,15.483 8.067,15.583 7.801,15.6C7.534,15.6 7.301,15.5 7.101,15.3L0.501,8.7C0.401,8.6 0.326,8.492 0.276,8.375C0.242,8.258 0.226,8.133 0.226,8C0.226,7.867 0.242,7.742 0.276,7.625C0.326,7.508 0.401,7.4 0.501,7.3L7.101,0.7C7.284,0.517 7.509,0.425 7.776,0.425C8.059,0.425 8.301,0.517 8.501,0.7C8.701,0.9 8.801,1.142 8.801,1.425C8.801,1.692 8.701,1.925 8.501,2.125L3.626,7H14.801C15.084,7 15.317,7.1 15.501,7.3C15.701,7.483 15.801,7.717 15.801,8C15.801,8.283 15.701,8.525 15.501,8.725C15.317,8.908 15.084,9 14.801,9H3.626Z"/>
|
android:pathData="M3.626,9L8.526,13.9C8.726,14.1 8.817,14.333 8.801,14.6C8.801,14.867 8.701,15.1 8.501,15.3C8.301,15.483 8.067,15.583 7.801,15.6C7.534,15.6 7.301,15.5 7.101,15.3L0.501,8.7C0.401,8.6 0.326,8.492 0.276,8.375C0.242,8.258 0.226,8.133 0.226,8C0.226,7.867 0.242,7.742 0.276,7.625C0.326,7.508 0.401,7.4 0.501,7.3L7.101,0.7C7.284,0.517 7.509,0.425 7.776,0.425C8.059,0.425 8.301,0.517 8.501,0.7C8.701,0.9 8.801,1.142 8.801,1.425C8.801,1.692 8.701,1.925 8.501,2.125L3.626,7H14.801C15.084,7 15.317,7.1 15.501,7.3C15.701,7.483 15.801,7.717 15.801,8C15.801,8.283 15.701,8.525 15.501,8.725C15.317,8.908 15.084,9 14.801,9H3.626Z"/>
|
||||||
</vector>
|
</vector>
|
||||||
</item>
|
</item>
|
||||||
|
<!-- Murine: ripple on top of the circle; the Toolbar's own ripple is drawn behind it -->
|
||||||
|
<item android:start="16dp">
|
||||||
|
<ripple android:color="?android:attr/colorControlHighlight">
|
||||||
|
<item android:id="@android:id/mask">
|
||||||
|
<shape android:shape="oval">
|
||||||
|
<solid android:color="@android:color/white" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</ripple>
|
||||||
|
</item>
|
||||||
</layer-list>
|
</layer-list>
|
||||||
@@ -19,9 +19,12 @@ package com.android.launcher3.settings;
|
|||||||
import static androidx.preference.PreferenceFragmentCompat.ARG_PREFERENCE_ROOT;
|
import static androidx.preference.PreferenceFragmentCompat.ARG_PREFERENCE_ROOT;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
import android.widget.ImageButton;
|
||||||
|
import android.widget.Toolbar;
|
||||||
|
|
||||||
import androidx.core.view.WindowCompat;
|
import androidx.core.view.WindowCompat;
|
||||||
import androidx.fragment.app.DialogFragment;
|
import androidx.fragment.app.DialogFragment;
|
||||||
@@ -82,6 +85,15 @@ public class SettingsActivity extends FragmentActivity
|
|||||||
// || intent.hasExtra(EXTRA_FRAGMENT_HIGHLIGHT_KEY)) {
|
// || intent.hasExtra(EXTRA_FRAGMENT_HIGHLIGHT_KEY)) {
|
||||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getActionBar().setHomeAsUpIndicator(com.android.settingslib.widget.theme.R.drawable.settingslib_expressive_icon_back);
|
getActionBar().setHomeAsUpIndicator(com.android.settingslib.widget.theme.R.drawable.settingslib_expressive_icon_back);
|
||||||
|
// The icon draws its own ripple now: drop the button's, which sits behind the circle, off-center
|
||||||
|
Toolbar toolbar = findViewById(R.id.action_bar);
|
||||||
|
Drawable navIcon = toolbar.getNavigationIcon();
|
||||||
|
for (int i = 0; i < toolbar.getChildCount(); i++) {
|
||||||
|
if (toolbar.getChildAt(i) instanceof ImageButton nav && nav.getDrawable() == navIcon) {
|
||||||
|
nav.setBackground(null);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
//}
|
//}
|
||||||
if (savedInstanceState == null) {
|
if (savedInstanceState == null) {
|
||||||
Bundle args = intent.getBundleExtra(EXTRA_FRAGMENT_ARGS);
|
Bundle args = intent.getBundleExtra(EXTRA_FRAGMENT_ARGS);
|
||||||
|
|||||||
Reference in new issue
Block a user