humanize the paths at rename dialogs

This commit is contained in:
tibbi 2016-11-11 00:01:08 +01:00
parent 48f5a33f90
commit 4b12949a73
2 changed files with 4 additions and 2 deletions

View file

@ -4,6 +4,7 @@ import android.app.Activity
import android.support.v7.app.AlertDialog import android.support.v7.app.AlertDialog
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.WindowManager import android.view.WindowManager
import com.simplemobiletools.filepicker.extensions.humanizePath
import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.Utils import com.simplemobiletools.gallery.Utils
import com.simplemobiletools.gallery.extensions.toast import com.simplemobiletools.gallery.extensions.toast
@ -19,7 +20,7 @@ class RenameDirectoryDialog(val activity: Activity, val dir: File, val listener:
val view = LayoutInflater.from(context).inflate(R.layout.rename_directory, null) val view = LayoutInflater.from(context).inflate(R.layout.rename_directory, null)
view.directory_name.setText(dir.name) view.directory_name.setText(dir.name)
view.directory_path.text = "${dir.parent}/" view.directory_path.text = "${context.humanizePath(dir.parent)}/"
AlertDialog.Builder(context) AlertDialog.Builder(context)
.setTitle(context.resources.getString(R.string.rename_folder)) .setTitle(context.resources.getString(R.string.rename_folder))

View file

@ -5,6 +5,7 @@ import android.media.MediaScannerConnection
import android.support.v7.app.AlertDialog import android.support.v7.app.AlertDialog
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.WindowManager import android.view.WindowManager
import com.simplemobiletools.filepicker.extensions.humanizePath
import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.Utils import com.simplemobiletools.gallery.Utils
import com.simplemobiletools.gallery.extensions.toast import com.simplemobiletools.gallery.extensions.toast
@ -28,7 +29,7 @@ class RenameFileDialog(val activity: Activity, val file: File, val listener: OnR
} }
view.file_name.setText(name) view.file_name.setText(name)
view.file_path.text = "${file.parent}/" view.file_path.text = "${context.humanizePath(file.parent)}/"
AlertDialog.Builder(context) AlertDialog.Builder(context)
.setTitle(context.resources.getString(R.string.rename_file)) .setTitle(context.resources.getString(R.string.rename_file))