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


Java KeyEvent.KEYCODE_PAGE_DOWN屬性代碼示例

本文整理匯總了Java中android.view.KeyEvent.KEYCODE_PAGE_DOWN屬性的典型用法代碼示例。如果您正苦於以下問題:Java KeyEvent.KEYCODE_PAGE_DOWN屬性的具體用法?Java KeyEvent.KEYCODE_PAGE_DOWN怎麽用?Java KeyEvent.KEYCODE_PAGE_DOWN使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.view.KeyEvent的用法示例。


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

示例1: playSoundEffect

/**
 * Helper method to be used for playing sound effects.
 */
@Thunk private static void playSoundEffect(int keyCode, View v) {
    switch (keyCode) {
        case KeyEvent.KEYCODE_DPAD_LEFT:
            v.playSoundEffect(SoundEffectConstants.NAVIGATION_LEFT);
            break;
        case KeyEvent.KEYCODE_DPAD_RIGHT:
            v.playSoundEffect(SoundEffectConstants.NAVIGATION_RIGHT);
            break;
        case KeyEvent.KEYCODE_DPAD_DOWN:
        case KeyEvent.KEYCODE_PAGE_DOWN:
        case KeyEvent.KEYCODE_MOVE_END:
            v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN);
            break;
        case KeyEvent.KEYCODE_DPAD_UP:
        case KeyEvent.KEYCODE_PAGE_UP:
        case KeyEvent.KEYCODE_MOVE_HOME:
            v.playSoundEffect(SoundEffectConstants.NAVIGATION_UP);
            break;
        default:
            break;
    }
}
 
開發者ID:enricocid,項目名稱:LaunchEnr,代碼行數:25,代碼來源:FocusHelper.java

示例2: playSoundEffect

/**
 * Helper method to be used for playing sound effects.
 */
@Thunk static void playSoundEffect(int keyCode, View v) {
    switch (keyCode) {
        case KeyEvent.KEYCODE_DPAD_LEFT:
            v.playSoundEffect(SoundEffectConstants.NAVIGATION_LEFT);
            break;
        case KeyEvent.KEYCODE_DPAD_RIGHT:
            v.playSoundEffect(SoundEffectConstants.NAVIGATION_RIGHT);
            break;
        case KeyEvent.KEYCODE_DPAD_DOWN:
        case KeyEvent.KEYCODE_PAGE_DOWN:
        case KeyEvent.KEYCODE_MOVE_END:
            v.playSoundEffect(SoundEffectConstants.NAVIGATION_DOWN);
            break;
        case KeyEvent.KEYCODE_DPAD_UP:
        case KeyEvent.KEYCODE_PAGE_UP:
        case KeyEvent.KEYCODE_MOVE_HOME:
            v.playSoundEffect(SoundEffectConstants.NAVIGATION_UP);
            break;
        default:
            break;
    }
}
 
開發者ID:michelelacorte,項目名稱:FlickLauncher,代碼行數:25,代碼來源:FocusHelper.java

示例3: onKeyUp

@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
    Log.d("KEYS", event.toString());
    switch (event.getKeyCode()) {
        case KeyEvent.KEYCODE_DPAD_LEFT:
        case KeyEvent.KEYCODE_PAGE_UP:
            previous();
            return true;
        case KeyEvent.KEYCODE_SPACE:
        case KeyEvent.KEYCODE_DPAD_RIGHT:
        case KeyEvent.KEYCODE_DPAD_CENTER:
        case KeyEvent.KEYCODE_PAGE_DOWN:
            advance();
            return true;
        case KeyEvent.KEYCODE_I:
        case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
        case KeyEvent.KEYCODE_PERIOD:
            display();
            return true;
        default:
            return super.onKeyUp(keyCode, event);
    }
}
 
開發者ID:StylingAndroid,項目名稱:PresenterLite,代碼行數:23,代碼來源:StandaloneDisplayActivity.java

示例4: onKey

