main: fix unusable fast scroll below fab
This commit is contained in:
parent
4a08809e50
commit
f8ec77e137
3 changed files with 17 additions and 3 deletions
|
@ -190,6 +190,8 @@ class ThemedSpeedDialView : SpeedDialView {
|
|||
val overlayColor = surfaceColor.defaultColor.withModulatedAlpha(0.87f)
|
||||
overlayLayout.setBackgroundColor(overlayColor)
|
||||
}
|
||||
// Fix default margins added by library
|
||||
(mainFab.layoutParams as LayoutParams).setMargins(0, 0, 0, 0)
|
||||
}
|
||||
|
||||
private fun Int.withModulatedAlpha(
|
||||
|
@ -230,13 +232,24 @@ class ThemedSpeedDialView : SpeedDialView {
|
|||
return super.addActionItem(actionItem, position, animate)?.apply {
|
||||
fab.apply {
|
||||
updateLayoutParams<MarginLayoutParams> {
|
||||
val horizontalMargin = context.getDimenPixels(R.dimen.spacing_mid_large)
|
||||
setMargins(horizontalMargin, 0, horizontalMargin, 0)
|
||||
val rightMargin = context.getDimenPixels(R.dimen.spacing_tiny)
|
||||
if (position == actionItems.lastIndex) {
|
||||
val bottomMargin = context.getDimenPixels(R.dimen.spacing_small)
|
||||
setMargins(0, 0, rightMargin, bottomMargin)
|
||||
} else {
|
||||
setMargins(0, 0, rightMargin, 0)
|
||||
}
|
||||
}
|
||||
useCompatPadding = false
|
||||
}
|
||||
|
||||
labelBackground.apply {
|
||||
updateLayoutParams<MarginLayoutParams> {
|
||||
if (position == actionItems.lastIndex) {
|
||||
val bottomMargin = context.getDimenPixels(R.dimen.spacing_small)
|
||||
setMargins(0, 0, rightMargin, bottomMargin)
|
||||
}
|
||||
}
|
||||
useCompatPadding = false
|
||||
setContentPadding(spacingSmall, spacingSmall, spacingSmall, spacingSmall)
|
||||
background =
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
android:layout_gravity="bottom|end"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:layout_margin="@dimen/spacing_medium"
|
||||
app:layout_anchor="@id/home_content">
|
||||
|
||||
<org.oxycblt.auxio.home.ThemedSpeedDialView
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:clipChildren="false"
|
||||
android:layout_margin="@dimen/spacing_medium"
|
||||
android:clipToPadding="false"
|
||||
app:layout_anchor="@id/home_content">
|
||||
|
||||
|
@ -54,7 +55,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/spacing_medium"
|
||||
android:contentDescription="@string/lbl_shuffle"
|
||||
android:src="@drawable/ic_shuffle_off_24" />
|
||||
|
||||
|
|
Loading…
Reference in a new issue