aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java28
1 files changed, 26 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
index 64299b626..6b8d4f890 100644
--- a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
+++ b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
@@ -165,6 +165,8 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener
private Map<Key,View> mMiniKeyboardCache;
private int[] mWindowOffset;
private Key[] mKeys;
+ private Typeface mKeyTextStyle = Typeface.DEFAULT;
+ private int mSymbolColorScheme = 0;
/** Listener for {@link OnKeyboardActionListener}. */
private OnKeyboardActionListener mKeyboardActionListener;
@@ -334,6 +336,24 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener
case R.styleable.LatinKeyboardBaseView_backgroundDimAmount:
mBackgroundDimAmount = a.getFloat(attr, 0.5f);
break;
+ //case android.R.styleable.
+ case R.styleable.LatinKeyboardBaseView_keyTextStyle:
+ int textStyle = a.getInt(attr, 0);
+ switch (textStyle) {
+ case 0:
+ mKeyTextStyle = Typeface.DEFAULT;
+ break;
+ case 1:
+ mKeyTextStyle = Typeface.DEFAULT_BOLD;
+ break;
+ default:
+ mKeyTextStyle = Typeface.defaultFromStyle(textStyle);
+ break;
+ }
+ break;
+ case R.styleable.LatinKeyboardBaseView_symbolColorScheme:
+ mSymbolColorScheme = a.getInt(attr, 0);
+ break;
}
}
@@ -526,6 +546,10 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener
return mShowPreview;
}
+ public int getSymbolColorSheme() {
+ return mSymbolColorScheme;
+ }
+
public void setVerticalCorrection(int verticalOffset) {
}
@@ -693,7 +717,7 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener
paint.setTypeface(Typeface.DEFAULT_BOLD);
} else {
paint.setTextSize(mKeyTextSize);
- paint.setTypeface(Typeface.DEFAULT);
+ paint.setTypeface(mKeyTextStyle);
}
// Draw a drop shadow for the text
paint.setShadowLayer(mShadowRadius, 0, 0, mShadowColor);
@@ -894,7 +918,7 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener
mPreviewText.setTypeface(Typeface.DEFAULT_BOLD);
} else {
mPreviewText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mPreviewTextSizeLarge);
- mPreviewText.setTypeface(Typeface.DEFAULT);
+ mPreviewText.setTypeface(mKeyTextStyle);
}
}
mPreviewText.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),