use disableMoreExternalSite

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2024-11-05 10:39:37 +01:00 committed by Alper Öztürk
parent 904e556a97
commit bae0ab70f6
2 changed files with 10 additions and 4 deletions

View file

@ -827,7 +827,8 @@ public abstract class DrawerActivity extends ToolbarActivity
private void updateQuotaLink() {
if (mQuotaTextLink != null) {
if (getBaseContext().getResources().getBoolean(R.bool.show_external_links)) {
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) {
List<ExternalLink> quotas = externalLinksProvider.getExternalLink(ExternalLinkType.QUOTA);
float density = getResources().getDisplayMetrics().density;
@ -976,7 +977,8 @@ public abstract class DrawerActivity extends ToolbarActivity
}
private void updateExternalLinksInDrawer() {
if (mNavigationView != null && getBaseContext().getResources().getBoolean(R.bool.show_external_links)) {
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) {
mNavigationView.getMenu().removeGroup(R.id.drawer_menu_external_links);
int greyColor = ContextCompat.getColor(this, R.color.drawer_menu_icon);
@ -1225,7 +1227,8 @@ public abstract class DrawerActivity extends ToolbarActivity
* Retrieves external links via api from 'external' app
*/
public void fetchExternalLinks(final boolean force) {
if (!getBaseContext().getResources().getBoolean(R.bool.show_external_links)) {
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) {
return;
}

View file

@ -50,6 +50,7 @@ import com.nextcloud.client.network.ConnectivityService;
import com.nextcloud.client.preferences.AppPreferences;
import com.nextcloud.client.preferences.AppPreferencesImpl;
import com.nextcloud.client.preferences.DarkMode;
import com.nextcloud.utils.extensions.ContextExtensionsKt;
import com.owncloud.android.BuildConfig;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
@ -72,6 +73,7 @@ import com.owncloud.android.utils.DeviceCredentialUtils;
import com.owncloud.android.utils.DisplayUtils;
import com.owncloud.android.utils.EncryptionUtils;
import com.owncloud.android.utils.MimeTypeUtil;
import com.owncloud.android.utils.appConfig.AppConfigKeys;
import com.owncloud.android.utils.theme.CapabilityUtils;
import com.owncloud.android.utils.theme.ViewThemeUtils;
@ -1101,7 +1103,8 @@ public class SettingsActivity extends PreferenceActivity
}
private void loadExternalSettingLinks(PreferenceCategory preferenceCategory) {
if (getBaseContext().getResources().getBoolean(R.bool.show_external_links)) {
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) {
ExternalLinksProvider externalLinksProvider = new ExternalLinksProvider(getContentResolver());
for (final ExternalLink link : externalLinksProvider.getExternalLink(ExternalLinkType.SETTINGS)) {