Fix sleep timer checkbox color
This commit is contained in:
parent
0c5edf8ef6
commit
53e7f7660e
3 changed files with 9 additions and 4 deletions
|
@ -28,6 +28,7 @@ import android.widget.TextView
|
|||
import android.widget.Toast
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.TintHelper
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||
import code.name.monkey.retromusic.service.MusicService
|
||||
|
@ -109,7 +110,7 @@ class SleepTimerDialog : DialogFragment() {
|
|||
shouldFinishLastSong = materialDialog.getCustomView().findViewById(R.id.shouldFinishLastSong)
|
||||
seekBar = materialDialog.getCustomView().findViewById(R.id.seekBar)
|
||||
timerDisplay = materialDialog.getCustomView().findViewById(R.id.timerDisplay)
|
||||
|
||||
TintHelper.setTintAuto(shouldFinishLastSong, ThemeStore.accentColor(requireContext()), false)
|
||||
|
||||
val finishMusic = PreferenceUtil.getInstance(requireContext()).sleepTimerFinishMusic
|
||||
shouldFinishLastSong.isChecked = finishMusic
|
||||
|
@ -119,7 +120,7 @@ class SleepTimerDialog : DialogFragment() {
|
|||
updateTimeDisplayTime()
|
||||
seekBar.progress = seekArcProgress
|
||||
|
||||
setProgressBarColor(ThemeStore.accentColor(context!!))
|
||||
setProgressBarColor(ThemeStore.accentColor(requireContext()))
|
||||
|
||||
seekBar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
|
||||
override fun onProgressChanged(seekBar: SeekBar, i: Int, b: Boolean) {
|
||||
|
@ -181,6 +182,7 @@ class SleepTimerDialog : DialogFragment() {
|
|||
updateCancelButton()
|
||||
}
|
||||
}
|
||||
|
||||
private fun setProgressBarColor(dark: Int) {
|
||||
ViewUtil.setProgressDrawable(progressSlider = seekBar, newColor = dark)
|
||||
}
|
||||
|
|
|
@ -63,6 +63,7 @@ class ThemeSettingsFragment : AbsSettingsFragment() {
|
|||
|
||||
accentColorPref.setOnPreferenceClickListener {
|
||||
MaterialDialog(requireActivity(), BottomSheet(LayoutMode.WRAP_CONTENT)).show {
|
||||
cornerRadius(PreferenceUtil.getInstance(requireContext()).dialogCorner)
|
||||
title(R.string.accent_color)
|
||||
positiveButton(R.string.set)
|
||||
colorChooser(colors = ACCENT_COLORS, allowCustomArgb = true, subColors = ACCENT_COLORS_SUB) { _, color ->
|
||||
|
@ -77,7 +78,6 @@ class ThemeSettingsFragment : AbsSettingsFragment() {
|
|||
val blackTheme: ATESwitchPreference? = findPreference("black_theme")
|
||||
blackTheme?.setOnPreferenceChangeListener { _, _ ->
|
||||
ThemeStore.markChanged(requireContext())
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
|
||||
requireActivity().setTheme(PreferenceUtil.getThemeResFromPrefValue("black"))
|
||||
DynamicShortcutManager(requireContext()).updateDynamicShortcuts()
|
||||
|
|
|
@ -71,9 +71,12 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="@null"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:thumbOffset="3dp"
|
||||
android:thumbOffset="2dp"
|
||||
app:layout_constraintEnd_toStartOf="@+id/seekbar_value"
|
||||
app:layout_constraintStart_toStartOf="@+id/guideline_front_margin"
|
||||
app:layout_constraintTop_toBottomOf="@android:id/summary" />
|
||||
|
|
Loading…
Reference in a new issue