mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2026-04-18 16:46:58 -04:00
fully working full screen
This commit is contained in:
@@ -67,13 +67,29 @@ public class MCLauncherActivity extends AppCompatActivity
|
||||
protected void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
gson = new Gson();
|
||||
|
||||
DisplayMetrics dm = Tools.getDisplayMetrics(this);
|
||||
AndroidDisplay.windowWidth = dm.widthPixels;
|
||||
AndroidDisplay.windowHeight = dm.heightPixels;
|
||||
viewInit();
|
||||
|
||||
final View decorView = getWindow().getDecorView();
|
||||
decorView.setOnSystemUiVisibilityChangeListener (new View.OnSystemUiVisibilityChangeListener() {
|
||||
@Override
|
||||
public void onSystemUiVisibilityChange(int visibility) {
|
||||
if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
|
||||
decorView.setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
// DEBUG
|
||||
//new android.support.design.widget.NavigationView(this);
|
||||
@@ -400,9 +416,11 @@ public class MCLauncherActivity extends AppCompatActivity
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume()
|
||||
{
|
||||
protected void onResume(){
|
||||
super.onResume();
|
||||
final int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
|
||||
final View decorView = getWindow().getDecorView();
|
||||
decorView.setSystemUiVisibility(uiOptions);
|
||||
}
|
||||
|
||||
private boolean canBack = false;
|
||||
|
||||
@@ -121,8 +121,7 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
||||
private boolean lastGrab = false;
|
||||
private boolean isExited = false;
|
||||
private boolean isLogAllow = false;
|
||||
private int navBarHeight;
|
||||
private Object screenWidth;
|
||||
private int navBarHeight = 40;
|
||||
|
||||
// private static Collection<? extends Provider.Service> rsaPkcs1List;
|
||||
|
||||
@@ -662,7 +661,7 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
||||
egl10.eglMakeCurrent(AndroidContextImplementation.display, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT);
|
||||
System.out.println(new StringBuffer().append("Gave up context: ").append(AndroidContextImplementation.context).toString());
|
||||
|
||||
AndroidDisplay.windowWidth =+ navBarHeight;
|
||||
AndroidDisplay.windowWidth += navBarHeight;
|
||||
|
||||
new Thread(new Runnable(){
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
|
||||
<item name="android:windowTranslucentNavigation">true</item>
|
||||
</style>
|
||||
|
||||
<style name="RunTheme" parent="@style/Theme.AppCompat.NoActionBar">
|
||||
@@ -14,6 +15,7 @@
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
<item name="android:windowTranslucentNavigation">true</item>
|
||||
</style>
|
||||
|
||||
<style name="AlertTheme" parent="@android:style/Theme.Material">
|
||||
@@ -28,14 +30,17 @@
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowAnimationStyle">@style/MenuDialogAnimation</item>
|
||||
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
|
||||
<item name="android:windowTranslucentNavigation">true</item>
|
||||
</style>
|
||||
|
||||
<style name="MenuDialogAnimation">
|
||||
<item name="android:windowEnterAnimation">@anim/translate_left_side</item>
|
||||
<item name="android:windowExitAnimation">@anim/translate_right_side</item>
|
||||
<item name="android:windowTranslucentNavigation">true</item>
|
||||
</style>
|
||||
|
||||
<style name="SpinnerChangeLanguage">
|
||||
<item name="android:windowTranslucentNavigation">true</item>
|
||||
<item name="android:background">@drawable/spinner_change_language</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user