当前位置: 首页>>代码示例>>Java>>正文


Java ConfigurationInfo.INPUT_FEATURE_FIVE_WAY_NAV属性代码示例

本文整理汇总了Java中android.content.pm.ConfigurationInfo.INPUT_FEATURE_FIVE_WAY_NAV属性的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationInfo.INPUT_FEATURE_FIVE_WAY_NAV属性的具体用法?Java ConfigurationInfo.INPUT_FEATURE_FIVE_WAY_NAV怎么用?Java ConfigurationInfo.INPUT_FEATURE_FIVE_WAY_NAV使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.content.pm.ConfigurationInfo的用法示例。


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

示例1: getInputFeaturesString

public static String getInputFeaturesString(int flag) {
    String string = "";
    if ((flag & ConfigurationInfo.INPUT_FEATURE_FIVE_WAY_NAV) != 0)
        string += "Five way nav";
    if ((flag & ConfigurationInfo.INPUT_FEATURE_HARD_KEYBOARD) != 0)
        string += (string.length() == 0 ? "" : "|") + "Hard keyboard";
    return string.length() == 0 ? "null" : string;
}
 
开发者ID:MajeurAndroid,项目名称:Android-Applications-Info,代码行数:8,代码来源:Utils.java

示例2: DeviceConfiguration

public DeviceConfiguration(Context context) {
    ConfigurationInfo configurationInfo = ((ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE)).getDeviceConfigurationInfo();
    touchScreen = configurationInfo.reqTouchScreen;
    keyboardType = configurationInfo.reqKeyboardType;
    navigation = configurationInfo.reqNavigation;
    Configuration configuration = context.getResources().getConfiguration();
    screenLayout = configuration.screenLayout;
    hasHardKeyboard = (configurationInfo.reqInputFeatures & ConfigurationInfo.INPUT_FEATURE_HARD_KEYBOARD) > 0;
    hasFiveWayNavigation = (configurationInfo.reqInputFeatures & ConfigurationInfo.INPUT_FEATURE_FIVE_WAY_NAV) > 0;
    DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
    densityDpi = displayMetrics.densityDpi;
    glEsVersion = configurationInfo.reqGlEsVersion;
    PackageManager packageManager = context.getPackageManager();
    String[] systemSharedLibraryNames = packageManager.getSystemSharedLibraryNames();
    sharedLibraries = new ArrayList<String>();
    if (systemSharedLibraryNames != null) sharedLibraries.addAll(Arrays.asList(systemSharedLibraryNames));
    for (String s : new String[]{"com.google.android.maps", "com.google.android.media.effects", "com.google.widevine.software.drm"}) {
        if (!sharedLibraries.contains(s)) {
            sharedLibraries.add(s);
        }
    }
    Collections.sort(sharedLibraries);
    availableFeatures = new ArrayList<String>();
    if (packageManager.getSystemAvailableFeatures() != null) {
        for (FeatureInfo featureInfo : packageManager.getSystemAvailableFeatures()) {
            if (featureInfo != null && featureInfo.name != null) availableFeatures.add(featureInfo.name);
        }
    }
    Collections.sort(availableFeatures);
    this.nativePlatforms = getNativePlatforms();
    widthPixels = displayMetrics.widthPixels;
    heightPixels = displayMetrics.heightPixels;
    locales = new ArrayList<String>(Arrays.asList(context.getAssets().getLocales()));
    for (int i = 0; i < locales.size(); i++) {
        locales.set(i, locales.get(i).replace("-", "_"));
    }
    Collections.sort(locales);
    Set<String> glExtensions = new HashSet<String>();
    addEglExtensions(glExtensions);
    this.glExtensions = new ArrayList<String>(glExtensions);
    Collections.sort(this.glExtensions);
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:42,代码来源:DeviceConfiguration.java


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