@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT || keyCode == KeyEvent.KEYCODE_DPAD_RIGHT
            || keyCode == KeyEvent.KEYCODE_PAGE_DOWN || keyCode == KeyEvent.KEYCODE_PAGE_UP) {
        // Handle the key event just like a workspace icon would in these cases. In this case,
        // it will basically act as if there is a single icon in the top left (so you could
        // think of the fullscreen page as a focusable fullscreen widget).
        return FocusHelper.handleIconKeyEvent(v, keyCode, event);
    }
    return false;
}
 
開發者ID:enricocid,項目名稱:LaunchEnr,代碼行數:11,代碼來源:FocusHelper.java

示例5: shouldConsume

/**
 * Returns true only if this utility class handles the key code.
 */
public static boolean shouldConsume(int keyCode) {
    return (keyCode == KeyEvent.KEYCODE_DPAD_LEFT || keyCode == KeyEvent.KEYCODE_DPAD_RIGHT ||
            keyCode == KeyEvent.KEYCODE_DPAD_UP || keyCode == KeyEvent.KEYCODE_DPAD_DOWN ||
            keyCode == KeyEvent.KEYCODE_MOVE_HOME || keyCode == KeyEvent.KEYCODE_MOVE_END ||
            keyCode == KeyEvent.KEYCODE_PAGE_UP || keyCode == KeyEvent.KEYCODE_PAGE_DOWN);
}
 
開發者ID:enricocid,項目名稱:LaunchEnr,代碼行數:9,代碼來源:FocusLogic.java

示例6: shouldConsume

/**
 * Returns true only if this utility class handles the key code.
 */
public static boolean shouldConsume(int keyCode) {
    return (keyCode == KeyEvent.KEYCODE_DPAD_LEFT || keyCode == KeyEvent.KEYCODE_DPAD_RIGHT ||
            keyCode == KeyEvent.KEYCODE_DPAD_UP || keyCode == KeyEvent.KEYCODE_DPAD_DOWN ||
            keyCode == KeyEvent.KEYCODE_MOVE_HOME || keyCode == KeyEvent.KEYCODE_MOVE_END ||
            keyCode == KeyEvent.KEYCODE_PAGE_UP || keyCode == KeyEvent.KEYCODE_PAGE_DOWN ||
            keyCode == KeyEvent.KEYCODE_DEL || keyCode == KeyEvent.KEYCODE_FORWARD_DEL);
}
 
開發者ID:michelelacorte,項目名稱:FlickLauncher,代碼行數:10,代碼來源:FocusLogic.java

示例7: handleKeyEvent

public static int handleKeyEvent(int keyCode, int [][] map, int iconIdx, int pageIndex,
        int pageCount, boolean isRtl) {

    int cntX = map == null ? -1 : map.length;
    int cntY = map == null ? -1 : map[0].length;

    int newIndex = NOOP;
    switch (keyCode) {
        case KeyEvent.KEYCODE_DPAD_LEFT:
            newIndex = handleDpadHorizontal(iconIdx, cntX, cntY, map, -1 /*increment*/, isRtl);
            if (!isRtl && newIndex == NOOP && pageIndex > 0) {
                newIndex = PREVIOUS_PAGE_RIGHT_COLUMN;
            } else if (isRtl && newIndex == NOOP && pageIndex < pageCount - 1) {
                newIndex = NEXT_PAGE_RIGHT_COLUMN;
            }
            break;
        case KeyEvent.KEYCODE_DPAD_RIGHT:
            newIndex = handleDpadHorizontal(iconIdx, cntX, cntY, map, 1 /*increment*/, isRtl);
            if (!isRtl && newIndex == NOOP && pageIndex < pageCount - 1) {
                newIndex = NEXT_PAGE_LEFT_COLUMN;
            } else if (isRtl && newIndex == NOOP && pageIndex > 0) {
                newIndex = PREVIOUS_PAGE_LEFT_COLUMN;
            }
            break;
        case KeyEvent.KEYCODE_DPAD_DOWN:
            newIndex = handleDpadVertical(iconIdx, cntX, cntY, map, 1  /*increment*/);
            break;
        case KeyEvent.KEYCODE_DPAD_UP:
            newIndex = handleDpadVertical(iconIdx, cntX, cntY, map, -1  /*increment*/);
            break;
        case KeyEvent.KEYCODE_MOVE_HOME:
            newIndex = handleMoveHome();
            break;
        case KeyEvent.KEYCODE_MOVE_END:
            newIndex = handleMoveEnd();
            break;
        case KeyEvent.KEYCODE_PAGE_DOWN:
            newIndex = handlePageDown(pageIndex, pageCount);
            break;
        case KeyEvent.KEYCODE_PAGE_UP:
            newIndex = handlePageUp(pageIndex);
            break;
        default:
            break;
    }
    return newIndex;
}
 
