本文整理匯總了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);
}