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:
parent
e397cf1540
commit
cde3a99f4d
9 changed files with 34 additions and 14 deletions
|
@ -68,7 +68,7 @@ fun <T : Music> ImageView.load(music: T?, @DrawableRes error: Int) {
|
|||
dispose()
|
||||
|
||||
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.
|
||||
val settingsManager = SettingsManager.getInstance()
|
||||
|
||||
|
|
|
@ -543,7 +543,10 @@ class PlaybackLayout @JvmOverloads constructor(
|
|||
val halfInRatio = max(ratio - 0.5f, 0f) / 0.5f
|
||||
|
||||
// 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
|
||||
// neutral color instead of an elevated one when fully expanded.
|
||||
|
|
|
@ -2,9 +2,8 @@
|
|||
This is part of a stopgap animation used by QueueFragment until it's fully integrated
|
||||
into PlaybackLayout.
|
||||
-->
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<translate
|
||||
android:duration="500"
|
||||
android:fromYDelta="0.0%p"
|
||||
android:toYDelta="0.0%p" />
|
||||
</set>
|
||||
<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" />
|
||||
|
|
9
app/src/main/res/anim/nav_slide_exit_anim.xml
Normal file
9
app/src/main/res/anim/nav_slide_exit_anim.xml
Normal 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" />
|
9
app/src/main/res/anim/nav_slide_pop_enter_anim.xml
Normal file
9
app/src/main/res/anim/nav_slide_pop_enter_anim.xml
Normal 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" />
|
|
@ -11,10 +11,10 @@
|
|||
<action
|
||||
android:id="@+id/action_show_queue"
|
||||
app:destination="@id/queue_fragment"
|
||||
app:enterAnim="@anim/anim_nav_slide_up"
|
||||
app:exitAnim="@anim/anim_stationary"
|
||||
app:popEnterAnim="@anim/anim_stationary"
|
||||
app:popExitAnim="@anim/anim_nav_slide_down" />
|
||||
app:enterAnim="@anim/nav_slide_enter_anim"
|
||||
app:exitAnim="@anim/nav_slide_exit_anim"
|
||||
app:popEnterAnim="@anim/nav_slide_pop_enter_anim"
|
||||
app:popExitAnim="@anim/nav_slide_pop_exit_anim" />
|
||||
<action
|
||||
android:id="@+id/action_show_settings"
|
||||
app:destination="@id/settings_fragment"
|
||||
|
|
|
@ -74,8 +74,8 @@
|
|||
<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_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_desc">Use gaudy rounded album covers</string>
|
||||
<string name="set_round_covers">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_loop">Prefer repeat mode action</string>
|
||||
<string name="set_alt_shuffle">Prefer shuffle action</string>
|
||||
|
|
Loading…
Reference in a new issue