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


Java Configuration.SCREENLAYOUT_SIZE_MASK属性代码示例

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


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

示例1: getScreenType

private ScreenType getScreenType(Context context) {
    int type = context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;
    ScreenType result;
    switch (type) {
        case Configuration.SCREENLAYOUT_SIZE_SMALL:
            result = ScreenType.SMALL;
            break;
        case Configuration.SCREENLAYOUT_SIZE_NORMAL:
            result = ScreenType.NORMAL;
            break;
        case Configuration.SCREENLAYOUT_SIZE_LARGE:
            result = ScreenType.LARGE;
            break;
        default:
            result = ScreenType.NORMAL;
            break;
    }
    return result;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:19,代码来源:MediaItemLayout.java

示例2: checkScreenSize

public void checkScreenSize() {

        int screenSize = getResources().getConfiguration().screenLayout &
                Configuration.SCREENLAYOUT_SIZE_MASK;

        switch (screenSize) {
            case Configuration.SCREENLAYOUT_SIZE_XLARGE:

                column_no = 4;
                break;
            case Configuration.SCREENLAYOUT_SIZE_UNDEFINED:
                column_no = 3;
                break;
            case Configuration.SCREENLAYOUT_SIZE_LARGE:
                column_no = 3;
                break;
            case Configuration.SCREENLAYOUT_SIZE_NORMAL:
                column_no = 2;
                break;
            case Configuration.SCREENLAYOUT_SIZE_SMALL:
                column_no = 2;
                break;
            default:
                column_no = 2;
        }
    }
 
开发者ID:MuditSrivastava,项目名称:Canvas-Vision,代码行数:26,代码来源:DiscoverFragment.java

示例3: checkScreenSize

public void checkScreenSize() {

        int screenSize = getResources().getConfiguration().screenLayout &
                Configuration.SCREENLAYOUT_SIZE_MASK;
        switch (screenSize) {
            case Configuration.SCREENLAYOUT_SIZE_XLARGE:
                column_no = 4;
                break;
            case Configuration.SCREENLAYOUT_SIZE_UNDEFINED:
                column_no = 3;
                break;
            case Configuration.SCREENLAYOUT_SIZE_LARGE:
                column_no = 3;
                break;
            case Configuration.SCREENLAYOUT_SIZE_NORMAL:
                column_no = 2;
                break;
            case Configuration.SCREENLAYOUT_SIZE_SMALL:
                column_no = 2;
                break;
            default:
                column_no = 2;
        }
    }
 
开发者ID:MuditSrivastava,项目名称:Canvas-Vision,代码行数:24,代码来源:ExploreFragment.java

示例4: isTabletDevice

public boolean isTabletDevice(Context activityContext) {
    boolean device_large = ((activityContext.getResources().getConfiguration().screenLayout &
            Configuration.SCREENLAYOUT_SIZE_MASK) ==
            Configuration.SCREENLAYOUT_SIZE_LARGE);

    if (device_large) {
        DisplayMetrics metrics = new DisplayMetrics();
        Activity activity = (Activity) activityContext;
        activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);

        if (metrics.densityDpi == DisplayMetrics.DENSITY_DEFAULT
                || metrics.densityDpi == DisplayMetrics.DENSITY_HIGH
                || metrics.densityDpi == DisplayMetrics.DENSITY_MEDIUM
                || metrics.densityDpi == DisplayMetrics.DENSITY_TV
                || metrics.densityDpi == DisplayMetrics.DENSITY_XHIGH) {
            return true;
        }
    }
    return false;
}
 
开发者ID:mityung,项目名称:XERUNG,代码行数:20,代码来源:Comman.java

示例5: calcInputKeyBtnHeight

@Override
public int calcInputKeyBtnHeight()	{
	int nScreenSizeCategory = getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;
	int nScreenOrientation = getResources().getConfiguration().orientation;

	DisplayMetrics metrics = new DisplayMetrics();
	getWindowManager().getDefaultDisplay().getMetrics(metrics);
	int nScreenShortSideInPx = Math.min(metrics.heightPixels, metrics.widthPixels);
	int nScreenLongSideInPx = Math.max(metrics.heightPixels, metrics.widthPixels);
	int nBtnHeight;
	if (nScreenOrientation == Configuration.ORIENTATION_LANDSCAPE)	{
		nBtnHeight = nScreenShortSideInPx;
		if (nScreenSizeCategory == Configuration.SCREENLAYOUT_SIZE_SMALL)	{
			nBtnHeight /= 6;
		} else if (nScreenSizeCategory == Configuration.SCREENLAYOUT_SIZE_NORMAL)	{
			nBtnHeight /= 8;
		} else	{
			// large and xlarge
			nBtnHeight /= 12;	// because the ads are on top
		}
	} else	{
		nBtnHeight = nScreenLongSideInPx;
		if (nScreenSizeCategory == Configuration.SCREENLAYOUT_SIZE_SMALL)	{
			nBtnHeight /= 9;
		} else if (nScreenSizeCategory == Configuration.SCREENLAYOUT_SIZE_NORMAL)	{
			nBtnHeight /= 12;
		} else	{
			// large and xlarge
			nBtnHeight /= 18;
		}
	}
	return nBtnHeight;
}
 
开发者ID:woshiwpa,项目名称:SmartMath,代码行数:33,代码来源:ScriptEditorActivity.java

示例6: isTabletDevice

public static boolean isTabletDevice() {
  try{
    return (WXEnvironment.getApplication().getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
  }catch (Exception e){
    WXLogUtils.e("[WXUtils] isTabletDevice:", e);
  }
  return false;
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:8,代码来源:WXUtils.java

示例7: isXLargeTablet

/**
 * 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;
}
 
开发者ID:dandanes7,项目名称:lurkerhn,代码行数:8,代码来源:SettingsActivity.java

示例8: isXLargeTablet

/**
 * Helper method to determine if the device has an extra-large screen. For
 * example, 10" tablets are extra-large.
 */
protected static boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
开发者ID:brolam,项目名称:OpenHomeAnalysis,代码行数:8,代码来源:AppCompatPreferenceHelper.java

示例9: isTablet

public static boolean isTablet(Context c) {
    boolean xlarge = ((c.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == 4);
    boolean large = ((c.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE);
    return (xlarge || large);
}
 
开发者ID:victordiaz,项目名称:phonk,代码行数:5,代码来源:AndroidUtils.java

示例10: isTablet

/**
 * 平板电脑?
 *
 * @return ??
 */
public static boolean isTablet(Context context) {
    int s = context.getResources().getConfiguration().screenLayout;
    s &= Configuration.SCREENLAYOUT_SIZE_MASK;
    return s >= Configuration.SCREENLAYOUT_SIZE_LARGE;
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:10,代码来源:TDevice.java

示例11: isXLargeTablet

private static boolean isXLargeTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
}
 
开发者ID:d0pam1n,项目名称:DoorPhone,代码行数:4,代码来源:SettingsActivity.java


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