simplifying a check in the sorting dialog
This commit is contained in:
parent
a87d3281dc
commit
e69fed1981
1 changed files with 13 additions and 10 deletions
|
@ -4,6 +4,7 @@ import android.content.DialogInterface
|
|||
import android.view.View
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
||||
import com.simplemobiletools.commons.extensions.beGoneIf
|
||||
import com.simplemobiletools.commons.extensions.beVisibleIf
|
||||
import com.simplemobiletools.commons.extensions.isVisible
|
||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||
|
@ -13,8 +14,10 @@ import com.simplemobiletools.gallery.pro.extensions.config
|
|||
import com.simplemobiletools.gallery.pro.helpers.SHOW_ALL
|
||||
import kotlinx.android.synthetic.main.dialog_change_sorting.view.*
|
||||
|
||||
class ChangeSortingDialog(val activity: BaseSimpleActivity, val isDirectorySorting: Boolean, val showFolderCheckbox: Boolean,
|
||||
val path: String = "", val callback: () -> Unit) :
|
||||
class ChangeSortingDialog(
|
||||
val activity: BaseSimpleActivity, val isDirectorySorting: Boolean, val showFolderCheckbox: Boolean,
|
||||
val path: String = "", val callback: () -> Unit
|
||||
) :
|
||||
DialogInterface.OnClickListener {
|
||||
private var currSorting = 0
|
||||
private var config = activity.config
|
||||
|
@ -54,8 +57,8 @@ class ChangeSortingDialog(val activity: BaseSimpleActivity, val isDirectorySorti
|
|||
view.use_for_this_folder_divider.beVisibleIf(view.sorting_dialog_numeric_sorting.isVisible() || view.sorting_dialog_use_for_this_folder.isVisible())
|
||||
|
||||
val isCustomSorting = checkedId == sortingRadio.sorting_dialog_radio_custom.id
|
||||
view.sorting_dialog_radio_order.beVisibleIf(!isCustomSorting)
|
||||
view.sorting_dialog_order_divider.beVisibleIf(!isCustomSorting)
|
||||
view.sorting_dialog_radio_order.beGoneIf(isCustomSorting)
|
||||
view.sorting_dialog_order_divider.beGoneIf(isCustomSorting)
|
||||
}
|
||||
|
||||
val sortBtn = when {
|
||||
|
|
Loading…
Reference in a new issue