本文整理汇总了Java中com.taobao.weex.WXEnvironment.SETTING_FORCE_VERTICAL_SCREEN属性的典型用法代码示例。如果您正苦于以下问题:Java WXEnvironment.SETTING_FORCE_VERTICAL_SCREEN属性的具体用法?Java WXEnvironment.SETTING_FORCE_VERTICAL_SCREEN怎么用?Java WXEnvironment.SETTING_FORCE_VERTICAL_SCREEN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.taobao.weex.WXEnvironment
的用法示例。
在下文中一共展示了WXEnvironment.SETTING_FORCE_VERTICAL_SCREEN属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getScreenWidth
@Deprecated
public static int getScreenWidth( ) {
if(WXEnvironment.sApplication!=null) {
int width = WXEnvironment.sApplication.getResources().getDisplayMetrics().widthPixels;
if(WXEnvironment.SETTING_FORCE_VERTICAL_SCREEN){
int height = WXEnvironment.sApplication.getResources()
.getDisplayMetrics()
.heightPixels;
width = height > width ?width:height;
}
return width;
}
if(WXEnvironment.isApkDebugable()){
throw new WXRuntimeException("Error Context is null When getScreenHeight");
}
return 0;
}
示例2: getScreenWidth
public static int getScreenWidth(Context ctx) {
if(ctx!=null){
Resources res = ctx.getResources();
mScreenWidth = res.getDisplayMetrics().widthPixels;
if(WXEnvironment.SETTING_FORCE_VERTICAL_SCREEN){
mScreenHeight = res
.getDisplayMetrics()
.heightPixels;
mScreenWidth = mScreenHeight > mScreenWidth ? mScreenWidth : mScreenHeight;
}
} else if(WXEnvironment.isApkDebugable()){
throw new WXRuntimeException("Error Context is null When getScreenHeight");
}
return mScreenWidth;
}
示例3: getScreenWidth
public static int getScreenWidth(Context ctx) {
if(ctx!=null){
Resources res = ctx.getResources();
mScreenWidth = res.getDisplayMetrics().widthPixels;
if(WXEnvironment.SETTING_FORCE_VERTICAL_SCREEN){
mScreenHeight = res
.getDisplayMetrics()
.heightPixels;
mScreenWidth = mScreenHeight > mScreenWidth ? mScreenWidth : mScreenHeight;
}
} else if(WXEnvironment.isApkDebugable()){
throw new WXRuntimeException("Error Context is null When getScreenHeight");
}
return mScreenWidth;
}