show the path at Save as dialog of editor

This commit is contained in:
tibbi 2016-12-04 13:20:37 +01:00
parent 5c12491fc1
commit 40e50dddc8
11 changed files with 36 additions and 10 deletions

View file

@ -4,17 +4,17 @@ import android.app.Activity
import android.app.AlertDialog
import android.view.LayoutInflater
import android.view.WindowManager
import com.simplemobiletools.filepicker.extensions.getFilenameFromPath
import com.simplemobiletools.filepicker.extensions.isAValidFilename
import com.simplemobiletools.filepicker.extensions.toast
import com.simplemobiletools.filepicker.extensions.value
import com.simplemobiletools.filepicker.extensions.*
import com.simplemobiletools.gallery.R
import kotlinx.android.synthetic.main.rename_file.view.*
import java.io.File
class SaveAsDialog(val activity: Activity, val path: String, val callback: (filename: String) -> Unit) {
init {
val view = LayoutInflater.from(activity).inflate(R.layout.dialog_save_as, null)
val realPath = File(path).parent.trimEnd('/')
view.file_path.text = activity.humanizePath(realPath)
view.file_name.setText(path.getFilenameFromPath())
AlertDialog.Builder(activity)

View file

@ -1,10 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/save_as_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="@dimen/activity_margin">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/save_as_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="@dimen/activity_margin">
<TextView
android:id="@+id/file_path_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/path"
android:textSize="@dimen/details_text_size"/>
<TextView
android:id="@+id/file_path"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_margin"
android:layout_marginLeft="@dimen/activity_margin"
android:paddingRight="@dimen/small_padding"
android:paddingTop="@dimen/small_padding"/>
<EditText
android:id="@+id/file_name"

View file

@ -76,6 +76,7 @@
<string name="editor">Editor</string>
<string name="save">Speichern</string>
<string name="rotate">Drehen</string>
<string name="path">Path</string>
<string name="invalid_image_path">Ungültiger Dateipfad</string>
<string name="image_editing_failed">Bildbearbeitung fehlgeschlagen</string>
<string name="edit_image_with">Bearbeite Bild mit:</string>

View file

@ -76,6 +76,7 @@
<string name="editor">Editor</string>
<string name="save">Save</string>
<string name="rotate">Rotate</string>
<string name="path">Path</string>
<string name="invalid_image_path">Invalid image path</string>
<string name="image_editing_failed">Image editing failed</string>
<string name="edit_image_with">Editar image usando:</string>

View file

@ -76,6 +76,7 @@
<string name="editor">Editor</string>
<string name="save">Salva</string>
<string name="rotate">Ruota</string>
<string name="path">Path</string>
<string name="invalid_image_path">Percorso immagine non valido</string>
<string name="image_editing_failed">Modifica immagine non riuscita</string>
<string name="edit_image_with">Modifica immagine con:</string>

View file

@ -76,6 +76,7 @@
<string name="editor">エディター</string>
<string name="save">保存</string>
<string name="rotate">回転</string>
<string name="path">Path</string>
<string name="invalid_image_path">無効な画像パス</string>
<string name="image_editing_failed">画像の編集に失敗しました</string>
<string name="edit_image_with">画像を編集:</string>

View file

@ -76,6 +76,7 @@
<string name="editor">Editor</string>
<string name="save">Guardar</string>
<string name="rotate">Rodar</string>
<string name="path">Path</string>
<string name="invalid_image_path">Caminho inválido</string>
<string name="image_editing_failed">Falha de edição de imagem</string>
<string name="edit_image_with">Editar imagem com:</string>

View file

@ -77,6 +77,7 @@
<string name="editor">Редактор</string>
<string name="save">Сохранить</string>
<string name="rotate">Поворот</string>
<string name="path">Path</string>
<string name="invalid_image_path">Недопустимый путь изображения</string>
<string name="image_editing_failed">Редактирование изображения не удалось</string>
<string name="edit_image_with">Редактирование изображений в:</string>

View file

@ -76,6 +76,7 @@
<string name="editor">Editor</string>
<string name="save">Save</string>
<string name="rotate">Rotate</string>
<string name="path">Path</string>
<string name="invalid_image_path">Invalid image path</string>
<string name="image_editing_failed">Image editing failed</string>
<string name="edit_image_with">Edit image with:</string>

View file

@ -77,6 +77,7 @@
<string name="editor">编辑器</string>
<string name="save">保存</string>
<string name="rotate">旋转</string>
<string name="path">Path</string>
<string name="invalid_image_path">错误图片路径</string>
<string name="image_editing_failed">图像编辑失败</string>
<string name="edit_image_with">编辑方式:</string>

View file

@ -76,6 +76,7 @@
<string name="editor">Editor</string>
<string name="save">Save</string>
<string name="rotate">Rotate</string>
<string name="path">Path</string>
<string name="invalid_image_path">Invalid image path</string>
<string name="image_editing_failed">Image editing failed</string>
<string name="edit_image_with">Edit image with:</string>