Java Code Examples for com.mob.tools.utils.ResHelper#getScreenWidth()

The following examples show how to use com.mob.tools.utils.ResHelper#getScreenWidth() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PlatformPageAdapterPort.java    From LQRWeChat with MIT License 6 votes vote down vote up
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;
	}
}
 
Example 2
Source File: PlatformPageAdapterPort.java    From LiuAGeAndroid with MIT License 6 votes vote down vote up
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;
	}
}
 
Example 3
Source File: PlatformPageAdapterPort.java    From enjoyshop with Apache License 2.0 6 votes vote down vote up
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;
	}
}
 
Example 4
Source File: PlatformPageAdapterPort.java    From YiZhi with Apache License 2.0 6 votes vote down vote up
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;
	}
}
 
Example 5
Source File: PlatformPageAdapterPort.java    From BaoKanAndroid with MIT License 6 votes vote down vote up
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;
	}
}
 
Example 6
Source File: PlatformPageAdapterLand.java    From POCenter with MIT License 5 votes vote down vote up
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;
}
 
Example 7
Source File: PlatformPageAdapterLand.java    From BaoKanAndroid with MIT License 5 votes vote down vote up
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;
}
 
Example 8
Source File: PlatformPageAdapterLand.java    From LiuAGeAndroid with MIT License 5 votes vote down vote up
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;
}
 
Example 9
Source File: PlatformPageAdapterLand.java    From YiZhi with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 10
Source File: FriendListPageLand.java    From enjoyshop with Apache License 2.0 4 votes vote down vote up
protected float getRatio() {
	float screenWidth = ResHelper.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}
 
Example 11
Source File: FriendListPagePort.java    From YiZhi with Apache License 2.0 4 votes vote down vote up
protected float getRatio() {
	float screenWidth = ResHelper.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}
 
Example 12
Source File: FriendListPagePort.java    From enjoyshop with Apache License 2.0 4 votes vote down vote up
protected float getRatio() {
	float screenWidth = ResHelper.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}
 
Example 13
Source File: FriendListPageLand.java    From LiuAGeAndroid with MIT License 4 votes vote down vote up
protected float getRatio() {
	float screenWidth = ResHelper.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}
 
Example 14
Source File: FriendListPageLand.java    From YiZhi with Apache License 2.0 4 votes vote down vote up
protected float getRatio() {
	float screenWidth = ResHelper.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}
 
Example 15
Source File: FriendListPagePort.java    From POCenter with MIT License 4 votes vote down vote up
protected float getRatio() {
	float screenWidth = ResHelper.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}
 
Example 16
Source File: FriendListPagePort.java    From LiuAGeAndroid with MIT License 4 votes vote down vote up
protected float getRatio() {
	float screenWidth = ResHelper.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}
 
Example 17
Source File: FriendListPagePort.java    From BaoKanAndroid with MIT License 4 votes vote down vote up
protected float getRatio() {
	float screenWidth = ResHelper.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}
 
Example 18
Source File: FriendListPageLand.java    From BaoKanAndroid with MIT License 4 votes vote down vote up
protected float getRatio() {
	float screenWidth = ResHelper.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}
 
Example 19
Source File: FriendListPageLand.java    From POCenter with MIT License 4 votes vote down vote up
protected float getRatio() {
	float screenWidth = ResHelper.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}
 
Example 20
Source File: FriendListPagePort.java    From LQRWeChat with MIT License 4 votes vote down vote up
protected float getRatio() {
	float screenWidth = ResHelper.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}