From e37bb095dbd2c31b6e2d5272b3e01ce2fe4edd5e Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 15 Jan 2023 11:25:09 +0100 Subject: [PATCH] use the new design for Save As dialog --- app/build.gradle | 2 +- .../filemanager/pro/dialogs/SaveAsDialog.kt | 19 +++--- app/src/main/res/layout/dialog_save_as.xml | 63 +++++++++++-------- 3 files changed, 46 insertions(+), 38 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e6a14aaf..81ee58ba 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -64,7 +64,7 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:449b24c6a4' + implementation 'com.github.SimpleMobileTools:Simple-Commons:3aade6f350' implementation 'com.github.tibbi:PdfViewPager:d2af24208d' implementation 'com.github.Stericson:RootTools:df729dcb13' implementation 'com.github.Stericson:RootShell:1.6' diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/dialogs/SaveAsDialog.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/dialogs/SaveAsDialog.kt index d43619d7..13ca4d09 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/dialogs/SaveAsDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/dialogs/SaveAsDialog.kt @@ -20,7 +20,7 @@ class SaveAsDialog( var realPath = path.getParentPath() val view = activity.layoutInflater.inflate(R.layout.dialog_save_as, null).apply { - save_as_path.text = activity.humanizePath(realPath) + folder_value.setText(activity.humanizePath(realPath)) val fullName = path.getFilenameFromPath() val dotAt = fullName.lastIndexOf(".") @@ -29,18 +29,17 @@ class SaveAsDialog( if (dotAt > 0) { name = fullName.substring(0, dotAt) val extension = fullName.substring(dotAt + 1) - save_as_extension.setText(extension) + extension_value.setText(extension) } - save_as_name.setText(name) + filename_value.setText(name) if (hidePath) { - save_as_path_label.beGone() - save_as_path.beGone() + folder_hint.beGone() } else { - save_as_path.setOnClickListener { + folder_value.setOnClickListener { FilePickerDialog(activity, realPath, false, false, true, true, showFavoritesButton = true) { - save_as_path.text = activity.humanizePath(it) + folder_value.setText(activity.humanizePath(it)) realPath = it } } @@ -52,10 +51,10 @@ class SaveAsDialog( .setNegativeButton(R.string.cancel, null) .apply { activity.setupDialogStuff(view, this, R.string.save_as) { alertDialog -> - alertDialog.showKeyboard(view.save_as_name) + alertDialog.showKeyboard(view.filename_value) alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener { - val filename = view.save_as_name.value - val extension = view.save_as_extension.value + val filename = view.filename_value.value + val extension = view.extension_value.value if (filename.isEmpty()) { activity.toast(R.string.filename_cannot_be_empty) diff --git a/app/src/main/res/layout/dialog_save_as.xml b/app/src/main/res/layout/dialog_save_as.xml index e33a86fb..6f441d44 100644 --- a/app/src/main/res/layout/dialog_save_as.xml +++ b/app/src/main/res/layout/dialog_save_as.xml @@ -6,43 +6,52 @@ android:orientation="vertical" android:padding="@dimen/activity_margin"> - - - + android:hint="@string/path"> - + + + + + android:hint="@string/filename"> - + - + + + android:hint="@string/extension"> + + +