diff --git a/app/src/main/java/com/nextcloud/client/preferences/AppPreferencesImpl.java b/app/src/main/java/com/nextcloud/client/preferences/AppPreferencesImpl.java index 4531fd20acf4..b5b09152e88f 100644 --- a/app/src/main/java/com/nextcloud/client/preferences/AppPreferencesImpl.java +++ b/app/src/main/java/com/nextcloud/client/preferences/AppPreferencesImpl.java @@ -429,7 +429,8 @@ public void setAutoUploadInit(boolean autoUploadInit) { @Override public int getUploaderBehaviour() { - return preferences.getInt(AUTO_PREF__UPLOADER_BEHAVIOR, 1); + //NMC Customization + return preferences.getInt(AUTO_PREF__UPLOADER_BEHAVIOR, 0); } @Override diff --git a/app/src/main/java/com/owncloud/android/ui/activity/UploadFilesActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/UploadFilesActivity.java index 9dd891a1f9fe..8c4feb1ee1b0 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/UploadFilesActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/UploadFilesActivity.java @@ -195,8 +195,9 @@ public void onCreate(Bundle savedInstanceState) { // file upload spinner List behaviours = new ArrayList<>(); - behaviours.add(getString(R.string.uploader_upload_files_behaviour_move_to_nextcloud_folder, - themeUtils.getDefaultDisplayNameForRootFolder(this))); + // Not required this option for NMC + // behaviours.add(getString(R.string.uploader_upload_files_behaviour_move_to_nextcloud_folder, + // themeUtils.getDefaultDisplayNameForRootFolder(this))); behaviours.add(getString(R.string.uploader_upload_files_behaviour_only_upload)); behaviours.add(getString(R.string.uploader_upload_files_behaviour_upload_and_delete_from_source)); @@ -205,6 +206,19 @@ public void onCreate(Bundle savedInstanceState) { behaviourAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); binding.uploadFilesSpinnerBehaviour.setAdapter(behaviourAdapter); binding.uploadFilesSpinnerBehaviour.setSelection(localBehaviour); + //NMC Customization + binding.uploadFilesSpinnerBehaviour.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { + @Override + public void onItemSelected(AdapterView adapterView, View view, int i, long l) { + // store behaviour + preferences.setUploaderBehaviour(binding.uploadFilesSpinnerBehaviour.getSelectedItemPosition()); + } + + @Override + public void onNothingSelected(AdapterView adapterView) { + + } + }); // setup the toolbar setupToolbar(); @@ -269,7 +283,12 @@ public void showToolbarSpinner() { private void fillDirectoryDropdown() { File currentDir = mCurrentDir; while (currentDir != null && currentDir.getParentFile() != null) { - mDirectories.add(currentDir.getName()); + //NMC Customization + if (currentDir.getName().equals("0")) { + mDirectories.add(getResources().getString(R.string.storage_internal_storage)); + } else { + mDirectories.add(currentDir.getName()); + } currentDir = currentDir.getParentFile(); } mDirectories.add(File.separator); @@ -500,15 +519,16 @@ public void onCheckAvailableSpaceFinish(boolean hasEnoughSpaceAvailable, String. // set result code switch (binding.uploadFilesSpinnerBehaviour.getSelectedItemPosition()) { - case 0: // move to nextcloud folder + // Not required for NMC + /*case 0: // move to nextcloud folder setResult(RESULT_OK_AND_MOVE, data); - break; + break;*/ - case 1: // only upload + case 0: // only upload setResult(RESULT_OK_AND_DO_NOTHING, data); break; - case 2: // upload and delete from source + case 1: // upload and delete from source setResult(RESULT_OK_AND_DELETE, data); break; @@ -574,7 +594,8 @@ private void checkWritableFolder(File folder) { int localBehaviour = preferences.getUploaderBehaviour(); binding.uploadFilesSpinnerBehaviour.setSelection(localBehaviour); } else { - binding.uploadFilesSpinnerBehaviour.setSelection(1); + //NMC Customization + binding.uploadFilesSpinnerBehaviour.setSelection(0); textView.setText(new StringBuilder().append(getString(R.string.uploader_upload_files_behaviour)) .append(' ') .append(getString(R.string.uploader_upload_files_behaviour_not_writable)) diff --git a/app/src/main/java/com/owncloud/android/ui/dialog/LocalStoragePathPickerDialogFragment.kt b/app/src/main/java/com/owncloud/android/ui/dialog/LocalStoragePathPickerDialogFragment.kt index 52e02a085205..5c872bee45fb 100644 --- a/app/src/main/java/com/owncloud/android/ui/dialog/LocalStoragePathPickerDialogFragment.kt +++ b/app/src/main/java/com/owncloud/android/ui/dialog/LocalStoragePathPickerDialogFragment.kt @@ -92,12 +92,14 @@ class LocalStoragePathPickerDialogFragment : Environment.getExternalStoragePublicDirectory(standardDirectory.name).absolutePath ) } - val sdCard = getString(R.string.storage_internal_storage) for (dir in FileStorageUtils.getStorageDirectories(requireActivity())) { + //NMC Customisation if (internalStoragePaths.contains(dir)) { - addIfExists(storagePathItems, R.drawable.ic_sd_grey600, sdCard, dir) + val internalStorage = getString(R.string.storage_internal_storage) + addIfExists(storagePathItems, R.drawable.ic_sd_grey600, internalStorage, dir) } else { - addIfExists(storagePathItems, R.drawable.ic_sd_grey600, File(dir).name, dir) + val sdCard = getString(R.string.storage_sd_card) + addIfExists(storagePathItems, R.drawable.ic_sd, sdCard, dir) } } return storagePathItems diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 9147d3a1b8ee..f2cbebb5c64d 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -1028,6 +1028,7 @@ E-Mail senden Speicherordner existiert nicht! Ursache könnte die Wiederherstellung einer Sicherungskopie auf einem anderen Gerät sein. Der Standard-Ordner wird jetzt wieder verwendet. Bitte überprüfen Sie die Einstellungen bezüglich des Speicherortes. + SD-Karte Inhalte von %1$d Datei konnten nicht synchronisiert werden (Konflikte: %2$d) Inhalte von %1$d Dateien konnten nicht synchronisiert werden (Konflikte: %2$d) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index cf523369c230..ba12a7d696bf 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1070,6 +1070,7 @@ Delete Link Settings Confirm + SD Card Strict mode: no HTTP connection allowed! Destination filename Suggest