@Override protected void onMeasure(int widthSpec, int heightSpec) { super.onMeasure(widthSpec, heightSpec); if (mRefreshHeaderView != null) { if (mRefreshHeaderView.getMeasuredHeight() > mRefreshFinalMoveOffset) { mRefreshFinalMoveOffset = 0; } } }
@Override protected void onMeasure(int widthSpec, int heightSpec) { super.onMeasure(widthSpec, heightSpec); if (mColumnWidth > 0) { int spanCount = Math.max(1, getMeasuredWidth() / mColumnWidth); mGridLayoutManager.setSpanCount(spanCount); } }
@Override protected void onMeasure(int widthSpec, int heightSpec) { super.onMeasure(widthSpec, heightSpec); if(mMode == MODE_FIXED){ int totalWidth = getMeasuredWidth() - getPaddingLeft() - getPaddingRight(); int count = mAdapter.getItemCount(); if(count > 0) { int width = totalWidth / count; int lastWidth = totalWidth - width * (count - 1); mAdapter.setFixedWidth(width, lastWidth); } else mAdapter.setFixedWidth(totalWidth, totalWidth); } }
@Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); super.onMeasure(widthMeasureSpec, expandSpec); }
@Override protected void onMeasure(int widthSpec, int heightSpec) { super.onMeasure(widthSpec, heightSpec); if (mColumnWidth > 0) { int spanCount = Math.max(1, getMeasuredWidth() / mColumnWidth); mGridLayoutManager.setSpanCount(spanCount); } }
@Override public void onMeasure(int widthSpec, int heightSpec) { super.onMeasure(widthSpec, heightSpec); }
@Override protected void onMeasure(int widthSpec, int heightSpec) { int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); super.onMeasure(widthSpec, expandSpec); } }
@Override protected void onMeasure(int widthSpec, int heightSpec) { super.onMeasure(widthSpec, heightSpec); if (mRefreshHeaderView != null) { if (mRefreshHeaderView.getMeasuredHeight() > mRefreshFinalMoveOffset) { mRefreshFinalMoveOffset = 0; } } }
@Override protected void onMeasure(int widthSpec, int heightSpec) { heightSpec = MeasureSpec.makeMeasureSpec(App.DEVICE_HEIGHT / 2, MeasureSpec.EXACTLY); super.onMeasure(widthSpec, heightSpec); } }
@Override protected void onMeasure(int widthSpec, int heightSpec) { super.onMeasure(widthSpec, heightSpec); if (columnWidth > 0) { int spanCount = Math.max(1, getMeasuredWidth() / columnWidth); manager.setSpanCount(spanCount); } } }
@Override protected void onMeasure(int widthSpec, int heightSpec) { super.onMeasure(widthSpec, heightSpec); if (columnWidth > 0) { int spanCount = Math.max(1, getMeasuredWidth() / columnWidth); manager.setSpanCount(spanCount); } } }
@Override protected void onMeasure(int widthSpec, int heightSpec) { super.onMeasure(widthSpec, heightSpec); if (columnWidth > 0) { int spanCount = Math.max(1, getMeasuredWidth() / columnWidth); manager.setSpanCount(spanCount); } } }
@Override protected void onMeasure(int widthSpec, int heightSpec) { super.onMeasure(widthSpec, heightSpec); switch (type){ case TYPE_GRID: if (columnWidth > 0) { //The spanCount will always be at least 1 int spanCount = Math.max(1, getMeasuredWidth() / columnWidth); ((GridLayoutManager)layoutManager).setSpanCount(spanCount); } break; } }
@Override public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); super.onMeasure(widthMeasureSpec, expandSpec); ViewGroup.LayoutParams params = getLayoutParams(); params.height = getMeasuredHeight(); setNestedScrollingEnabled(false); } }
@Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { if (getChildCount() > 0) { int height; View child = getChildAt(0); RecyclerView.LayoutParams params = (LayoutParams) child.getLayoutParams(); child.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); int max = getAdapter().getItemCount() * (child.getMeasuredHeight() + getPaddingTop() + getPaddingBottom() + params.topMargin + params .bottomMargin); height = Math.min(max, max_height); setMeasuredDimension(widthMeasureSpec, height); } else { super.onMeasure(widthMeasureSpec, heightMeasureSpec); } } }
@Override protected void onMeasure(int widthSpec, int heightSpec) { super.onMeasure(widthSpec, heightSpec); if (mHotspotHeight > -1) { mHotspotTopBoundStart = mHotspotOffsetTop; mHotspotTopBoundEnd = mHotspotOffsetTop + mHotspotHeight; mHotspotBottomBoundStart = (getMeasuredHeight() - mHotspotHeight) - mHotspotOffsetBottom; mHotspotBottomBoundEnd = getMeasuredHeight() - mHotspotOffsetBottom; LOG("RecyclerView height = %d", getMeasuredHeight()); LOG("Hotspot top bound = %d to %d", mHotspotTopBoundStart, mHotspotTopBoundStart); LOG("Hotspot bottom bound = %d to %d", mHotspotBottomBoundStart, mHotspotBottomBoundEnd); } }