improve bottom sheet layout

This commit is contained in:
Bnyro 2022-09-23 14:21:32 +02:00
parent 6e663cff41
commit c637a0e106
3 changed files with 8 additions and 15 deletions

View File

@ -35,16 +35,6 @@ 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

@ -9,7 +9,7 @@
style="@style/Widget.Material3.BottomSheet"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="10dp"
android:paddingBottom="20dp"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
<LinearLayout

View File

@ -5,19 +5,22 @@
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:orientation="horizontal"
android:padding="10dp">
android:paddingHorizontal="30dp"
android:paddingVertical="12dp">
<ImageView
android:id="@+id/drawable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center"
android:layout_marginEnd="25dp"
tools:src="@drawable/ic_download" />
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textSize="16sp"
tools:text="Option" />