當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。