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