Skip to content
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

[fix] Crashes in Landscape #137

Merged
merged 3 commits into from
Jan 14, 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 app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
applicationId "org.secuso.privacyfriendlysudoku"
minSdkVersion 17
targetSdkVersion 34
versionCode 17
versionName "3.2.2"
versionCode 18
versionName "3.2.3"
vectorDrawables.useSupportLibrary = true
multiDexEnabled = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,16 @@ public void onPageSelected(int position) {
GameType gameType = GameType.getValidGameTypes().get(mViewPager.getCurrentItem());
int index = difficultyBar.getProgress()-1;
GameDifficulty gameDifficulty = GameDifficulty.getValidDifficultyList().get(index < 0 ? 0 : index);
Button button = findViewById(R.id.playButton);
if (gameType == GameType.Default_16x16 && index <= 2) {
button.setEnabled(false);
button.setText(R.string.game_config_unsupported);
button.setBackgroundResource(R.drawable.button_inactive);
} else {
button.setEnabled(true);
button.setText(R.string.new_game);
button.setBackgroundResource(R.drawable.button_standalone);
}
((TextView) findViewById(R.id.level_count))
.setText(String.format(getString(R.string.levels_available), newLevelManager.getCountAvailableLevels(gameType, gameDifficulty)));
}
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/layout-land/activity_main_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@

</androidx.constraintlayout.widget.ConstraintLayout>

<TextView android:id="@+id/level_count"
android:text="Levels available:"
android:textStyle="bold"
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<Button
android:textColor="?attr/lightestFontColor"
android:layout_width="match_parent"
Expand Down