wrap the sorting dialog in a scrollview
This commit is contained in:
parent
747e007fd0
commit
49247ee9f1
3 changed files with 77 additions and 70 deletions
|
@ -34,36 +34,36 @@ class ChangeSortingDialog(val activity: Activity, val isDirectorySorting: Boolea
|
|||
}
|
||||
|
||||
private fun setupSortRadio() {
|
||||
val sortingRadio = view.dialog_radio_sorting
|
||||
var sortBtn = sortingRadio.dialog_radio_name
|
||||
val sortingRadio = view.sorting_dialog_radio_sorting
|
||||
var sortBtn = sortingRadio.sorting_dialog_radio_name
|
||||
|
||||
if (currSorting and SORT_BY_DATE != 0) {
|
||||
sortBtn = sortingRadio.dialog_radio_date
|
||||
sortBtn = sortingRadio.sorting_dialog_radio_date
|
||||
} else if (currSorting and SORT_BY_SIZE != 0) {
|
||||
sortBtn = sortingRadio.dialog_radio_size
|
||||
sortBtn = sortingRadio.sorting_dialog_radio_size
|
||||
}
|
||||
sortBtn.isChecked = true
|
||||
}
|
||||
|
||||
private fun setupOrderRadio() {
|
||||
val orderRadio = view.dialog_radio_order
|
||||
var orderBtn = orderRadio.dialog_radio_ascending
|
||||
val orderRadio = view.sorting_dialog_radio_order
|
||||
var orderBtn = orderRadio.sorting_dialog_radio_ascending
|
||||
|
||||
if (currSorting and SORT_DESCENDING != 0) {
|
||||
orderBtn = orderRadio.dialog_radio_descending
|
||||
orderBtn = orderRadio.sorting_dialog_radio_descending
|
||||
}
|
||||
orderBtn.isChecked = true
|
||||
}
|
||||
|
||||
override fun onClick(dialog: DialogInterface, which: Int) {
|
||||
val sortingRadio = view.dialog_radio_sorting
|
||||
val sortingRadio = view.sorting_dialog_radio_sorting
|
||||
var sorting = when (sortingRadio.checkedRadioButtonId) {
|
||||
R.id.dialog_radio_name -> SORT_BY_NAME
|
||||
R.id.dialog_radio_date -> SORT_BY_DATE
|
||||
R.id.sorting_dialog_radio_name -> SORT_BY_NAME
|
||||
R.id.sorting_dialog_radio_date -> SORT_BY_DATE
|
||||
else -> SORT_BY_SIZE
|
||||
}
|
||||
|
||||
if (view.dialog_radio_order.checkedRadioButtonId == R.id.dialog_radio_descending) {
|
||||
if (view.sorting_dialog_radio_order.checkedRadioButtonId == R.id.sorting_dialog_radio_descending) {
|
||||
sorting = sorting or SORT_DESCENDING
|
||||
}
|
||||
|
||||
|
|
|
@ -1,20 +1,26 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout android:id="@+id/dialog_holder"
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/sorting_dialog_scrollview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/sorting_dialog_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin"
|
||||
android:paddingTop="@dimen/activity_margin">
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/dialog_radio_sorting"
|
||||
android:id="@+id/sorting_dialog_radio_sorting"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/dialog_radio_name"
|
||||
android:id="@+id/sorting_dialog_radio_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/medium_padding"
|
||||
|
@ -22,7 +28,7 @@
|
|||
android:text="@string/name"/>
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/dialog_radio_date"
|
||||
android:id="@+id/sorting_dialog_radio_date"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/medium_padding"
|
||||
|
@ -30,7 +36,7 @@
|
|||
android:text="@string/date"/>
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/dialog_radio_size"
|
||||
android:id="@+id/sorting_dialog_radio_size"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/medium_padding"
|
||||
|
@ -46,12 +52,12 @@
|
|||
android:background="@color/light_grey"/>
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/dialog_radio_order"
|
||||
android:id="@+id/sorting_dialog_radio_order"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/dialog_radio_ascending"
|
||||
android:id="@+id/sorting_dialog_radio_ascending"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/medium_padding"
|
||||
|
@ -59,11 +65,12 @@
|
|||
android:text="@string/ascending"/>
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/dialog_radio_descending"
|
||||
android:id="@+id/sorting_dialog_radio_descending"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/medium_padding"
|
||||
android:paddingTop="@dimen/medium_padding"
|
||||
android:text="@string/descending"/>
|
||||
</RadioGroup>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/dialog_holder"
|
||||
android:id="@+id/sorting_dialog_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
|
|
Loading…
Reference in a new issue