Pārlūkot izejas kodu

enhance folder already exists

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 6 gadi atpakaļ
vecāks
revīzija
99ed63701b

+ 3 - 3
build.gradle

@@ -208,9 +208,9 @@ dependencies {
     // dependencies for app building
     // dependencies for app building
     implementation 'com.android.support:multidex:1.0.3'
     implementation 'com.android.support:multidex:1.0.3'
 //    implementation project('nextcloud-android-library')
 //    implementation project('nextcloud-android-library')
-    genericImplementation "com.github.nextcloud:android-library:master-SNAPSHOT"
-    gplayImplementation "com.github.nextcloud:android-library:master-SNAPSHOT"
-    versionDevImplementation 'com.github.nextcloud:android-library:master-SNAPSHOT' // use always latest master
+    genericImplementation "com.github.nextcloud:android-library:createExistingFolder-SNAPSHOT"
+    gplayImplementation "com.github.nextcloud:android-library:createExistingFolder-SNAPSHOT"
+    versionDevImplementation 'com.github.nextcloud:android-library:createExistingFolder-SNAPSHOT' // use always latest master
     implementation "com.android.support:support-v4:${supportLibraryVersion}"
     implementation "com.android.support:support-v4:${supportLibraryVersion}"
     implementation "com.android.support:design:${supportLibraryVersion}"
     implementation "com.android.support:design:${supportLibraryVersion}"
     implementation 'com.jakewharton:disklrucache:2.0.2'
     implementation 'com.jakewharton:disklrucache:2.0.2'

+ 6 - 4
src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@ -2109,10 +2109,12 @@ public class FileDisplayActivity extends HookActivity
             refreshListOfFilesFragment(false);
             refreshListOfFilesFragment(false);
         } else {
         } else {
             try {
             try {
-                DisplayUtils.showSnackMessage(
-                        this, ErrorMessageAdapter.getErrorCauseMessage(result, operation, getResources())
-                );
-
+                if (ResultCode.FOLDER_ALREADY_EXISTS == result.getCode()) {
+                    DisplayUtils.showSnackMessage(this, R.string.folder_already_exists);
+                } else {
+                    DisplayUtils.showSnackMessage(this, ErrorMessageAdapter.getErrorCauseMessage(result, operation,
+                            getResources()));
+                }
             } catch (NotFoundException e) {
             } catch (NotFoundException e) {
                 Log_OC.e(TAG, "Error while trying to show fail message ", e);
                 Log_OC.e(TAG, "Error while trying to show fail message ", e);
             }
             }

+ 1 - 0
src/main/res/values/strings.xml

@@ -825,4 +825,5 @@
     <string name="stream">Stream with…</string>
     <string name="stream">Stream with…</string>
     <string name="stream_not_possible_headline">Internal streaming not possible</string>
     <string name="stream_not_possible_headline">Internal streaming not possible</string>
     <string name="stream_not_possible_message">Please download media instead or use external app.</string>
     <string name="stream_not_possible_message">Please download media instead or use external app.</string>
+    <string name="folder_already_exists">Folder already exists</string>
 </resources>
 </resources>