mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-18 12:30:11 -07:00
Merge + Put duplicate codes to global method
This commit is contained in:
commit
7892198c9d
7 changed files with 37 additions and 61 deletions
|
|
@ -18,6 +18,7 @@ import net.kdt.pojavlaunch.prefs.*;
|
|||
import net.kdt.pojavlaunch.util.*;
|
||||
import net.kdt.pojavlaunch.value.*;
|
||||
import org.lwjgl.glfw.*;
|
||||
import android.view.*;
|
||||
|
||||
public final class Tools
|
||||
{
|
||||
|
|
@ -411,6 +412,23 @@ public final class Tools
|
|||
return displayMetrics;
|
||||
}
|
||||
|
||||
public static void setFullscreen(Activity act) {
|
||||
final View decorView = act.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);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void updateWindowSize(Activity ctx) {
|
||||
DisplayMetrics dm = getDisplayMetrics(ctx);
|
||||
CallbackBridge.windowWidth = dm.widthPixels;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue