Update compact controls animation
Make the slide animation on the compact controls look better.
This commit is contained in:
parent
bd79951c4e
commit
2f8916117e
6 changed files with 19 additions and 24 deletions
|
@ -14,9 +14,9 @@
|
||||||
|
|
||||||
## About
|
## About
|
||||||
|
|
||||||
Auxio is a local music player designed to be simple, straightfoward, and customizable. It has a fast, reliable UI/UX, and it is not bloated with useless features. In short, **It plays music.** Auxio is still configurable however, with both the UI and behavior able to be changed to ones liking.
|
Auxio is a local music player with a fast, reliable UI/UX and without any useless features. Auxio is still configurable however, with both the UI and behavior able to be changed to ones liking.
|
||||||
|
|
||||||
Unlike other music players, Auxio is based off of [ExoPlayer](https://exoplayer.dev/), allowing for much better listening experience compared to the native MediaPlayer API. Auxio's codebase is also designed to be extendable, allowing for the addition of features that are not included in the main app.
|
Unlike other music players, Auxio is also based off of <a href="https://exoplayer.dev/">Exoplayer</a>, allowing for much better listening experience compared to the native MediaPlayer API. Auxio's codebase is also designed to be extendable, allowing for the addition of features that are not included in the main app.
|
||||||
|
|
||||||
I primarily built Auxio for myself, but you can use it too, I guess.
|
I primarily built Auxio for myself, but you can use it too, I guess.
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,11 @@ class MainFragment : Fragment() {
|
||||||
|
|
||||||
binding.lifecycleOwner = this
|
binding.lifecycleOwner = this
|
||||||
|
|
||||||
|
// Speed up the slide-in effect on the controls view, solely to improve the UX
|
||||||
|
// and maybe hide the problem where the main view will snap-shrink before the compact
|
||||||
|
// view can slide.
|
||||||
|
(binding.controlsContainer as ViewGroup).layoutTransition.setDuration(150)
|
||||||
|
|
||||||
binding.navBar.apply {
|
binding.navBar.apply {
|
||||||
itemIconTintList = navTints
|
itemIconTintList = navTints
|
||||||
itemTextColor = navTints
|
itemTextColor = navTints
|
||||||
|
@ -150,11 +155,11 @@ class MainFragment : Fragment() {
|
||||||
if (song == null) {
|
if (song == null) {
|
||||||
logD("Hiding CompactPlaybackFragment since no song is being played.")
|
logD("Hiding CompactPlaybackFragment since no song is being played.")
|
||||||
|
|
||||||
binding.compactPlayback.visibility =
|
binding.compactPlayback.visibility = if (isLandscape(resources)) {
|
||||||
if (isLandscape(resources))
|
View.INVISIBLE
|
||||||
View.INVISIBLE
|
} else {
|
||||||
else
|
View.GONE
|
||||||
View.GONE
|
}
|
||||||
|
|
||||||
playbackModel.disableAnimation()
|
playbackModel.disableAnimation()
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
package org.oxycblt.auxio.ui
|
package org.oxycblt.auxio.ui
|
||||||
|
|
||||||
import android.animation.LayoutTransition
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Canvas
|
import android.graphics.Canvas
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import androidx.interpolator.view.animation.FastOutSlowInInterpolator
|
|
||||||
import org.oxycblt.auxio.logD
|
import org.oxycblt.auxio.logD
|
||||||
import org.oxycblt.auxio.logE
|
import org.oxycblt.auxio.logE
|
||||||
import java.lang.reflect.Field
|
import java.lang.reflect.Field
|
||||||
|
@ -40,12 +38,6 @@ class SlideLinearLayout @JvmOverloads constructor(
|
||||||
private var doDrawingTrick: Boolean = false
|
private var doDrawingTrick: Boolean = false
|
||||||
|
|
||||||
init {
|
init {
|
||||||
// Apply custom interpolation for the slide animations
|
|
||||||
layoutTransition.apply {
|
|
||||||
setInterpolator(LayoutTransition.APPEARING, FastOutSlowInInterpolator())
|
|
||||||
setInterpolator(LayoutTransition.DISAPPEARING, FastOutSlowInInterpolator())
|
|
||||||
}
|
|
||||||
|
|
||||||
if (disappearingChildrenField != null) {
|
if (disappearingChildrenField != null) {
|
||||||
// Create a junk view and add it, which makes all the magic happen [I think].
|
// Create a junk view and add it, which makes all the magic happen [I think].
|
||||||
dumpView = View(context)
|
dumpView = View(context)
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
tools:context=".MainFragment">
|
tools:context=".MainFragment">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<LinearLayout
|
||||||
android:id="@+id/main_layout"
|
android:id="@+id/main_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
@ -17,6 +17,7 @@
|
||||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/controls_container"
|
app:layout_constraintBottom_toTopOf="@+id/controls_container"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:navGraph="@navigation/nav_explore"
|
app:navGraph="@navigation/nav_explore"
|
||||||
|
@ -53,5 +54,5 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</LinearLayout>
|
||||||
</layout>
|
</layout>
|
|
@ -4,7 +4,7 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
tools:context=".MainFragment">
|
tools:context=".MainFragment">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<LinearLayout
|
||||||
android:id="@+id/main_layout"
|
android:id="@+id/main_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
@ -17,8 +17,7 @@
|
||||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/controls_container"
|
android:layout_weight="1"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:navGraph="@navigation/nav_explore"
|
app:navGraph="@navigation/nav_explore"
|
||||||
tools:layout="@layout/fragment_library" />
|
tools:layout="@layout/fragment_library" />
|
||||||
|
|
||||||
|
@ -37,7 +36,6 @@
|
||||||
android:name="org.oxycblt.auxio.playback.CompactPlaybackFragment"
|
android:name="org.oxycblt.auxio.playback.CompactPlaybackFragment"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/nav_bar"
|
|
||||||
tools:layout="@layout/fragment_compact_playback" />
|
tools:layout="@layout/fragment_compact_playback" />
|
||||||
|
|
||||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||||
|
@ -48,9 +46,8 @@
|
||||||
android:background="@color/background"
|
android:background="@color/background"
|
||||||
android:elevation="0dp"
|
android:elevation="0dp"
|
||||||
app:elevation="0dp"
|
app:elevation="0dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:menu="@menu/menu_nav" />
|
app:menu="@menu/menu_nav" />
|
||||||
|
|
||||||
</org.oxycblt.auxio.ui.SlideLinearLayout>
|
</org.oxycblt.auxio.ui.SlideLinearLayout>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</LinearLayout>
|
||||||
</layout>
|
</layout>
|
|
@ -1,4 +1,4 @@
|
||||||
Auxio is a local music player designed to be simple, straightfoward, and customizable. It has a fast, reliable UI/UX, and it is not bloated with useless features. In short, <b>It plays music</b>. Auxio is still configurable however, with both the UI and behavior able to be changed to ones liking.
|
Auxio is a local music player with a fast, reliable UI/UX and without any useless features. Auxio is still configurable however, with both the UI and behavior able to be changed to ones liking.
|
||||||
|
|
||||||
Unlike other music players, Auxio is also based off of <a href="https://exoplayer.dev/">Exoplayer</a>, allowing for much better listening experience compared to the native MediaPlayer API.
|
Unlike other music players, Auxio is also based off of <a href="https://exoplayer.dev/">Exoplayer</a>, allowing for much better listening experience compared to the native MediaPlayer API.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue