Prechádzať zdrojové kódy

Merge pull request #265 from nextcloud/captionInCopyMoveAction

change caption for move and copy action
Andy Scherzinger 8 rokov pred
rodič
commit
88ce073732

+ 1 - 1
res/menu/file_actions_menu.xml

@@ -63,7 +63,7 @@
         android:orderInCategory="1" />
     <item
         android:id="@+id/action_copy"
-        android:title="@android:string/copy"
+        android:title="@string/actionbar_copy"
         android:icon="@drawable/ic_action_copy"
         app:showAsAction="ifRoom"
         android:orderInCategory="1" />

+ 3 - 0
res/values/strings.xml

@@ -369,6 +369,7 @@
 	<string name="saml_authentication_required_text">Authentication required</string>
 	<string name="saml_authentication_wrong_pass">Wrong password</string>
 	<string name="actionbar_move">Move</string>
+    <string name="actionbar_copy">Copy</string>
 	<string name="file_list_empty_moving">Nothing in here. You can add a folder!</string>
 	<string name="folder_picker_choose_button_text">Choose</string>
 
@@ -490,6 +491,8 @@
     <string name="participate_contribute_forum_text">Help others on the &lt;a href="%1$s>forum&lt;/a></string>
     <string name="participate_contribute_translate_text">&lt;a href="%1$s>Translate&lt;/a> the app</string>
     <string name="participate_contribute_github_text">Contribute as a developer, see &lt;a href="https://github.com/nextcloud/android/blob/master/CONTRIBUTING.md">CONTRIBUTING.md&lt;/a> for details</string>
+    <string name="move_to">Move to&#8230;</string>
+    <string name="copy_to">Copy to&#8230;</string>
     <plurals name="items_selected_count">
         <!--
              As a developer, you should always supply "one" and "other"

+ 10 - 1
src/com/owncloud/android/ui/activity/FolderPickerActivity.java

@@ -64,6 +64,8 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C
                                                             + ".EXTRA_FOLDER";
     public static final String EXTRA_FILES = FolderPickerActivity.class.getCanonicalName()
             + ".EXTRA_FILES";
+    public static final String EXTRA_ACTION = FolderPickerActivity.class.getCanonicalName()
+            + ".EXTRA_ACTION";
 
     private SyncBroadcastReceiver mSyncBroadcastReceiver;
 
@@ -75,6 +77,7 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C
 
     protected Button mCancelBtn;
     protected Button mChooseBtn;
+    private String caption;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -94,6 +97,12 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C
         // Action bar setup
         setupToolbar();
         getSupportActionBar().setDisplayShowTitleEnabled(true);
+        if (getIntent().getStringExtra(EXTRA_ACTION) != null) {
+            caption = getIntent().getStringExtra(EXTRA_ACTION);
+        } else {
+            caption = getString(R.string.default_display_name_for_root_folder);
+        };
+        getSupportActionBar().setTitle(caption);
 
         setIndeterminate(mSyncInProgress);
         // always AFTER setContentView(...) ; to work around bug in its implementation
@@ -337,7 +346,7 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C
         actionBar.setHomeButtonEnabled(!atRoot);
         actionBar.setTitle(
             atRoot
-                ? getString(R.string.default_display_name_for_root_folder)
+                ? caption
                 : currentDir.getFileName()
         );
     }

+ 2 - 0
src/com/owncloud/android/ui/fragment/OCFileListFragment.java

@@ -592,12 +592,14 @@ public class OCFileListFragment extends ExtendedListFragment {
             case R.id.action_move: {
                 Intent action = new Intent(getActivity(), FolderPickerActivity.class);
                 action.putParcelableArrayListExtra(FolderPickerActivity.EXTRA_FILES, checkedFiles);
+                action.putExtra(FolderPickerActivity.EXTRA_ACTION, getResources().getText(R.string.move_to));
                 getActivity().startActivityForResult(action, FileDisplayActivity.REQUEST_CODE__MOVE_FILES);
                 return true;
             }
             case R.id.action_copy:
                 Intent action = new Intent(getActivity(), FolderPickerActivity.class);
                 action.putParcelableArrayListExtra(FolderPickerActivity.EXTRA_FILES, checkedFiles);
+                action.putExtra(FolderPickerActivity.EXTRA_ACTION, getResources().getText(R.string.copy_to));
                 getActivity().startActivityForResult(action, FileDisplayActivity.REQUEST_CODE__COPY_FILES);
                 return true;
             default: