From 1682c58bb7c8d61ba5ed178284110f9936f08daa Mon Sep 17 00:00:00 2001 From: rdatta95 Date: Sun, 1 Nov 2020 19:36:30 +0530 Subject: [PATCH 1/2] Changes for Issue #53 (enhancement) 1. Using fill color to represent completion and border for selection. 2. Updated image numfull.png to reflect this in help page 3. The button style gets updated on completion, even if the button is selected. --- .../ui/view/SudokuKeyboardLayout.java | 28 +++++++++++++----- .../drawable-v21/numpad_selected_complete.xml | 11 +++++++ .../numpad_unselected_complete.xml | 5 ++++ app/src/main/res/drawable/numfull.png | Bin 3722 -> 4492 bytes .../res/drawable/numpad_selected_complete.xml | 11 +++++++ .../drawable/numpad_unselected_complete.xml | 5 ++++ app/src/main/res/values-night/styles.xml | 2 ++ app/src/main/res/values/attrs.xml | 2 ++ app/src/main/res/values/styles.xml | 2 ++ 9 files changed, 58 insertions(+), 8 deletions(-) create mode 100644 app/src/main/res/drawable-v21/numpad_selected_complete.xml create mode 100644 app/src/main/res/drawable-v21/numpad_unselected_complete.xml create mode 100644 app/src/main/res/drawable/numpad_selected_complete.xml create mode 100644 app/src/main/res/drawable/numpad_unselected_complete.xml diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/SudokuKeyboardLayout.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/SudokuKeyboardLayout.java index 3b8f603..fa7149c 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/SudokuKeyboardLayout.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/SudokuKeyboardLayout.java @@ -185,17 +185,29 @@ public class SudokuKeyboardLayout extends LinearLayout implements IHighlightChan @Override public void onHighlightChanged() { for(SudokuButton i_btn : buttons) { - i_btn.setBackgroundResource(R.drawable.mnenomic_numpad_button); + int backgroundResId = R.drawable.mnenomic_numpad_button; - // Highlight Yellow if we are done with that number - if(gameController.getValueCount(i_btn.getValue()) == gameController.getSize()) { - i_btn.setBackgroundResource(R.drawable.numpad_highlighted_three); + boolean numCompleted = (gameController.getValueCount(i_btn.getValue()) == gameController.getSize()); + boolean numSelected = (gameController.getSelectedValue() == i_btn.getValue()); + + if(numCompleted) { + // Fill color : darkyellow + // Border (if selected) : yellow + if(numSelected) { + backgroundResId = R.drawable.numpad_selected_complete; + } else { + backgroundResId = R.drawable.numpad_unselected_complete; + } + } else { + // Fill color : lightblue + // Border (if selected) : colorPrimaryDark + if(numSelected) { + backgroundResId = R.drawable.numpad_highlighted; + } // The else scenario is taken care of by the default initialized value } - if(gameController.getSelectedValue() == i_btn.getValue()) { - // highlight button to indicate that the value is selected - i_btn.setBackgroundResource(R.drawable.numpad_highlighted); - } + i_btn.setBackgroundResource(backgroundResId); + } } diff --git a/app/src/main/res/drawable-v21/numpad_selected_complete.xml b/app/src/main/res/drawable-v21/numpad_selected_complete.xml new file mode 100644 index 0000000..62dd7f4 --- /dev/null +++ b/app/src/main/res/drawable-v21/numpad_selected_complete.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/app/src/main/res/drawable-v21/numpad_unselected_complete.xml b/app/src/main/res/drawable-v21/numpad_unselected_complete.xml new file mode 100644 index 0000000..c0716a8 --- /dev/null +++ b/app/src/main/res/drawable-v21/numpad_unselected_complete.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/app/src/main/res/drawable/numfull.png b/app/src/main/res/drawable/numfull.png index 9394b95712597876984a44254cae74c30405a98a..384c4ad96dbce1dddc97fe0e8a53971a20277cd4 100644 GIT binary patch literal 4492 zcmd5=c|4Tu*S~oxMYhU1WreLnYn-Jkoq&UK&jJ>PRa=iHC4IogT}%L@Yl zAZmBX+6e#z!2IW){rmX$(dqsS{&WC&$pZxdVx7B}Ko_F?4*#WG*hTj+XM}GU`c|k9 zfJURW{euHhuvRO)cv$HznsI4k_>GvUR z<(qNt%EAzWi-r-FAgzIQvHeUrO;E3Q_RW>c@^Tw!zH|3#J&{Rf{ON78TJ-gtsv+@wNO<rgb^mh29cLwH3U!NI9v6xg=qvZ849mq^JiC&YQq6Qc(2}jc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xml new file mode 100644 index 0000000..8a317a5 --- /dev/null +++ b/app/src/main/res/drawable/numpad_selected_complete.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/app/src/main/res/drawable/numpad_unselected_complete.xml b/app/src/main/res/drawable/numpad_unselected_complete.xml new file mode 100644 index 0000000..5bcd57c --- /dev/null +++ b/app/src/main/res/drawable/numpad_unselected_complete.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/app/src/main/res/values-night/styles.xml b/app/src/main/res/values-night/styles.xml index 193db3b..4c929a2 100644 --- a/app/src/main/res/values-night/styles.xml +++ b/app/src/main/res/values-night/styles.xml @@ -21,6 +21,8 @@ @color/lightblue @color/middlegrey @color/yellow + @color/darkyellow + @color/yellow @color/cardview_dark_background @color/colorPrimaryDark @color/colorPrimaryDark diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index 21f406a..190da01 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -15,6 +15,8 @@ + + diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index e265552..6e0341d 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -19,6 +19,8 @@ @color/lightblue @color/middlegrey @color/yellow + @color/darkyellow + @color/yellow @style/ToolbarStyle @color/colorAccent @color/white From 97592d8e22ca1292b0d3e749650626afecf18071 Mon Sep 17 00:00:00 2001 From: Christopher Beckmann Date: Tue, 3 Nov 2020 16:27:12 +0100 Subject: [PATCH 2/2] Changed the yellow to a more friendly green. --- app/src/main/res/drawable/numpad_selected_complete.xml | 4 ++-- app/src/main/res/values-night/styles.xml | 2 +- app/src/main/res/values/styles.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/drawable/numpad_selected_complete.xml b/app/src/main/res/drawable/numpad_selected_complete.xml index 8a317a5..889373e 100644 --- a/app/src/main/res/drawable/numpad_selected_complete.xml +++ b/app/src/main/res/drawable/numpad_selected_complete.xml @@ -2,8 +2,8 @@ + android:endColor="@color/green" + android:startColor="@color/green" /> @color/lightblue @color/middlegrey @color/yellow - @color/darkyellow + @color/green @color/yellow @color/cardview_dark_background @color/colorPrimaryDark diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 6e0341d..571c02a 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -19,7 +19,7 @@ @color/lightblue @color/middlegrey @color/yellow - @color/darkyellow + @color/green @color/yellow @style/ToolbarStyle @color/colorAccent