Update Material design components to the latest verion

slider is only changed for md3 theme and weird animation is removed
This commit is contained in:
Valeri Gokadze 2024-12-06 17:52:14 +04:00
parent 1c49bdcd72
commit 31fd668c83
5 changed files with 3 additions and 9 deletions

View file

@ -199,10 +199,6 @@ fun MaterialCardView.animateRadius(cornerRadius: Float, pause: Boolean = true) {
}
}
fun MaterialCardView.animateToCircle() {
animateRadius(measuredHeight / 2F, pause = false)
}
fun View.focusAndShowKeyboard() {
/**
* This is to be called when the window already has focus.

View file

@ -160,10 +160,8 @@ class MD3PlaybackControlsFragment :
private fun updatePlayPauseDrawableState() {
if (MusicPlayerRemote.isPlaying) {
binding.playPauseButton.setImageResource(R.drawable.ic_pause_outline_small)
binding.playPauseCard.animateRadius(40F)
} else {
binding.playPauseButton.setImageResource(R.drawable.ic_play_arrow_outline_small)
binding.playPauseCard.animateToCircle()
}
}

View file

@ -29,7 +29,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:maxHeight="2dp"
style="@style/Widget.Retro.Slider"
style="@style/Widget.Material3.Slider"
app:layout_constraintEnd_toStartOf="@id/songTotalTime"
app:layout_constraintStart_toEndOf="@id/songCurrentProgress"
app:layout_constraintTop_toTopOf="parent"

View file

@ -256,7 +256,7 @@
<item name="cornerSize">50%</item>
</style>
<style name="Widget.Retro.Slider" parent="Widget.Material3.Slider">
<style name="Widget.Retro.Slider" parent="Widget.Material3.Slider.Legacy">
<item name="labelBehavior">gone</item>
<item name="thumbRadius">6dp</item>
<item name="haloRadius">18dp</item>