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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
Reference in New Issue
Block a user