예제 #1
0
파일: Key.java 프로젝트: manhnct/myappname
 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));
 }
예제 #3
0
파일: Key.java 프로젝트: manhnct/myappname
 @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);
 }
예제 #5
0
파일: Key.java 프로젝트: manhnct/myappname
 public Drawable getPreviewIcon(KeyboardIconsSet iconSet) {
   return mPreviewIconId != ICON_UNDEFINED
       ? iconSet.getIconDrawable(mPreviewIconId)
       : iconSet.getIconDrawable(mIconId);
 }