本文整理汇总了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;
}
示例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);
}