Added new theme for Material You & a toggle
This commit is contained in:
parent
289557898e
commit
f23b102e41
34 changed files with 243 additions and 123 deletions
|
@ -35,23 +35,26 @@ class BottomNavigationBarTinted @JvmOverloads constructor(
|
|||
init {
|
||||
labelVisibilityMode = PreferenceUtil.tabTitleMode
|
||||
|
||||
val iconColor = ATHUtil.resolveColor(context, android.R.attr.colorControlNormal)
|
||||
val accentColor = ThemeStore.accentColor(context)
|
||||
NavigationViewUtil.setItemIconColors(
|
||||
this,
|
||||
ColorUtil.withAlpha(iconColor, 0.5f),
|
||||
accentColor
|
||||
)
|
||||
NavigationViewUtil.setItemTextColors(
|
||||
this,
|
||||
ColorUtil.withAlpha(iconColor, 0.5f),
|
||||
accentColor
|
||||
)
|
||||
itemRippleColor = ColorStateList.valueOf(accentColor.addAlpha())
|
||||
background = ColorDrawable(ATHUtil.resolveColor(context, R.attr.colorSurface))
|
||||
if (!PreferenceUtil.materialYou) {
|
||||
val iconColor = ATHUtil.resolveColor(context, android.R.attr.colorControlNormal)
|
||||
val accentColor = ThemeStore.accentColor(context)
|
||||
NavigationViewUtil.setItemIconColors(
|
||||
this,
|
||||
ColorUtil.withAlpha(iconColor, 0.5f),
|
||||
accentColor
|
||||
)
|
||||
NavigationViewUtil.setItemTextColors(
|
||||
this,
|
||||
ColorUtil.withAlpha(iconColor, 0.5f),
|
||||
accentColor
|
||||
)
|
||||
itemRippleColor = ColorStateList.valueOf(accentColor.addAlpha(0.08F))
|
||||
background = ColorDrawable(ATHUtil.resolveColor(context, R.attr.colorSurface))
|
||||
itemActiveIndicatorColor = ColorStateList.valueOf(accentColor.addAlpha(0.12F))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun Int.addAlpha(): Int {
|
||||
return ColorUtil.withAlpha(this, 0.12f)
|
||||
fun Int.addAlpha(alpha: Float): Int {
|
||||
return ColorUtil.withAlpha(this, alpha)
|
||||
}
|
||||
|
|
|
@ -32,7 +32,6 @@ import androidx.annotation.NonNull;
|
|||
import androidx.annotation.Nullable;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
|
||||
import code.name.monkey.appthemehelper.ThemeStore;
|
||||
import code.name.monkey.retromusic.R;
|
||||
|
||||
public class PopupBackground extends Drawable {
|
||||
|
@ -47,10 +46,10 @@ public class PopupBackground extends Drawable {
|
|||
|
||||
@NonNull private final Matrix mTempMatrix = new Matrix();
|
||||
|
||||
public PopupBackground(@NonNull Context context) {
|
||||
public PopupBackground(@NonNull Context context, int color) {
|
||||
mPaint = new Paint();
|
||||
mPaint.setAntiAlias(true);
|
||||
mPaint.setColor(ThemeStore.Companion.accentColor(context));
|
||||
mPaint.setColor(color);
|
||||
mPaint.setStyle(Paint.Style.FILL);
|
||||
Resources resources = context.getResources();
|
||||
mPaddingStart = resources.getDimensionPixelOffset(R.dimen.afs_md2_popup_padding_start);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue