diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/GameActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/GameActivity.java index 4c8e125..7b01c2e 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/GameActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/GameActivity.java @@ -83,10 +83,12 @@ public class GameActivity extends BaseActivity implements NavigationView.OnNavig protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - - getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); - SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this); + + if(sharedPref.getBoolean("pref_keep_screen_on", true)) { + getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); + } + GameType gameType = GameType.Unspecified; GameDifficulty gameDifficulty = GameDifficulty.Unspecified; int loadLevelID = 0; diff --git a/app/src/main/res/layout/activity_game_view.xml b/app/src/main/res/layout/activity_game_view.xml index 4278fe9..2e33c3f 100644 --- a/app/src/main/res/layout/activity_game_view.xml +++ b/app/src/main/res/layout/activity_game_view.xml @@ -40,10 +40,10 @@ android:layout_height="wrap_content" android:text="@string/gametype_unspecified" android:id="@+id/gameModeText" - android:layout_weight="8"/> + android:layout_weight="7"/> Privacy Friendly Sudoku does not use any permissions. Okay View Help - Challenge - Highlight input mistakes + Challenge + Highlight input mistakes + Keep Screen On + Don\'t turn the screen off while playing diff --git a/app/src/main/res/xml/pref_settings_general.xml b/app/src/main/res/xml/pref_settings_general.xml index 793e450..3102b95 100644 --- a/app/src/main/res/xml/pref_settings_general.xml +++ b/app/src/main/res/xml/pref_settings_general.xml @@ -13,7 +13,13 @@ android:summary="@string/pref_timer_reset_summary" android:defaultValue="true" /> - + +