aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-12-16 12:47:34 +0900
committerTadashi G. Takaoka <takaoka@google.com>2011-12-16 12:47:34 +0900
commit0b6237da9456daa2fa9d94e57491445032233ea0 (patch)
treeafc5b759c11a3558cca4f8d82bdc940117b885d4 /java/src
parente9a0efc242f3bca80e8f64523a7bade659c28069 (diff)
downloadlatinime-0b6237da9456daa2fa9d94e57491445032233ea0.tar.gz
latinime-0b6237da9456daa2fa9d94e57491445032233ea0.tar.xz
latinime-0b6237da9456daa2fa9d94e57491445032233ea0.zip
Make Key.mPreviewIcon public final
Change-Id: I280b1fa6a018e095e9b36ea5475dde68e0965350
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/keyboard/Key.java13
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardView.java2
2 files changed, 5 insertions, 10 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java
index 4e4ccef18..42d1fe1ac 100644
--- a/java/src/com/android/inputmethod/keyboard/Key.java
+++ b/java/src/com/android/inputmethod/keyboard/Key.java
@@ -73,10 +73,11 @@ public class Key {
private static final int LABEL_FLAGS_WITH_ICON_RIGHT = 0x2000;
private static final int LABEL_FLAGS_AUTO_X_SCALE = 0x4000;
+ // TODO: This should be public final
/** Icon to display instead of a label. Icon takes precedence over a label */
private Drawable mIcon;
/** Preview version of the icon, for the preview popup */
- private Drawable mPreviewIcon;
+ public final Drawable mPreviewIcon;
/** Width of the key, not including the gap */
public final int mWidth;
@@ -198,6 +199,7 @@ public class Key {
mCode = code;
mAltCode = Keyboard.CODE_DUMMY;
mIcon = icon;
+ mPreviewIcon = null;
// Horizontal gap is divided equally to both sides of the key.
mX = x + mHorizontalGap / 2;
mY = y;
@@ -425,18 +427,11 @@ public class Key {
return mIcon;
}
- public Drawable getPreviewIcon() {
- return mPreviewIcon;
- }
-
+ // TODO: Get rid of this method.
public void setIcon(Drawable icon) {
mIcon = icon;
}
- public void setPreviewIcon(Drawable icon) {
- mPreviewIcon = icon;
- }
-
/**
* Informs the key that it has been pressed, in case it needs to change its appearance or
* state.
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
index d2741edec..ebc0d82b2 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
@@ -889,7 +889,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
}
previewText.setText(mKeyboard.adjustLabelCase(key.mLabel));
} else {
- final Drawable previewIcon = key.getPreviewIcon();
+ final Drawable previewIcon = key.mPreviewIcon;
previewText.setCompoundDrawables(null, null, null,
previewIcon != null ? previewIcon : key.getIcon());
previewText.setText(null);