• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java KeyboardShortcutGroup类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中android.view.KeyboardShortcutGroup的典型用法代码示例。如果您正苦于以下问题:Java KeyboardShortcutGroup类的具体用法?Java KeyboardShortcutGroup怎么用?Java KeyboardShortcutGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



KeyboardShortcutGroup类属于android.view包,在下文中一共展示了KeyboardShortcutGroup类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onProvideKeyboardShortcuts

import android.view.KeyboardShortcutGroup; //导入依赖的package包/类
@Override
@TargetApi(Build.VERSION_CODES.N)
public void onProvideKeyboardShortcuts(
        List<KeyboardShortcutGroup> data, Menu menu, int deviceId) {

    ArrayList<KeyboardShortcutInfo> shortcutInfos = new ArrayList<>();
    if (mState == State.WORKSPACE) {
        shortcutInfos.add(new KeyboardShortcutInfo(getString(R.string.all_apps_button_label),
                KeyEvent.KEYCODE_A, KeyEvent.META_CTRL_ON));
    }
    View currentFocus = getCurrentFocus();
    if (new CustomActionsPopup(this, currentFocus).canShow()) {
        shortcutInfos.add(new KeyboardShortcutInfo(getString(R.string.custom_actions),
                KeyEvent.KEYCODE_O, KeyEvent.META_CTRL_ON));
    }
    if (currentFocus.getTag() instanceof ItemInfo
            && DeepShortcutManager.supportsShortcuts((ItemInfo) currentFocus.getTag())) {
        shortcutInfos.add(new KeyboardShortcutInfo(getString(R.string.action_deep_shortcut),
                KeyEvent.KEYCODE_S, KeyEvent.META_CTRL_ON));
    }
    if (!shortcutInfos.isEmpty()) {
        data.add(new KeyboardShortcutGroup(getString(R.string.home_screen), shortcutInfos));
    }

    super.onProvideKeyboardShortcuts(data, menu, deviceId);
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:27,代码来源:Launcher.java


示例2: onProvideKeyboardShortcuts

import android.view.KeyboardShortcutGroup; //导入依赖的package包/类
public void onProvideKeyboardShortcuts(final List<KeyboardShortcutGroup> data, final Menu menu,
        final int deviceId) {
    verifyMethodCalledFromDelegate(
            "onProvideKeyboardShortcuts(List<KeyboardShortcutGroup>, Menu, Integer)");
    ((CallVoid3<List<KeyboardShortcutGroup>, Menu, Integer>) mSuperListeners.pop())
            .call(data, menu, deviceId);
}
 
开发者ID:passsy,项目名称:CompositeAndroid,代码行数:8,代码来源:ActivityPlugin.java


示例3: onProvideKeyboardShortcuts

import android.view.KeyboardShortcutGroup; //导入依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.N)
@Override
public void onProvideKeyboardShortcuts(List<KeyboardShortcutGroup> data, @Nullable Menu menu, int deviceId) {
    mCallback.onProvideKeyboardShortcuts(data, menu, deviceId);
}
 
开发者ID:316boss,项目名称:TopNotification,代码行数:6,代码来源:AbstractWindowCallback.java


示例4: onProvideKeyboardShortcuts

import android.view.KeyboardShortcutGroup; //导入依赖的package包/类
@Override
public void onProvideKeyboardShortcuts(List<KeyboardShortcutGroup> data, Menu menu, int deviceId) {
    super.onProvideKeyboardShortcuts(data, menu, deviceId);
}
 
开发者ID:google,项目名称:spline,代码行数:5,代码来源:EditorActivity.java


示例5: onProvideKeyboardShortcuts

import android.view.KeyboardShortcutGroup; //导入依赖的package包/类
@Override
public void onProvideKeyboardShortcuts(final List<KeyboardShortcutGroup> data, final Menu menu,
        final int deviceId) {
    super.onProvideKeyboardShortcuts(data, menu, deviceId);
}
 
开发者ID:passsy,项目名称:CompositeAndroid,代码行数:6,代码来源:BlueprintActivity.java


示例6: onProvideKeyboardShortcuts

import android.view.KeyboardShortcutGroup; //导入依赖的package包/类
@Override
public void onProvideKeyboardShortcuts(final List<KeyboardShortcutGroup> data, final Menu menu,
        final int deviceId) {
    delegate.onProvideKeyboardShortcuts(data, menu, deviceId);
}
 
开发者ID:passsy,项目名称:CompositeAndroid,代码行数:6,代码来源:CompositeActivity.java


示例7: super_onProvideKeyboardShortcuts

import android.view.KeyboardShortcutGroup; //导入依赖的package包/类
@Override
public void super_onProvideKeyboardShortcuts(final List<KeyboardShortcutGroup> data,
        final Menu menu, final int deviceId) {
    super.onProvideKeyboardShortcuts(data, menu, deviceId);
}
 
开发者ID:passsy,项目名称:CompositeAndroid,代码行数:6,代码来源:CompositeActivity.java


示例8: onProvideKeyboardShortcuts

import android.view.KeyboardShortcutGroup; //导入依赖的package包/类
void onProvideKeyboardShortcuts(final List<KeyboardShortcutGroup> data, final Menu menu,
final int deviceId);
 
开发者ID:passsy,项目名称:CompositeAndroid,代码行数:3,代码来源:ICompositeActivity.java


示例9: super_onProvideKeyboardShortcuts

import android.view.KeyboardShortcutGroup; //导入依赖的package包/类
void super_onProvideKeyboardShortcuts(final List<KeyboardShortcutGroup> data, final Menu menu,
final int deviceId);
 
开发者ID:passsy,项目名称:CompositeAndroid,代码行数:3,代码来源:ICompositeActivity.java


示例10: onProvideKeyboardShortcuts

import android.view.KeyboardShortcutGroup; //导入依赖的package包/类
@Override
public void onProvideKeyboardShortcuts(List<KeyboardShortcutGroup> data, Menu menu,
        int deviceId) {
    data.addAll(KeyboardShortcuts.createShortcutGroup(this));
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:6,代码来源:ChromeTabbedActivity.java


示例11: createShortcutGroup

import android.view.KeyboardShortcutGroup; //导入依赖的package包/类
/**
 * This method should be called when overriding from
 * {@link android.app.Activity#onProvideKeyboardShortcuts(List, android.view.Menu, int)}
 * in an activity. It will return a list of the possible shortcuts. If
 * someone adds a shortcut they also need to add an explanation in the
 * appropriate group in this method so the user can see it when this method
 * is called.
 *
 * @param context We need an activity so we can call the strings from our
 *            resource.
 * @return a list of shortcuts organized into groups.
 */
@TargetApi(Build.VERSION_CODES.N)
public static List<KeyboardShortcutGroup> createShortcutGroup(Context context) {

    final int ctrlShift = KeyEvent.META_CTRL_ON | KeyEvent.META_SHIFT_ON;

    List<KeyboardShortcutGroup> shortcutGroups = new ArrayList<>();

    KeyboardShortcutGroup tabShortcutGroup = new KeyboardShortcutGroup(
            context.getString(R.string.keyboard_shortcut_tab_group_header));
    addShortcut(context, tabShortcutGroup, R.string.keyboard_shortcut_open_new_tab,
            KeyEvent.KEYCODE_N, KeyEvent.META_CTRL_ON);
    addShortcut(context, tabShortcutGroup, R.string.keyboard_shortcut_reopen_new_tab,
            KeyEvent.KEYCODE_T, ctrlShift);
    addShortcut(context, tabShortcutGroup, R.string.keyboard_shortcut_new_incognito_tab,
            KeyEvent.KEYCODE_N, ctrlShift);
    addShortcut(context, tabShortcutGroup, R.string.keyboard_shortcut_next_tab,
            KeyEvent.KEYCODE_TAB, KeyEvent.META_CTRL_ON);
    addShortcut(context, tabShortcutGroup, R.string.keyboard_shortcut_prev_tab,
            KeyEvent.KEYCODE_TAB, ctrlShift);
    addShortcut(context, tabShortcutGroup, R.string.keyboard_shortcut_close_tab,
            KeyEvent.KEYCODE_W, KeyEvent.META_CTRL_ON);
    shortcutGroups.add(tabShortcutGroup);

    KeyboardShortcutGroup chromeFeatureShortcutGroup = new KeyboardShortcutGroup(
            context.getString(R.string.keyboard_shortcut_chrome_feature_group_header));
    addShortcut(context, chromeFeatureShortcutGroup, R.string.keyboard_shortcut_open_menu,
            KeyEvent.KEYCODE_E, KeyEvent.META_ALT_ON);
    addShortcut(context, chromeFeatureShortcutGroup,
            R.string.keyboard_shortcut_bookmark_manager, KeyEvent.KEYCODE_B, ctrlShift);
    addShortcut(context, chromeFeatureShortcutGroup, R.string.keyboard_shortcut_history_manager,
            KeyEvent.KEYCODE_H, KeyEvent.META_CTRL_ON);
    addShortcut(context, chromeFeatureShortcutGroup, R.string.keyboard_shortcut_find_bar,
            KeyEvent.KEYCODE_F, KeyEvent.META_CTRL_ON);
    addShortcut(context, chromeFeatureShortcutGroup, R.string.keyboard_shortcut_address_bar,
            KeyEvent.KEYCODE_L, KeyEvent.META_CTRL_ON);
    shortcutGroups.add(chromeFeatureShortcutGroup);

    KeyboardShortcutGroup webpageShortcutGroup = new KeyboardShortcutGroup(
            context.getString(R.string.keyboard_shortcut_webpage_group_header));
    addShortcut(context, webpageShortcutGroup, R.string.keyboard_shortcut_print_page,
            KeyEvent.KEYCODE_P, KeyEvent.META_CTRL_ON);
    addShortcut(context, webpageShortcutGroup, R.string.keyboard_shortcut_reload_page,
            KeyEvent.KEYCODE_R, KeyEvent.META_CTRL_ON);
    addShortcut(context, webpageShortcutGroup, R.string.keyboard_shortcut_reload_no_cache,
            KeyEvent.KEYCODE_R, ctrlShift);
    addShortcut(context, webpageShortcutGroup, R.string.keyboard_shortcut_bookmark_page,
            KeyEvent.KEYCODE_D, KeyEvent.META_CTRL_ON);
    addShortcut(context, webpageShortcutGroup, R.string.keyboard_shortcut_zoom_in,
            KeyEvent.KEYCODE_EQUALS, KeyEvent.META_CTRL_ON);
    addShortcut(context, webpageShortcutGroup, R.string.keyboard_shortcut_zoom_out,
            KeyEvent.KEYCODE_MINUS, KeyEvent.META_CTRL_ON);
    addShortcut(context, webpageShortcutGroup, R.string.keyboard_shortcut_reset_zoom,
            KeyEvent.KEYCODE_0, KeyEvent.META_CTRL_ON);
    addShortcut(context, webpageShortcutGroup, R.string.keyboard_shortcut_help_center,
            KeyEvent.KEYCODE_SLASH, ctrlShift);
    shortcutGroups.add(webpageShortcutGroup);

    return shortcutGroups;
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:72,代码来源:KeyboardShortcuts.java


示例12: addShortcut

import android.view.KeyboardShortcutGroup; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.N)
private static void addShortcut(Context context,
        KeyboardShortcutGroup shortcutGroup, int resId, int keyCode, int keyModifier) {
    shortcutGroup.addItem(new KeyboardShortcutInfo(context.getString(resId), keyCode,
            keyModifier));
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:7,代码来源:KeyboardShortcuts.java


示例13: onProvideKeyboardShortcuts

import android.view.KeyboardShortcutGroup; //导入依赖的package包/类
@Override
public void onProvideKeyboardShortcuts(List<KeyboardShortcutGroup> data, @Nullable Menu menu, int deviceId) {

}
 
开发者ID:SiberiaDante,项目名称:CustomDialog,代码行数:5,代码来源:CustomDialog.java



注:本文中的android.view.KeyboardShortcutGroup类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ConstraintMapping类代码示例发布时间:2022-05-23
下一篇:
Java OfflineRegion类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap