diff --git a/builds/android/app/build.gradle b/builds/android/app/build.gradle index b00b9396a4..2a1c485766 100644 --- a/builds/android/app/build.gradle +++ b/builds/android/app/build.gradle @@ -5,9 +5,9 @@ android { assetPacks = [":assets"] defaultConfig { applicationId "org.easyrpg.player" - compileSdk 34 + compileSdk 35 minSdkVersion 21 - targetSdkVersion 34 + targetSdkVersion 35 versionName VERSION_NAME versionCode Integer.parseInt(VERSION_CODE) } @@ -53,12 +53,14 @@ android { "-DBUILD_SHARED_LIBS=ON", "-DPLAYER_ENABLE_TESTS=OFF" - if (project.hasProperty("toolchainDirs")) { - arguments.add('-DPLAYER_ANDROID_TOOLCHAIN_PATH=' + project.properties['toolchainDirs']) + if (project.hasProperty("toolchainDirs") && project.toolchainDirs) { + arguments.add('-DPLAYER_ANDROID_TOOLCHAIN_PATH=' + project.toolchainDirs) + } else if (System.getenv('EASYRPG_BUILDSCRIPTS')) { + arguments.add('-DPLAYER_ANDROID_TOOLCHAIN_PATH=' + System.getenv('EASYRPG_BUILDSCRIPTS') + '/android') } if (project.hasProperty("cmakeOptions")) { - arguments.addAll(project.properties['cmakeOptions'].split(" ")) + arguments.addAll(project.cmakeOptions.split(" ")) } } } diff --git a/builds/android/app/src/main/AndroidManifest.xml b/builds/android/app/src/main/AndroidManifest.xml index 6b69aa1ae9..3be2ba9ac3 100644 --- a/builds/android/app/src/main/AndroidManifest.xml +++ b/builds/android/app/src/main/AndroidManifest.xml @@ -106,6 +106,17 @@ + + + + + diff --git a/builds/android/app/src/main/java/org/easyrpg/player/BaseActivity.java b/builds/android/app/src/main/java/org/easyrpg/player/BaseActivity.java new file mode 100644 index 0000000000..5526cfb17a --- /dev/null +++ b/builds/android/app/src/main/java/org/easyrpg/player/BaseActivity.java @@ -0,0 +1,23 @@ +package org.easyrpg.player; + +import android.os.Bundle; +import androidx.appcompat.app.AppCompatActivity; +import org.easyrpg.player.settings.SettingsManager; + +public class BaseActivity extends AppCompatActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + // Retrieve User's preferences + SettingsManager.init(getApplicationContext()); + } + + @Override + protected void onResume() { + super.onResume(); + + // Retrieve User's preferences + SettingsManager.init(getApplicationContext()); + } +} diff --git a/builds/android/app/src/main/java/org/easyrpg/player/Helper.java b/builds/android/app/src/main/java/org/easyrpg/player/Helper.java index b01272a5c0..dfe119198e 100644 --- a/builds/android/app/src/main/java/org/easyrpg/player/Helper.java +++ b/builds/android/app/src/main/java/org/easyrpg/player/Helper.java @@ -288,6 +288,10 @@ public static DocumentFile findFile(Context context, Uri folderUri, String fileN } public static DocumentFile getFileFromURI (Context context, Uri fileURI) { + if (fileURI == null) { + return null; + } + try { return DocumentFile.fromTreeUri(context, fileURI); } catch (Exception e) { diff --git a/builds/android/app/src/main/java/org/easyrpg/player/InitActivity.java b/builds/android/app/src/main/java/org/easyrpg/player/InitActivity.java index b3aab24ca5..7f939f5504 100644 --- a/builds/android/app/src/main/java/org/easyrpg/player/InitActivity.java +++ b/builds/android/app/src/main/java/org/easyrpg/player/InitActivity.java @@ -26,7 +26,7 @@ * To start the standalone mode : put your project in assets/games * ("game" is the project directory, no sub folder) */ -public class InitActivity extends AppCompatActivity { +public class InitActivity extends BaseActivity { private boolean standaloneMode = false; private GameBrowserHelper.SafError safError = GameBrowserHelper.SafError.OK; @@ -37,9 +37,6 @@ protected void onCreate(Bundle savedInstanceState) { safError = GameBrowserHelper.SafError.OK; - // Retrieve User's preferences - SettingsManager.init(getApplicationContext()); - Activity thisActivity = this; (findViewById(R.id.set_games_folder)).setOnClickListener(v -> GameBrowserHelper.pickAGamesFolder(thisActivity)); diff --git a/builds/android/app/src/main/java/org/easyrpg/player/button_mapping/ButtonMappingActivity.java b/builds/android/app/src/main/java/org/easyrpg/player/button_mapping/ButtonMappingActivity.java index f99b7c9e36..3de78d11e5 100644 --- a/builds/android/app/src/main/java/org/easyrpg/player/button_mapping/ButtonMappingActivity.java +++ b/builds/android/app/src/main/java/org/easyrpg/player/button_mapping/ButtonMappingActivity.java @@ -43,6 +43,8 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.button_mapping_activity); + SettingsManager.init(getApplicationContext()); + // Menu configuration this.drawer = findViewById(R.id.drawer_layout); drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED); @@ -81,6 +83,14 @@ protected void onCreate(Bundle savedInstanceState) { } } + @Override + protected void onResume() { + super.onResume(); + + // Retrieve User's preferences + SettingsManager.init(getApplicationContext()); + } + @Override public boolean dispatchTouchEvent(MotionEvent ev) { pointerCount = ev.getPointerCount(); diff --git a/builds/android/app/src/main/java/org/easyrpg/player/button_mapping/VirtualButton.java b/builds/android/app/src/main/java/org/easyrpg/player/button_mapping/VirtualButton.java index b2a2d40007..b081412b30 100644 --- a/builds/android/app/src/main/java/org/easyrpg/player/button_mapping/VirtualButton.java +++ b/builds/android/app/src/main/java/org/easyrpg/player/button_mapping/VirtualButton.java @@ -205,16 +205,16 @@ public char getAppropriateChar(int keyCode) { char charButton; if (keyCode == ENTER) { - if (SettingsManager.getShowZXasAB()) { - charButton = 'A'; - } else { + if (SettingsManager.getShowABasZX()) { charButton = 'Z'; + } else { + charButton = 'A'; } } else if (keyCode == CANCEL) { - if (SettingsManager.getShowZXasAB()) { - charButton = 'B'; - } else { + if (SettingsManager.getShowABasZX()) { charButton = 'X'; + } else { + charButton = 'B'; } } else if (keyCode == SHIFT) { charButton = 'S'; diff --git a/builds/android/app/src/main/java/org/easyrpg/player/game_browser/GameBrowserActivity.java b/builds/android/app/src/main/java/org/easyrpg/player/game_browser/GameBrowserActivity.java index b4068bf4b4..41f6c09109 100644 --- a/builds/android/app/src/main/java/org/easyrpg/player/game_browser/GameBrowserActivity.java +++ b/builds/android/app/src/main/java/org/easyrpg/player/game_browser/GameBrowserActivity.java @@ -35,6 +35,7 @@ import com.google.android.material.navigation.NavigationView; +import org.easyrpg.player.BaseActivity; import org.easyrpg.player.R; import org.easyrpg.player.settings.SettingsManager; import org.libsdl.app.SDL; @@ -42,7 +43,7 @@ import java.util.Collections; import java.util.List; -public class GameBrowserActivity extends AppCompatActivity +public class GameBrowserActivity extends BaseActivity implements NavigationView.OnNavigationItemSelectedListener { public static Boolean libraryLoaded = false; @@ -178,7 +179,10 @@ public void openView() { .setPositiveButton(R.string.ok, (dialog, id) -> { int selectedPosition = ((AlertDialog) dialog).getListView().getCheckedItemPosition(); SettingsManager.setGameBrowserLabelMode(selectedPosition); - displayGamesList(); + if (displayedGamesList != null) { + // handle error case (no games displayed) + displayGamesList(); + } }) .setNegativeButton(R.string.cancel, null); builder.show(); diff --git a/builds/android/app/src/main/java/org/easyrpg/player/game_browser/GameBrowserHelper.java b/builds/android/app/src/main/java/org/easyrpg/player/game_browser/GameBrowserHelper.java index dcb6d32460..131dfd1212 100644 --- a/builds/android/app/src/main/java/org/easyrpg/player/game_browser/GameBrowserHelper.java +++ b/builds/android/app/src/main/java/org/easyrpg/player/game_browser/GameBrowserHelper.java @@ -58,13 +58,19 @@ public static void launchGame(Context context, Game game, boolean debugMode) { String savePath = path; if (!game.getSavePath().isEmpty()) { - DocumentFile saveFolder = Helper.createFolderInSave(context, game.getSavePath()); - - // In error case the native code will try to put a save folder next to the zip - if (saveFolder != null) { - savePath = saveFolder.getUri().toString(); + if (game.isStandalone()) { + savePath = game.getSavePath(); args.add("--save-path"); args.add(savePath); + } else { + DocumentFile saveFolder = Helper.createFolderInSave(context, game.getSavePath()); + + // In error case the native code will try to put a save folder next to the zip + if (saveFolder != null) { + savePath = saveFolder.getUri().toString(); + args.add("--save-path"); + args.add(savePath); + } } } diff --git a/builds/android/app/src/main/java/org/easyrpg/player/player/EasyRpgPlayerActivity.java b/builds/android/app/src/main/java/org/easyrpg/player/player/EasyRpgPlayerActivity.java index 828be979ea..8c32ed2e2c 100644 --- a/builds/android/app/src/main/java/org/easyrpg/player/player/EasyRpgPlayerActivity.java +++ b/builds/android/app/src/main/java/org/easyrpg/player/player/EasyRpgPlayerActivity.java @@ -47,6 +47,7 @@ import android.widget.RelativeLayout.LayoutParams; import android.widget.TextView; +import androidx.core.content.FileProvider; import androidx.core.view.GravityCompat; import androidx.drawerlayout.widget.DrawerLayout; @@ -65,6 +66,7 @@ import java.io.File; import java.lang.reflect.Method; import java.util.ArrayList; +import java.util.Locale; /** * EasyRPG Player for Android (inheriting from SDLActivity) @@ -239,12 +241,27 @@ private void reportBug() { .setPositiveButton(R.string.ok, (dialog, id) -> { // Attach to the email : the easyrpg log file and savefiles ArrayList files = new ArrayList<>(); - // The easyrpg_log.txt + String savepath = getIntent().getStringExtra(TAG_SAVE_PATH); if (getIntent().getBooleanExtra(TAG_STANDALONE, false)) { - // FIXME: Attaching files does not work because the files are in /data and - // other apps have no permission + File logFile = new File(savepath, "easyrpg_log.txt"); + if (logFile.exists()) { + Uri logUri = FileProvider.getUriForFile(this, getPackageName() + ".fileprovider", logFile); + if (logUri != null) { + files.add(logUri); + } + } + + for (int i = 1; i <= 15; ++i) { + File saveFile = new File(savepath, String.format(Locale.ROOT, "Save%02d.lsd", i)); + if (saveFile.exists()) { + Uri saveUri = FileProvider.getUriForFile(this, getPackageName() + ".fileprovider", saveFile); + if (saveUri != null) { + files.add(saveUri); + } + } + } } else { Uri saveFolder = Uri.parse(savepath); Uri log = Helper.findFileUri(getContext(), saveFolder, "easyrpg_log.txt"); diff --git a/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsAudioActivity.java b/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsAudioActivity.java index 6a84265184..f23cc78845 100644 --- a/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsAudioActivity.java +++ b/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsAudioActivity.java @@ -16,13 +16,14 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.documentfile.provider.DocumentFile; +import org.easyrpg.player.BaseActivity; import org.easyrpg.player.Helper; import org.easyrpg.player.R; import java.util.ArrayList; import java.util.List; -public class SettingsAudioActivity extends AppCompatActivity { +public class SettingsAudioActivity extends BaseActivity { private LinearLayout soundfontsListLayout; List soundfontList; @@ -33,8 +34,6 @@ protected void onCreate(Bundle savedInstanceState) { soundfontsListLayout = findViewById(R.id.settings_sound_fonts_list); - SettingsManager.init(getApplicationContext()); - // Setup UI components // The Soundfont Button Button button = this.findViewById(R.id.button_open_soundfont_folder); diff --git a/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsEnum.java b/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsEnum.java index fd95651fc4..537bb9e437 100644 --- a/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsEnum.java +++ b/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsEnum.java @@ -29,7 +29,7 @@ enum SettingsEnum { FONT1_SIZE("Font1Size"), FONT2_SIZE("Font2Size"), GAME_BROWSER_LABEL_MODE("GAME_BROWSER_LABEL_MODE"), - SHOW_ZX_AS_AB("SHOW_ZX_AS_AB") + SHOW_AB_AS_ZX("SHOW_AB_AS_ZX") ; diff --git a/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsFontActivity.java b/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsFontActivity.java index 2429ad646e..f3546c1624 100644 --- a/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsFontActivity.java +++ b/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsFontActivity.java @@ -19,6 +19,7 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.documentfile.provider.DocumentFile; +import org.easyrpg.player.BaseActivity; import org.easyrpg.player.Helper; import org.easyrpg.player.R; import org.libsdl.app.SDL; @@ -26,7 +27,7 @@ import java.util.ArrayList; import java.util.List; -public class SettingsFontActivity extends AppCompatActivity { +public class SettingsFontActivity extends BaseActivity { private LinearLayout fonts1ListLayout; private LinearLayout fonts2ListLayout; private String[] extensions = new String[] {".fon", ".fnt", ".bdf", ".ttf", ".ttc", ".otf", ".woff2", ".woff"}; @@ -43,7 +44,6 @@ protected void onCreate(Bundle savedInstanceState) { fonts1ListLayout = findViewById(R.id.settings_font1_list); fonts2ListLayout = findViewById(R.id.settings_font2_list); - SettingsManager.init(getApplicationContext()); SDL.setContext(getApplicationContext()); // Setup UI components diff --git a/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsGamesFolderActivity.java b/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsGamesFolderActivity.java index 37e4aad8f8..388041125d 100644 --- a/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsGamesFolderActivity.java +++ b/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsGamesFolderActivity.java @@ -12,12 +12,13 @@ import androidx.appcompat.app.AppCompatActivity; +import org.easyrpg.player.BaseActivity; import org.easyrpg.player.R; import org.easyrpg.player.game_browser.GameBrowserActivity; import org.easyrpg.player.game_browser.GameBrowserHelper; import org.libsdl.app.SDL; -public class SettingsGamesFolderActivity extends AppCompatActivity { +public class SettingsGamesFolderActivity extends BaseActivity { private GameBrowserHelper.SafError safError = GameBrowserHelper.SafError.OK; @Override @@ -28,8 +29,6 @@ public void onCreate(Bundle savedInstanceState) { safError = GameBrowserHelper.SafError.OK; - SettingsManager.init(getApplicationContext()); - Activity thisActivity = this; Button setGamesFolderButton = findViewById(R.id.set_games_folder); setGamesFolderButton.setOnClickListener(v -> GameBrowserHelper.pickAGamesFolder(thisActivity)); diff --git a/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsInputActivity.java b/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsInputActivity.java index 4c7bcbd3ee..5fa8177357 100644 --- a/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsInputActivity.java +++ b/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsInputActivity.java @@ -9,14 +9,14 @@ import android.widget.SeekBar; import android.widget.TextView; -import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.AppCompatSpinner; +import org.easyrpg.player.BaseActivity; import org.easyrpg.player.R; import org.easyrpg.player.button_mapping.ButtonMappingActivity; import org.easyrpg.player.button_mapping.InputLayout; -public class SettingsInputActivity extends AppCompatActivity implements View.OnClickListener { +public class SettingsInputActivity extends BaseActivity implements View.OnClickListener { private CheckBox enableVibrateWhenSlidingCheckbox; private SeekBar layoutTransparencyLayout, layoutSizeSeekBar, fastForwardMultiplierSeekBar; private TextView layoutTransparencyTextView, layoutSizeTextView, fastForwardMultiplierTextView; @@ -26,8 +26,6 @@ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.activity_settings_inputs); - SettingsManager.init(getApplicationContext()); - // Setting UI components CheckBox enableVibrationCheckBox = findViewById(R.id.settings_enable_vibration); enableVibrationCheckBox.setChecked(SettingsManager.isVibrationEnabled()); @@ -37,9 +35,9 @@ public void onCreate(Bundle savedInstanceState) { enableVibrateWhenSlidingCheckbox.setChecked(SettingsManager.isVibrateWhenSlidingDirectionEnabled()); enableVibrateWhenSlidingCheckbox.setOnClickListener(this); - CheckBox showZXasABcheckbox = findViewById(R.id.settings_show_zx_as_ab); - showZXasABcheckbox.setChecked(SettingsManager.getShowZXasAB()); - showZXasABcheckbox.setOnClickListener(this); + CheckBox showABasZXcheckbox = findViewById(R.id.settings_show_ab_as_zx); + showABasZXcheckbox.setChecked(SettingsManager.getShowABasZX()); + showABasZXcheckbox.setOnClickListener(this); configureFastForwardButton(); configureLayoutTransparencySystem(); @@ -61,8 +59,8 @@ public void onClick(View v) { enableVibrateWhenSlidingCheckbox.setEnabled(c.isChecked()); } else if (id == R.id.settings_vibrate_when_sliding){ SettingsManager.setVibrateWhenSlidingDirectionEnabled(((CheckBox) v).isChecked()); - } else if (id == R.id.settings_show_zx_as_ab) { - SettingsManager.setShowZXasAB(((CheckBox)v).isChecked()); + } else if (id == R.id.settings_show_ab_as_zx) { + SettingsManager.setShowABasZX(((CheckBox)v).isChecked()); } } diff --git a/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsMainActivity.java b/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsMainActivity.java index b13979b2f5..2bfe6cbf86 100644 --- a/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsMainActivity.java +++ b/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsMainActivity.java @@ -7,9 +7,10 @@ import androidx.appcompat.app.AppCompatActivity; +import org.easyrpg.player.BaseActivity; import org.easyrpg.player.R; -public class SettingsMainActivity extends AppCompatActivity implements View.OnClickListener { +public class SettingsMainActivity extends BaseActivity implements View.OnClickListener { @Override public void onCreate(Bundle savedInstanceState) { diff --git a/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsManager.java b/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsManager.java index b4052c858a..ff596b0d61 100644 --- a/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsManager.java +++ b/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsManager.java @@ -51,7 +51,7 @@ public class SettingsManager { FONTS_FOLDER_NAME = "fonts"; public static int FAST_FORWARD_MODE_HOLD = 0, FAST_FORWARD_MODE_TAP = 1; private static int gameBrowserLabelMode = 0; - private static boolean showZXasAB = false; + private static boolean showABasZX = false; private static List imageSizeOption = Arrays.asList("nearest", "integer", "bilinear"); private static List gameResolutionOption = Arrays.asList("original", "widescreen", "ultrawide"); @@ -107,7 +107,7 @@ private static void loadSettings(Context context) { gameBrowserLabelMode = sharedPref.getInt(GAME_BROWSER_LABEL_MODE.toString(), 0); - showZXasAB = sharedPref.getBoolean(SHOW_ZX_AS_AB.toString(), false); + showABasZX = sharedPref.getBoolean(SHOW_AB_AS_ZX.toString(), false); } public static Set getFavoriteGamesList() { @@ -309,7 +309,7 @@ public static void setEasyRPGFolderURI(Uri easyRPGFolderURI) { } public static Uri getGamesFolderURI(Context context) { - DocumentFile easyRPGFolder = Helper.getFileFromURI(context, easyRPGFolderURI); + DocumentFile easyRPGFolder = Helper.getFileFromURI(context, getEasyRPGFolderURI(context)); if (easyRPGFolder != null) { return Helper.findFileUri(context, easyRPGFolder.getUri(), GAMES_FOLDER_NAME); } else { @@ -318,7 +318,7 @@ public static Uri getGamesFolderURI(Context context) { } public static Uri getRTPFolderURI(Context context) { - DocumentFile easyRPGFolder = Helper.getFileFromURI(context, easyRPGFolderURI); + DocumentFile easyRPGFolder = Helper.getFileFromURI(context, getEasyRPGFolderURI(context)); if (easyRPGFolder != null) { return Helper.findFileUri(context, easyRPGFolder.getUri(), RTP_FOLDER_NAME); } else { @@ -327,7 +327,7 @@ public static Uri getRTPFolderURI(Context context) { } public static Uri getFontsFolderURI(Context context) { - DocumentFile easyRPGFolder = Helper.getFileFromURI(context, easyRPGFolderURI); + DocumentFile easyRPGFolder = Helper.getFileFromURI(context, getEasyRPGFolderURI(context)); if (easyRPGFolder != null) { return Helper.findFileUri(context, easyRPGFolder.getUri(), FONTS_FOLDER_NAME); } else { @@ -336,7 +336,7 @@ public static Uri getFontsFolderURI(Context context) { } public static Uri getSoundFontsFolderURI(Context context) { - DocumentFile easyRPGFolder = Helper.getFileFromURI(context, easyRPGFolderURI); + DocumentFile easyRPGFolder = Helper.getFileFromURI(context, getEasyRPGFolderURI(context)); if (easyRPGFolder != null) { return Helper.findFileUri(context, easyRPGFolder.getUri(), SOUND_FONTS_FOLDER_NAME); } else { @@ -505,13 +505,13 @@ public static void setGameBrowserLabelMode(int i) { editor.commit(); } - public static boolean getShowZXasAB() { - return showZXasAB; + public static boolean getShowABasZX() { + return showABasZX; } - public static void setShowZXasAB(boolean b) { - showZXasAB = b; - editor.putBoolean(SHOW_ZX_AS_AB.toString(), b); + public static void setShowABasZX(boolean b) { + showABasZX = b; + editor.putBoolean(SHOW_AB_AS_ZX.toString(), b); editor.commit(); } } diff --git a/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsVideoActivity.java b/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsVideoActivity.java index 8d8347c980..41b8b082db 100644 --- a/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsVideoActivity.java +++ b/builds/android/app/src/main/java/org/easyrpg/player/settings/SettingsVideoActivity.java @@ -7,13 +7,14 @@ import androidx.appcompat.app.AppCompatActivity; +import org.easyrpg.player.BaseActivity; import org.easyrpg.player.R; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -public class SettingsVideoActivity extends AppCompatActivity implements View.OnClickListener { +public class SettingsVideoActivity extends BaseActivity implements View.OnClickListener { List imageSizeRadioButtonList; List gameResolutionRadioButtonList; @@ -22,8 +23,6 @@ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.activity_settings_video); - SettingsManager.init(getApplicationContext()); - // Setting UI components CheckBox forceLandscapeModeCheckbox = findViewById(R.id.force_landscape_mode); forceLandscapeModeCheckbox.setChecked(SettingsManager.isForcedLandscape()); diff --git a/builds/android/app/src/main/res/layout/activity_settings_inputs.xml b/builds/android/app/src/main/res/layout/activity_settings_inputs.xml index 3c17030c59..51ac179b02 100644 --- a/builds/android/app/src/main/res/layout/activity_settings_inputs.xml +++ b/builds/android/app/src/main/res/layout/activity_settings_inputs.xml @@ -26,10 +26,10 @@ android:textSize="20sp"/> diff --git a/builds/android/app/src/main/res/values/strings.xml b/builds/android/app/src/main/res/values/strings.xml index 1b18f85de4..b8f992f088 100644 --- a/builds/android/app/src/main/res/values/strings.xml +++ b/builds/android/app/src/main/res/values/strings.xml @@ -97,7 +97,7 @@ Please tell us in detail what went wrong.\n\n Sound effect volume Input layout transparency: Ignore button size settings and use this instead: - Display Z and X buttons as A and B + Display A and B buttons as Z and X No read access on %1$s Quick access Fast-forward button mode: diff --git a/builds/android/app/src/main/res/xml/file_paths.xml b/builds/android/app/src/main/res/xml/file_paths.xml new file mode 100644 index 0000000000..d2c05e9d88 --- /dev/null +++ b/builds/android/app/src/main/res/xml/file_paths.xml @@ -0,0 +1,3 @@ + + + diff --git a/builds/android/build.gradle b/builds/android/build.gradle index 5facda44e1..ed2299cb0d 100644 --- a/builds/android/build.gradle +++ b/builds/android/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:8.4.2' + classpath 'com.android.tools.build:gradle:8.7.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/builds/android/gradle.properties b/builds/android/gradle.properties index e48fe2d1f1..b096a3865e 100644 --- a/builds/android/gradle.properties +++ b/builds/android/gradle.properties @@ -10,7 +10,7 @@ VERSION_NAME=0.8 VERSION_CODE=8843 # Architectures to build for when developing (debug) -ABI_FILTERS_DEBUG=armeabi-v7a +ABI_FILTERS_DEBUG=arm64-v8a # Architectures to build for when creating a release ABI_FILTERS_RELEASE=armeabi-v7a,arm64-v8a,x86,x86_64 diff --git a/src/platform/android/org_easyrpg_player_player_EasyRpgPlayerActivity.cpp b/src/platform/android/org_easyrpg_player_player_EasyRpgPlayerActivity.cpp index 9fe5731cac..d7fcc66157 100644 --- a/src/platform/android/org_easyrpg_player_player_EasyRpgPlayerActivity.cpp +++ b/src/platform/android/org_easyrpg_player_player_EasyRpgPlayerActivity.cpp @@ -57,7 +57,7 @@ JNIEXPORT void JNICALL Java_org_easyrpg_player_player_EasyRpgPlayerActivity_togg JNIEXPORT void JNICALL Java_org_easyrpg_player_player_EasyRpgPlayerActivity_openSettings(JNIEnv *, jclass) { EpAndroid::schedule([]() { - if (Scene::instance->type != Scene::Logo && !Scene::Find(Scene::Settings)) { + if (Scene::instance->type != Scene::Logo && !Scene::Find(Scene::Settings) && !Scene::IsAsyncPending()) { Scene::Push(std::make_shared()); } });