Merge remote-tracking branch 'origin/master'

Conflicts:
	app/src/main/java/tu_darmstadt/sudoku/controller/Symbol.java
This commit is contained in:
Christopher Beckmann 2015-11-19 13:41:33 +01:00
commit c7e7f1d88c
3 changed files with 23 additions and 4 deletions

View file

@ -29,4 +29,5 @@ public enum Symbol {
} }
return -1; return -1;
} }
} }

View file

@ -3,6 +3,7 @@ package tu_darmstadt.sudoku.ui.view;
import android.content.Context; import android.content.Context;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.Gravity; import android.view.Gravity;
import android.view.View; import android.view.View;
import android.widget.GridLayout; import android.widget.GridLayout;
@ -22,6 +23,7 @@ public class SudokuKeyboardLayout extends GridLayout {
GameController gameController; GameController gameController;
boolean notesEnabled=false; boolean notesEnabled=false;
Symbol symbolsToUse = Symbol.Default; Symbol symbolsToUse = Symbol.Default;
float normalTextSize = 0;
OnClickListener listener = new OnClickListener() { OnClickListener listener = new OnClickListener() {
@Override @Override
@ -83,17 +85,18 @@ public class SudokuKeyboardLayout extends GridLayout {
public void toggleNotesEnabled() { public void toggleNotesEnabled() {
notesEnabled = !notesEnabled; notesEnabled = !notesEnabled;
if (normalTextSize == 0) {normalTextSize = buttons[0].getTextSize();}
if(notesEnabled) { if(notesEnabled) {
setTextSize(buttons[0].getPaint().getTextSize()/2); setTextSize(normalTextSize*0.6f);
}else { }else {
setTextSize(buttons[0].getPaint().getTextSize()*2); setTextSize(normalTextSize);
} }
} }
private void setTextSize(float size){ private void setTextSize(float size){
for (SudokuButton b : buttons){ for (SudokuButton b : buttons){
//b.setTextSize(size); //b.setTextSize(size);
b.getPaint().setTextSize(size); b.setTextSize(TypedValue.COMPLEX_UNIT_PX,size);
} }
} }

View file

@ -17,7 +17,22 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary" 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> </android.support.design.widget.AppBarLayout>