From 6629c3d9a63ab329ea1573c60d13534b305af6f4 Mon Sep 17 00:00:00 2001 From: Christopher Beckmann Date: Sun, 15 Nov 2015 13:14:14 +0100 Subject: [PATCH] Corrected Keyboard to always take the remaining space available. Fixed Delete button. --- .../java/tu_darmstadt/sudoku/controller/GameController.java | 2 +- app/src/main/java/tu_darmstadt/sudoku/ui/GameActivity.java | 3 +-- .../tu_darmstadt/sudoku/ui/view/SudokuKeyboardLayout.java | 1 - app/src/main/res/layout/content_game_view.xml | 6 +++--- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/tu_darmstadt/sudoku/controller/GameController.java b/app/src/main/java/tu_darmstadt/sudoku/controller/GameController.java index acf756d..7169a2a 100644 --- a/app/src/main/java/tu_darmstadt/sudoku/controller/GameController.java +++ b/app/src/main/java/tu_darmstadt/sudoku/controller/GameController.java @@ -310,7 +310,7 @@ public class GameController { } public void deleteSelectedValue() { - if(isCellSelected()) setValue(selectedRow, selectedCol, 0); + if(isCellSelected()) deleteValue(selectedRow, selectedCol); } public void toggleSelectedNote(int value) { diff --git a/app/src/main/java/tu_darmstadt/sudoku/ui/GameActivity.java b/app/src/main/java/tu_darmstadt/sudoku/ui/GameActivity.java index c7efdf1..401e969 100644 --- a/app/src/main/java/tu_darmstadt/sudoku/ui/GameActivity.java +++ b/app/src/main/java/tu_darmstadt/sudoku/ui/GameActivity.java @@ -69,7 +69,6 @@ public class GameActivity extends AppCompatActivity implements NavigationView.On keyboard.setRowCount(3); Point p = new Point(); getWindowManager().getDefaultDisplay().getSize(p); - keyboard.getLayoutParams().height = (int)(p.y*0.3); //int width = p.x; keyboard.setKeyBoard(gameController.getSize(), p.x); /* @@ -116,7 +115,7 @@ public class GameActivity extends AppCompatActivity implements NavigationView.On if (id == R.id.nav_newgame) { //create new game - intent = new Intent(this, GameActivity.class); + intent = new Intent(this, NewGameActivity.class); startActivity(intent); } else if (id == R.id.nav_mainmenu) { diff --git a/app/src/main/java/tu_darmstadt/sudoku/ui/view/SudokuKeyboardLayout.java b/app/src/main/java/tu_darmstadt/sudoku/ui/view/SudokuKeyboardLayout.java index 7785c09..6dbdd28 100644 --- a/app/src/main/java/tu_darmstadt/sudoku/ui/view/SudokuKeyboardLayout.java +++ b/app/src/main/java/tu_darmstadt/sudoku/ui/view/SudokuKeyboardLayout.java @@ -73,7 +73,6 @@ public class SudokuKeyboardLayout extends GridLayout { public SudokuKeyboardLayout(Context context, AttributeSet attrs) { super(context, attrs); this.attrs = attrs; - } diff --git a/app/src/main/res/layout/content_game_view.xml b/app/src/main/res/layout/content_game_view.xml index 305669e..b7a58c0 100644 --- a/app/src/main/res/layout/content_game_view.xml +++ b/app/src/main/res/layout/content_game_view.xml @@ -21,11 +21,11 @@ + android:layout_centerVertical="true">