home: fix visual clipping on shuffle fab shadow

Fix visual clipping on the shuffle FAB's shadow.

Turns out padding, while slower, is actually the better inset handling
method, as it allows me to avoid visual clipping in some cases.
This commit is contained in:
Alexander Capehart
2023-02-12 21:53:34 -07:00
parent 1826ae3215
commit c9ddda2ebd
3 changed files with 6 additions and 1 deletions
@@ -22,6 +22,7 @@ import android.util.AttributeSet
import android.view.WindowInsets
import android.widget.FrameLayout
import androidx.annotation.AttrRes
import androidx.core.view.updatePadding
import org.oxycblt.auxio.util.systemBarInsetsCompat
/**
@@ -38,7 +39,7 @@ constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr
override fun onApplyWindowInsets(insets: WindowInsets): WindowInsets {
// Prevent excessive layouts by using translation instead of padding.
translationY = -insets.systemBarInsetsCompat.bottom.toFloat()
updatePadding(bottom = insets.systemBarInsetsCompat.bottom)
return insets
}
}
+1
View File
@@ -5,6 +5,7 @@
<style name="Widget.Auxio.AppBarLayout" parent="Widget.Material3.AppBarLayout">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:stateListAnimator">@null</item>
</style>
<!-- Base toolbar style -->