Merge pull request #1771 from nextcloud/bumpCommons

Streamline commons version
This commit is contained in:
Andy Scherzinger 2023-04-17 16:05:32 +02:00 committed by GitHub
commit a7f921b1bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View file

@ -77,11 +77,11 @@ dependencies {
// Nextcloud SSO // Nextcloud SSO
implementation 'com.github.nextcloud.android-common:ui:0.8.0' 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:android-commons:0.2.9'
implementation 'com.github.stefan-niedermann.nextcloud-commons:sso-glide:1.6.4' implementation "com.github.stefan-niedermann.nextcloud-commons:sso-glide:$commonsVersion"
implementation 'com.github.stefan-niedermann.nextcloud-commons:exception:1.6.4' implementation "com.github.stefan-niedermann.nextcloud-commons:exception:$commonsVersion"
implementation('com.github.stefan-niedermann.nextcloud-commons:markdown:1.6.4') { implementation("com.github.stefan-niedermann.nextcloud-commons:markdown:$commonsVersion") {
exclude group: 'org.jetbrains', module: 'annotations-java5' exclude group: 'org.jetbrains', module: 'annotations-java5'
} }

View file

@ -12,13 +12,12 @@ import androidx.annotation.NonNull;
import androidx.core.util.Consumer; import androidx.core.util.Consumer;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.nextcloud.android.sso.Constants;
import com.nextcloud.android.sso.helper.VersionCheckHelper; 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.FormattingHelpActivity;
import it.niedermann.owncloud.notes.R; import it.niedermann.owncloud.notes.R;
import it.niedermann.owncloud.notes.about.AboutActivity; 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.databinding.ItemNavigationBinding;
import it.niedermann.owncloud.notes.persistence.entity.Account; import it.niedermann.owncloud.notes.persistence.entity.Account;
import it.niedermann.owncloud.notes.preferences.PreferencesActivity; import it.niedermann.owncloud.notes.preferences.PreferencesActivity;
@ -79,9 +78,9 @@ public class MenuAdapter extends RecyclerView.Adapter<MenuViewHolder> {
// https://github.com/nextcloud/android/pull/8405#issuecomment-852966877 // https://github.com/nextcloud/android/pull/8405#issuecomment-852966877
final int minVersionCode = 30170090; final int minVersionCode = 30170090;
try { try {
if (VersionCheckHelper.getNextcloudFilesVersionCode(context, true) > minVersionCode) { if (VersionCheckHelper.getNextcloudFilesVersionCode(context, FilesAppType.PROD) > minVersionCode) {
return generateTrashbinAppIntent(context, account, true); 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); return generateTrashbinAppIntent(context, account, false);
} else { } else {
// Files app is too old to be able to switch the account when launching the TrashbinActivity // 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<MenuViewHolder> {
private static Intent generateTrashbinAppIntent(@NonNull Context context, @NonNull Account account, boolean prod) throws PackageManager.NameNotFoundException { private static Intent generateTrashbinAppIntent(@NonNull Context context, @NonNull Account account, boolean prod) throws PackageManager.NameNotFoundException {
final var packageManager = context.getPackageManager(); 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(); final var intent = new Intent();
intent.setClassName(packageName, "com.owncloud.android.ui.trashbin.TrashbinActivity"); intent.setClassName(packageName, "com.owncloud.android.ui.trashbin.TrashbinActivity");
if (packageManager.resolveActivity(intent, 0) != null) { if (packageManager.resolveActivity(intent, 0) != null) {

View file

@ -3,6 +3,7 @@
buildscript { buildscript {
ext { ext {
kotlinVersion = '1.8.20' kotlinVersion = '1.8.20'
commonsVersion = '1.7.0'
} }
repositories { repositories {
mavenCentral() mavenCentral()