本文整理汇总了Java中com.mob.tools.utils.ResHelper.getScreenWidth方法的典型用法代码示例。如果您正苦于以下问题:Java ResHelper.getScreenWidth方法的具体用法?Java ResHelper.getScreenWidth怎么用?Java ResHelper.getScreenWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.mob.tools.utils.ResHelper
的用法示例。
在下文中一共展示了ResHelper.getScreenWidth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculateSize
import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
protected void calculateSize(Context context, ArrayList<Object> plats) {
int screenWidth = ResHelper.getScreenWidth(context);
lineSize = LINE_SIZE_P;
float ratio = ((float) screenWidth) / DESIGN_SCREEN_WIDTH_P;
sepLineWidth = (int) (DESIGN_SEP_LINE_WIDTH * ratio);
sepLineWidth = sepLineWidth < 1 ? 1 : sepLineWidth;
logoHeight = (int) (DESIGN_LOGO_HEIGHT * ratio);
paddingTop = (int) (DESIGN_PADDING_TOP * ratio);
bottomHeight = (int) (DESIGN_BOTTOM_HEIGHT * ratio);
cellHeight = (screenWidth - sepLineWidth * 3) / 4;
if (plats.size() <= lineSize) {
panelHeight = cellHeight + sepLineWidth;
} else if (plats.size() <= PAGE_SIZE_P - lineSize) {
panelHeight = (cellHeight + sepLineWidth) * 2;
} else {
panelHeight = (cellHeight + sepLineWidth) * 3;
}
}
示例2: calculateSize
import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
protected void calculateSize(Context context, ArrayList<Object> plats) {
int screenWidth = ResHelper.getScreenWidth(context);
float ratio = ((float) screenWidth) / DESIGN_SCREEN_WIDTH_L;
int cellWidth = (int) (DESIGN_CELL_WIDTH_L * ratio);
lineSize = screenWidth / cellWidth;
sepLineWidth = (int) (DESIGN_SEP_LINE_WIDTH * ratio);
sepLineWidth = sepLineWidth < 1 ? 1 : sepLineWidth;
logoHeight = (int) (DESIGN_LOGO_HEIGHT * ratio);
paddingTop = (int) (DESIGN_PADDING_TOP * ratio);
bottomHeight = (int) (DESIGN_BOTTOM_HEIGHT * ratio);
cellHeight = (screenWidth - sepLineWidth * 3) / (lineSize - 1);
panelHeight = cellHeight + sepLineWidth;
}
示例3: getRatio
import com.mob.tools.utils.ResHelper; //导入方法依赖的package包/类
protected float getRatio() {
float screenWidth = ResHelper.getScreenWidth(activity);
return screenWidth / DESIGN_SCREEN_WIDTH;
}