Hotfix für Fixed Button Row

This commit is contained in:
Gongxter 2015-11-15 12:50:12 +01:00
parent 45ed0fc2da
commit 8a170f88bf
2 changed files with 2 additions and 2 deletions

View file

@ -65,7 +65,7 @@ public class GameActivity extends AppCompatActivity implements NavigationView.On
keyboard = (SudokuKeyboardLayout) findViewById(R.id.sudokuKeyboardLayout); keyboard = (SudokuKeyboardLayout) findViewById(R.id.sudokuKeyboardLayout);
keyboard.removeAllViews(); keyboard.removeAllViews();
keyboard.setGameController(gameController); keyboard.setGameController(gameController);
keyboard.setColumnCount((gameController.getSize() / 2) + 1); keyboard.setColumnCount(Math.max(((gameController.getSize() / 2) + 1),keyboard.fixedButtonsCount));
keyboard.setRowCount(3); keyboard.setRowCount(3);
Point p = new Point(); Point p = new Point();
getWindowManager().getDefaultDisplay().getSize(p); getWindowManager().getDefaultDisplay().getSize(p);

View file

@ -20,6 +20,7 @@ public class SudokuKeyboardLayout extends GridLayout {
AttributeSet attrs; AttributeSet attrs;
SudokuButton [] buttons; SudokuButton [] buttons;
SudokuButton [] fixedButtons; SudokuButton [] fixedButtons;
public int fixedButtonsCount = 6;
GameController gameController; GameController gameController;
boolean notesEnabled=false; boolean notesEnabled=false;
SudokuButtonType [] fixedTypes = {SudokuButtonType.Do,SudokuButtonType.Undo,SudokuButtonType.NoteToggle,SudokuButtonType.Delete,SudokuButtonType.NumberOrCellFirst,SudokuButtonType.Hint}; 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) { public void setKeyBoard(int size,int width) {
LayoutParams p ; LayoutParams p ;
int fixedButtonsCount = 6;
buttons = new SudokuButton[size]; buttons = new SudokuButton[size];
fixedButtons = new SudokuButton[fixedButtonsCount]; fixedButtons = new SudokuButton[fixedButtonsCount];
int row = 0; int row = 0;