From 8a170f88bffef15ee00460efe70a7190d79baccd Mon Sep 17 00:00:00 2001 From: Gongxter Date: Sun, 15 Nov 2015 12:50:12 +0100 Subject: [PATCH] =?UTF-8?q?Hotfix=20f=C3=BCr=20Fixed=20Button=20Row?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/tu_darmstadt/sudoku/ui/GameActivity.java | 2 +- .../java/tu_darmstadt/sudoku/ui/view/SudokuKeyboardLayout.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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;