Merge remote-tracking branch 'origin/master'
Conflicts: app/src/main/java/tu_darmstadt/sudoku/controller/Symbol.java
This commit is contained in:
commit
c7e7f1d88c
3 changed files with 23 additions and 4 deletions
|
@ -29,4 +29,5 @@ public enum Symbol {
|
|||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package tu_darmstadt.sudoku.ui.view;
|
|||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.widget.GridLayout;
|
||||
|
@ -22,6 +23,7 @@ public class SudokuKeyboardLayout extends GridLayout {
|
|||
GameController gameController;
|
||||
boolean notesEnabled=false;
|
||||
Symbol symbolsToUse = Symbol.Default;
|
||||
float normalTextSize = 0;
|
||||
|
||||
OnClickListener listener = new OnClickListener() {
|
||||
@Override
|
||||
|
@ -83,17 +85,18 @@ public class SudokuKeyboardLayout extends GridLayout {
|
|||
|
||||
public void toggleNotesEnabled() {
|
||||
notesEnabled = !notesEnabled;
|
||||
if (normalTextSize == 0) {normalTextSize = buttons[0].getTextSize();}
|
||||
if(notesEnabled) {
|
||||
setTextSize(buttons[0].getPaint().getTextSize()/2);
|
||||
setTextSize(normalTextSize*0.6f);
|
||||
}else {
|
||||
setTextSize(buttons[0].getPaint().getTextSize()*2);
|
||||
setTextSize(normalTextSize);
|
||||
}
|
||||
}
|
||||
|
||||
private void setTextSize(float size){
|
||||
for (SudokuButton b : buttons){
|
||||
//b.setTextSize(size);
|
||||
b.getPaint().setTextSize(size);
|
||||
b.setTextSize(TypedValue.COMPLEX_UNIT_PX,size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,22 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay" />
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay" >
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="test"
|
||||
android:id="@+id/time"
|
||||
android:gravity="right"
|
||||
android:layout_marginRight="@dimen/activity_horizontal_margin"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="testMode"
|
||||
android:id="@+id/gameModeText"
|
||||
android:gravity="center" />
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
|
|
Loading…
Reference in a new issue