diff options
author | 2010-06-29 05:32:48 +0900 | |
---|---|---|
committer | 2010-06-29 08:41:33 +0900 | |
commit | 6c20ab55b5b33543aedf5a56ffdea0b85f9e9cb6 (patch) | |
tree | 396b3b107cf9be08509e512b5241456708386209 /java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java | |
parent | cd61cadb717264953e56db5d292bf81fa88c81b7 (diff) | |
download | latinime-6c20ab55b5b33543aedf5a56ffdea0b85f9e9cb6.tar.gz latinime-6c20ab55b5b33543aedf5a56ffdea0b85f9e9cb6.tar.xz latinime-6c20ab55b5b33543aedf5a56ffdea0b85f9e9cb6.zip |
Add a typeFace element and a symbol's color element
- add default bold theme
- add
Change-Id: Ie3f31a6973c12e7f8b885d0036f50e8647c9fe82
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java | 28 |
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), |