com.socks.jiandan.utils.ScreenSizeUtil Java Examples

The following examples show how to use com.socks.jiandan.utils.ScreenSizeUtil. 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: ShowMaxImageView.java    From JianDan_OkHttpWithVolley with Apache License 2.0 6 votes vote down vote up
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

	if (mHeight != 0) {

		int sizeWidth = MeasureSpec.getSize(widthMeasureSpec);
		int sizeHeight = MeasureSpec.getSize(heightMeasureSpec);

		int resultHeight = (int) Math.max(mHeight, sizeHeight);

		if (resultHeight >= ScreenSizeUtil.getScreenHeight((Activity) getContext())) {
			resultHeight = ScreenSizeUtil.getScreenHeight((Activity) getContext()) / 3;
		}

		setMeasuredDimension(sizeWidth, resultHeight);
	} else {
		super.onMeasure(widthMeasureSpec, heightMeasureSpec);
	}

}
 
Example #2
Source File: ShowMaxImageView.java    From JianDan with Apache License 2.0 6 votes vote down vote up
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

	if (mHeight != 0) {

		int sizeWidth = MeasureSpec.getSize(widthMeasureSpec);
		int sizeHeight = MeasureSpec.getSize(heightMeasureSpec);

		int resultHeight = (int) Math.max(mHeight, sizeHeight);

		if (resultHeight >= ScreenSizeUtil.getScreenHeight((Activity) getContext())) {
			resultHeight = ScreenSizeUtil.getScreenHeight((Activity) getContext()) / 3;
		}

		setMeasuredDimension(sizeWidth, resultHeight);
	} else {
		super.onMeasure(widthMeasureSpec, heightMeasureSpec);
	}

}
 
Example #3
Source File: ShowMaxImageView.java    From JianDanRxJava with Apache License 2.0 6 votes vote down vote up
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

	if (mHeight != 0) {

		int sizeWidth = MeasureSpec.getSize(widthMeasureSpec);
		int sizeHeight = MeasureSpec.getSize(heightMeasureSpec);

		int resultHeight = (int) Math.max(mHeight, sizeHeight);

		if (resultHeight >= ScreenSizeUtil.getScreenHeight((Activity) getContext())) {
			resultHeight = ScreenSizeUtil.getScreenHeight((Activity) getContext()) / 3;
		}

		setMeasuredDimension(sizeWidth, resultHeight);
	} else {
		super.onMeasure(widthMeasureSpec, heightMeasureSpec);
	}

}
 
Example #4
Source File: ShowMaxImageView.java    From JianDan_OkHttp with Apache License 2.0 6 votes vote down vote up
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

	if (mHeight != 0) {

		int sizeWidth = MeasureSpec.getSize(widthMeasureSpec);
		int sizeHeight = MeasureSpec.getSize(heightMeasureSpec);

		int resultHeight = (int) Math.max(mHeight, sizeHeight);

		if (resultHeight >= ScreenSizeUtil.getScreenHeight((Activity) getContext())) {
			resultHeight = ScreenSizeUtil.getScreenHeight((Activity) getContext()) / 3;
		}

		setMeasuredDimension(sizeWidth, resultHeight);
	} else {
		super.onMeasure(widthMeasureSpec, heightMeasureSpec);
	}

}