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


Java R.getScreenWidth方法代码示例

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


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

示例1: calculateSize

import com.mob.tools.utils.R; //导入方法依赖的package包/类
protected void calculateSize(Context context, ArrayList<Object> plats) {
	int screenWidth = R.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;
	}
}
 
开发者ID:wp521,项目名称:MyFire,代码行数:20,代码来源:PlatformPageAdapterPort.java

示例2: 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

示例3: getPageView

import com.mob.tools.utils.R; //导入方法依赖的package包/类
private RelativeLayout getPageView() {
    this.rlPage = new RelativeLayout(getContext());
    this.rlPage.setBackgroundDrawable(this.background);
    if (this.dialogMode) {
        RelativeLayout rlDialog = new RelativeLayout(getContext());
        rlDialog.setBackgroundColor(-1070452174);
        int dp_8 = R.dipToPx(getContext(), 8);
        LayoutParams lpDialog = new LayoutParams(R.getScreenWidth(getContext()) - (dp_8 * 2), -2);
        lpDialog.topMargin = dp_8;
        lpDialog.bottomMargin = dp_8;
        lpDialog.addRule(13);
        rlDialog.setLayoutParams(lpDialog);
        this.rlPage.addView(rlDialog);
        rlDialog.addView(getPageTitle());
        rlDialog.addView(getPageBody());
        rlDialog.addView(getImagePin());
    } else {
        this.rlPage.addView(getPageTitle());
        this.rlPage.addView(getPageBody());
        this.rlPage.addView(getImagePin());
    }
    return this.rlPage;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:24,代码来源:EditPage.java

示例4: calculateSize

import com.mob.tools.utils.R; //导入方法依赖的package包/类
protected void calculateSize(Context context, ArrayList<Object> plats) {
	int screenWidth = R.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;
}
 
开发者ID:wp521,项目名称:MyFire,代码行数:15,代码来源:PlatformPageAdapterLand.java

示例5: setCurrentScreen

import com.mob.tools.utils.R; //导入方法依赖的package包/类
public void setCurrentScreen(int i) {
    if (this.adapter != null) {
        if (!this.scroller.isFinished()) {
            this.scroller.abortAnimation();
        }
        int i2 = this.currentScreen;
        this.currentScreen = Math.max(0, Math.min(i, getChildCount()));
        this.adapter.onScreenChange(this.currentScreen, i2);
        i2 = R.getScreenWidth(getContext()) * this.currentScreen;
        this.scroller.startScroll(0, 0, i2, 0);
        scrollTo(i2, 0);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:14,代码来源:ViewPagerClassic.java

示例6: getRatio

import com.mob.tools.utils.R; //导入方法依赖的package包/类
protected float getRatio() {
	float screenWidth = R.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}
 
开发者ID:wp521,项目名称:MyFire,代码行数:5,代码来源:FriendListPageLand.java


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