開發者ID:enricocid,項目名稱:LaunchEnr,代碼行數:47,代碼來源:FocusLogic.java

示例8: handleKeyEvent

public static int handleKeyEvent(int keyCode, int [][] map, int iconIdx, int pageIndex,
        int pageCount, boolean isRtl) {

    int cntX = map == null ? -1 : map.length;
    int cntY = map == null ? -1 : map[0].length;

    if (DEBUG) {
        Log.v(TAG, String.format(
                "handleKeyEvent START: cntX=%d, cntY=%d, iconIdx=%d, pageIdx=%d, pageCnt=%d",
                cntX, cntY, iconIdx, pageIndex, pageCount));
    }

    int newIndex = NOOP;
    switch (keyCode) {
        case KeyEvent.KEYCODE_DPAD_LEFT:
            newIndex = handleDpadHorizontal(iconIdx, cntX, cntY, map, -1 /*increment*/, isRtl);
            if (!isRtl && newIndex == NOOP && pageIndex > 0) {
                newIndex = PREVIOUS_PAGE_RIGHT_COLUMN;
            } else if (isRtl && newIndex == NOOP && pageIndex < pageCount - 1) {
                newIndex = NEXT_PAGE_RIGHT_COLUMN;
            }
            break;
        case KeyEvent.KEYCODE_DPAD_RIGHT:
            newIndex = handleDpadHorizontal(iconIdx, cntX, cntY, map, 1 /*increment*/, isRtl);
            if (!isRtl && newIndex == NOOP && pageIndex < pageCount - 1) {
                newIndex = NEXT_PAGE_LEFT_COLUMN;
            } else if (isRtl && newIndex == NOOP && pageIndex > 0) {
                newIndex = PREVIOUS_PAGE_LEFT_COLUMN;
            }
            break;
        case KeyEvent.KEYCODE_DPAD_DOWN:
            newIndex = handleDpadVertical(iconIdx, cntX, cntY, map, 1  /*increment*/);
            break;
        case KeyEvent.KEYCODE_DPAD_UP:
            newIndex = handleDpadVertical(iconIdx, cntX, cntY, map, -1  /*increment*/);
            break;
        case KeyEvent.KEYCODE_MOVE_HOME:
            newIndex = handleMoveHome();
            break;
        case KeyEvent.KEYCODE_MOVE_END:
            newIndex = handleMoveEnd();
            break;
        case KeyEvent.KEYCODE_PAGE_DOWN:
            newIndex = handlePageDown(pageIndex, pageCount);
            break;
        case KeyEvent.KEYCODE_PAGE_UP:
            newIndex = handlePageUp(pageIndex);
            break;
        default:
            break;
    }

    if (DEBUG) {
        Log.v(TAG, String.format("handleKeyEvent FINISH: index [%d -> %s]",
                iconIdx, getStringIndex(newIndex)));
    }
    return newIndex;
}
 
開發者ID:michelelacorte,項目名稱:FlickLauncher,代碼行數:58,代碼來源:FocusLogic.java


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