@Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); int h = getMeasuredHeight(); int w = getMeasuredWidth(); if (h > 0 && w > 0) { if (w < h) { if (View.MeasureSpec.getMode(ViewCompat.getMeasuredHeightAndState(this)) != MeasureSpec.EXACTLY) { h = w; } } else if (h < w) { if (View.MeasureSpec.getMode(ViewCompat.getMeasuredWidthAndState(this)) != MeasureSpec.EXACTLY) { w = h; } } } setMeasuredDimension(w, h); } }
int contentViewHeight = ViewCompat.getMeasuredHeightAndState(mContentView); LayoutParams lp = (LayoutParams) mContentView.getLayoutParams(); int lGap = getPaddingLeft() + lp.leftMargin; int menuViewHeight = ViewCompat.getMeasuredHeightAndState(mEndSwiper.getMenuView()); lp = (LayoutParams) mEndSwiper.getMenuView().getLayoutParams(); tGap = getPaddingTop() + lp.topMargin; int menuViewHeight = ViewCompat.getMeasuredHeightAndState(mBeginSwiper.getMenuView()); lp = (LayoutParams) mBeginSwiper.getMenuView().getLayoutParams(); tGap = getPaddingTop() + lp.topMargin;
final int childState = ViewCompat.getMeasuredHeightAndState(selectedDot); final int measuredHeight = ViewCompat.resolveSizeAndState(height, heightMeasureSpec, childState);
final int childState = ViewCompat.getMeasuredHeightAndState(startDot); final int measuredHeight = ViewCompat.resolveSizeAndState(height, heightMeasureSpec, childState);
int tGap = getPaddingTop() + lp.topMargin; int menuViewWidth = ViewCompat.getMeasuredWidthAndState(mEndSwiper.getMenuView()); int menuViewHeight = ViewCompat.getMeasuredHeightAndState(mEndSwiper.getMenuView()); if (mBeginSwiper.getMenuView() == mEndSwiper.getMenuView()) { if (checker.x >= 0) {