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


Java Configuration.SCREENLAYOUT_SIZE_LARGE属性代码示例

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


在下文中一共展示了Configuration.SCREENLAYOUT_SIZE_LARGE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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,代码来源:NavActivity.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: getKeyTextSize

public static float getKeyTextSize(int nScreenSizeCategory, int nScreenOrientation)	{
	float fInputKeyTextSize;
	if (nScreenSizeCategory == Configuration.SCREENLAYOUT_SIZE_SMALL) {     
    	fInputKeyTextSize = 18;
    } else if (nScreenSizeCategory == Configuration.SCREENLAYOUT_SIZE_LARGE) {
    	fInputKeyTextSize = 24;
    } else if (nScreenSizeCategory >= Configuration.SCREENLAYOUT_SIZE_LARGE + 1)	{	//	xlarge size
    	// Configuration.SCREENLAYOUT_SIZE_XLARGE is not supported until Android 9, this is to ensure
    	// compatibility with Android 7.
    	if (nScreenOrientation == Configuration.ORIENTATION_LANDSCAPE)	{
    		fInputKeyTextSize = 40;
    	} else	{
    		fInputKeyTextSize = 36;
    	}

    } else	{	// normal size or undefined size
    	fInputKeyTextSize = 18;
    }
	return fInputKeyTextSize;

}
 
开发者ID:woshiwpa,项目名称:SmartMath,代码行数:21,代码来源:ActivityCfgKeyPad.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: isTablet

/**
 * 判断是否是平板
 *
 * @return {@code true}: 是<br>{@code false}: 否
 */
