improve padding without drawable

This commit is contained in:
Bnyro 2022-09-11 18:34:15 +02:00
parent 3bee5b146c
commit c10672f837
2 changed files with 14 additions and 5 deletions

View File

@ -29,6 +29,14 @@ class BottomSheetAdapter(
root.setOnClickListener {
listener.invoke(position)
}
// increase padding if there's no drawable
if (item.drawable == null) root.setPadding(
root.paddingLeft * 2,
root.paddingTop,
root.paddingRight,
root.paddingBottom
)
}
}

View File

@ -1,20 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/standard_bottom_sheet"
style="@style/Widget.Material3.BottomSheet"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="10dp"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- Drag handle for accessibility -->
<com.google.android.material.bottomsheet.BottomSheetDragHandleView