From 1bf2c9ec7fab37959d128a79a25ce52d2d921529 Mon Sep 17 00:00:00 2001 From: uykek Date: Wed, 19 Aug 2020 19:32:27 +0200 Subject: [PATCH] Replace 'note toggle' button in CreateSudokuActivity with 'import' button --- .../ui/view/CreateSudokuButtonType.java | 6 ++--- .../view/CreateSudokuSpecialButtonLayout.java | 23 ++----------------- app/src/main/res/drawable/ic_import.xml | 4 ++++ 3 files changed, 9 insertions(+), 24 deletions(-) create mode 100644 app/src/main/res/drawable/ic_import.xml diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/CreateSudokuButtonType.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/CreateSudokuButtonType.java index a9cf926..708c6e9 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/CreateSudokuButtonType.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/CreateSudokuButtonType.java @@ -29,7 +29,7 @@ public enum CreateSudokuButtonType { Value(R.drawable.ic_accessibility_black_48dp), // should be non picture Do(R.drawable.ic_redo_black_48dp), Undo(R.drawable.ic_undo_black_48dp), - NoteToggle(R.drawable.ic_create_black_48dp), + Import(R.drawable.ic_import), Spacer(R.drawable.ic_accessibility_black_48dp),//placeholder Delete(R.drawable.ic_delete_black_48dp), Finalize(R.drawable.ic_finalize), @@ -53,7 +53,7 @@ public enum CreateSudokuButtonType { result.add(Finalize); //result.add(Spacer); result.add(Delete); - result.add(NoteToggle); + result.add(Import); return result; } public static String getName(CreateSudokuButtonType type) { @@ -61,7 +61,7 @@ public enum CreateSudokuButtonType { case Do: return "Do"; case Undo: return "Un"; case Finalize: return "Fi"; - case NoteToggle: return "On"; + case Import: return "Im"; case Spacer: return ""; case Delete: return "Del"; default:return "NotSet"; diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/CreateSudokuSpecialButtonLayout.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/CreateSudokuSpecialButtonLayout.java index 3301968..0c0c3aa 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/CreateSudokuSpecialButtonLayout.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/CreateSudokuSpecialButtonLayout.java @@ -76,12 +76,8 @@ public class CreateSudokuSpecialButtonLayout extends LinearLayout implements IHi case Delete: gameController.deleteSelectedCellsValue(); break; - case NoteToggle: - // rotates the Drawable - gameController.setNoteStatus(!gameController.getNoteStatus()); - keyboard.updateNotesEnabled(); - onHighlightChanged(); - break; + case Import: + break; case Do: gameController.ReDo(); break; @@ -179,21 +175,6 @@ public class CreateSudokuSpecialButtonLayout extends LinearLayout implements IHi fixedButtons[i].setBackgroundResource(gameController.isRedoAvailable() ? R.drawable.numpad_highlighted_four : R.drawable.inactive_button); break; - case NoteToggle: - Drawable drawable = ContextCompat.getDrawable(context, fixedButtons[i].getType().getResID()); - // prepare canvas for the rotation of the note drawable - setUpVectorDrawable(drawable); - - canvas.rotate(gameController.getNoteStatus() ? 45.0f : 0.0f, bitMap.getWidth()/2, bitMap.getHeight()/2); - canvas.drawBitmap(bitMap, 0, 0, null); - drawable.draw(canvas); - - fixedButtons[i].setImageBitmap(bitResult); - fixedButtons[i].setBackgroundResource(gameController.getNoteStatus() ? R.drawable.numpad_highlighted_three : R.drawable.numpad_highlighted_four); - - keyboard.updateNotesEnabled(); - - break; default: break; } diff --git a/app/src/main/res/drawable/ic_import.xml b/app/src/main/res/drawable/ic_import.xml new file mode 100644 index 0000000..45d8360 --- /dev/null +++ b/app/src/main/res/drawable/ic_import.xml @@ -0,0 +1,4 @@ + + +