Java Code Examples for com.socks.jiandan.utils.ScreenSizeUtil

The following examples show how to use com.socks.jiandan.utils.ScreenSizeUtil. These examples are extracted from open source projects. 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 Project: JianDan_OkHttpWithVolley   Source File: ShowMaxImageView.java    License: 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 Project: JianDan   Source File: ShowMaxImageView.java    License: 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 Project: JianDanRxJava   Source File: ShowMaxImageView.java    License: 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 Project: JianDan_OkHttp   Source File: ShowMaxImageView.java    License: 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);
	}

}