use the nicer Path picker at Save as dialog

This commit is contained in:
tibbi 2023-01-20 23:22:02 +01:00
parent ef3918c2f9
commit dc8b1b6d79
3 changed files with 21 additions and 23 deletions

View File

@ -432,11 +432,13 @@ class MainActivity : SimpleActivity(), CanvasListener {
}
private fun updateButtonColor(view: ImageView, enabled: Boolean) {
if (enabled) {
view.applyColorFilter(getProperPrimaryColor())
val buttonColor = if (enabled) {
getProperPrimaryColor()
} else {
view.applyColorFilter(config.canvasBackgroundColor.getContrastColor())
config.canvasBackgroundColor.getContrastColor()
}
view.applyColorFilter(buttonColor)
}
private fun hideBrushSettings(hide: Boolean) {

View File

@ -32,13 +32,12 @@ class SaveImageDialog(
)
if (hidePath) {
save_image_path_label.beGone()
save_image_path.beGone()
folder_hint.beGone()
} else {
save_image_path.text = activity.humanizePath(folder)
save_image_path.setOnClickListener {
folder_value.setText(activity.humanizePath(folder))
folder_value.setOnClickListener {
FilePickerDialog(activity, folder, false, showFAB = true) {
save_image_path.text = activity.humanizePath(it)
folder_value.setText(activity.humanizePath(it))
folder = it
}
}

View File

@ -14,28 +14,25 @@
android:paddingTop="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/save_image_path_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/small_margin"
android:text="@string/path"
android:textSize="@dimen/smaller_text_size" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/save_image_path"
<com.simplemobiletools.commons.views.MyTextInputLayout
android:id="@+id/folder_hint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="@dimen/small_margin"
android:paddingTop="@dimen/small_margin"
android:paddingEnd="@dimen/small_margin"
android:paddingBottom="@dimen/activity_margin" />
android:layout_marginBottom="@dimen/activity_margin"
android:hint="@string/path">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/folder_value"
style="@style/UnclickableEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.simplemobiletools.commons.views.MyTextInputLayout>
<com.simplemobiletools.commons.views.MyTextInputLayout
android:id="@+id/save_image_filename_hint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/activity_margin"
android:layout_marginBottom="@dimen/medium_margin"
android:hint="@string/filename">