Update compact controls animation

Make the slide animation on the compact controls look better.
This commit is contained in:
OxygenCobalt 2021-02-18 19:08:49 -07:00
parent bd79951c4e
commit 2f8916117e
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
6 changed files with 19 additions and 24 deletions

View file

@ -14,9 +14,9 @@
## 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.

View file

@ -69,6 +69,11 @@ class MainFragment : Fragment() {
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 {
itemIconTintList = navTints
itemTextColor = navTints
@ -150,11 +155,11 @@ class MainFragment : Fragment() {
if (song == null) {
logD("Hiding CompactPlaybackFragment since no song is being played.")
binding.compactPlayback.visibility =
if (isLandscape(resources))
View.INVISIBLE
else
View.GONE
binding.compactPlayback.visibility = if (isLandscape(resources)) {
View.INVISIBLE
} else {
View.GONE
}
playbackModel.disableAnimation()
} else {

View file

@ -1,13 +1,11 @@
package org.oxycblt.auxio.ui
import android.animation.LayoutTransition
import android.content.Context
import android.graphics.Canvas
import android.util.AttributeSet
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import androidx.interpolator.view.animation.FastOutSlowInInterpolator
import org.oxycblt.auxio.logD
import org.oxycblt.auxio.logE
import java.lang.reflect.Field
@ -40,12 +38,6 @@ class SlideLinearLayout @JvmOverloads constructor(
private var doDrawingTrick: Boolean = false
init {
// Apply custom interpolation for the slide animations
layoutTransition.apply {
setInterpolator(LayoutTransition.APPEARING, FastOutSlowInInterpolator())
setInterpolator(LayoutTransition.DISAPPEARING, FastOutSlowInInterpolator())
}
if (disappearingChildrenField != null) {
// Create a junk view and add it, which makes all the magic happen [I think].
dumpView = View(context)

View file

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
tools:context=".MainFragment">
<androidx.constraintlayout.widget.ConstraintLayout
<LinearLayout
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -17,6 +17,7 @@
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
app:layout_constraintBottom_toTopOf="@+id/controls_container"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="@navigation/nav_explore"
@ -53,5 +54,5 @@
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</layout>

View file

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
tools:context=".MainFragment">
<androidx.constraintlayout.widget.ConstraintLayout
<LinearLayout
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -17,8 +17,7 @@
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/controls_container"
app:layout_constraintTop_toTopOf="parent"
android:layout_weight="1"
app:navGraph="@navigation/nav_explore"
tools:layout="@layout/fragment_library" />
@ -37,7 +36,6 @@
android:name="org.oxycblt.auxio.playback.CompactPlaybackFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@+id/nav_bar"
tools:layout="@layout/fragment_compact_playback" />
<com.google.android.material.bottomnavigation.BottomNavigationView
@ -48,9 +46,8 @@
android:background="@color/background"
android:elevation="0dp"
app:elevation="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:menu="@menu/menu_nav" />
</org.oxycblt.auxio.ui.SlideLinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</layout>

View file

@ -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.