From 2f8916117e40d459dc11a9d9e36ff974b107966e Mon Sep 17 00:00:00 2001 From: OxygenCobalt Date: Thu, 18 Feb 2021 19:08:49 -0700 Subject: [PATCH] Update compact controls animation Make the slide animation on the compact controls look better. --- README.md | 4 ++-- .../main/java/org/oxycblt/auxio/MainFragment.kt | 15 ++++++++++----- .../org/oxycblt/auxio/ui/SlideLinearLayout.kt | 8 -------- app/src/main/res/layout-land/fragment_main.xml | 5 +++-- app/src/main/res/layout/fragment_main.xml | 9 +++------ .../metadata/android/en-US/full_description.txt | 2 +- 6 files changed, 19 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 037e4b22b..dab1a29d6 100644 --- a/README.md +++ b/README.md @@ -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 Exoplayer, 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. diff --git a/app/src/main/java/org/oxycblt/auxio/MainFragment.kt b/app/src/main/java/org/oxycblt/auxio/MainFragment.kt index 4942044bf..5b4a88a86 100644 --- a/app/src/main/java/org/oxycblt/auxio/MainFragment.kt +++ b/app/src/main/java/org/oxycblt/auxio/MainFragment.kt @@ -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 { diff --git a/app/src/main/java/org/oxycblt/auxio/ui/SlideLinearLayout.kt b/app/src/main/java/org/oxycblt/auxio/ui/SlideLinearLayout.kt index 1ea501107..2a79fc39f 100644 --- a/app/src/main/java/org/oxycblt/auxio/ui/SlideLinearLayout.kt +++ b/app/src/main/java/org/oxycblt/auxio/ui/SlideLinearLayout.kt @@ -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) diff --git a/app/src/main/res/layout-land/fragment_main.xml b/app/src/main/res/layout-land/fragment_main.xml index 3d9ee7549..5fd4d19a7 100644 --- a/app/src/main/res/layout-land/fragment_main.xml +++ b/app/src/main/res/layout-land/fragment_main.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" tools:context=".MainFragment"> - - + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_main.xml b/app/src/main/res/layout/fragment_main.xml index 8456ddd60..2cf65c643 100644 --- a/app/src/main/res/layout/fragment_main.xml +++ b/app/src/main/res/layout/fragment_main.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" tools:context=".MainFragment"> - @@ -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" /> - + \ No newline at end of file diff --git a/fastlane/metadata/android/en-US/full_description.txt b/fastlane/metadata/android/en-US/full_description.txt index 393b84e64..7e2afa331 100644 --- a/fastlane/metadata/android/en-US/full_description.txt +++ b/fastlane/metadata/android/en-US/full_description.txt @@ -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, 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 also based off of Exoplayer, allowing for much better listening experience compared to the native MediaPlayer API.