The notch option is now gone for users with no notch.

This commit is contained in:
SerpentSpirale 2021-06-28 14:32:19 +02:00
parent 9593adba31
commit f666e190be
2 changed files with 5 additions and 3 deletions

View File

@ -311,8 +311,8 @@ public class PojavLauncherActivity extends BaseLauncherActivity
@Override @Override
public void onAttachedToWindow() { public void onAttachedToWindow() {
super.onAttachedToWindow(); super.onAttachedToWindow();
//Try to get the notch so it can be taken into account in settings
if (Build.VERSION.SDK_INT >= P){ if (Build.VERSION.SDK_INT >= P){
//Get the fucking notch height:
try { try {
PREF_NOTCH_SIZE = getWindow().getDecorView().getRootWindowInsets().getDisplayCutout().getBoundingRects().get(0).width(); PREF_NOTCH_SIZE = getWindow().getDecorView().getRootWindowInsets().getDisplayCutout().getBoundingRects().get(0).width();
}catch (Exception e){ }catch (Exception e){

View File

@ -9,6 +9,8 @@ import net.kdt.pojavlaunch.Tools;
import android.content.*; import android.content.*;
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.PREF_NOTCH_SIZE;
public class LauncherPreferenceFragment extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener public class LauncherPreferenceFragment extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener
{ {
@Override @Override
@ -16,9 +18,9 @@ public class LauncherPreferenceFragment extends PreferenceFragmentCompat impleme
addPreferencesFromResource(R.xml.pref_main); addPreferencesFromResource(R.xml.pref_main);
// Disable freeform mode in Android 6.0 and below. // Disable freeform mode in Android 6.0 and below.
findPreference("freeform").setVisible(Build.VERSION.SDK_INT >= 24); findPreference("freeform").setVisible(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N);
//Disable notch checking behavior on android 8.1 and below. //Disable notch checking behavior on android 8.1 and below.
findPreference("ignoreNotch").setVisible(Build.VERSION.SDK_INT >= 28); findPreference("ignoreNotch").setVisible(Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && PREF_NOTCH_SIZE != 0);
CustomSeekBarPreference seek2 = (CustomSeekBarPreference) findPreference("timeLongPressTrigger"); CustomSeekBarPreference seek2 = (CustomSeekBarPreference) findPreference("timeLongPressTrigger");
seek2.setMin(100); seek2.setMin(100);