From 8780dcf640b0d56af3e9b9f3a0ff4d371004020a Mon Sep 17 00:00:00 2001 From: uykek Date: Sun, 23 Aug 2020 10:12:58 +0200 Subject: [PATCH 1/4] Fix regex used in the DailySudoku class --- .../controller/database/model/DailySudoku.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/database/model/DailySudoku.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/database/model/DailySudoku.java index 81a75b7..4228ec4 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/database/model/DailySudoku.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/database/model/DailySudoku.java @@ -65,7 +65,7 @@ public class DailySudoku extends Level { * does not have the right format) */ public int getTimeNeededInSeconds() { - if (timeNeeded.matches("/d/d:/d/d:/d/d")) { + if (timeNeeded.matches("[0-9]{2}:[0-5][0-9]:[0-5][0-9]")) { String[] timeInstances = timeNeeded.split(":"); int hourIndex = 0; int minuteIndex = 1; @@ -73,7 +73,7 @@ public class DailySudoku extends Level { int minutes = Integer.parseInt(timeInstances[hourIndex]) * 60 + Integer.parseInt(timeInstances[minuteIndex]); return minutes * 60 + Integer.parseInt(timeInstances[secondIndex]); - } + } return 0; } From ec40f340e67d3202e88b5cb5bb1ddc0e1aae5495 Mon Sep 17 00:00:00 2001 From: uykek Date: Sun, 23 Aug 2020 16:59:23 +0200 Subject: [PATCH 2/4] Fix bug that caused navigation bar item "import sudoku" to be selected instead of "main menu" after cancelling the ImportBoardDialog in the MainActivity. --- .../org/secuso/privacyfriendlysudoku/ui/MainActivity.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/MainActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/MainActivity.java index 8a4f6fa..c3d1f18 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/MainActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/MainActivity.java @@ -474,7 +474,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig } public void onDialogNegativeClick() { - + mNavigationView.setCheckedItem(R.id.nav_newgame_main); } public static class ImportBoardDialog extends DialogFragment { @@ -505,7 +505,9 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig }) .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { - // User cancelled the dialog + for(IImportDialogFragmentListener l : listeners) { + l.onDialogNegativeClick(); + } } }); return builder.create(); From b270de08ea71a3f59a71455455041095025c82f8 Mon Sep 17 00:00:00 2001 From: uykek Date: Sun, 23 Aug 2020 22:47:15 +0200 Subject: [PATCH 3/4] Change attributes applied to AlertDialog instances to remove opaque background from 'copy/ut/paste' popup menu --- app/src/main/res/values-night/styles.xml | 4 ++-- app/src/main/res/values/styles.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/values-night/styles.xml b/app/src/main/res/values-night/styles.xml index b19b842..0988338 100644 --- a/app/src/main/res/values-night/styles.xml +++ b/app/src/main/res/values-night/styles.xml @@ -36,10 +36,10 @@ true - -