mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-17 08:35:37 -04:00
VUI fixes & improvements pt.3.5
Fixed the controls layout being offset on first start Fixed the controls layout crashing when loading new control layout
This commit is contained in:
parent
8419cee745
commit
ca0e9e2c0d
@ -500,7 +500,7 @@ public final class Tools {
|
||||
|
||||
public static void setFullscreen(Activity activity, boolean fullscreen) {
|
||||
final View decorView = activity.getWindow().getDecorView();
|
||||
decorView.setOnSystemUiVisibilityChangeListener (visibility -> {
|
||||
View.OnSystemUiVisibilityChangeListener visibilityChangeListener = visibility -> {
|
||||
if(fullscreen){
|
||||
if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
|
||||
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
@ -514,7 +514,9 @@ public final class Tools {
|
||||
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
decorView.setOnSystemUiVisibilityChangeListener(visibilityChangeListener);
|
||||
visibilityChangeListener.onSystemUiVisibilityChange(decorView.getSystemUiVisibility()); //call it once since the UI state may not change after the call, so the activity wont become fullscreen
|
||||
}
|
||||
|
||||
public static DisplayMetrics currentDisplayMetrics;
|
||||
|
@ -242,7 +242,7 @@ public class ControlLayout extends FrameLayout {
|
||||
@Override
|
||||
public void onViewRemoved(View child) {
|
||||
super.onViewRemoved(child);
|
||||
if(child instanceof ControlInterface){
|
||||
if(child instanceof ControlInterface && mControlPopup != null){
|
||||
mControlPopup.disappearColor();
|
||||
mControlPopup.disappear();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user