Browse Source

Revert isBrandedClient checks

Signed-off-by: alperozturk <alper_ozturk@proton.me>
alperozturk 1 year ago
parent
commit
b7defed16f

+ 0 - 4
app/src/main/java/com/owncloud/android/MainApp.java

@@ -380,10 +380,6 @@ public class MainApp extends MultiDexApplication implements HasAndroidInjector {
         }
     });
 
-    public static boolean isClientBranded() {
-        return getAppContext().getResources().getBoolean(R.bool.is_branded_client);
-    }
-
     public static boolean isClientBrandedPlus() {
         return (getAppContext().getResources().getBoolean(R.bool.is_branded_plus_client));
     }

+ 1 - 1
app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java

@@ -594,7 +594,7 @@ public class SettingsActivity extends PreferenceActivity
         boolean fPassCodeEnabled = getResources().getBoolean(R.bool.passcode_enabled);
         boolean fDeviceCredentialsEnabled = getResources().getBoolean(R.bool.device_credentials_enabled);
         boolean fShowHiddenFilesEnabled = getResources().getBoolean(R.bool.show_hidden_files_enabled);
-        boolean fShowEcosystemAppsEnabled = !MainApp.isClientBrandedPlus() || !MainApp.isClientBranded();
+        boolean fShowEcosystemAppsEnabled = !getResources().getBoolean(R.bool.is_branded_client);
         boolean fSyncedFolderLightEnabled = getResources().getBoolean(R.bool.syncedFolder_light);
         boolean fShowMediaScanNotifications = preferences.isShowMediaScanNotifications();
 

+ 1 - 2
app/src/main/java/com/owncloud/android/ui/preview/PreviewMediaActivity.kt

@@ -60,7 +60,6 @@ import com.nextcloud.common.NextcloudClient
 import com.nextcloud.ui.fileactions.FileActionsBottomSheet.Companion.newInstance
 import com.nextcloud.ui.fileactions.FileActionsBottomSheet.ResultListener
 import com.nextcloud.utils.extensions.getParcelableArgument
-import com.owncloud.android.MainApp
 import com.owncloud.android.R
 import com.owncloud.android.databinding.ActivityPreviewMediaBinding
 import com.owncloud.android.datamodel.OCFile
@@ -273,7 +272,7 @@ class PreviewMediaActivity :
     private fun genericThumbnail(): Drawable? {
         val result = AppCompatResources.getDrawable(this, R.drawable.logo)
         result?.let {
-            if (!MainApp.isClientBranded() || !MainApp.isClientBrandedPlus()) {
+            if (!resources.getBoolean(R.bool.is_branded_client)) {
                 DrawableCompat.setTint(it, resources.getColor(R.color.primary, this.theme))
             }
         }

+ 1 - 1
app/src/main/java/com/owncloud/android/ui/preview/PreviewMediaFragment.java

@@ -294,7 +294,7 @@ public class PreviewMediaFragment extends FileFragment implements OnTouchListene
     private void setGenericThumbnail() {
         Drawable logo = AppCompatResources.getDrawable(requireContext(), R.drawable.logo);
         if (logo != null) {
-            if (!MainApp.isClientBranded() || !MainApp.isClientBrandedPlus()) {
+            if (!getResources().getBoolean(R.bool.is_branded_client)) {
                 // only colour logo of non-branded client
                 DrawableCompat.setTint(logo, getResources().getColor(R.color.primary, requireContext().getTheme()));
             }

+ 2 - 2
app/src/main/java/com/owncloud/android/utils/DrawerMenuUtil.java

@@ -49,8 +49,8 @@ public final class DrawerMenuUtil {
         }
     }
 
-    public static void filterAssistantMenuItem(Menu menu, @Nullable OCCapability capability) {
-        if (MainApp.isClientBranded() || MainApp.isClientBrandedPlus()) {
+    public static void filterAssistantMenuItem(Menu menu, @Nullable OCCapability capability, Resources resources) {
+        if (resources.getBoolean(R.bool.is_branded_client)) {
             if (capability != null && capability.getAssistant().isFalse()) {
                 removeMenuItem(menu, R.id.nav_assistant);
             }