コード例 #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));
 }
コード例 #4
0
 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);
 }