本文整理汇总了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;
}
示例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);
}
示例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);
}