am deb5cedf: Add Key.getIconId for testability
* commit 'deb5cedf811e6d605a4a2a934f4d0c75b880cede': Add Key.getIconId for testabilitymain
commit
5d2c961ed6
|
@ -716,10 +716,14 @@ public class Key implements Comparable<Key> {
|
|||
return (attrs != null) ? attrs.mAltCode : CODE_UNSPECIFIED;
|
||||
}
|
||||
|
||||
public int getIconId() {
|
||||
return mIconId;
|
||||
}
|
||||
|
||||
public Drawable getIcon(final KeyboardIconsSet iconSet, final int alpha) {
|
||||
final OptionalAttributes attrs = mOptionalAttributes;
|
||||
final int disabledIconId = (attrs != null) ? attrs.mDisabledIconId : ICON_UNDEFINED;
|
||||
final int iconId = mEnabled ? mIconId : disabledIconId;
|
||||
final int iconId = mEnabled ? getIconId() : disabledIconId;
|
||||
final Drawable icon = iconSet.getIconDrawable(iconId);
|
||||
if (icon != null) {
|
||||
icon.setAlpha(alpha);
|
||||
|
@ -731,7 +735,7 @@ public class Key implements Comparable<Key> {
|
|||
final OptionalAttributes attrs = mOptionalAttributes;
|
||||
final int previewIconId = (attrs != null) ? attrs.mPreviewIconId : ICON_UNDEFINED;
|
||||
return previewIconId != ICON_UNDEFINED
|
||||
? iconSet.getIconDrawable(previewIconId) : iconSet.getIconDrawable(mIconId);
|
||||
? iconSet.getIconDrawable(previewIconId) : iconSet.getIconDrawable(getIconId());
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
|
|
|
@ -102,7 +102,7 @@ public final class KeyboardIconsSet {
|
|||
return isValidIconId(iconId) ? ICON_NAMES[iconId] : "unknown<" + iconId + ">";
|
||||
}
|
||||
|
||||
static int getIconId(final String name) {
|
||||
public static int getIconId(final String name) {
|
||||
Integer iconId = sNameToIdsMap.get(name);
|
||||
if (iconId != null) {
|
||||
return iconId;
|
||||
|
|
Loading…
Reference in New Issue