From 8bdfbb49ab0fd36dee5d28f89ab668c9a9f48d4e Mon Sep 17 00:00:00 2001 From: alperozturk Date: Tue, 5 Nov 2024 11:13:24 +0100 Subject: [PATCH] better variable naming Signed-off-by: alperozturk --- .../main/java/com/owncloud/android/MainApp.java | 4 ++-- .../owncloud/android/files/FileMenuFilter.java | 4 ++-- .../android/ui/activity/DrawerActivity.java | 16 ++++++++-------- .../android/ui/activity/SettingsActivity.java | 8 ++++---- .../android/ui/adapter/UserListAdapter.java | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/MainApp.java b/app/src/main/java/com/owncloud/android/MainApp.java index 067d710582..631e2fd4e8 100644 --- a/app/src/main/java/com/owncloud/android/MainApp.java +++ b/app/src/main/java/com/owncloud/android/MainApp.java @@ -339,8 +339,8 @@ public class MainApp extends Application implements HasAndroidInjector, NetworkC // initialise thumbnails cache on background thread new ThumbnailsCacheManager.InitDiskCacheTask().execute(); - boolean disableLog = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableLog, getResources().getBoolean(R.bool.disable_log)); - if ((BuildConfig.DEBUG || getApplicationContext().getResources().getBoolean(R.bool.logger_enabled)) && !disableLog) { + boolean disableLogViaMDM = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableLog, getResources().getBoolean(R.bool.disable_log)); + if ((BuildConfig.DEBUG || getApplicationContext().getResources().getBoolean(R.bool.logger_enabled)) && !disableLogViaMDM) { // use app writable dir, no permissions needed Log_OC.setLoggerImplementation(new LegacyLoggerAdapter(logger)); Log_OC.d("Debug", "start logging"); diff --git a/app/src/main/java/com/owncloud/android/files/FileMenuFilter.java b/app/src/main/java/com/owncloud/android/files/FileMenuFilter.java index 277c69568c..55b3d38038 100644 --- a/app/src/main/java/com/owncloud/android/files/FileMenuFilter.java +++ b/app/src/main/java/com/owncloud/android/files/FileMenuFilter.java @@ -186,8 +186,8 @@ public class FileMenuFilter { } private void filterSendFiles(List toHide, boolean inSingleFileFragment) { - boolean disableSharing = ContextExtensionsKt.getRestriction(context, AppConfigKeys.DisableSharing, context.getResources().getBoolean(R.bool.disable_sharing)); - if (!disableSharing || (overflowMenu || SEND_OFF.equalsIgnoreCase(context.getString(R.string.send_files_to_other_apps)) || containsEncryptedFile()) || + boolean disableSharingViaMDM = ContextExtensionsKt.getRestriction(context, AppConfigKeys.DisableSharing, context.getResources().getBoolean(R.bool.disable_sharing)); + if (!disableSharingViaMDM || (overflowMenu || SEND_OFF.equalsIgnoreCase(context.getString(R.string.send_files_to_other_apps)) || containsEncryptedFile()) || (!inSingleFileFragment && (isSingleSelection() || !allFileDown())) || !toHide.contains(R.id.action_send_share_file)) { toHide.add(R.id.action_send_file); diff --git a/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java index 8a09a8aa74..83e3db017f 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java @@ -604,11 +604,11 @@ public abstract class DrawerActivity extends ToolbarActivity } public void openAddAccount() { - boolean disableIntro = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableIntro, getResources().getBoolean(R.bool.disable_intro)); + boolean disableIntroViaMDM = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableIntro, getResources().getBoolean(R.bool.disable_intro)); boolean isProviderOrOwnInstallationVisible = getResources() .getBoolean(R.bool.show_provider_or_own_installation); - if (isProviderOrOwnInstallationVisible && !disableIntro) { + if (isProviderOrOwnInstallationVisible && !disableIntroViaMDM) { Intent firstRunIntent = new Intent(getApplicationContext(), FirstRunActivity.class); firstRunIntent.putExtra(FirstRunActivity.EXTRA_ALLOW_CLOSE, true); startActivity(firstRunIntent); @@ -827,8 +827,8 @@ public abstract class DrawerActivity extends ToolbarActivity private void updateQuotaLink() { if (mQuotaTextLink != null) { - boolean disableMoreExternalSite = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableMoreExternalSite, getResources().getBoolean(R.bool.disable_more_external_site)); - if (getBaseContext().getResources().getBoolean(R.bool.show_external_links) && !disableMoreExternalSite) { + boolean disableMoreExternalSiteViaMDM = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableMoreExternalSite, getResources().getBoolean(R.bool.disable_more_external_site)); + if (getBaseContext().getResources().getBoolean(R.bool.show_external_links) && !disableMoreExternalSiteViaMDM) { List quotas = externalLinksProvider.getExternalLink(ExternalLinkType.QUOTA); float density = getResources().getDisplayMetrics().density; @@ -977,8 +977,8 @@ public abstract class DrawerActivity extends ToolbarActivity } private void updateExternalLinksInDrawer() { - boolean disableMoreExternalSite = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableMoreExternalSite, getResources().getBoolean(R.bool.disable_more_external_site)); - if (mNavigationView != null && getBaseContext().getResources().getBoolean(R.bool.show_external_links) && !disableMoreExternalSite) { + boolean disableMoreExternalSiteViaMDM = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableMoreExternalSite, getResources().getBoolean(R.bool.disable_more_external_site)); + if (mNavigationView != null && getBaseContext().getResources().getBoolean(R.bool.show_external_links) && !disableMoreExternalSiteViaMDM) { mNavigationView.getMenu().removeGroup(R.id.drawer_menu_external_links); int greyColor = ContextCompat.getColor(this, R.color.drawer_menu_icon); @@ -1227,8 +1227,8 @@ public abstract class DrawerActivity extends ToolbarActivity * Retrieves external links via api from 'external' app */ public void fetchExternalLinks(final boolean force) { - boolean disableMoreExternalSite = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableMoreExternalSite, getResources().getBoolean(R.bool.disable_more_external_site)); - if (!getBaseContext().getResources().getBoolean(R.bool.show_external_links) || disableMoreExternalSite) { + boolean disableMoreExternalSiteViaMDM = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableMoreExternalSite, getResources().getBoolean(R.bool.disable_more_external_site)); + if (!getBaseContext().getResources().getBoolean(R.bool.show_external_links) || disableMoreExternalSiteViaMDM) { return; } diff --git a/app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java index 9cbd09d501..bb48f97c16 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java @@ -381,11 +381,11 @@ public class SettingsActivity extends PreferenceActivity } private void setupLoggingPreference(PreferenceCategory preferenceCategoryMore) { - boolean disableLog = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableLog, getResources().getBoolean(R.bool.disable_log)); + boolean disableLogViaMDM = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableLog, getResources().getBoolean(R.bool.disable_log)); boolean loggerEnabled = getResources().getBoolean(R.bool.logger_enabled) || BuildConfig.DEBUG; Preference pLogger = findPreference("logger"); if (pLogger != null) { - if (loggerEnabled && !disableLog) { + if (loggerEnabled && !disableLogViaMDM) { pLogger.setOnPreferenceClickListener(preference -> { Intent loggerIntent = new Intent(getApplicationContext(), LogsActivity.class); startActivity(loggerIntent); @@ -1103,8 +1103,8 @@ public class SettingsActivity extends PreferenceActivity } private void loadExternalSettingLinks(PreferenceCategory preferenceCategory) { - boolean disableMoreExternalSite = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableMoreExternalSite, getResources().getBoolean(R.bool.disable_more_external_site)); - if (getBaseContext().getResources().getBoolean(R.bool.show_external_links) && !disableMoreExternalSite) { + boolean disableMoreExternalSiteViaMDM = ContextExtensionsKt.getRestriction(this, AppConfigKeys.DisableMoreExternalSite, getResources().getBoolean(R.bool.disable_more_external_site)); + if (getBaseContext().getResources().getBoolean(R.bool.show_external_links) && !disableMoreExternalSiteViaMDM) { ExternalLinksProvider externalLinksProvider = new ExternalLinksProvider(getContentResolver()); for (final ExternalLink link : externalLinksProvider.getExternalLink(ExternalLinkType.SETTINGS)) { diff --git a/app/src/main/java/com/owncloud/android/ui/adapter/UserListAdapter.java b/app/src/main/java/com/owncloud/android/ui/adapter/UserListAdapter.java index b39f28dcfc..5603afb6eb 100644 --- a/app/src/main/java/com/owncloud/android/ui/adapter/UserListAdapter.java +++ b/app/src/main/java/com/owncloud/android/ui/adapter/UserListAdapter.java @@ -320,11 +320,11 @@ public class UserListAdapter extends RecyclerView.Adapter accountListAdapterListener.showFirstRunActivity()); } else { itemView.setOnClickListener(v -> accountListAdapterListener.startAccountCreation());