Fix material theme

main
h4h13 2020-02-02 00:24:08 +05:30
parent 53e3eb2f41
commit 5d640b59d1
2 changed files with 14 additions and 13 deletions

View File

@ -126,23 +126,22 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() {
updateShuffleState() updateShuffleState()
val colorFinal = if (PreferenceUtil.getInstance(requireContext()).adaptiveColor) { val colorFinal = if (PreferenceUtil.getInstance(requireContext()).adaptiveColor) {
lastPlaybackControlsColor = color
color color
} else { } else {
ThemeStore.textColorSecondary(requireContext()) ThemeStore.textColorSecondary(requireContext())
} }.ripAlpha()
text.setTextColor(colorFinal) text.setTextColor(colorFinal)
ViewUtil.setProgressDrawable(progressSlider, colorFinal.ripAlpha(), true) ViewUtil.setProgressDrawable(progressSlider, colorFinal, true)
volumeFragment?.setTintable(colorFinal.ripAlpha()) volumeFragment?.setTintable(colorFinal)
updatePlayPauseColor() updatePlayPauseColor(colorFinal)
updatePrevNextColor() updatePrevNextColor(colorFinal)
} }
private fun updatePlayPauseColor() { private fun updatePlayPauseColor(color: Int) {
playPauseButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN) playPauseButton.setColorFilter(color, PorterDuff.Mode.SRC_IN)
} }
private fun setUpPlayPauseFab() { private fun setUpPlayPauseFab() {
@ -166,14 +165,14 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() {
} }
private fun setUpPrevNext() { private fun setUpPrevNext() {
updatePrevNextColor() updatePrevNextColor(ThemeStore.textColorSecondary(requireContext()))
nextButton.setOnClickListener { MusicPlayerRemote.playNextSong() } nextButton.setOnClickListener { MusicPlayerRemote.playNextSong() }
previousButton.setOnClickListener { MusicPlayerRemote.back() } previousButton.setOnClickListener { MusicPlayerRemote.back() }
} }
private fun updatePrevNextColor() { private fun updatePrevNextColor(color: Int) {
nextButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN) nextButton.setColorFilter(color, PorterDuff.Mode.SRC_IN)
previousButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN) previousButton.setColorFilter(color, PorterDuff.Mode.SRC_IN)
} }
private fun setUpShuffleButton() { private fun setUpShuffleButton() {

View File

@ -94,7 +94,6 @@
android:maxHeight="3dp" android:maxHeight="3dp"
android:progressDrawable="@drawable/color_progress_seek" android:progressDrawable="@drawable/color_progress_seek"
android:splitTrack="false" android:splitTrack="false"
android:thumb="@drawable/switch_thumb_material"
app:layout_constraintEnd_toStartOf="@id/songTotalTime" app:layout_constraintEnd_toStartOf="@id/songTotalTime"
app:layout_constraintStart_toEndOf="@id/songCurrentProgress" app:layout_constraintStart_toEndOf="@id/songCurrentProgress"
app:layout_constraintTop_toBottomOf="@id/text" app:layout_constraintTop_toBottomOf="@id/text"
@ -143,6 +142,7 @@
android:scaleType="fitCenter" android:scaleType="fitCenter"
app:layout_constraintBottom_toBottomOf="@+id/playPauseButton" app:layout_constraintBottom_toBottomOf="@+id/playPauseButton"
app:layout_constraintEnd_toStartOf="@+id/playPauseButton" app:layout_constraintEnd_toStartOf="@+id/playPauseButton"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/repeatButton" app:layout_constraintStart_toEndOf="@+id/repeatButton"
app:layout_constraintTop_toTopOf="@+id/playPauseButton" app:layout_constraintTop_toTopOf="@+id/playPauseButton"
app:srcCompat="@drawable/ic_skip_previous_white_24dp" app:srcCompat="@drawable/ic_skip_previous_white_24dp"
@ -174,6 +174,7 @@
android:scaleType="fitCenter" android:scaleType="fitCenter"
app:layout_constraintBottom_toBottomOf="@+id/playPauseButton" app:layout_constraintBottom_toBottomOf="@+id/playPauseButton"
app:layout_constraintEnd_toStartOf="@+id/shuffleButton" app:layout_constraintEnd_toStartOf="@+id/shuffleButton"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/playPauseButton" app:layout_constraintStart_toEndOf="@+id/playPauseButton"
app:layout_constraintTop_toTopOf="@+id/playPauseButton" app:layout_constraintTop_toTopOf="@+id/playPauseButton"
app:srcCompat="@drawable/ic_skip_next_white_24dp" app:srcCompat="@drawable/ic_skip_next_white_24dp"
@ -189,6 +190,7 @@
android:scaleType="fitCenter" android:scaleType="fitCenter"
app:layout_constraintBottom_toBottomOf="@+id/nextButton" app:layout_constraintBottom_toBottomOf="@+id/nextButton"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/nextButton" app:layout_constraintStart_toEndOf="@+id/nextButton"
app:layout_constraintTop_toTopOf="@+id/nextButton" app:layout_constraintTop_toTopOf="@+id/nextButton"
app:srcCompat="@drawable/ic_shuffle_white_24dp" app:srcCompat="@drawable/ic_shuffle_white_24dp"