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 d171cc1..c7efdf1 100644 --- a/app/src/main/java/tu_darmstadt/sudoku/ui/GameActivity.java +++ b/app/src/main/java/tu_darmstadt/sudoku/ui/GameActivity.java @@ -65,7 +65,7 @@ public class GameActivity extends AppCompatActivity implements NavigationView.On keyboard = (SudokuKeyboardLayout) findViewById(R.id.sudokuKeyboardLayout); keyboard.removeAllViews(); keyboard.setGameController(gameController); - keyboard.setColumnCount((gameController.getSize() / 2) + 1); + keyboard.setColumnCount(Math.max(((gameController.getSize() / 2) + 1),keyboard.fixedButtonsCount)); keyboard.setRowCount(3); Point p = new Point(); getWindowManager().getDefaultDisplay().getSize(p); 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 1c98772..7785c09 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 @@ -20,6 +20,7 @@ public class SudokuKeyboardLayout extends GridLayout { AttributeSet attrs; SudokuButton [] buttons; SudokuButton [] fixedButtons; + public int fixedButtonsCount = 6; GameController gameController; boolean notesEnabled=false; SudokuButtonType [] fixedTypes = {SudokuButtonType.Do,SudokuButtonType.Undo,SudokuButtonType.NoteToggle,SudokuButtonType.Delete,SudokuButtonType.NumberOrCellFirst,SudokuButtonType.Hint}; @@ -78,7 +79,6 @@ public class SudokuKeyboardLayout extends GridLayout { public void setKeyBoard(int size,int width) { LayoutParams p ; - int fixedButtonsCount = 6; buttons = new SudokuButton[size]; fixedButtons = new SudokuButton[fixedButtonsCount]; int row = 0;