Small fix to KeyboardView

Change-Id: Ifb7500ec2e55b50bb7951aa847fd4fbf49e32f4e
main
Tadashi G. Takaoka 2012-07-30 16:50:03 +09:00
parent efd8b838ee
commit edf7990e84
1 changed files with 11 additions and 6 deletions

View File

@ -255,10 +255,12 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
} }
public void updateKeyHeight(int keyHeight) { public void updateKeyHeight(int keyHeight) {
if (mKeyLetterRatio >= 0.0f) if (mKeyLetterRatio >= 0.0f) {
mKeyLetterSize = (int)(keyHeight * mKeyLetterRatio); mKeyLetterSize = (int)(keyHeight * mKeyLetterRatio);
if (mKeyLabelRatio >= 0.0f) }
if (mKeyLabelRatio >= 0.0f) {
mKeyLabelSize = (int)(keyHeight * mKeyLabelRatio); mKeyLabelSize = (int)(keyHeight * mKeyLabelRatio);
}
mKeyLargeLabelSize = (int)(keyHeight * mKeyLargeLabelRatio); mKeyLargeLabelSize = (int)(keyHeight * mKeyLargeLabelRatio);
mKeyLargeLetterSize = (int)(keyHeight * mKeyLargeLetterRatio); mKeyLargeLetterSize = (int)(keyHeight * mKeyLargeLetterRatio);
mKeyHintLetterSize = (int)(keyHeight * mKeyHintLetterRatio); mKeyHintLetterSize = (int)(keyHeight * mKeyHintLetterRatio);
@ -340,13 +342,16 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
} }
public void updateKeyHeight(int keyHeight) { public void updateKeyHeight(int keyHeight) {
mPreviewTextSize = (int)(keyHeight * mPreviewTextRatio); if (mPreviewTextRatio >= 0.0f) {
mKeyLetterSize = (int)(keyHeight * mKeyLetterRatio); mPreviewTextSize = (int)(keyHeight * mPreviewTextRatio);
}
if (mKeyLetterRatio >= 0.0f) {
mKeyLetterSize = (int)(keyHeight * mKeyLetterRatio);
}
} }
private static void setAlpha(Drawable drawable, int alpha) { private static void setAlpha(Drawable drawable, int alpha) {
if (drawable == null) if (drawable == null) return;
return;
drawable.setAlpha(alpha); drawable.setAlpha(alpha);
} }
} }