Merge branch 'Sudoku-v3.0' of https://github.com/SecUSo/privacy-friendly-sudoku into Sudoku-v3.0
This commit is contained in:
commit
c115b6c990
3 changed files with 15 additions and 1 deletions
|
@ -42,6 +42,7 @@
|
||||||
<activity
|
<activity
|
||||||
android:name="org.secuso.privacyfriendlysudoku.ui.GameActivity"
|
android:name="org.secuso.privacyfriendlysudoku.ui.GameActivity"
|
||||||
android:label="@string/title_activity_game_view"
|
android:label="@string/title_activity_game_view"
|
||||||
|
android:launchMode="singleTask"
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
|
|
||||||
<intent-filter >
|
<intent-filter >
|
||||||
|
|
|
@ -104,6 +104,11 @@ public class GameInfoContainer {
|
||||||
fixedValues = new int[s.length()];
|
fixedValues = new int[s.length()];
|
||||||
for(int i = 0; i < s.length(); i++) {
|
for(int i = 0; i < s.length(); i++) {
|
||||||
fixedValues[i] = Symbol.getValue(Symbol.SaveFormat, String.valueOf(s.charAt(i)))+1;
|
fixedValues[i] = Symbol.getValue(Symbol.SaveFormat, String.valueOf(s.charAt(i)))+1;
|
||||||
|
if (gameType != GameType.Unspecified && gameType != null) {
|
||||||
|
if (fixedValues[i] < 0 || fixedValues[i] > gameType.getSize()) {
|
||||||
|
throw new IllegalArgumentException("Fixed values must each be smaller than " + gameType.getSize() + ".");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -130,8 +130,8 @@ public class GameActivity extends BaseActivity implements NavigationView.OnNavig
|
||||||
GameType.Unspecified, new int [boardSize], new int [boardSize], new boolean [boardSize][sectionSize]);
|
GameType.Unspecified, new int [boardSize], new int [boardSize], new boolean [boardSize][sectionSize]);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
container.parseFixedValues(input);
|
|
||||||
container.parseGameType("Default_" + sectionSize + "x" + sectionSize);
|
container.parseGameType("Default_" + sectionSize + "x" + sectionSize);
|
||||||
|
container.parseFixedValues(input);
|
||||||
|
|
||||||
difficultyCheck = new QQWing(container.getGameType(), GameDifficulty.Unspecified);
|
difficultyCheck = new QQWing(container.getGameType(), GameDifficulty.Unspecified);
|
||||||
difficultyCheck.setRecordHistory(true);
|
difficultyCheck.setRecordHistory(true);
|
||||||
|
@ -303,6 +303,14 @@ public class GameActivity extends BaseActivity implements NavigationView.OnNavig
|
||||||
}
|
}
|
||||||
gameController.deleteTimer();
|
gameController.deleteTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNewIntent(Intent intent) {
|
||||||
|
super.onNewIntent(intent);
|
||||||
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume(){
|
public void onResume(){
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
Loading…
Reference in a new issue