當前位置: 首頁>>代碼示例>>Java>>正文


Java KeyData類代碼示例

本文整理匯總了Java中android.view.KeyCharacterMap.KeyData的典型用法代碼示例。如果您正苦於以下問題:Java KeyData類的具體用法?Java KeyData怎麽用?Java KeyData使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


KeyData類屬於android.view.KeyCharacterMap包,在下文中一共展示了KeyData類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: findItemsWithShortcutForKey

import android.view.KeyCharacterMap.KeyData; //導入依賴的package包/類
void findItemsWithShortcutForKey(List<MenuItemImpl> items, int keyCode, KeyEvent event) {
    boolean qwerty = isQwertyMode();
    int metaState = event.getMetaState();
    KeyData possibleChars = new KeyData();
    if (event.getKeyData(possibleChars) || keyCode == 67) {
        int N = this.mItems.size();
        for (int i = 0; i < N; i++) {
            MenuItemImpl item = (MenuItemImpl) this.mItems.get(i);
            if (item.hasSubMenu()) {
                ((MenuBuilder) item.getSubMenu()).findItemsWithShortcutForKey(items, keyCode, event);
            }
            char shortcutChar = qwerty ? item.getAlphabeticShortcut() : item.getNumericShortcut();
            if ((metaState & 5) == 0 && shortcutChar != '\u0000' && ((shortcutChar == possibleChars.meta[0] || shortcutChar == possibleChars.meta[2] || (qwerty && shortcutChar == '\b' && keyCode == 67)) && item.isEnabled())) {
                items.add(item);
            }
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:19,代碼來源:MenuBuilder.java

示例2: findItemWithShortcutForKey

import android.view.KeyCharacterMap.KeyData; //導入依賴的package包/類
MenuItemImpl findItemWithShortcutForKey(int keyCode, KeyEvent event) {
    ArrayList<MenuItemImpl> items = this.mTempShortcutItemList;
    items.clear();
    findItemsWithShortcutForKey(items, keyCode, event);
    if (items.isEmpty()) {
        return null;
    }
    int metaState = event.getMetaState();
    KeyData possibleChars = new KeyData();
    event.getKeyData(possibleChars);
    int size = items.size();
    if (size == 1) {
        return (MenuItemImpl) items.get(0);
    }
    boolean qwerty = isQwertyMode();
    for (int i = 0; i < size; i++) {
        MenuItemImpl item = (MenuItemImpl) items.get(i);
        char shortcutChar = qwerty ? item.getAlphabeticShortcut() : item.getNumericShortcut();
        if ((shortcutChar == possibleChars.meta[0] && (metaState & 2) == 0) || ((shortcutChar == possibleChars.meta[2] && (metaState & 2) != 0) || (qwerty && shortcutChar == '\b' && keyCode == 67))) {
            return item;
        }
    }
    return null;
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:25,代碼來源:MenuBuilder.java

示例3: m2114a

import android.view.KeyCharacterMap.KeyData; //導入依賴的package包/類
void m2114a(List list, int i, KeyEvent keyEvent) {
    boolean b = m2124b();
    int metaState = keyEvent.getMetaState();
    KeyData keyData = new KeyData();
    if (keyEvent.getKeyData(keyData) || i == 67) {
        int size = this.f966j.size();
        for (int i2 = 0; i2 < size; i2++) {
            C0272m c0272m = (C0272m) this.f966j.get(i2);
            if (c0272m.hasSubMenu()) {
                ((C0264i) c0272m.getSubMenu()).m2114a(list, i, keyEvent);
            }
            char alphabeticShortcut = b ? c0272m.getAlphabeticShortcut() : c0272m.getNumericShortcut();
            if ((metaState & 5) == 0 && alphabeticShortcut != '\u0000' && ((alphabeticShortcut == keyData.meta[0] || alphabeticShortcut == keyData.meta[2] || (b && alphabeticShortcut == '\b' && i == 67)) && c0272m.isEnabled())) {
                list.add(c0272m);
            }
        }
    }
}
 
開發者ID:Qwaz,項目名稱:solved-hacking-problem,代碼行數:19,代碼來源:C0264i.java

示例4: m2105a

import android.view.KeyCharacterMap.KeyData; //導入依賴的package包/類
C0272m m2105a(int i, KeyEvent keyEvent) {
    List list = this.f978v;
    list.clear();
    m2114a(list, i, keyEvent);
    if (list.isEmpty()) {
        return null;
    }
    int metaState = keyEvent.getMetaState();
    KeyData keyData = new KeyData();
    keyEvent.getKeyData(keyData);
    int size = list.size();
    if (size == 1) {
        return (C0272m) list.get(0);
    }
    boolean b = m2124b();
    for (int i2 = 0; i2 < size; i2++) {
        C0272m c0272m = (C0272m) list.get(i2);
        char alphabeticShortcut = b ? c0272m.getAlphabeticShortcut() : c0272m.getNumericShortcut();
        if (alphabeticShortcut == keyData.meta[0] && (metaState & 2) == 0) {
            return c0272m;
        }
        if (alphabeticShortcut == keyData.meta[2] && (metaState & 2) != 0) {
            return c0272m;
        }
        if (b && alphabeticShortcut == '\b' && i == 67) {
            return c0272m;
        }
    }
    return null;
}
 
開發者ID:Qwaz,項目名稱:solved-hacking-problem,代碼行數:31,代碼來源:C0264i.java

示例5: findItemWithShortcutForKey

import android.view.KeyCharacterMap.KeyData; //導入依賴的package包/類
private MenuItemImpl findItemWithShortcutForKey(int paramInt, KeyEvent paramKeyEvent)
{
  ArrayList localArrayList = this.mTempShortcutItemList;
  localArrayList.clear();
  findItemsWithShortcutForKey(localArrayList, paramInt, paramKeyEvent);
  if (localArrayList.isEmpty()) {}
  for (;;)
  {
    return null;
    int i = paramKeyEvent.getMetaState();
    KeyCharacterMap.KeyData localKeyData = new KeyCharacterMap.KeyData();
    paramKeyEvent.getKeyData(localKeyData);
    int j = localArrayList.size();
    if (j == 1) {
      return (MenuItemImpl)localArrayList.get(0);
    }
    boolean bool = isQwertyMode();
    for (int k = 0; k < j; k++)
    {
      MenuItemImpl localMenuItemImpl = (MenuItemImpl)localArrayList.get(k);
      if (bool) {}
      for (int m = localMenuItemImpl.getAlphabeticShortcut(); ((m == localKeyData.meta[0]) && ((i & 0x2) == 0)) || ((m == localKeyData.meta[2]) && ((i & 0x2) != 0)) || ((bool) && (m == 8) && (paramInt == 67)); m = localMenuItemImpl.getNumericShortcut()) {
        return localMenuItemImpl;
      }
    }
  }
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:28,代碼來源:MenuBuilder.java

示例6: a

import android.view.KeyCharacterMap.KeyData; //導入依賴的package包/類
private xp a(int paramInt, KeyEvent paramKeyEvent)
{
  ArrayList localArrayList = this.x;
  localArrayList.clear();
  a(localArrayList, paramInt, paramKeyEvent);
  xp localxp;
  if (localArrayList.isEmpty()) {
    localxp = null;
  }
  label181:
  for (;;)
  {
    return localxp;
    int i1 = paramKeyEvent.getMetaState();
    KeyCharacterMap.KeyData localKeyData = new KeyCharacterMap.KeyData();
    paramKeyEvent.getKeyData(localKeyData);
    int i2 = localArrayList.size();
    if (i2 == 1) {
      return (xp)localArrayList.get(0);
    }
    boolean bool = b();
    int i3 = 0;
    if (i3 >= i2) {
      break;
    }
    localxp = (xp)localArrayList.get(i3);
    if (bool) {}
    for (int i4 = localxp.getAlphabeticShortcut();; i4 = localxp.getNumericShortcut())
    {
      if (((i4 == localKeyData.meta[0]) && ((i1 & 0x2) == 0)) || ((i4 == localKeyData.meta[2]) && ((i1 & 0x2) != 0)) || ((bool) && (i4 == 8) && (paramInt == 67))) {
        break label181;
      }
      i3++;
      break;
    }
  }
  return null;
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:39,代碼來源:xl.java


注:本文中的android.view.KeyCharacterMap.KeyData類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。