From b86d7572c8f886f46f90e4b5727c46fa15c7e4c9 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 12 Oct 2019 18:10:54 -0400 Subject: [PATCH] v0.7.5b: renamed AndroidLauncher to AndroidGame --- android/src/main/AndroidManifest.xml | 2 +- ...{AndroidLauncher.java => AndroidGame.java} | 2 +- .../android/AndroidPlatformSupport.java | 28 +++++++++---------- .../android/windows/WndAndroidTextInput.java | 4 +-- 4 files changed, 18 insertions(+), 18 deletions(-) rename android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/{AndroidLauncher.java => AndroidGame.java} (98%) diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index d4912f29e..298475f14 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -25,7 +25,7 @@ android:backupAgent=".AndroidBackupHandler"> diff --git a/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidLauncher.java b/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidGame.java similarity index 98% rename from android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidLauncher.java rename to android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidGame.java index 7052261fc..eef871d64 100644 --- a/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidLauncher.java +++ b/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidGame.java @@ -37,7 +37,7 @@ import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.watabou.noosa.Game; import com.watabou.noosa.audio.Music; -public class AndroidLauncher extends AndroidApplication { +public class AndroidGame extends AndroidApplication { public static AndroidApplication instance; protected static GLSurfaceView view; diff --git a/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidPlatformSupport.java b/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidPlatformSupport.java index f8555183e..47ced511c 100644 --- a/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidPlatformSupport.java +++ b/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidPlatformSupport.java @@ -47,15 +47,15 @@ public class AndroidPlatformSupport extends PlatformSupport { public void updateDisplaySize(){ boolean landscape = SPDSettings.landscape(); - AndroidLauncher.instance.setRequestedOrientation(landscape ? + AndroidGame.instance.setRequestedOrientation(landscape ? ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); - if (AndroidLauncher.view.getMeasuredWidth() == 0 || AndroidLauncher.view.getMeasuredHeight() == 0) + if (AndroidGame.view.getMeasuredWidth() == 0 || AndroidGame.view.getMeasuredHeight() == 0) return; - Game.dispWidth = AndroidLauncher.view.getMeasuredWidth(); - Game.dispHeight = AndroidLauncher.view.getMeasuredHeight(); + Game.dispWidth = AndroidGame.view.getMeasuredWidth(); + Game.dispHeight = AndroidGame.view.getMeasuredHeight(); if ((Game.dispWidth > Game.dispHeight) != landscape){ int tmp = Game.dispWidth; @@ -89,19 +89,19 @@ public class AndroidPlatformSupport extends PlatformSupport { final int finalH = Math.round(renderHeight); if (finalW != Game.width || finalH != Game.height){ - AndroidLauncher.instance.runOnUiThread(new Runnable() { + AndroidGame.instance.runOnUiThread(new Runnable() { @Override public void run() { - AndroidLauncher.view.getHolder().setFixedSize(finalW, finalH); + AndroidGame.view.getHolder().setFixedSize(finalW, finalH); } }); } } else { - AndroidLauncher.instance.runOnUiThread(new Runnable() { + AndroidGame.instance.runOnUiThread(new Runnable() { @Override public void run() { - AndroidLauncher.view.getHolder().setSizeFromLayout(); + AndroidGame.view.getHolder().setSizeFromLayout(); } }); } @@ -109,29 +109,29 @@ public class AndroidPlatformSupport extends PlatformSupport { public void updateSystemUI() { - AndroidLauncher.instance.runOnUiThread(new Runnable() { + AndroidGame.instance.runOnUiThread(new Runnable() { @SuppressLint("NewApi") @Override public void run() { boolean fullscreen = Build.VERSION.SDK_INT < Build.VERSION_CODES.N - || !AndroidLauncher.instance.isInMultiWindowMode(); + || !AndroidGame.instance.isInMultiWindowMode(); if (fullscreen){ - AndroidLauncher.instance.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, + AndroidGame.instance.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); } else { - AndroidLauncher.instance.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, + AndroidGame.instance.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){ if (SPDSettings.fullscreen()) { - AndroidLauncher.instance.getWindow().getDecorView().setSystemUiVisibility( + AndroidGame.instance.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 ); } else { - AndroidLauncher.instance.getWindow().getDecorView().setSystemUiVisibility( + AndroidGame.instance.getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE ); } } diff --git a/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/windows/WndAndroidTextInput.java b/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/windows/WndAndroidTextInput.java index 74059e77b..72423ca96 100644 --- a/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/windows/WndAndroidTextInput.java +++ b/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/windows/WndAndroidTextInput.java @@ -40,7 +40,7 @@ import com.badlogic.gdx.backends.android.AndroidApplication; import com.badlogic.gdx.backends.android.AndroidGraphics; import com.shatteredpixel.shatteredpixeldungeon.SPDSettings; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; -import com.shatteredpixel.shatteredpixeldungeon.android.AndroidLauncher; +import com.shatteredpixel.shatteredpixeldungeon.android.AndroidGame; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock; @@ -98,7 +98,7 @@ public class WndAndroidTextInput extends Window { textInput = new EditText((AndroidApplication)Gdx.app); textInput.setText( initialValue ); if (!SPDSettings.systemFont()){ - textInput.setTypeface( Typeface.createFromAsset(AndroidLauncher.instance.getAssets(), "pixel_font.ttf") ); + textInput.setTypeface( Typeface.createFromAsset(AndroidGame.instance.getAssets(), "pixel_font.ttf") ); } textInput.setFilters(new InputFilter[]{new InputFilter.LengthFilter(maxLength)}); textInput.setInputType( InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES );