From d22093ff608aebdcf974d40485e951e3a79f0b5b Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Mon, 17 Apr 2023 11:30:25 +0200 Subject: [PATCH] Streamline commons version Signed-off-by: tobiasKaminsky --- app/build.gradle | 8 ++++---- .../niedermann/owncloud/notes/main/menu/MenuAdapter.java | 9 ++++----- build.gradle | 1 + 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 3f253a94..c0edb3f3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -77,11 +77,11 @@ dependencies { // Nextcloud SSO implementation 'com.github.nextcloud.android-common:ui:0.8.0' - implementation 'com.github.nextcloud:Android-SingleSignOn:0.6.1' + implementation 'com.github.nextcloud:Android-SingleSignOn:0.7.0' implementation 'com.github.stefan-niedermann:android-commons:0.2.9' - implementation 'com.github.stefan-niedermann.nextcloud-commons:sso-glide:1.6.4' - implementation 'com.github.stefan-niedermann.nextcloud-commons:exception:1.6.4' - implementation('com.github.stefan-niedermann.nextcloud-commons:markdown:1.6.4') { + implementation "com.github.stefan-niedermann.nextcloud-commons:sso-glide:$commonsVersion" + implementation "com.github.stefan-niedermann.nextcloud-commons:exception:$commonsVersion" + implementation("com.github.stefan-niedermann.nextcloud-commons:markdown:$commonsVersion") { exclude group: 'org.jetbrains', module: 'annotations-java5' } diff --git a/app/src/main/java/it/niedermann/owncloud/notes/main/menu/MenuAdapter.java b/app/src/main/java/it/niedermann/owncloud/notes/main/menu/MenuAdapter.java index f920813d..855cda89 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/main/menu/MenuAdapter.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/main/menu/MenuAdapter.java @@ -12,13 +12,12 @@ import androidx.annotation.NonNull; import androidx.core.util.Consumer; import androidx.recyclerview.widget.RecyclerView; -import com.nextcloud.android.sso.Constants; import com.nextcloud.android.sso.helper.VersionCheckHelper; +import com.nextcloud.android.sso.model.FilesAppType; import it.niedermann.owncloud.notes.FormattingHelpActivity; import it.niedermann.owncloud.notes.R; import it.niedermann.owncloud.notes.about.AboutActivity; -import it.niedermann.owncloud.notes.branding.BrandingUtil; import it.niedermann.owncloud.notes.databinding.ItemNavigationBinding; import it.niedermann.owncloud.notes.persistence.entity.Account; import it.niedermann.owncloud.notes.preferences.PreferencesActivity; @@ -79,9 +78,9 @@ public class MenuAdapter extends RecyclerView.Adapter { // https://github.com/nextcloud/android/pull/8405#issuecomment-852966877 final int minVersionCode = 30170090; try { - if (VersionCheckHelper.getNextcloudFilesVersionCode(context, true) > minVersionCode) { + if (VersionCheckHelper.getNextcloudFilesVersionCode(context, FilesAppType.PROD) > minVersionCode) { return generateTrashbinAppIntent(context, account, true); - } else if (VersionCheckHelper.getNextcloudFilesVersionCode(context, false) > minVersionCode) { + } else if (VersionCheckHelper.getNextcloudFilesVersionCode(context, FilesAppType.DEV) > minVersionCode) { return generateTrashbinAppIntent(context, account, false); } else { // Files app is too old to be able to switch the account when launching the TrashbinActivity @@ -95,7 +94,7 @@ public class MenuAdapter extends RecyclerView.Adapter { private static Intent generateTrashbinAppIntent(@NonNull Context context, @NonNull Account account, boolean prod) throws PackageManager.NameNotFoundException { final var packageManager = context.getPackageManager(); - final String packageName = prod ? Constants.PACKAGE_NAME_PROD : Constants.PACKAGE_NAME_DEV; + final String packageName = prod ? FilesAppType.PROD.packageId : FilesAppType.DEV.packageId; final var intent = new Intent(); intent.setClassName(packageName, "com.owncloud.android.ui.trashbin.TrashbinActivity"); if (packageManager.resolveActivity(intent, 0) != null) { diff --git a/build.gradle b/build.gradle index 5d898a6b..fcc04a01 100644 --- a/build.gradle +++ b/build.gradle @@ -3,6 +3,7 @@ buildscript { ext { kotlinVersion = '1.8.20' + commonsVersion = '1.7.0' } repositories { mavenCentral()