diff --git a/app/src/main/res/layout/fragment_main_recycler.xml b/app/src/main/res/layout/fragment_main_recycler.xml index 1c1478b7..c1d2df14 100644 --- a/app/src/main/res/layout/fragment_main_recycler.xml +++ b/app/src/main/res/layout/fragment_main_recycler.xml @@ -84,5 +84,6 @@ android:layout_height="wrap_content" android:layout_gravity="bottom|right" app:srcCompat="@drawable/ic_shuffle" + style="@style/Widget.Material3.FloatingActionButton.Primary" android:layout_marginHorizontal="16dp"/> \ No newline at end of file diff --git a/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/prefs/supportv7/ATEPreferenceCategory.kt b/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/prefs/supportv7/ATEPreferenceCategory.kt index e8dccf0a..c2a890a3 100644 --- a/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/prefs/supportv7/ATEPreferenceCategory.kt +++ b/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/prefs/supportv7/ATEPreferenceCategory.kt @@ -17,9 +17,12 @@ package code.name.monkey.appthemehelper.common.prefs.supportv7 import android.content.Context import android.util.AttributeSet import android.widget.TextView +import androidx.core.content.ContextCompat import androidx.preference.PreferenceCategory import androidx.preference.PreferenceViewHolder +import code.name.monkey.appthemehelper.R import code.name.monkey.appthemehelper.ThemeStore +import code.name.monkey.appthemehelper.util.VersionUtils class ATEPreferenceCategory @JvmOverloads constructor( context: Context?, @@ -31,6 +34,13 @@ class ATEPreferenceCategory @JvmOverloads constructor( override fun onBindViewHolder(holder: PreferenceViewHolder) { super.onBindViewHolder(holder) val title = holder.itemView.findViewById(android.R.id.title) - title.setTextColor(ThemeStore.accentColor(context)) + title.setTextColor( + // Set MD3 accent if MD3 is enabled or in-app accent otherwise + if (ThemeStore.isMD3Enabled(context) && VersionUtils.hasS()) { + ContextCompat.getColor(context, R.color.m3_accent_color) + } else { + ThemeStore.accentColor(context) + } + ) } } diff --git a/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/prefs/supportv7/ATESeekBarPreference.kt b/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/prefs/supportv7/ATESeekBarPreference.kt index 098cb840..7963f5fa 100644 --- a/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/prefs/supportv7/ATESeekBarPreference.kt +++ b/appthemehelper/src/main/java/code/name/monkey/appthemehelper/common/prefs/supportv7/ATESeekBarPreference.kt @@ -5,6 +5,7 @@ import android.text.Editable import android.util.AttributeSet import android.widget.SeekBar import android.widget.TextView +import androidx.core.content.ContextCompat import androidx.core.graphics.BlendModeColorFilterCompat import androidx.core.graphics.BlendModeCompat import androidx.core.widget.doAfterTextChanged @@ -14,6 +15,7 @@ import code.name.monkey.appthemehelper.R import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.util.ATHUtil import code.name.monkey.appthemehelper.util.TintHelper +import code.name.monkey.appthemehelper.util.VersionUtils class ATESeekBarPreference @JvmOverloads constructor( context: Context, @@ -43,7 +45,14 @@ class ATESeekBarPreference @JvmOverloads constructor( override fun onBindViewHolder(view: PreferenceViewHolder) { super.onBindViewHolder(view) val seekBar = view.findViewById(R.id.seekbar) as SeekBar - TintHelper.setTintAuto(seekBar, ThemeStore.accentColor(context), false) + TintHelper.setTintAuto( + seekBar, // Set MD3 accent if MD3 is enabled or in-app accent otherwise + if (ThemeStore.isMD3Enabled(context) && VersionUtils.hasS()) { + ContextCompat.getColor(context, R.color.m3_accent_color) + } else { + ThemeStore.accentColor(context) + }, false + ) (view.findViewById(R.id.seekbar_value) as TextView).apply { appendUnit(editableText) doAfterTextChanged {