android.content.res.Configuration#SCREENLAYOUT_SIZE_MASK源码实例Demo

下面列出了android.content.res.Configuration#SCREENLAYOUT_SIZE_MASK 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: chips-input-layout   文件: Utils.java
static int getNavBarHeight(Context c) {
    int result = 0;
    boolean hasMenuKey = ViewConfiguration.get(c).hasPermanentMenuKey();
    boolean hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK);

    if (!hasMenuKey && !hasBackKey) {
        // The device has a navigation bar
        final Resources res = c.getResources();
        final Configuration config = res.getConfiguration();

        int orientation = config.orientation;
        int resourceId;

        // Check if the device is a tablet
        if ((config.screenLayout&Configuration.SCREENLAYOUT_SIZE_MASK)
                >= Configuration.SCREENLAYOUT_SIZE_LARGE) {
            resourceId = res.getIdentifier(orientation == Configuration.ORIENTATION_PORTRAIT
                    ? "navigation_bar_height" : "navigation_bar_height_landscape",
                    "dimen", "android");
        } else {
            resourceId = res.getIdentifier(orientation == Configuration.ORIENTATION_PORTRAIT
                    ? "navigation_bar_height" : "navigation_bar_width",
                    "dimen", "android");
        }

        if (resourceId > 0) {
            return res.getDimensionPixelSize(resourceId);
        }
    }
    return result;
}
 
/**
 * Helper method to determine if the device has an extra-large screen. For
 * example, 10" tablets are extra-large.
 */
private static boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
源代码3 项目: aptoide-client-v8   文件: AptoideUtils.java
private static int getScreenSizeInt(Resources resources) {
  return resources.getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;
}
 
源代码4 项目: MensaGuthaben   文件: SettingsActivity.java
/**
 * Helper method to determine if the device has an extra-large screen. For
 * example, 10" tablets are extra-large.
 */
private static boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout
    & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
源代码5 项目: CoordinatorLayoutExample   文件: DeviceUtils.java
private static boolean _isTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >=
            Configuration.SCREENLAYOUT_SIZE_LARGE;
}
 
源代码6 项目: SmartPack-Kernel-Manager   文件: Utils.java
public static boolean isTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)
            >= Configuration.SCREENLAYOUT_SIZE_LARGE;
}
 
源代码7 项目: NetworkMapper   文件: SettingsActivity.java
/**
 * Helper method to determine if the device has an extra-large screen. For
 * example, 10" tablets are extra-large.
 */
private static boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
源代码8 项目: cashuwallet   文件: SettingsActivity.java
/**
 * Helper method to determine if the device has an extra-large screen. For
 * example, 10" tablets are extra-large.
 */
private static boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
源代码9 项目: BotLibre   文件: MainActivity.java
public static boolean isTablet(Context context) {
	return (context.getResources().getConfiguration().screenLayout
			& Configuration.SCREENLAYOUT_SIZE_MASK)
			>= Configuration.SCREENLAYOUT_SIZE_LARGE;
}
 
/**
 * Helper method to determine if the device has an extra-large screen. For
 * example, 10" tablets are extra-large.
 */
private static boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
public boolean isTablet(Context context) {
	boolean xlarge = ((context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == 4);
	boolean large = ((context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE);
	MLog.log("IS TABLET = " + (xlarge || large));
	return (xlarge || large);
}
 
源代码12 项目: QuranAndroid   文件: HighlightImageView.java
private static boolean isTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
}
 
源代码13 项目: mvvm-template   文件: ViewHelper.java
private static boolean isTablet(@NonNull Resources resources) {
    return (resources.getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
}
 
源代码14 项目: xDrip   文件: BgGraphBuilder.java
static public boolean isLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
}
 
源代码15 项目: dapp-wallet-demo   文件: QMUIDeviceHelper.java
private static boolean _isTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >=
            Configuration.SCREENLAYOUT_SIZE_LARGE;
}
 
源代码16 项目: Android-skin-support   文件: SkinDeviceUtils.java
private static boolean _isTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >=
            Configuration.SCREENLAYOUT_SIZE_LARGE;
}
 
private static boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
源代码18 项目: homeDash   文件: SettingsActivity.java
/**
 * Helper method to determine if the device has an extra-large screen. For
 * example, 10" tablets are extra-large.
 */
private static boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
源代码19 项目: deskcon-android   文件: StatusUpdateService.java
public static boolean isTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout
           & Configuration.SCREENLAYOUT_SIZE_MASK)
           >= Configuration.SCREENLAYOUT_SIZE_LARGE;
}
 
源代码20 项目: Swiftnotes   文件: EditActivity.java
/**
 * Check if current device has tablet screen size or not
 * @param context current application context
 * @return true if device is tablet, false otherwise
 */
public static boolean isTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout &
            Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
}