Fix material theme
parent
53e3eb2f41
commit
5d640b59d1
|
@ -126,23 +126,22 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() {
|
|||
updateShuffleState()
|
||||
|
||||
val colorFinal = if (PreferenceUtil.getInstance(requireContext()).adaptiveColor) {
|
||||
lastPlaybackControlsColor = color
|
||||
color
|
||||
} else {
|
||||
ThemeStore.textColorSecondary(requireContext())
|
||||
}
|
||||
}.ripAlpha()
|
||||
|
||||
text.setTextColor(colorFinal)
|
||||
ViewUtil.setProgressDrawable(progressSlider, colorFinal.ripAlpha(), true)
|
||||
ViewUtil.setProgressDrawable(progressSlider, colorFinal, true)
|
||||
|
||||
volumeFragment?.setTintable(colorFinal.ripAlpha())
|
||||
volumeFragment?.setTintable(colorFinal)
|
||||
|
||||
updatePlayPauseColor()
|
||||
updatePrevNextColor()
|
||||
updatePlayPauseColor(colorFinal)
|
||||
updatePrevNextColor(colorFinal)
|
||||
}
|
||||
|
||||
private fun updatePlayPauseColor() {
|
||||
playPauseButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN)
|
||||
private fun updatePlayPauseColor(color: Int) {
|
||||
playPauseButton.setColorFilter(color, PorterDuff.Mode.SRC_IN)
|
||||
}
|
||||
|
||||
private fun setUpPlayPauseFab() {
|
||||
|
@ -166,14 +165,14 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() {
|
|||
}
|
||||
|
||||
private fun setUpPrevNext() {
|
||||
updatePrevNextColor()
|
||||
updatePrevNextColor(ThemeStore.textColorSecondary(requireContext()))
|
||||
nextButton.setOnClickListener { MusicPlayerRemote.playNextSong() }
|
||||
previousButton.setOnClickListener { MusicPlayerRemote.back() }
|
||||
}
|
||||
|
||||
private fun updatePrevNextColor() {
|
||||
nextButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN)
|
||||
previousButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN)
|
||||
private fun updatePrevNextColor(color: Int) {
|
||||
nextButton.setColorFilter(color, PorterDuff.Mode.SRC_IN)
|
||||
previousButton.setColorFilter(color, PorterDuff.Mode.SRC_IN)
|
||||
}
|
||||
|
||||
private fun setUpShuffleButton() {
|
||||
|
|
|
@ -94,7 +94,6 @@
|
|||
android:maxHeight="3dp"
|
||||
android:progressDrawable="@drawable/color_progress_seek"
|
||||
android:splitTrack="false"
|
||||
android:thumb="@drawable/switch_thumb_material"
|
||||
app:layout_constraintEnd_toStartOf="@id/songTotalTime"
|
||||
app:layout_constraintStart_toEndOf="@id/songCurrentProgress"
|
||||
app:layout_constraintTop_toBottomOf="@id/text"
|
||||
|
@ -143,6 +142,7 @@
|
|||
android:scaleType="fitCenter"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/playPauseButton"
|
||||
app:layout_constraintEnd_toStartOf="@+id/playPauseButton"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toEndOf="@+id/repeatButton"
|
||||
app:layout_constraintTop_toTopOf="@+id/playPauseButton"
|
||||
app:srcCompat="@drawable/ic_skip_previous_white_24dp"
|
||||
|
@ -174,6 +174,7 @@
|
|||
android:scaleType="fitCenter"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/playPauseButton"
|
||||
app:layout_constraintEnd_toStartOf="@+id/shuffleButton"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toEndOf="@+id/playPauseButton"
|
||||
app:layout_constraintTop_toTopOf="@+id/playPauseButton"
|
||||
app:srcCompat="@drawable/ic_skip_next_white_24dp"
|
||||
|
@ -189,6 +190,7 @@
|
|||
android:scaleType="fitCenter"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/nextButton"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toEndOf="@+id/nextButton"
|
||||
app:layout_constraintTop_toTopOf="@+id/nextButton"
|
||||
app:srcCompat="@drawable/ic_shuffle_white_24dp"
|
||||
|
|
Loading…
Reference in New Issue