mirror of
https://github.com/love2d/love-android.git
synced 2026-08-20 12:40:28 +02:00
Using immersive mode by default
This commit is contained in:
@@ -29,6 +29,7 @@ import android.os.Vibrator;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
import android.view.*;
|
||||||
|
|
||||||
public class GameActivity extends SDLActivity {
|
public class GameActivity extends SDLActivity {
|
||||||
private static DisplayMetrics metrics = new DisplayMetrics();
|
private static DisplayMetrics metrics = new DisplayMetrics();
|
||||||
@@ -78,6 +79,20 @@ public class GameActivity extends SDLActivity {
|
|||||||
super.onPause();
|
super.onPause();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onWindowFocusChanged(boolean hasFocus) {
|
||||||
|
super.onWindowFocusChanged(hasFocus);
|
||||||
|
if (hasFocus) {
|
||||||
|
getWindow().getDecorView().setSystemUiVisibility(
|
||||||
|
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||||
|
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||||
|
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||||
|
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||||
|
| View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||||
|
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static String getGamePath() {
|
public static String getGamePath() {
|
||||||
Log.d ("GameActivity", "called getGamePath(), game path = " + gamePath);
|
Log.d ("GameActivity", "called getGamePath(), game path = " + gamePath);
|
||||||
return gamePath;
|
return gamePath;
|
||||||
|
|||||||
Reference in New Issue
Block a user