settings: fix incorrect divider use
Fix incorrect divider setups in the settings UI.
This commit is contained in:
parent
9e1f6af21e
commit
0f265cc2a4
2 changed files with 6 additions and 16 deletions
|
@ -38,7 +38,7 @@ constructor(
|
||||||
override fun shouldDrawDivider(position: Int, adapter: RecyclerView.Adapter<*>?) =
|
override fun shouldDrawDivider(position: Int, adapter: RecyclerView.Adapter<*>?) =
|
||||||
try {
|
try {
|
||||||
logD(position)
|
logD(position)
|
||||||
(adapter as PreferenceGroupAdapter).getItem(position) is PreferenceCategory
|
(adapter as PreferenceGroupAdapter).getItem(position + 1) is PreferenceCategory
|
||||||
} catch (e: ClassCastException) {
|
} catch (e: ClassCastException) {
|
||||||
false
|
false
|
||||||
} catch (e: IndexOutOfBoundsException) {
|
} catch (e: IndexOutOfBoundsException) {
|
||||||
|
|
|
@ -11,12 +11,6 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<com.google.android.material.divider.MaterialDivider
|
|
||||||
android:id="@+id/dirs_mode_header_divider"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_width="match_parent" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
style="@style/Widget.Auxio.TextView.Header"
|
style="@style/Widget.Auxio.TextView.Header"
|
||||||
android:id="@+id/dirs_mode_header"
|
android:id="@+id/dirs_mode_header"
|
||||||
|
@ -24,8 +18,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingStart="@dimen/spacing_large"
|
android:paddingStart="@dimen/spacing_large"
|
||||||
android:paddingEnd="@dimen/spacing_large"
|
android:paddingEnd="@dimen/spacing_large"
|
||||||
android:text="@string/set_dirs_mode"
|
android:text="@string/set_dirs_mode" />
|
||||||
app:layout_constraintTop_toBottomOf="@+id/dirs_mode_header_divider" />
|
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButtonToggleGroup
|
<com.google.android.material.button.MaterialButtonToggleGroup
|
||||||
|
@ -33,7 +26,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/spacing_large"
|
android:layout_marginStart="@dimen/spacing_large"
|
||||||
android:layout_marginTop="@dimen/spacing_medium"
|
android:layout_marginTop="@dimen/spacing_small"
|
||||||
android:layout_marginEnd="@dimen/spacing_large"
|
android:layout_marginEnd="@dimen/spacing_large"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/dirs_mode_header"
|
app:layout_constraintTop_toBottomOf="@+id/dirs_mode_header"
|
||||||
|
@ -43,7 +36,7 @@
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/dirs_mode_exclude"
|
android:id="@+id/dirs_mode_exclude"
|
||||||
style="@style/Widget.Auxio.Button.Secondary"
|
style="@style/Widget.Material3.Button.OutlinedButton"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
@ -52,7 +45,7 @@
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/dirs_mode_include"
|
android:id="@+id/dirs_mode_include"
|
||||||
style="@style/Widget.Auxio.Button.Secondary"
|
style="@style/Widget.Material3.Button.OutlinedButton"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
@ -65,7 +58,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/spacing_large"
|
android:layout_marginStart="@dimen/spacing_large"
|
||||||
android:layout_marginTop="@dimen/spacing_small"
|
android:layout_marginTop="@dimen/spacing_tiny"
|
||||||
android:layout_marginEnd="@dimen/spacing_large"
|
android:layout_marginEnd="@dimen/spacing_large"
|
||||||
android:textAlignment="viewStart"
|
android:textAlignment="viewStart"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/folder_mode_group"
|
app:layout_constraintTop_toBottomOf="@+id/folder_mode_group"
|
||||||
|
@ -99,8 +92,6 @@
|
||||||
app:layout_constraintTop_toBottomOf="@+id/dirs_list_header_divider"
|
app:layout_constraintTop_toBottomOf="@+id/dirs_list_header_divider"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/dirs_list_header" />
|
app:layout_constraintEnd_toEndOf="@+id/dirs_list_header" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/dirs_recycler"
|
android:id="@+id/dirs_recycler"
|
||||||
style="@style/Widget.Auxio.RecyclerView.Linear"
|
style="@style/Widget.Auxio.RecyclerView.Linear"
|
||||||
|
@ -110,7 +101,6 @@
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:overScrollMode="never"
|
android:overScrollMode="never"
|
||||||
android:paddingTop="@dimen/spacing_small"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/dirs_list_header"
|
app:layout_constraintTop_toBottomOf="@+id/dirs_list_header"
|
||||||
tools:listitem="@layout/item_music_dir" />
|
tools:listitem="@layout/item_music_dir" />
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue