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

The following examples show how to use com.mob.tools.utils.R#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 fingerpoetry-android with Apache License 2.0 6 votes vote down vote up
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;
	}
}
 
Example 2
Source File: PlatformPageAdapterPort.java    From Social with Apache License 2.0 6 votes vote down vote up
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;
	}
}
 
Example 3
Source File: PlatformPageAdapterPort.java    From GithubApp with Apache License 2.0 6 votes vote down vote up
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;
	}
}
 
Example 4
Source File: PlatformPageAdapterPort.java    From MyHearts with Apache License 2.0 6 votes vote down vote up
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;
	}
}
 
Example 5
Source File: PlatformPageAdapterPort.java    From Mobike with Apache License 2.0 6 votes vote down vote up
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;
	}
}
 
Example 6
Source File: PlatformPageAdapterPort.java    From HHComicViewer with Apache License 2.0 6 votes vote down vote up
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;
	}
}
 
Example 7
Source File: PlatformPageAdapterLand.java    From HHComicViewer with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 8
Source File: PlatformPageAdapterLand.java    From GithubApp with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 9
Source File: PlatformPageAdapterLand.java    From MyHearts with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 10
Source File: PlatformPageAdapterLand.java    From Mobike with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 11
Source File: FriendListPagePort.java    From Mobike with Apache License 2.0 4 votes vote down vote up
protected float getRatio() {
	float screenWidth = R.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}
 
Example 12
Source File: FriendListPagePort.java    From MyHearts with Apache License 2.0 4 votes vote down vote up
protected float getRatio() {
	float screenWidth = R.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}
 
Example 13
Source File: FriendListPageLand.java    From GithubApp with Apache License 2.0 4 votes vote down vote up
protected float getRatio() {
	float screenWidth = R.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}
 
Example 14
Source File: FriendListPageLand.java    From Mobike with Apache License 2.0 4 votes vote down vote up
protected float getRatio() {
	float screenWidth = R.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}
 
Example 15
Source File: FriendListPagePort.java    From Social with Apache License 2.0 4 votes vote down vote up
protected float getRatio() {
	float screenWidth = R.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}
 
Example 16
Source File: FriendListPagePort.java    From GithubApp with Apache License 2.0 4 votes vote down vote up
protected float getRatio() {
	float screenWidth = R.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}
 
Example 17
Source File: FriendListPageLand.java    From fingerpoetry-android with Apache License 2.0 4 votes vote down vote up
protected float getRatio() {
	float screenWidth = R.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}
 
Example 18
Source File: FriendListPagePort.java    From HHComicViewer with Apache License 2.0 4 votes vote down vote up
protected float getRatio() {
	float screenWidth = R.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}
 
Example 19
Source File: FriendListPageLand.java    From Social with Apache License 2.0 4 votes vote down vote up
protected float getRatio() {
	float screenWidth = R.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}
 
Example 20
Source File: FriendListPagePort.java    From fingerpoetry-android with Apache License 2.0 4 votes vote down vote up
protected float getRatio() {
	float screenWidth = R.getScreenWidth(activity);
	return screenWidth / DESIGN_SCREEN_WIDTH;
}