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


Java R.getScreenHeight方法代码示例

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


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

示例1: calPageSize

import com.mob.tools.utils.R; //导入方法依赖的package包/类
private void calPageSize() {
    float whR = ((float) R.getScreenWidth(getContext())) / ((float) R.getScreenHeight(getContext()));
    if (((double) whR) < 0.63d) {
        this.COLUMN_PER_LINE = 3;
        this.LINE_PER_PAGE = 3;
    } else if (((double) whR) < 0.75d) {
        this.COLUMN_PER_LINE = 3;
        this.LINE_PER_PAGE = 2;
    } else {
        this.LINE_PER_PAGE = 1;
        if (((double) whR) >= 1.75d) {
            this.COLUMN_PER_LINE = 6;
        } else if (((double) whR) >= 1.5d) {
            this.COLUMN_PER_LINE = 5;
        } else if (((double) whR) >= 1.3d) {
            this.COLUMN_PER_LINE = 4;
        } else {
            this.COLUMN_PER_LINE = 3;
        }
    }
    this.PAGE_SIZE = this.COLUMN_PER_LINE * this.LINE_PER_PAGE;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:23,代码来源:PlatformGridView.java

示例2: onCreate

import com.mob.tools.utils.R; //导入方法依赖的package包/类
public void onCreate() {
	super.onCreate();

	int screenHeight = R.getScreenHeight(activity);
	float ratio = ((float) screenHeight) / DESIGN_SCREEN_WIDTH;

	maxBodyHeight = 0;

	llPage = new LinearLayout(activity);
	llPage.setOrientation(LinearLayout.VERTICAL);
	activity.setContentView(llPage);

	rlTitle = new RelativeLayout(activity);
	rlTitle.setBackgroundColor(0xffe6e9ec);
	int titleHeight = (int) (DESIGN_TITLE_HEIGHT_L * ratio);

	LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, titleHeight);
	llPage.addView(rlTitle, lp);
	initTitle(rlTitle, ratio);

	RelativeLayout rlBody = new RelativeLayout(activity);
	rlBody.setBackgroundColor(0xffffffff);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	llPage.addView(rlBody, lp);
	initBody(rlBody, ratio);

	LinearLayout llShadow = new LinearLayout(activity);
	llShadow.setOrientation(LinearLayout.VERTICAL);
	rlBody.addView(llShadow, new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
	initShadow(llShadow, ratio);

	llBottom = new LinearLayout(activity);
	llBottom.setOrientation(LinearLayout.VERTICAL);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	llPage.addView(llBottom, lp);
	initBottom(llBottom, ratio);
}
 
开发者ID:wp521,项目名称:MyFire,代码行数:38,代码来源:EditPageLand.java

示例3: onCreate

import com.mob.tools.utils.R; //导入方法依赖的package包/类
public void onCreate() {
	super.onCreate();

	int screenHeight = R.getScreenHeight(activity);
	float ratio = ((float) screenHeight) / DESIGN_SCREEN_HEIGHT;

	maxBodyHeight = 0;

	llPage = new LinearLayout(activity);
	llPage.setOrientation(LinearLayout.VERTICAL);
	activity.setContentView(llPage);

	rlTitle = new RelativeLayout(activity);
	rlTitle.setBackgroundColor(0xffe6e9ec);
	int titleHeight = (int) (DESIGN_TITLE_HEIGHT * ratio);

	LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, titleHeight);
	llPage.addView(rlTitle, lp);
	initTitle(rlTitle, ratio);

	RelativeLayout rlBody = new RelativeLayout(activity);
	rlBody.setBackgroundColor(0xffffffff);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	llPage.addView(rlBody, lp);
	initBody(rlBody, ratio);

	LinearLayout llShadow = new LinearLayout(activity);
	llShadow.setOrientation(LinearLayout.VERTICAL);
	rlBody.addView(llShadow, new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
	initShadow(llShadow, ratio);

	llBottom = new LinearLayout(activity);
	llBottom.setOrientation(LinearLayout.VERTICAL);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	llPage.addView(llBottom, lp);
	initBottom(llBottom, ratio);
}
 
开发者ID:wp521,项目名称:MyFire,代码行数:38,代码来源:EditPagePort.java


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