public Drawable getIcon(KeyboardIconsSet iconSet, int alpha) { final int iconId = mEnabled ? mIconId : mDisabledIconId; final Drawable icon = iconSet.getIconDrawable(iconId); if (icon != null) { icon.setAlpha(alpha); } return icon; }
private void assertParser( String message, String moreKeySpec, String expectedLabel, String expectedOutputText, int expectedIcon, int expectedCode) { final String labelResolved = KeySpecParser.resolveTextReference(moreKeySpec, mTextsSet); final MoreKeySpec spec = new MoreKeySpec(labelResolved, false /* needsToUpperCase */, Locale.US, mCodesSet); assertEquals(message + " [label]", expectedLabel, spec.mLabel); assertEquals(message + " [ouptputText]", expectedOutputText, spec.mOutputText); assertEquals( message + " [icon]", KeyboardIconsSet.getIconName(expectedIcon), KeyboardIconsSet.getIconName(spec.mIconId)); assertEquals( message + " [code]", Keyboard.printableCode(expectedCode), Keyboard.printableCode(spec.mCode)); }
@Override public String toString() { return String.format( "%s/%s %d,%d %dx%d %s/%s/%s", Keyboard.printableCode(mCode), mLabel, mX, mY, mWidth, mHeight, mHintLabel, KeyboardIconsSet.getIconName(mIconId), backgroundName(mBackgroundType)); }
public ExpectedMoreKey(final String iconName) { mLabelResId = NO_LABEL; mIconId = KeyboardIconsSet.getIconId(iconName); }
public Drawable getPreviewIcon(KeyboardIconsSet iconSet) { return mPreviewIconId != ICON_UNDEFINED ? iconSet.getIconDrawable(mPreviewIconId) : iconSet.getIconDrawable(mIconId); }