diff --git a/app/src/main/java/com/owncloud/android/ui/activity/BaseActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/BaseActivity.java index 8b11e60b4d..af85b9ebeb 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/BaseActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/BaseActivity.java @@ -10,6 +10,7 @@ package com.owncloud.android.ui.activity; import android.accounts.Account; import android.content.Intent; import android.graphics.Color; +import android.os.Build; import android.os.Bundle; import com.nextcloud.client.account.User; @@ -68,8 +69,13 @@ public abstract class BaseActivity extends AppCompatActivity implements Injectab @Override protected void onCreate(@Nullable Bundle savedInstanceState) { - enableEdgeToEdge(); - WindowExtensionsKt.addSystemBarPaddings(getWindow()); + boolean isApiLevel35OrHigher = (Build.VERSION.SDK_INT >= 35); + + if (isApiLevel35OrHigher) { + enableEdgeToEdge(); + WindowExtensionsKt.addSystemBarPaddings(getWindow()); + } + super.onCreate(savedInstanceState); sessionMixin = new SessionMixin(this, accountManager); mixinRegistry.add(sessionMixin); 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 dd9427b436..bde331c722 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 @@ -23,6 +23,7 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Configuration; import android.graphics.drawable.Drawable; import android.net.Uri; +import android.os.Build; import android.os.Bundle; import android.preference.ListPreference; import android.preference.Preference; @@ -146,8 +147,12 @@ public class SettingsActivity extends PreferenceActivity @SuppressWarnings("deprecation") @Override public void onCreate(Bundle savedInstanceState) { - WindowExtensionsKt.addSystemBarPaddings(getWindow()); - WindowExtensionsKt.setNoLimitLayout(getWindow()); + boolean isApiLevel35OrHigher = (Build.VERSION.SDK_INT >= 35); + if (isApiLevel35OrHigher) { + WindowExtensionsKt.addSystemBarPaddings(getWindow()); + WindowExtensionsKt.setNoLimitLayout(getWindow()); + } + super.onCreate(savedInstanceState); getDelegate().installViewFactory(); @@ -191,7 +196,10 @@ public class SettingsActivity extends PreferenceActivity // workaround for mismatched color when app dark mode and system dark mode don't agree setListBackground(); showPasscodeDialogIfEnforceAppProtection(); - adjustTopMarginForActionBar(); + + if (isApiLevel35OrHigher) { + adjustTopMarginForActionBar(); + } } private void adjustTopMarginForActionBar() {