list: fix incomplete scrolling in menu dialog
Fix an issue where the options in MenuDialog could not full scroll for an unknown reason. Derived from some absurd issue where BottomSheetBehavior dislikes ConstraintLayout's spacing and decides to improperly allocate enough space for the RecyclerView to scroll.
This commit is contained in:
@@ -36,9 +36,6 @@ import org.oxycblt.auxio.util.unlikelyToBeNull
|
|||||||
* A lifecycle-aware [DialogFragment] that automatically manages the [ViewBinding] lifecycle as a
|
* A lifecycle-aware [DialogFragment] that automatically manages the [ViewBinding] lifecycle as a
|
||||||
* [BottomSheetDialogFragment].
|
* [BottomSheetDialogFragment].
|
||||||
*
|
*
|
||||||
* TODO: Debug why menu RecyclerView believes it can scroll more than it actually can in
|
|
||||||
* landscape.
|
|
||||||
*
|
|
||||||
* @author Alexander Capehart (OxygenCobalt)
|
* @author Alexander Capehart (OxygenCobalt)
|
||||||
*/
|
*/
|
||||||
abstract class ViewBindingBottomSheetDialogFragment<VB : ViewBinding> :
|
abstract class ViewBindingBottomSheetDialogFragment<VB : ViewBinding> :
|
||||||
|
|||||||
@@ -1,79 +1,90 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
|
<!--
|
||||||
android:id="@+id/menu_handle"
|
Required to use a LinearLayout here for space allocation to stop the BottomSheetDialog
|
||||||
|
from flipping out and not allowing the RecyclerView to scroll fully.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent">
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<org.oxycblt.auxio.image.CoverView
|
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
|
||||||
android:id="@+id/menu_cover"
|
android:id="@+id/menu_handle"
|
||||||
style="@style/Widget.Auxio.Image.Full"
|
android:layout_width="match_parent"
|
||||||
android:layout_marginBottom="@dimen/spacing_medium"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/spacing_medium"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
app:layout_constraintTop_toBottomOf="@+id/menu_handle" />
|
|
||||||
|
|
||||||
<TextView
|
<org.oxycblt.auxio.image.CoverView
|
||||||
android:id="@+id/menu_type"
|
android:id="@+id/menu_cover"
|
||||||
android:layout_width="0dp"
|
style="@style/Widget.Auxio.Image.Full"
|
||||||
android:layout_height="wrap_content"
|
android:layout_marginStart="@dimen/spacing_medium"
|
||||||
android:layout_marginHorizontal="@dimen/spacing_medium"
|
android:layout_marginBottom="@dimen/spacing_medium"
|
||||||
android:layout_marginTop="@dimen/spacing_small"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
android:textAppearance="@style/TextAppearance.Auxio.LabelMedium"
|
app:layout_constraintTop_toBottomOf="@+id/menu_handle" />
|
||||||
android:textColor="?attr/colorSecondary"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/menu_name"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/menu_cover"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/menu_cover"
|
|
||||||
app:layout_constraintVertical_chainStyle="packed"
|
|
||||||
tools:text="Type" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/menu_name"
|
android:id="@+id/menu_type"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/Widget.Auxio.TextView.Primary"
|
android:layout_marginHorizontal="@dimen/spacing_medium"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/menu_info"
|
android:layout_marginTop="@dimen/spacing_small"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/menu_type"
|
android:textAppearance="@style/TextAppearance.Auxio.LabelMedium"
|
||||||
app:layout_constraintStart_toStartOf="@+id/menu_type"
|
android:textColor="?attr/colorSecondary"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/menu_type"
|
app:layout_constraintBottom_toTopOf="@+id/menu_name"
|
||||||
tools:text="Name" />
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/menu_cover"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/menu_cover"
|
||||||
|
app:layout_constraintVertical_chainStyle="packed"
|
||||||
|
tools:text="Type" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/menu_info"
|
android:id="@+id/menu_name"
|
||||||
android:layout_width="0dp"
|
style="@style/Widget.Auxio.TextView.Primary"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="0dp"
|
||||||
style="@style/Widget.Auxio.TextView.Secondary.Marquee"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
app:layout_constraintBottom_toTopOf="@+id/menu_info"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/menu_type"
|
app:layout_constraintEnd_toEndOf="@+id/menu_type"
|
||||||
app:layout_constraintStart_toStartOf="@+id/menu_name"
|
app:layout_constraintStart_toStartOf="@+id/menu_type"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/menu_name"
|
app:layout_constraintTop_toBottomOf="@+id/menu_type"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/menu_cover"
|
tools:text="Name" />
|
||||||
android:layout_marginBottom="@dimen/spacing_small"
|
|
||||||
tools:text="Info A" />
|
|
||||||
|
|
||||||
<com.google.android.material.divider.MaterialDivider
|
<TextView
|
||||||
android:id="@+id/materialDivider"
|
android:id="@+id/menu_info"
|
||||||
android:layout_width="match_parent"
|
style="@style/Widget.Auxio.TextView.Secondary.Marquee"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_marginTop="@dimen/spacing_medium"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/menu_cover" />
|
android:layout_marginBottom="@dimen/spacing_small"
|
||||||
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/menu_cover"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/menu_type"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/menu_name"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/menu_name"
|
||||||
|
tools:text="Info A" />
|
||||||
|
|
||||||
|
<com.google.android.material.divider.MaterialDivider
|
||||||
|
android:id="@+id/menu_divider"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/spacing_medium"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/menu_cover" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<org.oxycblt.auxio.list.recycler.AuxioRecyclerView
|
<org.oxycblt.auxio.list.recycler.AuxioRecyclerView
|
||||||
android:id="@+id/menu_option_recycler"
|
android:id="@+id/menu_option_recycler"
|
||||||
style="@style/Widget.Auxio.RecyclerView.Linear"
|
style="@style/Widget.Auxio.RecyclerView.Linear"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="match_parent"
|
||||||
android:overScrollMode="never"
|
android:overScrollMode="never"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/materialDivider"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/menu_divider"
|
||||||
tools:listitem="@layout/item_menu_option" />
|
tools:listitem="@layout/item_menu_option" />
|
||||||
|
</LinearLayout>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
Reference in New Issue
Block a user