diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
index 8d51574c3..5fede1357 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt
@@ -158,7 +158,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
}
private fun showSortingDialog() {
- ChangeSortingDialog(this, true) {
+ ChangeSortingDialog(this, true, false) {
getDirectories()
}
}
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt
index 710eac8c5..ed577ec71 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt
@@ -145,7 +145,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
}
private fun showSortingDialog() {
- ChangeSortingDialog(this, false) {
+ ChangeSortingDialog(this, false, true) {
getMedia()
}
}
diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt
index 33040623f..90152ae8c 100644
--- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/ChangeSortingDialog.kt
@@ -4,6 +4,7 @@ import android.content.DialogInterface
import android.support.v7.app.AlertDialog
import android.view.LayoutInflater
import android.view.View
+import com.simplemobiletools.commons.extensions.beVisibleIf
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.SimpleActivity
@@ -11,7 +12,8 @@ import com.simplemobiletools.gallery.extensions.config
import com.simplemobiletools.gallery.helpers.*
import kotlinx.android.synthetic.main.dialog_change_sorting.view.*
-class ChangeSortingDialog(val activity: SimpleActivity, val isDirectorySorting: Boolean, val callback: () -> Unit) : DialogInterface.OnClickListener {
+class ChangeSortingDialog(val activity: SimpleActivity, val isDirectorySorting: Boolean, val showFolderCheckbox: Boolean, val callback: () -> Unit) :
+ DialogInterface.OnClickListener {
companion object {
private var currSorting = 0
@@ -22,6 +24,8 @@ class ChangeSortingDialog(val activity: SimpleActivity, val isDirectorySorting:
init {
config = activity.config
view = LayoutInflater.from(activity).inflate(R.layout.dialog_change_sorting, null)
+ view.use_for_this_folder_divider.beVisibleIf(showFolderCheckbox)
+ view.sorting_dialog_use_for_this_folder.beVisibleIf(showFolderCheckbox)
AlertDialog.Builder(activity)
.setPositiveButton(R.string.ok, this)
diff --git a/app/src/main/res/layout/dialog_change_sorting.xml b/app/src/main/res/layout/dialog_change_sorting.xml
index 3dea20d4b..d0ab9b36f 100644
--- a/app/src/main/res/layout/dialog_change_sorting.xml
+++ b/app/src/main/res/layout/dialog_change_sorting.xml
@@ -61,7 +61,8 @@
android:id="@+id/sorting_dialog_radio_order"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/medium_margin">
+ android:layout_marginTop="@dimen/medium_margin"
+ android:paddingBottom="@dimen/medium_margin">
+
+
+
+
+