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 6ff3c05..1ece34b 100644 --- a/app/src/main/java/tu_darmstadt/sudoku/controller/GameController.java +++ b/app/src/main/java/tu_darmstadt/sudoku/controller/GameController.java @@ -41,6 +41,16 @@ public class GameController { this.gameType = type; setGameType(type); gameField = new GameField(size, sectionHeight, sectionWidth); + setValue(0, 1, 8); setValue(0, 4, 2); + setValue(0, 5, 6); setValue(0, 6, 7); + setValue(0, 7, 3); setValue(0, 8, 4); + setNote(6, 3, 1); setNote(6, 3, 2); setNote(6, 3, 3); setNote(6, 3, 4); + setNote(6, 3, 5); setNote(6, 3, 6); setNote(6, 3, 7); setNote(6, 3, 8); + setNote(6, 3, 9); + + setNote(7, 3, 2); setNote(7, 3, 3); setNote(7, 3, 4); + setNote(7, 3, 5); setNote(7, 3, 7); setNote(7, 3, 8); + setNote(7, 3, 9); } private GameField solve(GameField gameField) { diff --git a/app/src/main/java/tu_darmstadt/sudoku/view/SudokuCellView.java b/app/src/main/java/tu_darmstadt/sudoku/view/SudokuCellView.java index da00664..afdebcf 100644 --- a/app/src/main/java/tu_darmstadt/sudoku/view/SudokuCellView.java +++ b/app/src/main/java/tu_darmstadt/sudoku/view/SudokuCellView.java @@ -10,6 +10,7 @@ import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.widget.RelativeLayout; +import android.widget.TextView; import android.widget.Toast; import java.util.jar.Attributes; @@ -120,9 +121,30 @@ public class SudokuCellView extends View { } public void drawValue(Canvas canvas) { - if(mGameCell.getValue() == 0) return; - Paint p = new Paint(); + int j= 3; + int k = 3; + if(mGameCell.getValue() == 0) { + for (int i = 0; i < mGameCell.getNotes().length; i++) { + if (mGameCell.getNotes()[i]) { + p.setTypeface(Typeface.SANS_SERIF); + p.setTextSize(mWidth * 3 / 12); + p.setTextAlign(Paint.Align.RIGHT); + canvas.drawText(String.valueOf(i+1),(mWidth*1/12)*k,(mWidth*1/12)*j,p); + k+=4; + if (k > 11) { + k = 3; + j +=4; + } + /*canvas.drawText(String.valueOf(1), (mWidth * 1 / 12)*3, (mWidth* 1 / 12)*3, p); + canvas.drawText(String.valueOf(2),(mWidth*1/12)*7, (mWidth* 1 / 12)*7,p ); + canvas.drawText(String.valueOf(3),(mWidth*1/12)*11, (mWidth* 1 / 12)*11,p );*/ + } + } + return; + } + + if (mGameCell.isFixed()) { p.setTypeface(Typeface.DEFAULT_BOLD); }