mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-18 00:59:35 -04:00
- Better implementation of Tools.ignoreNotch to work with all activities.
This commit is contained in:
parent
4ebf4cde5c
commit
12009282d4
@ -5,6 +5,8 @@ import android.os.*;
|
|||||||
import androidx.appcompat.app.*;
|
import androidx.appcompat.app.*;
|
||||||
import net.kdt.pojavlaunch.utils.*;
|
import net.kdt.pojavlaunch.utils.*;
|
||||||
|
|
||||||
|
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.PREF_IGNORE_NOTCH;
|
||||||
|
|
||||||
public class BaseActivity extends AppCompatActivity
|
public class BaseActivity extends AppCompatActivity
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
@ -24,4 +26,10 @@ public class BaseActivity extends AppCompatActivity
|
|||||||
super.startActivity(i);
|
super.startActivity(i);
|
||||||
new Throwable("StartActivity").printStackTrace();
|
new Throwable("StartActivity").printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPostResume() {
|
||||||
|
super.onPostResume();
|
||||||
|
Tools.ignoreNotch(PREF_IGNORE_NOTCH,this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ import java.io.*;
|
|||||||
import net.kdt.pojavlaunch.prefs.*;
|
import net.kdt.pojavlaunch.prefs.*;
|
||||||
import net.kdt.pojavlaunch.customcontrols.*;
|
import net.kdt.pojavlaunch.customcontrols.*;
|
||||||
|
|
||||||
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.PREF_IGNORE_NOTCH;
|
|
||||||
|
|
||||||
public class CustomControlsActivity extends BaseActivity
|
public class CustomControlsActivity extends BaseActivity
|
||||||
{
|
{
|
||||||
@ -35,8 +35,6 @@ public class CustomControlsActivity extends BaseActivity
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.control_mapping);
|
setContentView(R.layout.control_mapping);
|
||||||
|
|
||||||
Tools.ignoreNotch(PREF_IGNORE_NOTCH, this);
|
|
||||||
|
|
||||||
mPref = PreferenceManager.getDefaultSharedPreferences(this);
|
mPref = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@ import java.io.*;
|
|||||||
import com.google.gson.*;
|
import com.google.gson.*;
|
||||||
|
|
||||||
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.DEFAULT_PREF;
|
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.DEFAULT_PREF;
|
||||||
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.PREF_IGNORE_NOTCH;
|
|
||||||
|
|
||||||
public class MainActivity extends BaseMainActivity {
|
public class MainActivity extends BaseMainActivity {
|
||||||
private ControlLayout mControlLayout;
|
private ControlLayout mControlLayout;
|
||||||
@ -24,7 +23,6 @@ public class MainActivity extends BaseMainActivity {
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
initLayout(R.layout.main_with_customctrl);
|
initLayout(R.layout.main_with_customctrl);
|
||||||
|
|
||||||
Tools.ignoreNotch(PREF_IGNORE_NOTCH, this);
|
|
||||||
|
|
||||||
mClickListener = new View.OnClickListener(){
|
mClickListener = new View.OnClickListener(){
|
||||||
@Override
|
@Override
|
||||||
|
@ -66,7 +66,6 @@ import net.kdt.pojavlaunch.prefs.LauncherPreferences;
|
|||||||
import net.kdt.pojavlaunch.utils.JREUtils;
|
import net.kdt.pojavlaunch.utils.JREUtils;
|
||||||
import net.kdt.pojavlaunch.utils.LocaleUtils;
|
import net.kdt.pojavlaunch.utils.LocaleUtils;
|
||||||
import net.kdt.pojavlaunch.value.MinecraftAccount;
|
import net.kdt.pojavlaunch.value.MinecraftAccount;
|
||||||
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.PREF_IGNORE_NOTCH;
|
|
||||||
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
|
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
|
||||||
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
|
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
|
||||||
import org.apache.commons.compress.compressors.xz.XZCompressorInputStream;
|
import org.apache.commons.compress.compressors.xz.XZCompressorInputStream;
|
||||||
@ -99,8 +98,7 @@ public class PojavLoginActivity extends BaseActivity
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState){
|
protected void onCreate(Bundle savedInstanceState){
|
||||||
super.onCreate(savedInstanceState); // false);
|
super.onCreate(savedInstanceState); // false);
|
||||||
|
|
||||||
Tools.ignoreNotch(PREF_IGNORE_NOTCH, this);
|
|
||||||
Tools.updateWindowSize(this);
|
Tools.updateWindowSize(this);
|
||||||
/*
|
/*
|
||||||
ControlData.pixelOf2dp = (int) Tools.dpToPx(2);
|
ControlData.pixelOf2dp = (int) Tools.dpToPx(2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user