Skip to content

Urgent Android fix #3388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions builds/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ android {
assetPacks = [":assets"]
defaultConfig {
applicationId "org.easyrpg.player"
compileSdk 35
compileSdk 34
minSdkVersion 21
targetSdkVersion 35
targetSdkVersion 34
versionName VERSION_NAME
versionCode Integer.parseInt(VERSION_CODE)
}
Expand Down
3 changes: 2 additions & 1 deletion builds/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
<!-- Player's Activity -->
<activity
android:name=".player.EasyRpgPlayerActivity"
android:configChanges="orientation|screenSize" />
android:configChanges="orientation|screenSize"
android:theme="@style/AppThemePlayerActivity"/>
<!-- Settings' Activity -->
<activity
android:name=".settings.SettingsMainActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ public void onDrawerStateChanged(int newState) {

NavigationView navigationView = findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
hideStatusBar();

// Screen orientation
if (SettingsManager.isForcedLandscape()) {
Expand Down Expand Up @@ -207,12 +206,6 @@ public boolean onNavigationItemSelected(MenuItem item) {
return false;
}

public void hideStatusBar() {
// Hide the status bar
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == LAYOUT_EDIT) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ enum SettingsEnum {
MUSIC_VOLUME("MusicVolume"),
SOUND_VOLUME("SoundVolume"),
STRETCH("Stretch"),
FULLSCREEN("Fullscreen"),
GAME_RESOLUTION("GameResolution"),
SPEED_MODIFIER_A("SpeedModifierA"),
FONT1_URI("Font1"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class SettingsManager {
private static boolean ignoreLayoutSizePreferencesEnabled;
private static boolean forcedLandscape;
private static boolean stretch;
private static boolean fullscreen;
private static boolean rtpScanningEnabled;
private static int imageSize, gameResolution;
private static int layoutTransparency, layoutSize, fastForwardMode, fastForwardMultiplier;
Expand Down Expand Up @@ -80,6 +81,7 @@ private static void loadSettings(Context context) {
layoutSize = sharedPref.getInt(LAYOUT_SIZE.toString(), 100);
forcedLandscape = sharedPref.getBoolean(FORCED_LANDSCAPE.toString(), false);
stretch = configIni.video.getBoolean(STRETCH.toString(), false);
fullscreen = configIni.video.getBoolean(FULLSCREEN.toString(), true);
fastForwardMode = sharedPref.getInt(FAST_FORWARD_MODE.toString(), FAST_FORWARD_MODE_TAP);

musicVolume = configIni.audio.getInteger(MUSIC_VOLUME.toString(), 100);
Expand Down Expand Up @@ -289,6 +291,16 @@ public static void setStretch(boolean b) {
configIni.save();
}

public static boolean isFullscreen() {
return fullscreen;
}

public static void setFullscreen(boolean b) {
fullscreen = b;
configIni.video.set(FULLSCREEN.toString(), b);
configIni.save();
}

public static Uri getEasyRPGFolderURI(Context context) {
if (easyRPGFolderURI == null) {
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ public void onCreate(Bundle savedInstanceState) {
this.setContentView(R.layout.activity_settings_video);

// Setting UI components
CheckBox fullscreenCheckbox = findViewById(R.id.fullscreen_mode);
fullscreenCheckbox.setChecked(SettingsManager.isFullscreen());
fullscreenCheckbox.setOnClickListener(this);

CheckBox forceLandscapeModeCheckbox = findViewById(R.id.force_landscape_mode);
forceLandscapeModeCheckbox.setChecked(SettingsManager.isForcedLandscape());
forceLandscapeModeCheckbox.setOnClickListener(this);
Expand Down Expand Up @@ -67,6 +71,10 @@ public void onCreate(Bundle savedInstanceState) {

@Override
public void onClick(View v) {
if (v.getId() == R.id.fullscreen_mode) {
SettingsManager.setFullscreen(((CheckBox)v).isChecked());
}

if (v.getId() == R.id.force_landscape_mode) {
SettingsManager.setForcedLandscape(((CheckBox)v).isChecked());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
android:padding="10dp"
tools:context="org.easyrpg.player.settings.SettingsVideoActivity">

<CheckBox
android:id="@+id/fullscreen_mode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fullscreen_mode"
android:textSize="20sp"/>

<CheckBox
android:id="@+id/force_landscape_mode"
android:layout_width="match_parent"
Expand Down
1 change: 1 addition & 0 deletions builds/android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Please tell us in detail what went wrong.\n\n
<string name="easyrpg_folders">EasyRPG Folders</string>
<string name="settings">Settings</string>
<string name="screen_size">Screen scaling:</string>
<string name="fullscreen_mode">Fullscreen</string>
<string name="force_landscape_mode">Force landscape orientation</string>
<string name="scale_nearest">Scale to screen size using nearest neighbour (Fast, bad quality)</string>
<string name="scale_integer">Scale to a multiple of the game resolution (Fast, smaller image, good quality)</string>
Expand Down
3 changes: 3 additions & 0 deletions builds/android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppThemePlayerActivity" parent="Theme.AppCompat.Light.DarkActionBar">
</style>

<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
Expand Down
Loading