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
|
@ -20,6 +20,7 @@ import code.name.monkey.appthemehelper.ThemeStore
|
||||||
import code.name.monkey.appthemehelper.util.VersionUtils
|
import code.name.monkey.appthemehelper.util.VersionUtils
|
||||||
import code.name.monkey.retromusic.Constants.PRO_VERSION_PRODUCT_ID
|
import code.name.monkey.retromusic.Constants.PRO_VERSION_PRODUCT_ID
|
||||||
import code.name.monkey.retromusic.appshortcuts.DynamicShortcutManager
|
import code.name.monkey.retromusic.appshortcuts.DynamicShortcutManager
|
||||||
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
import com.anjlab.android.iab.v3.BillingProcessor
|
import com.anjlab.android.iab.v3.BillingProcessor
|
||||||
import com.anjlab.android.iab.v3.TransactionDetails
|
import com.anjlab.android.iab.v3.TransactionDetails
|
||||||
import com.google.android.material.color.DynamicColors
|
import com.google.android.material.color.DynamicColors
|
||||||
|
@ -46,7 +47,9 @@ class App : Application() {
|
||||||
.commit()
|
.commit()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (PreferenceUtil.materialYou) {
|
||||||
DynamicColors.applyToActivitiesIfAvailable(this)
|
DynamicColors.applyToActivitiesIfAvailable(this)
|
||||||
|
}
|
||||||
|
|
||||||
if (VersionUtils.hasNougatMR())
|
if (VersionUtils.hasNougatMR())
|
||||||
DynamicShortcutManager(this).initDynamicShortcuts()
|
DynamicShortcutManager(this).initDynamicShortcuts()
|
||||||
|
|
|
@ -148,3 +148,4 @@ const val SHOW_LYRICS = "show_lyrics"
|
||||||
const val REMEMBER_LAST_TAB = "remember_last_tab"
|
const val REMEMBER_LAST_TAB = "remember_last_tab"
|
||||||
const val LAST_USED_TAB = "last_used_tab"
|
const val LAST_USED_TAB = "last_used_tab"
|
||||||
const val WHITELIST_MUSIC = "whitelist_music"
|
const val WHITELIST_MUSIC = "whitelist_music"
|
||||||
|
const val MATERIAL_YOU = "material_you"
|
||||||
|
|
|
@ -33,6 +33,7 @@ import code.name.monkey.appthemehelper.util.MaterialUtil
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.databinding.ActivityAlbumTagEditorBinding
|
import code.name.monkey.retromusic.databinding.ActivityAlbumTagEditorBinding
|
||||||
import code.name.monkey.retromusic.extensions.appHandleColor
|
import code.name.monkey.retromusic.extensions.appHandleColor
|
||||||
|
import code.name.monkey.retromusic.extensions.setTint
|
||||||
import code.name.monkey.retromusic.glide.GlideApp
|
import code.name.monkey.retromusic.glide.GlideApp
|
||||||
import code.name.monkey.retromusic.glide.palette.BitmapPaletteWrapper
|
import code.name.monkey.retromusic.glide.palette.BitmapPaletteWrapper
|
||||||
import code.name.monkey.retromusic.model.ArtworkInfo
|
import code.name.monkey.retromusic.model.ArtworkInfo
|
||||||
|
@ -62,8 +63,6 @@ class AlbumTagEditorActivity : AbsTagEditorActivity<ActivityAlbumTagEditorBindin
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun loadImageFromFile(selectedFile: Uri?) {
|
override fun loadImageFromFile(selectedFile: Uri?) {
|
||||||
|
|
||||||
|
|
||||||
GlideApp.with(this@AlbumTagEditorActivity).asBitmapPalette().load(selectedFile)
|
GlideApp.with(this@AlbumTagEditorActivity).asBitmapPalette().load(selectedFile)
|
||||||
.diskCacheStrategy(DiskCacheStrategy.NONE).skipMemoryCache(true)
|
.diskCacheStrategy(DiskCacheStrategy.NONE).skipMemoryCache(true)
|
||||||
.into(object : ImageViewTarget<BitmapPaletteWrapper>(binding.editorImage) {
|
.into(object : ImageViewTarget<BitmapPaletteWrapper>(binding.editorImage) {
|
||||||
|
@ -119,10 +118,10 @@ class AlbumTagEditorActivity : AbsTagEditorActivity<ActivityAlbumTagEditorBindin
|
||||||
private fun setUpViews() {
|
private fun setUpViews() {
|
||||||
fillViewsWithFileTags()
|
fillViewsWithFileTags()
|
||||||
|
|
||||||
MaterialUtil.setTint(binding.yearContainer, false)
|
binding.yearContainer.setTint(false)
|
||||||
MaterialUtil.setTint(binding.genreContainer, false)
|
binding.genreContainer.setTint(false)
|
||||||
MaterialUtil.setTint(binding.albumTitleContainer, false)
|
binding.albumTitleContainer.setTint(false)
|
||||||
MaterialUtil.setTint(binding.albumArtistContainer, false)
|
binding.albumArtistContainer.setTint(false)
|
||||||
|
|
||||||
binding.albumText.appHandleColor().addTextChangedListener(this)
|
binding.albumText.appHandleColor().addTextChangedListener(this)
|
||||||
binding.albumArtistText.appHandleColor().addTextChangedListener(this)
|
binding.albumArtistText.appHandleColor().addTextChangedListener(this)
|
||||||
|
|
|
@ -22,10 +22,10 @@ import android.text.TextWatcher
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||||
import code.name.monkey.appthemehelper.util.MaterialUtil
|
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.databinding.ActivitySongTagEditorBinding
|
import code.name.monkey.retromusic.databinding.ActivitySongTagEditorBinding
|
||||||
import code.name.monkey.retromusic.extensions.appHandleColor
|
import code.name.monkey.retromusic.extensions.appHandleColor
|
||||||
|
import code.name.monkey.retromusic.extensions.setTint
|
||||||
import code.name.monkey.retromusic.repository.SongRepository
|
import code.name.monkey.retromusic.repository.SongRepository
|
||||||
import org.jaudiotagger.tag.FieldKey
|
import org.jaudiotagger.tag.FieldKey
|
||||||
import org.koin.android.ext.android.inject
|
import org.koin.android.ext.android.inject
|
||||||
|
@ -50,15 +50,15 @@ class SongTagEditorActivity : AbsTagEditorActivity<ActivitySongTagEditorBinding>
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
private fun setUpViews() {
|
private fun setUpViews() {
|
||||||
fillViewsWithFileTags()
|
fillViewsWithFileTags()
|
||||||
MaterialUtil.setTint(binding.songTextContainer, false)
|
binding.songTextContainer.setTint(false)
|
||||||
MaterialUtil.setTint(binding.composerContainer, false)
|
binding.composerContainer.setTint(false)
|
||||||
MaterialUtil.setTint(binding.albumTextContainer, false)
|
binding.albumTextContainer.setTint(false)
|
||||||
MaterialUtil.setTint(binding.artistContainer, false)
|
binding.artistContainer.setTint(false)
|
||||||
MaterialUtil.setTint(binding.albumArtistContainer, false)
|
binding.albumArtistContainer.setTint(false)
|
||||||
MaterialUtil.setTint(binding.yearContainer, false)
|
binding.yearContainer.setTint(false)
|
||||||
MaterialUtil.setTint(binding.genreContainer, false)
|
binding.genreContainer.setTint(false)
|
||||||
MaterialUtil.setTint(binding.trackNumberContainer, false)
|
binding.trackNumberContainer.setTint(false)
|
||||||
MaterialUtil.setTint(binding.lyricsContainer, false)
|
binding.lyricsContainer.setTint(false)
|
||||||
|
|
||||||
binding.songText.appHandleColor().addTextChangedListener(this)
|
binding.songText.appHandleColor().addTextChangedListener(this)
|
||||||
binding.albumText.appHandleColor().addTextChangedListener(this)
|
binding.albumText.appHandleColor().addTextChangedListener(this)
|
||||||
|
|
|
@ -21,6 +21,7 @@ import android.widget.ImageView
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.appcompat.widget.AppCompatTextView
|
import androidx.appcompat.widget.AppCompatTextView
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.os.bundleOf
|
import androidx.core.os.bundleOf
|
||||||
import androidx.fragment.app.findFragment
|
import androidx.fragment.app.findFragment
|
||||||
import androidx.navigation.findNavController
|
import androidx.navigation.findNavController
|
||||||
|
@ -30,6 +31,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import code.name.monkey.appthemehelper.ThemeStore
|
import code.name.monkey.appthemehelper.ThemeStore
|
||||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||||
|
import code.name.monkey.appthemehelper.util.VersionUtils
|
||||||
import code.name.monkey.retromusic.*
|
import code.name.monkey.retromusic.*
|
||||||
import code.name.monkey.retromusic.adapter.album.AlbumAdapter
|
import code.name.monkey.retromusic.adapter.album.AlbumAdapter
|
||||||
import code.name.monkey.retromusic.adapter.artist.ArtistAdapter
|
import code.name.monkey.retromusic.adapter.artist.ArtistAdapter
|
||||||
|
@ -190,7 +192,11 @@ class HomeAdapter(
|
||||||
)
|
)
|
||||||
|
|
||||||
fun bindView(home: Home) {
|
fun bindView(home: Home) {
|
||||||
val color = ThemeStore.accentColor(activity)
|
val color = if (PreferenceUtil.materialYou && VersionUtils.hasS()) {
|
||||||
|
ContextCompat.getColor(App.getContext(), R.color.m3_accent_color)
|
||||||
|
} else {
|
||||||
|
ThemeStore.accentColor(activity)
|
||||||
|
}
|
||||||
itemView.findViewById<TextView>(R.id.message).apply {
|
itemView.findViewById<TextView>(R.id.message).apply {
|
||||||
setTextColor(color)
|
setTextColor(color)
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
|
|
|
@ -16,10 +16,9 @@ package code.name.monkey.retromusic.adapter.song
|
||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.fragment.app.FragmentActivity
|
import androidx.fragment.app.FragmentActivity
|
||||||
import code.name.monkey.appthemehelper.ThemeStore
|
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.extensions.applyColor
|
import code.name.monkey.retromusic.extensions.accentColor
|
||||||
import code.name.monkey.retromusic.extensions.applyOutlineColor
|
import code.name.monkey.retromusic.extensions.accentOutlineColor
|
||||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||||
import code.name.monkey.retromusic.interfaces.ICabHolder
|
import code.name.monkey.retromusic.interfaces.ICabHolder
|
||||||
import code.name.monkey.retromusic.model.Song
|
import code.name.monkey.retromusic.model.Song
|
||||||
|
@ -45,19 +44,18 @@ class ShuffleButtonSongAdapter(
|
||||||
|
|
||||||
override fun onBindViewHolder(holder: SongAdapter.ViewHolder, position: Int) {
|
override fun onBindViewHolder(holder: SongAdapter.ViewHolder, position: Int) {
|
||||||
if (holder.itemViewType == OFFSET_ITEM) {
|
if (holder.itemViewType == OFFSET_ITEM) {
|
||||||
val color = ThemeStore.accentColor(activity)
|
|
||||||
val viewHolder = holder as ViewHolder
|
val viewHolder = holder as ViewHolder
|
||||||
viewHolder.playAction?.let {
|
viewHolder.playAction?.let {
|
||||||
it.setOnClickListener {
|
it.setOnClickListener {
|
||||||
MusicPlayerRemote.openQueue(dataSet, 0, true)
|
MusicPlayerRemote.openQueue(dataSet, 0, true)
|
||||||
}
|
}
|
||||||
it.applyOutlineColor(color)
|
it.accentOutlineColor()
|
||||||
}
|
}
|
||||||
viewHolder.shuffleAction?.let {
|
viewHolder.shuffleAction?.let {
|
||||||
it.setOnClickListener {
|
it.setOnClickListener {
|
||||||
MusicPlayerRemote.openAndShuffleQueue(dataSet, true)
|
MusicPlayerRemote.openAndShuffleQueue(dataSet, true)
|
||||||
}
|
}
|
||||||
it.applyColor(color)
|
it.accentColor()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
super.onBindViewHolder(holder, position - 1)
|
super.onBindViewHolder(holder, position - 1)
|
||||||
|
|
|
@ -37,6 +37,7 @@ import code.name.monkey.appthemehelper.util.ColorUtil
|
||||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||||
import code.name.monkey.retromusic.App
|
import code.name.monkey.retromusic.App
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
|
import code.name.monkey.retromusic.util.PreferenceUtil.materialYou
|
||||||
import com.google.android.material.button.MaterialButton
|
import com.google.android.material.button.MaterialButton
|
||||||
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||||
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
|
@ -84,23 +85,32 @@ fun Fragment.resolveColor(@AttrRes attr: Int, fallBackColor: Int = 0) =
|
||||||
fun Dialog.resolveColor(@AttrRes attr: Int, fallBackColor: Int = 0) =
|
fun Dialog.resolveColor(@AttrRes attr: Int, fallBackColor: Int = 0) =
|
||||||
ATHUtil.resolveColor(context, attr, fallBackColor)
|
ATHUtil.resolveColor(context, attr, fallBackColor)
|
||||||
|
|
||||||
|
// Don't apply accent colors if Material You is enabled
|
||||||
|
// Material Components will take care of applying material you colors
|
||||||
fun CheckBox.addAccentColor() {
|
fun CheckBox.addAccentColor() {
|
||||||
|
if (materialYou) return
|
||||||
buttonTintList = ColorStateList.valueOf(ThemeStore.accentColor(context))
|
buttonTintList = ColorStateList.valueOf(ThemeStore.accentColor(context))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun SeekBar.addAccentColor() {
|
fun SeekBar.addAccentColor() {
|
||||||
|
if (materialYou) return
|
||||||
val colorState = ColorStateList.valueOf(ThemeStore.accentColor(context))
|
val colorState = ColorStateList.valueOf(ThemeStore.accentColor(context))
|
||||||
progressTintList = colorState
|
progressTintList = colorState
|
||||||
thumbTintList = colorState
|
thumbTintList = colorState
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Button.accentTextColor() = setTextColor(ThemeStore.accentColor(App.getContext()))
|
fun Button.accentTextColor() {
|
||||||
|
if (materialYou) return
|
||||||
|
setTextColor(ThemeStore.accentColor(App.getContext()))
|
||||||
|
}
|
||||||
|
|
||||||
fun MaterialButton.accentBackgroundColor() {
|
fun MaterialButton.accentBackgroundColor() {
|
||||||
|
if (materialYou) return
|
||||||
backgroundTintList = ColorStateList.valueOf(ThemeStore.accentColor(App.getContext()))
|
backgroundTintList = ColorStateList.valueOf(ThemeStore.accentColor(App.getContext()))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun MaterialButton.accentOutlineColor() {
|
fun MaterialButton.accentOutlineColor() {
|
||||||
|
if (materialYou) return
|
||||||
val color = ThemeStore.accentColor(context)
|
val color = ThemeStore.accentColor(context)
|
||||||
val colorStateList = ColorStateList.valueOf(color)
|
val colorStateList = ColorStateList.valueOf(color)
|
||||||
iconTint = colorStateList
|
iconTint = colorStateList
|
||||||
|
@ -116,6 +126,7 @@ fun SeekBar.applyColor(@ColorInt color: Int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun ExtendedFloatingActionButton.accentColor() {
|
fun ExtendedFloatingActionButton.accentColor() {
|
||||||
|
if (materialYou) return
|
||||||
val color = ThemeStore.accentColor(context)
|
val color = ThemeStore.accentColor(context)
|
||||||
val textColor = MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(color))
|
val textColor = MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(color))
|
||||||
val colorStateList = ColorStateList.valueOf(color)
|
val colorStateList = ColorStateList.valueOf(color)
|
||||||
|
@ -126,6 +137,7 @@ fun ExtendedFloatingActionButton.accentColor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun FloatingActionButton.accentColor() {
|
fun FloatingActionButton.accentColor() {
|
||||||
|
if (materialYou) return
|
||||||
val color = ThemeStore.accentColor(context)
|
val color = ThemeStore.accentColor(context)
|
||||||
val textColor = MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(color))
|
val textColor = MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(color))
|
||||||
backgroundTintList = ColorStateList.valueOf(color)
|
backgroundTintList = ColorStateList.valueOf(color)
|
||||||
|
@ -145,15 +157,21 @@ fun MaterialButton.applyColor(color: Int) {
|
||||||
iconTint = textColorColorStateList
|
iconTint = textColorColorStateList
|
||||||
}
|
}
|
||||||
|
|
||||||
fun MaterialButton.accentColor() = applyColor(ThemeStore.accentColor(context))
|
fun MaterialButton.accentColor() {
|
||||||
|
if (materialYou) return
|
||||||
|
applyColor(ThemeStore.accentColor(context))
|
||||||
|
}
|
||||||
|
|
||||||
fun MaterialButton.applyOutlineColor(color: Int) {
|
fun MaterialButton.applyOutlineColor(color: Int) {
|
||||||
val textColorColorStateList = ColorStateList.valueOf(color)
|
val colorStateList = ColorStateList.valueOf(color)
|
||||||
setTextColor(textColorColorStateList)
|
iconTint = colorStateList
|
||||||
iconTint = textColorColorStateList
|
strokeColor = colorStateList
|
||||||
|
setTextColor(colorStateList)
|
||||||
|
rippleColor = colorStateList
|
||||||
}
|
}
|
||||||
|
|
||||||
fun TextInputLayout.accentColor() {
|
fun TextInputLayout.accentColor() {
|
||||||
|
if (materialYou) return
|
||||||
val accentColor = ThemeStore.accentColor(context)
|
val accentColor = ThemeStore.accentColor(context)
|
||||||
val colorState = ColorStateList.valueOf(accentColor)
|
val colorState = ColorStateList.valueOf(accentColor)
|
||||||
boxStrokeColor = accentColor
|
boxStrokeColor = accentColor
|
||||||
|
@ -162,6 +180,7 @@ fun TextInputLayout.accentColor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun CircularProgressIndicator.accentColor() {
|
fun CircularProgressIndicator.accentColor() {
|
||||||
|
if (materialYou) return
|
||||||
val color = ThemeStore.accentColor(context)
|
val color = ThemeStore.accentColor(context)
|
||||||
setIndicatorColor(color)
|
setIndicatorColor(color)
|
||||||
trackColor = ColorUtil.withAlpha(color, 0.2f)
|
trackColor = ColorUtil.withAlpha(color, 0.2f)
|
||||||
|
@ -174,6 +193,21 @@ fun CircularProgressIndicator.applyColor(color: Int) {
|
||||||
|
|
||||||
fun AppCompatImageView.accentColor(): Int = ThemeStore.accentColor(context)
|
fun AppCompatImageView.accentColor(): Int = ThemeStore.accentColor(context)
|
||||||
|
|
||||||
|
fun TextInputLayout.setTint(background: Boolean = true) {
|
||||||
|
if (materialYou) return
|
||||||
|
val accentColor = ThemeStore.accentColor(context)
|
||||||
|
val colorState = ColorStateList.valueOf(accentColor)
|
||||||
|
|
||||||
|
if (background) {
|
||||||
|
backgroundTintList = colorState
|
||||||
|
defaultHintTextColor = colorState
|
||||||
|
} else {
|
||||||
|
boxStrokeColor = accentColor
|
||||||
|
defaultHintTextColor = colorState
|
||||||
|
isHintAnimationEnabled = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@CheckResult
|
@CheckResult
|
||||||
fun Drawable.tint(@ColorInt color: Int): Drawable {
|
fun Drawable.tint(@ColorInt color: Int): Drawable {
|
||||||
val tintedDrawable = DrawableCompat.wrap(this).mutate()
|
val tintedDrawable = DrawableCompat.wrap(this).mutate()
|
||||||
|
|
|
@ -27,6 +27,7 @@ import androidx.core.animation.doOnEnd
|
||||||
import androidx.core.animation.doOnStart
|
import androidx.core.animation.doOnStart
|
||||||
import code.name.monkey.appthemehelper.ThemeStore
|
import code.name.monkey.appthemehelper.ThemeStore
|
||||||
import code.name.monkey.appthemehelper.util.TintHelper
|
import code.name.monkey.appthemehelper.util.TintHelper
|
||||||
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||||
import com.google.android.material.imageview.ShapeableImageView
|
import com.google.android.material.imageview.ShapeableImageView
|
||||||
import com.google.android.material.shape.ShapeAppearanceModel
|
import com.google.android.material.shape.ShapeAppearanceModel
|
||||||
|
@ -51,6 +52,7 @@ fun View.hidden() {
|
||||||
fun View.showOrHide(show: Boolean) = if (show) show() else hide()
|
fun View.showOrHide(show: Boolean) = if (show) show() else hide()
|
||||||
|
|
||||||
fun EditText.appHandleColor(): EditText {
|
fun EditText.appHandleColor(): EditText {
|
||||||
|
if (PreferenceUtil.materialYou) return this
|
||||||
TintHelper.colorHandles(this, ThemeStore.accentColor(context))
|
TintHelper.colorHandles(this, ThemeStore.accentColor(context))
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ import android.view.MenuInflater
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import android.view.MenuItem.SHOW_AS_ACTION_IF_ROOM
|
import android.view.MenuItem.SHOW_AS_ACTION_IF_ROOM
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.os.bundleOf
|
import androidx.core.os.bundleOf
|
||||||
import androidx.core.text.HtmlCompat
|
import androidx.core.text.HtmlCompat
|
||||||
import androidx.core.view.doOnPreDraw
|
import androidx.core.view.doOnPreDraw
|
||||||
|
@ -29,6 +30,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import code.name.monkey.appthemehelper.ThemeStore
|
import code.name.monkey.appthemehelper.ThemeStore
|
||||||
import code.name.monkey.appthemehelper.common.ATHToolbarActivity
|
import code.name.monkey.appthemehelper.common.ATHToolbarActivity
|
||||||
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
|
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
|
||||||
|
import code.name.monkey.appthemehelper.util.VersionUtils
|
||||||
import code.name.monkey.retromusic.*
|
import code.name.monkey.retromusic.*
|
||||||
import code.name.monkey.retromusic.adapter.HomeAdapter
|
import code.name.monkey.retromusic.adapter.HomeAdapter
|
||||||
import code.name.monkey.retromusic.databinding.FragmentBannerHomeBinding
|
import code.name.monkey.retromusic.databinding.FragmentBannerHomeBinding
|
||||||
|
@ -139,7 +141,11 @@ class HomeFragment :
|
||||||
MaterialSharedAxis(MaterialSharedAxis.Z, false)
|
MaterialSharedAxis(MaterialSharedAxis.Z, false)
|
||||||
findNavController().navigate(R.id.searchFragment, null, navOptions)
|
findNavController().navigate(R.id.searchFragment, null, navOptions)
|
||||||
}
|
}
|
||||||
val color = ThemeStore.accentColor(requireContext())
|
val color = if (PreferenceUtil.materialYou && VersionUtils.hasS()) {
|
||||||
|
ContextCompat.getColor(App.getContext(), R.color.m3_accent_color)
|
||||||
|
} else {
|
||||||
|
ThemeStore.accentColor(requireContext())
|
||||||
|
}
|
||||||
val hexColor = String.format("#%06X", 0xFFFFFF and color)
|
val hexColor = String.format("#%06X", 0xFFFFFF and color)
|
||||||
val appName = HtmlCompat.fromHtml(
|
val appName = HtmlCompat.fromHtml(
|
||||||
"Retro <span style='color:$hexColor';>Music</span>",
|
"Retro <span style='color:$hexColor';>Music</span>",
|
||||||
|
|
|
@ -111,6 +111,12 @@ class ThemeSettingsFragment : AbsSettingsFragment() {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val materialYou: ATESwitchPreference? = findPreference(MATERIAL_YOU)
|
||||||
|
materialYou?.setOnPreferenceChangeListener { _, _ ->
|
||||||
|
restartActivity()
|
||||||
|
true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
package code.name.monkey.retromusic.glide
|
package code.name.monkey.retromusic.glide
|
||||||
|
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import code.name.monkey.appthemehelper.ThemeStore.Companion.accentColor
|
import code.name.monkey.appthemehelper.ThemeStore.Companion.accentColor
|
||||||
import code.name.monkey.appthemehelper.util.TintHelper
|
import code.name.monkey.appthemehelper.util.TintHelper
|
||||||
|
import code.name.monkey.appthemehelper.util.VersionUtils
|
||||||
import code.name.monkey.retromusic.App.Companion.getContext
|
import code.name.monkey.retromusic.App.Companion.getContext
|
||||||
import code.name.monkey.retromusic.Constants.USER_BANNER
|
import code.name.monkey.retromusic.Constants.USER_BANNER
|
||||||
import code.name.monkey.retromusic.Constants.USER_PROFILE
|
import code.name.monkey.retromusic.Constants.USER_PROFILE
|
||||||
|
@ -17,6 +19,7 @@ import code.name.monkey.retromusic.util.CustomArtistImageUtil.Companion.getFile
|
||||||
import code.name.monkey.retromusic.util.CustomArtistImageUtil.Companion.getInstance
|
import code.name.monkey.retromusic.util.CustomArtistImageUtil.Companion.getInstance
|
||||||
import code.name.monkey.retromusic.util.MusicUtil.getMediaStoreAlbumCoverUri
|
import code.name.monkey.retromusic.util.MusicUtil.getMediaStoreAlbumCoverUri
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
|
import code.name.monkey.retromusic.util.PreferenceUtil.materialYou
|
||||||
import com.bumptech.glide.GenericTransitionOptions
|
import com.bumptech.glide.GenericTransitionOptions
|
||||||
import com.bumptech.glide.Priority
|
import com.bumptech.glide.Priority
|
||||||
import com.bumptech.glide.RequestBuilder
|
import com.bumptech.glide.RequestBuilder
|
||||||
|
@ -185,7 +188,11 @@ object RetroGlideExtension {
|
||||||
return TintHelper.createTintedDrawable(
|
return TintHelper.createTintedDrawable(
|
||||||
getContext(),
|
getContext(),
|
||||||
R.drawable.ic_account,
|
R.drawable.ic_account,
|
||||||
|
if (materialYou && VersionUtils.hasS()) {
|
||||||
|
ContextCompat.getColor(getContext(), R.color.m3_accent_color)
|
||||||
|
} else {
|
||||||
accentColor(getContext())
|
accentColor(getContext())
|
||||||
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -613,4 +613,7 @@ object PreferenceUtil {
|
||||||
val crossFadeDuration
|
val crossFadeDuration
|
||||||
get() = sharedPreferences
|
get() = sharedPreferences
|
||||||
.getInt(CROSS_FADE_DURATION, 0)
|
.getInt(CROSS_FADE_DURATION, 0)
|
||||||
|
|
||||||
|
val materialYou
|
||||||
|
get() = sharedPreferences.getBoolean(MATERIAL_YOU, false)
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ import code.name.monkey.appthemehelper.ThemeStore.Companion.accentColor
|
||||||
import code.name.monkey.appthemehelper.util.ColorUtil.isColorLight
|
import code.name.monkey.appthemehelper.util.ColorUtil.isColorLight
|
||||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper.getPrimaryTextColor
|
import code.name.monkey.appthemehelper.util.MaterialValueHelper.getPrimaryTextColor
|
||||||
import code.name.monkey.appthemehelper.util.TintHelper
|
import code.name.monkey.appthemehelper.util.TintHelper
|
||||||
|
import code.name.monkey.appthemehelper.util.VersionUtils
|
||||||
import code.name.monkey.retromusic.views.PopupBackground
|
import code.name.monkey.retromusic.views.PopupBackground
|
||||||
import me.zhanghai.android.fastscroll.FastScroller
|
import me.zhanghai.android.fastscroll.FastScroller
|
||||||
import me.zhanghai.android.fastscroll.FastScrollerBuilder
|
import me.zhanghai.android.fastscroll.FastScrollerBuilder
|
||||||
|
@ -27,13 +28,17 @@ import me.zhanghai.android.fastscroll.R
|
||||||
object ThemedFastScroller {
|
object ThemedFastScroller {
|
||||||
fun create(view: ViewGroup): FastScroller {
|
fun create(view: ViewGroup): FastScroller {
|
||||||
val context = view.context
|
val context = view.context
|
||||||
val color = accentColor(context)
|
val color = if (PreferenceUtil.materialYou && VersionUtils.hasS()) {
|
||||||
|
context.getColor(code.name.monkey.retromusic.R.color.m3_accent_color)
|
||||||
|
} else {
|
||||||
|
accentColor(context)
|
||||||
|
}
|
||||||
val textColor = getPrimaryTextColor(context, isColorLight(color))
|
val textColor = getPrimaryTextColor(context, isColorLight(color))
|
||||||
val fastScrollerBuilder = FastScrollerBuilder(view)
|
val fastScrollerBuilder = FastScrollerBuilder(view)
|
||||||
fastScrollerBuilder.useMd2Style()
|
fastScrollerBuilder.useMd2Style()
|
||||||
fastScrollerBuilder.setPopupStyle { popupText ->
|
fastScrollerBuilder.setPopupStyle { popupText ->
|
||||||
PopupStyles.MD2.accept(popupText)
|
PopupStyles.MD2.accept(popupText)
|
||||||
popupText.background = PopupBackground(context)
|
popupText.background = PopupBackground(context, color)
|
||||||
popupText.setTextColor(textColor)
|
popupText.setTextColor(textColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import androidx.annotation.StyleRes
|
||||||
import androidx.appcompat.app.AppCompatDelegate
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.extensions.generalThemeValue
|
import code.name.monkey.retromusic.extensions.generalThemeValue
|
||||||
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
import code.name.monkey.retromusic.util.theme.ThemeMode.*
|
import code.name.monkey.retromusic.util.theme.ThemeMode.*
|
||||||
|
|
||||||
object ThemeManager {
|
object ThemeManager {
|
||||||
|
@ -12,12 +13,17 @@ object ThemeManager {
|
||||||
@StyleRes
|
@StyleRes
|
||||||
fun getThemeResValue(
|
fun getThemeResValue(
|
||||||
context: Context
|
context: Context
|
||||||
): Int = when (context.generalThemeValue) {
|
): Int =
|
||||||
|
if (PreferenceUtil.materialYou) {
|
||||||
|
R.style.Theme_RetroMusic_MD3
|
||||||
|
} else {
|
||||||
|
when (context.generalThemeValue) {
|
||||||
LIGHT -> R.style.Theme_RetroMusic_Light
|
LIGHT -> R.style.Theme_RetroMusic_Light
|
||||||
DARK -> R.style.Theme_RetroMusic_Base
|
DARK -> R.style.Theme_RetroMusic_Base
|
||||||
BLACK -> R.style.Theme_RetroMusic_Black
|
BLACK -> R.style.Theme_RetroMusic_Black
|
||||||
AUTO -> R.style.Theme_RetroMusic_FollowSystem
|
AUTO -> R.style.Theme_RetroMusic_FollowSystem
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun getNightMode(
|
fun getNightMode(
|
||||||
context: Context
|
context: Context
|
||||||
|
|
|
@ -35,6 +35,7 @@ class BottomNavigationBarTinted @JvmOverloads constructor(
|
||||||
init {
|
init {
|
||||||
labelVisibilityMode = PreferenceUtil.tabTitleMode
|
labelVisibilityMode = PreferenceUtil.tabTitleMode
|
||||||
|
|
||||||
|
if (!PreferenceUtil.materialYou) {
|
||||||
val iconColor = ATHUtil.resolveColor(context, android.R.attr.colorControlNormal)
|
val iconColor = ATHUtil.resolveColor(context, android.R.attr.colorControlNormal)
|
||||||
val accentColor = ThemeStore.accentColor(context)
|
val accentColor = ThemeStore.accentColor(context)
|
||||||
NavigationViewUtil.setItemIconColors(
|
NavigationViewUtil.setItemIconColors(
|
||||||
|
@ -47,11 +48,13 @@ class BottomNavigationBarTinted @JvmOverloads constructor(
|
||||||
ColorUtil.withAlpha(iconColor, 0.5f),
|
ColorUtil.withAlpha(iconColor, 0.5f),
|
||||||
accentColor
|
accentColor
|
||||||
)
|
)
|
||||||
itemRippleColor = ColorStateList.valueOf(accentColor.addAlpha())
|
itemRippleColor = ColorStateList.valueOf(accentColor.addAlpha(0.08F))
|
||||||
background = ColorDrawable(ATHUtil.resolveColor(context, R.attr.colorSurface))
|
background = ColorDrawable(ATHUtil.resolveColor(context, R.attr.colorSurface))
|
||||||
|
itemActiveIndicatorColor = ColorStateList.valueOf(accentColor.addAlpha(0.12F))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Int.addAlpha(): Int {
|
fun Int.addAlpha(alpha: Float): Int {
|
||||||
return ColorUtil.withAlpha(this, 0.12f)
|
return ColorUtil.withAlpha(this, alpha)
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,6 @@ import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.core.graphics.drawable.DrawableCompat;
|
import androidx.core.graphics.drawable.DrawableCompat;
|
||||||
|
|
||||||
import code.name.monkey.appthemehelper.ThemeStore;
|
|
||||||
import code.name.monkey.retromusic.R;
|
import code.name.monkey.retromusic.R;
|
||||||
|
|
||||||
public class PopupBackground extends Drawable {
|
public class PopupBackground extends Drawable {
|
||||||
|
@ -47,10 +46,10 @@ public class PopupBackground extends Drawable {
|
||||||
|
|
||||||
@NonNull private final Matrix mTempMatrix = new Matrix();
|
@NonNull private final Matrix mTempMatrix = new Matrix();
|
||||||
|
|
||||||
public PopupBackground(@NonNull Context context) {
|
public PopupBackground(@NonNull Context context, int color) {
|
||||||
mPaint = new Paint();
|
mPaint = new Paint();
|
||||||
mPaint.setAntiAlias(true);
|
mPaint.setAntiAlias(true);
|
||||||
mPaint.setColor(ThemeStore.Companion.accentColor(context));
|
mPaint.setColor(color);
|
||||||
mPaint.setStyle(Paint.Style.FILL);
|
mPaint.setStyle(Paint.Style.FILL);
|
||||||
Resources resources = context.getResources();
|
Resources resources = context.getResources();
|
||||||
mPaddingStart = resources.getDimensionPixelOffset(R.dimen.afs_md2_popup_padding_start);
|
mPaddingStart = resources.getDimensionPixelOffset(R.dimen.afs_md2_popup_padding_start);
|
||||||
|
|
34
app/src/main/res/drawable-v31/rect_selector.xml
Normal file
34
app/src/main/res/drawable-v31/rect_selector.xml
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
|
~ Copyright (c) 2020 Hemanth Savarala.
|
||||||
|
~
|
||||||
|
~ Licensed under the GNU General Public License v3
|
||||||
|
~
|
||||||
|
~ This is free software: you can redistribute it and/or modify it under
|
||||||
|
~ the terms of the GNU General Public License as published by
|
||||||
|
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
~
|
||||||
|
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
~ See the GNU General Public License for more details.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="?android:attr/colorControlHighlight">
|
||||||
|
|
||||||
|
<item android:id="@android:id/mask">
|
||||||
|
<shape>
|
||||||
|
<corners android:radius="8dp" />
|
||||||
|
<solid android:color="@color/md_green_500" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<selector>
|
||||||
|
<item android:state_activated="true">
|
||||||
|
<shape>
|
||||||
|
<corners android:radius="8dp" />
|
||||||
|
<solid android:color="@android:color/system_neutral1_300" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
||||||
|
</item>
|
||||||
|
</ripple>
|
|
@ -13,6 +13,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_marginEnd="4dp"
|
||||||
|
android:paddingVertical="10dp"
|
||||||
android:text="@string/action_play_all"
|
android:text="@string/action_play_all"
|
||||||
android:textAppearance="@style/TextViewButton"
|
android:textAppearance="@style/TextViewButton"
|
||||||
android:textColor="?android:attr/textColorPrimary"
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
|
@ -26,12 +27,12 @@
|
||||||
android:id="@+id/shuffleAction"
|
android:id="@+id/shuffleAction"
|
||||||
style="@style/Widget.Material3.Button.Icon"
|
style="@style/Widget.Material3.Button.Icon"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
android:layout_marginStart="4dp"
|
android:layout_marginStart="4dp"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
|
android:paddingVertical="10dp"
|
||||||
android:text="@string/shuffle"
|
android:text="@string/shuffle"
|
||||||
android:textAppearance="@style/TextViewButton"
|
android:textAppearance="@style/TextViewButton"
|
||||||
android:textColor="?android:attr/textColorPrimary"
|
|
||||||
app:icon="@drawable/ic_shuffle"
|
app:icon="@drawable/ic_shuffle"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/playAction"
|
app:layout_constraintBottom_toBottomOf="@+id/playAction"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_marginEnd="4dp"
|
||||||
|
android:paddingVertical="10dp"
|
||||||
android:text="@string/action_play_all"
|
android:text="@string/action_play_all"
|
||||||
android:textAppearance="@style/TextViewButton"
|
android:textAppearance="@style/TextViewButton"
|
||||||
android:textColor="?android:attr/textColorPrimary"
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
|
@ -27,13 +28,12 @@
|
||||||
android:id="@+id/shuffleAction"
|
android:id="@+id/shuffleAction"
|
||||||
style="@style/Widget.Material3.Button.Icon"
|
style="@style/Widget.Material3.Button.Icon"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
android:layout_marginStart="4dp"
|
android:layout_marginStart="4dp"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
|
android:paddingVertical="10dp"
|
||||||
android:text="@string/shuffle"
|
android:text="@string/shuffle"
|
||||||
android:textAppearance="@style/TextViewButton"
|
android:textAppearance="@style/TextViewButton"
|
||||||
android:textColor="?android:attr/textColorPrimary"
|
|
||||||
app:backgroundTint="?attr/colorSurface"
|
|
||||||
app:icon="@drawable/ic_shuffle"
|
app:icon="@drawable/ic_shuffle"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/playAction"
|
app:layout_constraintBottom_toBottomOf="@+id/playAction"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
|
|
@ -18,16 +18,16 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingHorizontal="16dp"
|
android:paddingHorizontal="16dp">
|
||||||
android:paddingVertical="10dp">
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/playAction"
|
android:id="@+id/playAction"
|
||||||
style="@style/Widget.Material3.Button.OutlinedButton"
|
style="@style/Widget.Material3.Button.OutlinedButton"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_marginEnd="4dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:paddingVertical="10dp"
|
||||||
android:text="@string/action_play_all"
|
android:text="@string/action_play_all"
|
||||||
android:textAppearance="@style/TextViewButton"
|
android:textAppearance="@style/TextViewButton"
|
||||||
android:textColor="?android:attr/textColorPrimary"
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
|
@ -38,12 +38,12 @@
|
||||||
android:id="@+id/shuffleAction"
|
android:id="@+id/shuffleAction"
|
||||||
style="@style/Widget.Material3.Button.Icon"
|
style="@style/Widget.Material3.Button.Icon"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="4dp"
|
android:layout_marginStart="4dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:paddingVertical="10dp"
|
||||||
android:text="@string/shuffle"
|
android:text="@string/shuffle"
|
||||||
android:textAppearance="@style/TextViewButton"
|
android:textAppearance="@style/TextViewButton"
|
||||||
android:textColor="?android:attr/textColorPrimary"
|
|
||||||
app:icon="@drawable/ic_shuffle" />
|
app:icon="@drawable/ic_shuffle" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -55,17 +55,12 @@
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.BottomNavigationBarTinted
|
<code.name.monkey.retromusic.views.BottomNavigationBarTinted
|
||||||
android:id="@+id/bottomNavigationView"
|
android:id="@+id/bottomNavigationView"
|
||||||
|
style="@style/Widget.Material3.BottomNavigationView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/bottom_nav_height"
|
android:layout_height="@dimen/bottom_nav_height"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
android:background="?attr/colorSurface"
|
|
||||||
android:elevation="0dp"
|
android:elevation="0dp"
|
||||||
app:itemHorizontalTranslationEnabled="false"
|
app:itemHorizontalTranslationEnabled="false"
|
||||||
app:itemIconTint="@drawable/bottom_navigation_item_colors"
|
|
||||||
app:itemTextAppearanceActive="@style/BottomSheetItemTextAppearance"
|
|
||||||
app:itemTextAppearanceInactive="@style/BottomSheetItemTextAppearance"
|
|
||||||
app:itemTextColor="@drawable/bottom_navigation_item_colors"
|
|
||||||
app:labelVisibilityMode="labeled"
|
|
||||||
app:menu="@menu/bottom_navigation_main"
|
app:menu="@menu/bottom_navigation_main"
|
||||||
tools:layout_height="56dp" />
|
tools:layout_height="wrap_content" />
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<style name="Theme.RetroMusic.Base.Adaptive" parent="Theme.RetroMusic.Base.MD3.DayNight">
|
<style name="Theme.RetroMusic.Base.Adaptive" parent="Theme.Material3.DayNight.NoActionBar">
|
||||||
<item name="android:windowActionBarOverlay">true</item>
|
<item name="android:windowActionBarOverlay">true</item>
|
||||||
<item name="android:windowActivityTransitions">true</item>
|
<item name="android:windowActivityTransitions">true</item>
|
||||||
<item name="windowActionBarOverlay">true</item>
|
<item name="windowActionBarOverlay">true</item>
|
||||||
|
@ -27,9 +27,11 @@
|
||||||
<item name="bottomNavigationStyle">@style/Widget.Material3.BottomNavigationView</item>
|
<item name="bottomNavigationStyle">@style/Widget.Material3.BottomNavigationView</item>
|
||||||
<item name="materialButtonStyle">@style/MaterialButtonTheme</item>
|
<item name="materialButtonStyle">@style/MaterialButtonTheme</item>
|
||||||
<item name="materialCardViewStyle">@style/Widget.Material3.CardView.Elevated</item>
|
<item name="materialCardViewStyle">@style/Widget.Material3.CardView.Elevated</item>
|
||||||
|
<item name="bottomSheetTint">@color/bottomSheetColor</item>
|
||||||
|
<item name="elevationOverlayColor">@color/elevationOverlay</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.RetroMusic.Base" parent="Theme.RetroMusic.Base.MD3.Dark">
|
<style name="Theme.RetroMusic.Base" parent="Theme.Material3.DayNight.NoActionBar">
|
||||||
<item name="md_background_color">@color/darkColorPrimary</item>
|
<item name="md_background_color">@color/darkColorPrimary</item>
|
||||||
<item name="android:windowActionBarOverlay">true</item>
|
<item name="android:windowActionBarOverlay">true</item>
|
||||||
<item name="android:windowActivityTransitions">true</item>
|
<item name="android:windowActivityTransitions">true</item>
|
||||||
|
@ -47,9 +49,11 @@
|
||||||
<item name="bottomNavigationStyle">@style/Widget.Material3.BottomNavigationView</item>
|
<item name="bottomNavigationStyle">@style/Widget.Material3.BottomNavigationView</item>
|
||||||
<item name="android:windowBackground">@color/window_color_dark</item>
|
<item name="android:windowBackground">@color/window_color_dark</item>
|
||||||
<item name="materialCardViewStyle">@style/Widget.Material3.CardView.Elevated</item>
|
<item name="materialCardViewStyle">@style/Widget.Material3.CardView.Elevated</item>
|
||||||
|
<item name="bottomSheetTint">@color/bottomSheetColor</item>
|
||||||
|
<item name="elevationOverlayColor">@color/elevationOverlay</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.RetroMusic.Base.Light" parent="Theme.RetroMusic.Base.MD3.Light">
|
<style name="Theme.RetroMusic.Base.Light" parent="Theme.Material3.Light.NoActionBar">
|
||||||
<item name="android:windowActionBarOverlay">true</item>
|
<item name="android:windowActionBarOverlay">true</item>
|
||||||
<item name="windowActionBarOverlay">true</item>
|
<item name="windowActionBarOverlay">true</item>
|
||||||
<item name="roundSelector">@drawable/round_selector</item>
|
<item name="roundSelector">@drawable/round_selector</item>
|
||||||
|
@ -64,5 +68,7 @@
|
||||||
<item name="materialButtonStyle">@style/MaterialButtonTheme</item>
|
<item name="materialButtonStyle">@style/MaterialButtonTheme</item>
|
||||||
<item name="bottomNavigationStyle">@style/Widget.Material3.BottomNavigationView</item>
|
<item name="bottomNavigationStyle">@style/Widget.Material3.BottomNavigationView</item>
|
||||||
<item name="materialCardViewStyle">@style/Widget.Material3.CardView.Elevated</item>
|
<item name="materialCardViewStyle">@style/Widget.Material3.CardView.Elevated</item>
|
||||||
|
<item name="bottomSheetTint">@color/bottomSheetColorLight</item>
|
||||||
|
<item name="elevationOverlayColor">@color/elevationOverlayLight</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
4
app/src/main/res/values-v31/donottranslate.xml
Normal file
4
app/src/main/res/values-v31/donottranslate.xml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<bool name="md3_available">true</bool>
|
||||||
|
</resources>
|
9
app/src/main/res/values-v31/styles.xml
Normal file
9
app/src/main/res/values-v31/styles.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<resources>
|
||||||
|
<style name="Theme.RetroMusic.MD3" parent="@style/Theme.Material3.DayNight.NoActionBar" >
|
||||||
|
<item name="rectSelector">@drawable/rect_selector</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="BottomSheetStyle" parent="Widget.MaterialComponents.BottomSheet">
|
||||||
|
<item name="android:maxWidth">@empty</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
|
@ -1,12 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
|
|
||||||
<style name="Theme.RetroMusic.Base.MD3.Light" parent="Theme.Material3.Light.NoActionBar" />
|
|
||||||
|
|
||||||
<style name="Theme.RetroMusic.Base.MD3.DayNight" parent="Theme.Material3.DayNight.NoActionBar" />
|
|
||||||
|
|
||||||
<style name="Theme.RetroMusic.Base.MD3.Dark" parent="Theme.Material3.DayNight.NoActionBar" />
|
|
||||||
|
|
||||||
<style name="Theme.RetroMusic.Base.MD3.Black" parent="Theme.Material3.DayNight.NoActionBar" />
|
|
||||||
|
|
||||||
</resources>
|
|
|
@ -35,5 +35,4 @@
|
||||||
<color name="bottomSheetColorBlack">#000000</color>
|
<color name="bottomSheetColorBlack">#000000</color>
|
||||||
|
|
||||||
<color name="bottomSheetColor">#FFFFFF</color>
|
<color name="bottomSheetColor">#FFFFFF</color>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -34,8 +34,8 @@
|
||||||
<dimen name="now_playing_top_margin">12dp</dimen>
|
<dimen name="now_playing_top_margin">12dp</dimen>
|
||||||
|
|
||||||
<dimen name="icon_notification_dimen">32dp</dimen>
|
<dimen name="icon_notification_dimen">32dp</dimen>
|
||||||
<dimen name="mini_player_height_expanded">112dp</dimen>
|
<dimen name="mini_player_height_expanded">136dp</dimen>
|
||||||
<dimen name="mini_cast_player_height_expanded">120dp</dimen>
|
<dimen name="mini_cast_player_height_expanded">144dp</dimen>
|
||||||
<dimen name="toolbar_margin_horizontal">8dp</dimen>
|
<dimen name="toolbar_margin_horizontal">8dp</dimen>
|
||||||
<dimen name="toolbar_height">48dp</dimen>
|
<dimen name="toolbar_height">48dp</dimen>
|
||||||
<dimen name="item_song_height">52dp</dimen>
|
<dimen name="item_song_height">52dp</dimen>
|
||||||
|
@ -53,5 +53,5 @@
|
||||||
<dimen name="indicator_radius">10dp</dimen>
|
<dimen name="indicator_radius">10dp</dimen>
|
||||||
<dimen name="lyrics_dialog_radius">20dp</dimen>
|
<dimen name="lyrics_dialog_radius">20dp</dimen>
|
||||||
<dimen name="cast_mini_player_height">64dp</dimen>
|
<dimen name="cast_mini_player_height">64dp</dimen>
|
||||||
<dimen name="bottom_nav_height">56dp</dimen>
|
<dimen name="bottom_nav_height">80dp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -21,4 +21,8 @@
|
||||||
<string name="app_shortcut_top_tracks_long" translatable="false">@string/my_top_tracks</string>
|
<string name="app_shortcut_top_tracks_long" translatable="false">@string/my_top_tracks</string>
|
||||||
|
|
||||||
<string name="empty_text_emoji" translatable="false">😱</string>
|
<string name="empty_text_emoji" translatable="false">😱</string>
|
||||||
|
|
||||||
|
<!-- Material You -->
|
||||||
|
<string name="pref_title_md3">Material You</string>
|
||||||
|
<bool name="md3_available">false</bool>
|
||||||
</resources>
|
</resources>
|
|
@ -23,6 +23,16 @@
|
||||||
<item name="android:windowAnimationStyle">@style/WindowAnimationTransition</item>
|
<item name="android:windowAnimationStyle">@style/WindowAnimationTransition</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="Theme.RetroMusic.MD3" parent="@style/Theme.Material3.DayNight.NoActionBar">
|
||||||
|
<item name="roundSelector">@drawable/round_selector</item>
|
||||||
|
<item name="rectSelector">@drawable/rect_selector</item>
|
||||||
|
<item name="toolbarPopupTheme">@style/ThemeOverlay.AppCompat.DayNight</item>
|
||||||
|
<item name="materialCardViewStyle">@style/Widget.Material3.CardView.Elevated</item>
|
||||||
|
<item name="materialButtonStyle">@style/MaterialButtonTheme</item>
|
||||||
|
<item name="popupWindowStyle">@style/MaterialPopupMenuStyle</item>
|
||||||
|
<item name="popupMenuStyle">@style/MaterialPopupMenuStyle</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<style name="Theme.RetroMusic.Notification" parent="@android:style/TextAppearance.StatusBar.EventContent" />
|
<style name="Theme.RetroMusic.Notification" parent="@android:style/TextAppearance.StatusBar.EventContent" />
|
||||||
|
|
||||||
<style name="Theme.RetroMusic.Notification.Title" parent="@android:style/TextAppearance.StatusBar.EventContent.Title" />
|
<style name="Theme.RetroMusic.Notification.Title" parent="@android:style/TextAppearance.StatusBar.EventContent.Title" />
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<style name="Theme.RetroMusic.Base.Adaptive" parent="Theme.RetroMusic.Base.MD3.DayNight">
|
<style name="Theme.RetroMusic.Base.Adaptive" parent="Theme.Material3.DayNight.NoActionBar">
|
||||||
<item name="android:windowActionBarOverlay">true</item>
|
<item name="android:windowActionBarOverlay">true</item>
|
||||||
<item name="android:windowActivityTransitions">true</item>
|
<item name="android:windowActivityTransitions">true</item>
|
||||||
<item name="windowActionBarOverlay">true</item>
|
<item name="windowActionBarOverlay">true</item>
|
||||||
|
@ -15,9 +15,11 @@
|
||||||
<item name="popupMenuStyle">@style/MaterialPopupMenuStyle</item>
|
<item name="popupMenuStyle">@style/MaterialPopupMenuStyle</item>
|
||||||
<item name="popupWindowStyle">@style/MaterialPopupMenuStyle</item>
|
<item name="popupWindowStyle">@style/MaterialPopupMenuStyle</item>
|
||||||
<item name="materialCardViewStyle">@style/Widget.Material3.CardView.Elevated</item>
|
<item name="materialCardViewStyle">@style/Widget.Material3.CardView.Elevated</item>
|
||||||
|
<item name="bottomSheetTint">@color/bottomSheetColor</item>
|
||||||
|
<item name="elevationOverlayColor">@color/elevationOverlay</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.RetroMusic.Base" parent="Theme.RetroMusic.Base.MD3.Dark">
|
<style name="Theme.RetroMusic.Base" parent="Theme.Material3.DayNight.NoActionBar">
|
||||||
<item name="md_background_color">@color/darkColorSurface</item>
|
<item name="md_background_color">@color/darkColorSurface</item>
|
||||||
<item name="android:windowActionBarOverlay">true</item>
|
<item name="android:windowActionBarOverlay">true</item>
|
||||||
<item name="android:windowActivityTransitions">true</item>
|
<item name="android:windowActivityTransitions">true</item>
|
||||||
|
@ -34,9 +36,11 @@
|
||||||
<item name="android:windowBackground">@color/window_color_dark</item>
|
<item name="android:windowBackground">@color/window_color_dark</item>
|
||||||
<item name="popupMenuStyle">@style/MaterialPopupMenuStyle</item>
|
<item name="popupMenuStyle">@style/MaterialPopupMenuStyle</item>
|
||||||
<item name="materialCardViewStyle">@style/Widget.Material3.CardView.Elevated</item>
|
<item name="materialCardViewStyle">@style/Widget.Material3.CardView.Elevated</item>
|
||||||
|
<item name="bottomSheetTint">@color/bottomSheetColor</item>
|
||||||
|
<item name="elevationOverlayColor">@color/elevationOverlay</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.RetroMusic.Base.Black" parent="Theme.RetroMusic.Base.MD3.Black">
|
<style name="Theme.RetroMusic.Base.Black" parent="Theme.Material3.DayNight.NoActionBar">
|
||||||
<item name="md_background_color">@color/blackColorSurface</item>
|
<item name="md_background_color">@color/blackColorSurface</item>
|
||||||
<item name="roundSelector">@drawable/round_selector</item>
|
<item name="roundSelector">@drawable/round_selector</item>
|
||||||
<item name="rectSelector">@drawable/rect_selector</item>
|
<item name="rectSelector">@drawable/rect_selector</item>
|
||||||
|
@ -51,9 +55,11 @@
|
||||||
<item name="toolbarPopupTheme">@style/ThemeOverlay.AppCompat.Dark</item>
|
<item name="toolbarPopupTheme">@style/ThemeOverlay.AppCompat.Dark</item>
|
||||||
<item name="popupMenuStyle">@style/MaterialPopupMenuStyle</item>
|
<item name="popupMenuStyle">@style/MaterialPopupMenuStyle</item>
|
||||||
<item name="materialCardViewStyle">@style/Widget.Material3.CardView.Elevated</item>
|
<item name="materialCardViewStyle">@style/Widget.Material3.CardView.Elevated</item>
|
||||||
|
<item name="bottomSheetTint">@color/bottomSheetColorBlack</item>
|
||||||
|
<item name="elevationOverlayColor">@color/elevationOverlayBlack</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.RetroMusic.Base.Light" parent="Theme.RetroMusic.Base.MD3.Light">
|
<style name="Theme.RetroMusic.Base.Light" parent="Theme.Material3.Light.NoActionBar">
|
||||||
<item name="android:windowActionBarOverlay">true</item>
|
<item name="android:windowActionBarOverlay">true</item>
|
||||||
<item name="windowActionBarOverlay">true</item>
|
<item name="windowActionBarOverlay">true</item>
|
||||||
<item name="roundSelector">@drawable/round_selector</item>
|
<item name="roundSelector">@drawable/round_selector</item>
|
||||||
|
@ -68,32 +74,10 @@
|
||||||
<item name="materialButtonStyle">@style/MaterialButtonTheme</item>
|
<item name="materialButtonStyle">@style/MaterialButtonTheme</item>
|
||||||
<item name="popupMenuStyle">@style/MaterialPopupMenuStyle</item>
|
<item name="popupMenuStyle">@style/MaterialPopupMenuStyle</item>
|
||||||
<item name="materialCardViewStyle">@style/Widget.Material3.CardView.Elevated</item>
|
<item name="materialCardViewStyle">@style/Widget.Material3.CardView.Elevated</item>
|
||||||
</style>
|
|
||||||
|
|
||||||
<!-- Base Themes -->
|
|
||||||
<style name="Theme.RetroMusic.Base.MD3" parent="Theme.RetroMusic.Base" />
|
|
||||||
|
|
||||||
<style name="Theme.RetroMusic.Base.MD3.Light" parent="Theme.Material3.Light.NoActionBar">
|
|
||||||
<item name="bottomSheetTint">@color/bottomSheetColorLight</item>
|
<item name="bottomSheetTint">@color/bottomSheetColorLight</item>
|
||||||
<item name="elevationOverlayColor">@color/elevationOverlayLight</item>
|
<item name="elevationOverlayColor">@color/elevationOverlayLight</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.RetroMusic.Base.MD3.DayNight" parent="Theme.Material3.DayNight.NoActionBar">
|
|
||||||
<item name="bottomSheetTint">@color/bottomSheetColor</item>
|
|
||||||
<item name="elevationOverlayColor">@color/elevationOverlay</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="Theme.RetroMusic.Base.MD3.Dark" parent="Theme.Material3.DayNight.NoActionBar">
|
|
||||||
<item name="bottomSheetTint">@color/bottomSheetColor</item>
|
|
||||||
<item name="elevationOverlayColor">@color/elevationOverlay</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="Theme.RetroMusic.Base.MD3.Black" parent="Theme.Material3.DayNight.NoActionBar">
|
|
||||||
<item name="bottomSheetTint">@color/bottomSheetColorBlack</item>
|
|
||||||
<item name="elevationOverlayColor">@color/elevationOverlayBlack</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
|
|
||||||
<style name="MusicProgressSliderParent">
|
<style name="MusicProgressSliderParent">
|
||||||
<item name="android:progressDrawable">@android:color/transparent</item>
|
<item name="android:progressDrawable">@android:color/transparent</item>
|
||||||
<item name="android:layout_width">match_parent</item>
|
<item name="android:layout_width">match_parent</item>
|
||||||
|
|
|
@ -17,10 +17,19 @@
|
||||||
app:icon="@drawable/ic_color_lens" />
|
app:icon="@drawable/ic_color_lens" />
|
||||||
|
|
||||||
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
|
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
|
||||||
|
android:dependency="material_you"
|
||||||
android:key="black_theme"
|
android:key="black_theme"
|
||||||
android:layout="@layout/list_item_view_switch_no_title"
|
android:layout="@layout/list_item_view_switch_no_title"
|
||||||
android:title="@string/black_theme_name" />
|
android:title="@string/black_theme_name" />
|
||||||
|
|
||||||
|
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:disableDependentsState="true"
|
||||||
|
android:key="material_you"
|
||||||
|
android:layout="@layout/list_item_view_switch_no_title"
|
||||||
|
android:title="@string/pref_title_md3"
|
||||||
|
app:isPreferenceVisible="@bool/md3_available" />
|
||||||
|
|
||||||
</code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory>
|
</code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory>
|
||||||
|
|
||||||
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory
|
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory
|
||||||
|
@ -29,6 +38,7 @@
|
||||||
android:title="@string/colors">
|
android:title="@string/colors">
|
||||||
|
|
||||||
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEColorPreference
|
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEColorPreference
|
||||||
|
android:dependency="material_you"
|
||||||
android:key="accent_color"
|
android:key="accent_color"
|
||||||
android:layout="@layout/list_item_color_view"
|
android:layout="@layout/list_item_color_view"
|
||||||
android:persistent="false"
|
android:persistent="false"
|
||||||
|
@ -38,6 +48,7 @@
|
||||||
|
|
||||||
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
|
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
|
android:dependency="material_you"
|
||||||
android:key="desaturated_color"
|
android:key="desaturated_color"
|
||||||
android:layout="@layout/list_item_view_switch"
|
android:layout="@layout/list_item_view_switch"
|
||||||
android:summary="@string/pref_summary_desaturated_color"
|
android:summary="@string/pref_summary_desaturated_color"
|
||||||
|
@ -52,6 +63,7 @@
|
||||||
|
|
||||||
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
|
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
|
android:dependency="material_you"
|
||||||
android:key="should_color_app_shortcuts"
|
android:key="should_color_app_shortcuts"
|
||||||
android:layout="@layout/list_item_view_switch"
|
android:layout="@layout/list_item_view_switch"
|
||||||
android:summary="@string/pref_summary_colored_app_shortcuts"
|
android:summary="@string/pref_summary_colored_app_shortcuts"
|
||||||
|
|
|
@ -9,7 +9,6 @@ import androidx.core.content.ContextCompat
|
||||||
import code.name.monkey.appthemehelper.util.ATHUtil.isWindowBackgroundDark
|
import code.name.monkey.appthemehelper.util.ATHUtil.isWindowBackgroundDark
|
||||||
import code.name.monkey.appthemehelper.util.ATHUtil.resolveColor
|
import code.name.monkey.appthemehelper.util.ATHUtil.resolveColor
|
||||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||||
import code.name.monkey.appthemehelper.util.VersionUtils
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -205,9 +204,6 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
|
||||||
@CheckResult
|
@CheckResult
|
||||||
@ColorInt
|
@ColorInt
|
||||||
fun accentColor(context: Context): Int {
|
fun accentColor(context: Context): Int {
|
||||||
if (VersionUtils.hasS()) {
|
|
||||||
return ContextCompat.getColor(context, R.color.m3_accent_color)
|
|
||||||
}
|
|
||||||
val desaturatedColor = prefs(context).getBoolean("desaturated_color", false)
|
val desaturatedColor = prefs(context).getBoolean("desaturated_color", false)
|
||||||
val color = prefs(context).getInt(
|
val color = prefs(context).getInt(
|
||||||
ThemeStorePrefKeys.KEY_ACCENT_COLOR,
|
ThemeStorePrefKeys.KEY_ACCENT_COLOR,
|
||||||
|
|
Loading…
Reference in a new issue