public static boolean isTablet() {
    return (Utils.getApp().getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK)
            >= Configuration.SCREENLAYOUT_SIZE_LARGE;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:ScreenUtils.java

示例8: isTablet

private static boolean isTablet(Context c) {
    final Resources res = c.getResources();
    return (res.getConfiguration().screenLayout&Configuration.SCREENLAYOUT_SIZE_MASK)
            >= Configuration.SCREENLAYOUT_SIZE_LARGE;
}
 
开发者ID:tylersuehr7,项目名称:chips-input-layout,代码行数:5,代码来源:Utils.java

示例9: setExample

public void setExample()	{
	int nScreenSizeCategory = getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;
	int nNumofCurves = 1;
	if (nScreenSizeCategory == Configuration.SCREENLAYOUT_SIZE_SMALL
			|| nScreenSizeCategory == Configuration.SCREENLAYOUT_SIZE_NORMAL)	{
		nNumofCurves = 2;
	} else if (nScreenSizeCategory == Configuration.SCREENLAYOUT_SIZE_LARGE)	{
		nNumofCurves = 2;
	} else	{	// ex-large
		nNumofCurves = 3;
	}
	if (nNumofCurves <= 0)	{
		nNumofCurves = 0;
	} else if (nNumofCurves >= 3)	{
		nNumofCurves = 3;
	}
	mlistCurveSettings = new CurveSettings[nNumofCurves];
	switch (nNumofCurves)	{
	case 3:
        mlistCurveSettings[2] = new CurveSettings();
		mlistCurveSettings[2].mstrCurveTitle = getString(R.string.curve_title_hint2);
		mlistCurveSettings[2].mstrCurveColor = "green";
		mlistCurveSettings[2].mstrCurvePntColor = "green";
		mlistCurveSettings[2].mstrCurvePntStyle = "diamond";
		mlistCurveSettings[2].mnCurvePntSize = 1;
		mlistCurveSettings[2].mstrCurveLnColor = "green";
		mlistCurveSettings[2].mstrCurveLnStyle = "solid";
		mlistCurveSettings[2].mnCurveLnSize = 1;
		mlistCurveSettings[2].mstrTFrom = "4";
		mlistCurveSettings[2].mstrTTo = "-6";
		mlistCurveSettings[2].mstrTStep = "-0.1";
		mlistCurveSettings[2].mstrXExpr = "t**2/5";
		mlistCurveSettings[2].mstrYExpr = "log2(abs(t)+2)";
	case 2:
        mlistCurveSettings[1] = new CurveSettings();
		mlistCurveSettings[1].mstrCurveTitle = getString(R.string.curve_title_hint);
		mlistCurveSettings[1].mstrCurveColor = "blue";
		mlistCurveSettings[1].mstrCurvePntColor = "blue";
		mlistCurveSettings[1].mstrCurvePntStyle = "point";
		mlistCurveSettings[1].mnCurvePntSize = 1;
		mlistCurveSettings[1].mstrCurveLnColor = "blue";
		mlistCurveSettings[1].mstrCurveLnStyle = "solid";
		mlistCurveSettings[1].mnCurveLnSize = 1;
		mlistCurveSettings[1].mstrTFrom = "-5";
		mlistCurveSettings[1].mstrTTo = "5";
		mlistCurveSettings[1].mstrTStep = "0.1";	//"0";	// auto step.
		mlistCurveSettings[1].mstrXExpr = "2*(" + getString(R.string.x_t_hint) + ")+3";
		mlistCurveSettings[1].mstrYExpr = "32*(" + getString(R.string.y_t_hint) + ")";	// make the shape close to x:y == 1:1
	case 1:
        mlistCurveSettings[0] = new CurveSettings();
		mlistCurveSettings[0].mstrCurveTitle = getString(R.string.curve_title_hint1);
		mlistCurveSettings[0].mstrCurveColor = "red";
		mlistCurveSettings[0].mstrCurvePntColor = "red";
		mlistCurveSettings[0].mstrCurvePntStyle = "point";
		mlistCurveSettings[0].mnCurvePntSize = 1;
		mlistCurveSettings[0].mstrCurveLnColor = "red";
		mlistCurveSettings[0].mstrCurveLnStyle = "solid";
		mlistCurveSettings[0].mnCurveLnSize = 1;
		mlistCurveSettings[0].mstrTFrom = "0";
		mlistCurveSettings[0].mstrTTo = "6";
		mlistCurveSettings[0].mstrTStep = " ";	//Auto Step;
		mlistCurveSettings[0].mstrXExpr = "t";	//"10/(t**2 - 10 * t + 10)";
		mlistCurveSettings[0].mstrYExpr = "tan(t)";
	default:	// 0
	}
	refreshCurveDefViewList();
}
 
开发者ID:woshiwpa,项目名称:SmartMath,代码行数:67,代码来源:ActivityPlotXYGraph.java

示例10: FloatingView

/**
 * コンストラクタ
 *
 * @param context {@link android.content.Context}
 */
FloatingView(final Context context) {
    super(context);
    mWindowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
    mParams = new WindowManager.LayoutParams();
    mMetrics = new DisplayMetrics();
    mWindowManager.getDefaultDisplay().getMetrics(mMetrics);
    mParams.width = ViewGroup.LayoutParams.WRAP_CONTENT;
    mParams.height = ViewGroup.LayoutParams.WRAP_CONTENT;
    mParams.type = WindowManager.LayoutParams.TYPE_PRIORITY_PHONE;
    mParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |
            WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS |
            WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
    mParams.format = PixelFormat.TRANSLUCENT;
    // 左下の座標を0とする
    mParams.gravity = Gravity.LEFT | Gravity.BOTTOM;
    mAnimationHandler = new FloatingAnimationHandler(this);
    mLongPressHandler = new LongPressHandler(this);
    mMoveEdgeInterpolator = new OvershootInterpolator(MOVE_TO_EDGE_OVERSHOOT_TENSION);
    mMoveDirection = FloatingViewManager.MOVE_DIRECTION_DEFAULT;
    final Resources resources = context.getResources();
    mIsTablet = (resources.getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
    mRotation = mWindowManager.getDefaultDisplay().getRotation();

    mMoveLimitRect = new Rect();
    mPositionLimitRect = new Rect();

    // ステータスバーの高さを取得
    mBaseStatusBarHeight = getSystemUiDimensionPixelSize(resources, "status_bar_height");
    mStatusBarHeight = mBaseStatusBarHeight;

    // get navigation bar height
    final boolean hasMenuKey = ViewConfiguration.get(context).hasPermanentMenuKey();
    final boolean hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK);
    if (hasMenuKey || hasBackKey) {
        mBaseNavigationBarHeight = 0;
        mBaseNavigationBarRotatedHeight = 0;
    } else {
        mBaseNavigationBarHeight = getSystemUiDimensionPixelSize(resources, "navigation_bar_height");
        final String resName = mIsTablet ? "navigation_bar_height_landscape" : "navigation_bar_width";
        mBaseNavigationBarRotatedHeight = getSystemUiDimensionPixelSize(resources, resName);
    }

    // 初回描画処理用
    getViewTreeObserver().addOnPreDrawListener(this);
}
 
开发者ID:cheenid,项目名称:FLFloatingButton,代码行数:50,代码来源:FloatingView.java

示例11: isTablet1

public static boolean isTablet1(Context context) {
    return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
}
 
开发者ID:fekracomputers,项目名称:QuranAndroid,代码行数:3,代码来源:TranslationAdapter.java

示例12: isTablet

private static boolean isTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
}
 
开发者ID:fekracomputers,项目名称:QuranAndroid,代码行数:3,代码来源:PartShowAdapter.java

示例13: isTablet

public static boolean isTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
}
 
开发者ID:fekracomputers,项目名称:QuranAndroid,代码行数:3,代码来源:TranslationReadActivity.java

示例14: isLargeTablet

/**
 * Helper method to determine if the device has an extra-large screen. For example, 10" tablets are extra-large.
 */
private static boolean isLargeTablet(@NonNull final Context context)
{
	return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
}
 
开发者ID:1313ou,项目名称:TreebolicPlugins,代码行数:7,代码来源:SettingsActivity.java

示例15: isTabletDevice

/**
 * 判断是否平板设备
 *
 * @param context 上下文
 * @return true:平板,false:手机
 */
public static boolean isTabletDevice(Context context) {
    return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >=
            Configuration.SCREENLAYOUT_SIZE_LARGE;
}
 
开发者ID:senierr,项目名称:ModuleFrame,代码行数:10,代码来源:DeviceUtil.java


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