show the path at directory renaming dialog

This commit is contained in:
tibbi 2016-06-23 11:43:32 +02:00
parent 6a21c8a27c
commit 686430fcca
4 changed files with 12 additions and 16 deletions

View file

@ -26,6 +26,7 @@ import android.view.View;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.EditText; import android.widget.EditText;
import android.widget.GridView; import android.widget.GridView;
import android.widget.TextView;
import com.simplemobiletools.gallery.Constants; import com.simplemobiletools.gallery.Constants;
import com.simplemobiletools.gallery.R; import com.simplemobiletools.gallery.R;
@ -283,13 +284,16 @@ public class MainActivity extends AppCompatActivity
private void renameDir(final String path) { private void renameDir(final String path) {
final File dir = new File(path); final File dir = new File(path);
final View renameFileView = getLayoutInflater().inflate(R.layout.rename_directory, null); final View renameDirView = getLayoutInflater().inflate(R.layout.rename_directory, null);
final EditText dirNameET = (EditText) renameFileView.findViewById(R.id.directory_name); final EditText dirNameET = (EditText) renameDirView.findViewById(R.id.directory_name);
dirNameET.setText(dir.getName()); dirNameET.setText(dir.getName());
final AlertDialog.Builder builder = new AlertDialog.Builder(this); final AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(getResources().getString(R.string.rename_folder)); builder.setTitle(getResources().getString(R.string.rename_folder));
builder.setView(renameFileView); builder.setView(renameDirView);
final TextView dirPath = (TextView) renameDirView.findViewById(R.id.directory_path);
dirPath.setText(dir.getParent() + "/");
builder.setPositiveButton("OK", null); builder.setPositiveButton("OK", null);
builder.setNegativeButton("Cancel", null); builder.setNegativeButton("Cancel", null);

View file

@ -1,14 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout android:id="@+id/rename_directory_holder"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:padding="@dimen/activity_margin"> android:padding="@dimen/activity_margin">
<TextView <TextView
android:id="@+id/directory_path"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"/>
android:text="@string/folder_name"/>
<EditText <EditText
android:id="@+id/directory_name" android:id="@+id/directory_name"

View file

@ -9,14 +9,7 @@
<TextView <TextView
android:id="@+id/file_path" android:id="@+id/file_path"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"/>
android:layout_marginBottom="@dimen/activity_margin"/>
<TextView
android:id="@+id/file_name_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/file_name"/>
<EditText <EditText
android:id="@+id/file_name" android:id="@+id/file_name"

View file

@ -15,8 +15,6 @@
<string name="rename_folder_empty">Folder name must not be empty</string> <string name="rename_folder_empty">Folder name must not be empty</string>
<string name="rename_folder_ok">Folder renamed successfully</string> <string name="rename_folder_ok">Folder renamed successfully</string>
<string name="renaming_folder">Renaming folder</string> <string name="renaming_folder">Renaming folder</string>
<string name="file_name">File name</string>
<string name="folder_name">Folder name</string>
<string name="extension">Extension</string> <string name="extension">Extension</string>
<string name="file_deleted">File deleted</string> <string name="file_deleted">File deleted</string>