diff options
-rw-r--r-- | app/build.gradle | 10 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/tips/TipsAdapter.java | 18 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 3 |
3 files changed, 19 insertions, 12 deletions
diff --git a/app/build.gradle b/app/build.gradle index 3e8054a46..8985e6b96 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -70,9 +70,9 @@ dependencies { coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' // Android X - implementation 'androidx.appcompat:appcompat:1.3.1' - implementation 'androidx.camera:camera-camera2:1.1.0-alpha10' - implementation 'androidx.camera:camera-lifecycle:1.1.0-alpha10' + implementation 'androidx.appcompat:appcompat:1.4.0' + implementation 'androidx.camera:camera-camera2:1.1.0-alpha11' + implementation 'androidx.camera:camera-lifecycle:1.1.0-alpha11' implementation 'androidx.camera:camera-view:1.0.0-alpha30' implementation 'androidx.constraintlayout:constraintlayout:2.1.2' implementation 'androidx.preference:preference:1.1.1' @@ -80,7 +80,7 @@ dependencies { implementation "androidx.room:room-runtime:$roomVersion" annotationProcessor "androidx.room:room-compiler:$roomVersion" implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' - implementation 'androidx.work:work-runtime:2.7.0' + implementation 'androidx.work:work-runtime:2.7.1' implementation "com.google.android.material:material:$rootProject.materialVersion" // Glide @@ -121,7 +121,7 @@ dependencies { // Tests testImplementation 'junit:junit:4.13.2' - testImplementation 'org.robolectric:robolectric:4.7' + testImplementation 'org.robolectric:robolectric:4.7.1' testImplementation 'org.mockito:mockito-core:4.0.0' testImplementation 'androidx.test:core:1.4.0' testImplementation 'androidx.arch.core:core-testing:2.1.0' diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/tips/TipsAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/tips/TipsAdapter.java index 6d0c3ff5e..5588c12dc 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/tips/TipsAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/tips/TipsAdapter.java @@ -79,7 +79,8 @@ public class TipsAdapter extends RecyclerView.Adapter<TipsViewHolder> { add(R.string.error_dialog_tip_clear_storage_might_help); add(R.string.error_dialog_tip_clear_storage, INTENT_APP_INFO); } else if (throwable instanceof NextcloudFilesAppNotSupportedException) { - add(R.string.error_dialog_tip_files_outdated); + add(R.string.error_dialog_min_version, new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.nextcloud.client")) + .putExtra(INTENT_EXTRA_BUTTON_TEXT, R.string.error_action_update_files_app)); } else if (throwable instanceof OfflineException) { add(R.string.error_dialog_tip_offline); add(R.string.error_dialog_tip_sync_only_on_wifi); @@ -169,12 +170,17 @@ public class TipsAdapter extends RecyclerView.Adapter<TipsViewHolder> { add(R.string.error_dialog_tip_clear_storage, INTENT_APP_INFO); } } else if (throwable instanceof UnknownErrorException) { - if (account != null) { - add(R.string.error_dialog_unknown_error, new Intent(Intent.ACTION_VIEW) - .putExtra(INTENT_EXTRA_BUTTON_TEXT, R.string.error_action_open_in_browser) - .setData(Uri.parse(account.getUrl()))); + if ("com.nextcloud.android.sso.QueryParam".equals(throwable.getMessage())) { + add(R.string.error_dialog_min_version, new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.nextcloud.client")) + .putExtra(INTENT_EXTRA_BUTTON_TEXT, R.string.error_action_update_files_app)); } else { - add(R.string.error_dialog_unknown_error); + if (account != null) { + add(R.string.error_dialog_unknown_error, new Intent(Intent.ACTION_VIEW) + .putExtra(INTENT_EXTRA_BUTTON_TEXT, R.string.error_action_open_in_browser) + .setData(Uri.parse(account.getUrl()))); + } else { + add(R.string.error_dialog_unknown_error); + } } } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0cf2eb534..57e865856 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -239,7 +239,6 @@ <string name="error_dialog_tip_clear_storage_might_help">If the issue persists, try to clear the storage of both apps: Nextcloud and Nextcloud Deck to solve this issue.</string> <string name="error_dialog_tip_database_upgrade_failed">The upgrade of the database failed. Please report the issue and clear the storage to use the app normally.</string> <string name="error_dialog_tip_clear_storage">You can clear the storage by opening the app info and selecting Storage → Clear storage.</string> - <string name="error_dialog_tip_files_outdated">Your Nextcloud app seems to be outdated. Please visit the Play Store or F-Droid to get the latest version.</string> <string name="error_dialog_tip_offline">It looks like you tried to trigger a synchronization without an internet connection.</string> <string name="error_dialog_tip_sync_only_on_wifi">If you have enabled the "Sync only on Wi-Fi" setting, you can only synchronize when you are connected to a Wi-Fi.</string> <string name="error_dialog_tip_files_force_stop">Something seems to be wrong with your Nextcloud app. Please try to force stop both, the Nextcloud app and the Nextcloud Deck app.</string> @@ -260,6 +259,7 @@ <string name="error_dialog_certificate">Something seems to be wrong with the certificate of the server. Please check all the accounts in the Nextcloud app for further information.</string> <string name="error_dialog_tip_disable_battery_optimizations">Please disable all battery optimizations for Nextcloud and the Deck app.</string> <string name="error_dialog_unknown_error">Your Nextcloud instance seems to be not reachable. Please check your internet connection and whether you are able to connect to your instance via browser.</string> + <string name="error_dialog_min_version">The Deck Android app requires the Nextcloud Android app to be at least version 3.18.</string> <string name="error_action_open_deck_info">Open App info</string> <string name="error_action_open_nextcloud_app">Open Nextcloud app</string> <string name="error_action_open_network">Network settings</string> @@ -267,6 +267,7 @@ <string name="error_action_open_in_browser">Open in browser</string> <string name="error_action_install">Install</string> <string name="error_action_report_issue">Report</string> + <string name="error_action_update_files_app">Update</string> <string name="info_box_maintenance_mode">Server is in maintenance mode</string> <string name="info_box_version_not_supported">Server version %1$s not supported, please update to %2$s</string> <string name="share_link">Share link</string> |