playback: fade out content as view slides

Re-add the ability for content to fade out as the playback or queue
view slides up. This also migrates the queue slide animation to also
fade out content, which allows for the stylistic cohesion I desire.
This commit is contained in:
OxygenCobalt 2021-11-27 11:49:06 -07:00
parent e397cf1540
commit cde3a99f4d
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
9 changed files with 34 additions and 14 deletions

View file

@ -68,7 +68,7 @@ fun <T : Music> ImageView.load(music: T?, @DrawableRes error: Int) {
dispose() dispose()
load(music) { load(music) {
// Round out the corners if it's enabled // Round out the corners if enabled
// We don't do this by default because it's ugly and desecrates album artwork. // We don't do this by default because it's ugly and desecrates album artwork.
val settingsManager = SettingsManager.getInstance() val settingsManager = SettingsManager.getInstance()

View file

@ -543,7 +543,10 @@ class PlaybackLayout @JvmOverloads constructor(
val halfInRatio = max(ratio - 0.5f, 0f) / 0.5f val halfInRatio = max(ratio - 0.5f, 0f) / 0.5f
// Optimize out drawing for this view completely // Optimize out drawing for this view completely
contentView.isInvisible = outRatio == 0f contentView.apply {
alpha = outRatio
isInvisible = alpha == 0f
}
// Slowly reduce the elevation of the container as we slide up, eventually resulting in a // Slowly reduce the elevation of the container as we slide up, eventually resulting in a
// neutral color instead of an elevated one when fully expanded. // neutral color instead of an elevated one when fully expanded.

View file

@ -2,9 +2,8 @@
This is part of a stopgap animation used by QueueFragment until it's fully integrated This is part of a stopgap animation used by QueueFragment until it's fully integrated
into PlaybackLayout. into PlaybackLayout.
--> -->
<set xmlns:android="http://schemas.android.com/apk/res/android"> <alpha xmlns:android="http://schemas.android.com/apk/res/android"
<translate android:duration="500"
android:duration="500" android:fromAlpha="1"
android:fromYDelta="0.0%p" android:interpolator="@android:interpolator/decelerate_quint"
android:toYDelta="0.0%p" /> android:toAlpha="0" />
</set>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?><!--
This is part of a stopgap animation used by QueueFragment until it's fully integrated
into PlaybackLayout.
-->
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="500"
android:fromAlpha="1"
android:interpolator="@android:interpolator/decelerate_quint"
android:toAlpha="0" />

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?><!--
This is part of a stopgap animation used by QueueFragment until it's fully integrated
into PlaybackLayout.
-->
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="500"
android:fromAlpha="0"
android:interpolator="@android:interpolator/decelerate_quint"
android:toAlpha="1" />

View file

@ -11,10 +11,10 @@
<action <action
android:id="@+id/action_show_queue" android:id="@+id/action_show_queue"
app:destination="@id/queue_fragment" app:destination="@id/queue_fragment"
app:enterAnim="@anim/anim_nav_slide_up" app:enterAnim="@anim/nav_slide_enter_anim"
app:exitAnim="@anim/anim_stationary" app:exitAnim="@anim/nav_slide_exit_anim"
app:popEnterAnim="@anim/anim_stationary" app:popEnterAnim="@anim/nav_slide_pop_enter_anim"
app:popExitAnim="@anim/anim_nav_slide_down" /> app:popExitAnim="@anim/nav_slide_pop_exit_anim" />
<action <action
android:id="@+id/action_show_settings" android:id="@+id/action_show_settings"
app:destination="@id/settings_fragment" app:destination="@id/settings_fragment"

View file

@ -74,8 +74,8 @@
<string name="set_show_covers_desc">Turn off to save memory usage</string> <string name="set_show_covers_desc">Turn off to save memory usage</string>
<string name="set_quality_covers">Ignore MediaStore covers</string> <string name="set_quality_covers">Ignore MediaStore covers</string>
<string name="set_quality_covers_desc">Increases album cover quality, but results in longer loading times and higher memory usage</string> <string name="set_quality_covers_desc">Increases album cover quality, but results in longer loading times and higher memory usage</string>
<string name="set_round_covers">Round album covers</string> <string name="set_round_covers">Rounded album covers</string>
<string name="set_round_covers_desc">Use gaudy rounded album covers</string> <string name="set_round_covers_desc">Use album covers with rounded corners</string>
<string name="set_alt_action">Use alternate notification action</string> <string name="set_alt_action">Use alternate notification action</string>
<string name="set_alt_loop">Prefer repeat mode action</string> <string name="set_alt_loop">Prefer repeat mode action</string>
<string name="set_alt_shuffle">Prefer shuffle action</string> <string name="set_alt_shuffle">Prefer shuffle action</string>