Apply only for api level 35

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2024-11-29 12:31:32 +01:00 committed by Tobias Kaminsky
parent 9487e8b3c8
commit b9be105730
2 changed files with 19 additions and 5 deletions

View file

@ -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);

View file

@ -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() {