2021-06-27 20:44:35 +00:00
package androidx.recyclerview.widget ;
import android.content.Context ;
import android.graphics.Rect ;
import android.util.AttributeSet ;
import android.util.SparseIntArray ;
import android.view.View ;
import android.view.ViewGroup ;
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat ;
import androidx.recyclerview.widget.LinearLayoutManager ;
import androidx.recyclerview.widget.RecyclerView ;
import c.d.b.a.a ;
import java.util.Arrays ;
public class GridLayoutManager extends LinearLayoutManager {
private static final boolean DEBUG = false ;
public static final int DEFAULT_SPAN_COUNT = - 1 ;
private static final String TAG = " GridLayoutManager " ;
public int [ ] mCachedBorders ;
public final Rect mDecorInsets = new Rect ( ) ;
public boolean mPendingSpanCountChange = false ;
public final SparseIntArray mPreLayoutSpanIndexCache = new SparseIntArray ( ) ;
public final SparseIntArray mPreLayoutSpanSizeCache = new SparseIntArray ( ) ;
public View [ ] mSet ;
public int mSpanCount = - 1 ;
public SpanSizeLookup mSpanSizeLookup = new DefaultSpanSizeLookup ( ) ;
private boolean mUsingSpansToEstimateScrollBarDimensions ;
public static final class DefaultSpanSizeLookup extends SpanSizeLookup {
@Override // androidx.recyclerview.widget.GridLayoutManager.SpanSizeLookup
public int getSpanIndex ( int i , int i2 ) {
return i % i2 ;
}
@Override // androidx.recyclerview.widget.GridLayoutManager.SpanSizeLookup
public int getSpanSize ( int i ) {
return 1 ;
}
}
public static class LayoutParams extends RecyclerView . LayoutParams {
public static final int INVALID_SPAN_ID = - 1 ;
public int mSpanIndex = - 1 ;
public int mSpanSize = 0 ;
public LayoutParams ( int i , int i2 ) {
super ( i , i2 ) ;
}
public LayoutParams ( Context context , AttributeSet attributeSet ) {
super ( context , attributeSet ) ;
}
public LayoutParams ( ViewGroup . LayoutParams layoutParams ) {
super ( layoutParams ) ;
}
public LayoutParams ( ViewGroup . MarginLayoutParams marginLayoutParams ) {
super ( marginLayoutParams ) ;
}
public LayoutParams ( RecyclerView . LayoutParams layoutParams ) {
super ( layoutParams ) ;
}
public int getSpanIndex ( ) {
return this . mSpanIndex ;
}
public int getSpanSize ( ) {
return this . mSpanSize ;
}
}
public static abstract class SpanSizeLookup {
private boolean mCacheSpanGroupIndices = false ;
private boolean mCacheSpanIndices = false ;
public final SparseIntArray mSpanGroupIndexCache = new SparseIntArray ( ) ;
public final SparseIntArray mSpanIndexCache = new SparseIntArray ( ) ;
public static int findFirstKeyLessThan ( SparseIntArray sparseIntArray , int i ) {
int size = sparseIntArray . size ( ) - 1 ;
int i2 = 0 ;
while ( i2 < = size ) {
int i3 = ( i2 + size ) > > > 1 ;
if ( sparseIntArray . keyAt ( i3 ) < i ) {
i2 = i3 + 1 ;
} else {
size = i3 - 1 ;
}
}
int i4 = i2 - 1 ;
if ( i4 < 0 | | i4 > = sparseIntArray . size ( ) ) {
return - 1 ;
}
return sparseIntArray . keyAt ( i4 ) ;
}
public int getCachedSpanGroupIndex ( int i , int i2 ) {
if ( ! this . mCacheSpanGroupIndices ) {
return getSpanGroupIndex ( i , i2 ) ;
}
int i3 = this . mSpanGroupIndexCache . get ( i , - 1 ) ;
if ( i3 ! = - 1 ) {
return i3 ;
}
int spanGroupIndex = getSpanGroupIndex ( i , i2 ) ;
this . mSpanGroupIndexCache . put ( i , spanGroupIndex ) ;
return spanGroupIndex ;
}
public int getCachedSpanIndex ( int i , int i2 ) {
if ( ! this . mCacheSpanIndices ) {
return getSpanIndex ( i , i2 ) ;
}
int i3 = this . mSpanIndexCache . get ( i , - 1 ) ;
if ( i3 ! = - 1 ) {
return i3 ;
}
int spanIndex = getSpanIndex ( i , i2 ) ;
this . mSpanIndexCache . put ( i , spanIndex ) ;
return spanIndex ;
}
public int getSpanGroupIndex ( int i , int i2 ) {
int i3 ;
int i4 ;
int i5 ;
int findFirstKeyLessThan ;
if ( ! this . mCacheSpanGroupIndices | | ( findFirstKeyLessThan = findFirstKeyLessThan ( this . mSpanGroupIndexCache , i ) ) = = - 1 ) {
i5 = 0 ;
i4 = 0 ;
i3 = 0 ;
} else {
i4 = this . mSpanGroupIndexCache . get ( findFirstKeyLessThan ) ;
i3 = findFirstKeyLessThan + 1 ;
i5 = getSpanSize ( findFirstKeyLessThan ) + getCachedSpanIndex ( findFirstKeyLessThan , i2 ) ;
if ( i5 = = i2 ) {
i4 + + ;
i5 = 0 ;
}
}
int spanSize = getSpanSize ( i ) ;
while ( i3 < i ) {
int spanSize2 = getSpanSize ( i3 ) ;
i5 + = spanSize2 ;
if ( i5 = = i2 ) {
i4 + + ;
i5 = 0 ;
} else if ( i5 > i2 ) {
i4 + + ;
i5 = spanSize2 ;
}
i3 + + ;
}
return i5 + spanSize > i2 ? i4 + 1 : i4 ;
}
/* JADX WARNING: Removed duplicated region for block: B:10:0x0024 */
public int getSpanIndex ( int i , int i2 ) {
int i3 ;
int i4 ;
int spanSize = getSpanSize ( i ) ;
if ( spanSize = = i2 ) {
return 0 ;
}
if ( ! this . mCacheSpanIndices | | ( i4 = findFirstKeyLessThan ( this . mSpanIndexCache , i ) ) < 0 ) {
i4 = 0 ;
i3 = 0 ;
} else {
i3 = getSpanSize ( i4 ) + this . mSpanIndexCache . get ( i4 ) ;
i4 + + ;
}
if ( i4 < i ) {
int spanSize2 = getSpanSize ( i4 ) ;
i3 + = spanSize2 ;
if ( i3 = = i2 ) {
i3 = 0 ;
} else if ( i3 > i2 ) {
i3 = spanSize2 ;
}
i4 + + ;
if ( i4 < i ) {
}
}
if ( spanSize + i3 < = i2 ) {
return i3 ;
}
return 0 ;
}
public abstract int getSpanSize ( int i ) ;
public void invalidateSpanGroupIndexCache ( ) {
this . mSpanGroupIndexCache . clear ( ) ;
}
public void invalidateSpanIndexCache ( ) {
this . mSpanIndexCache . clear ( ) ;
}
public boolean isSpanGroupIndexCacheEnabled ( ) {
return this . mCacheSpanGroupIndices ;
}
public boolean isSpanIndexCacheEnabled ( ) {
return this . mCacheSpanIndices ;
}
public void setSpanGroupIndexCacheEnabled ( boolean z2 ) {
if ( ! z2 ) {
this . mSpanGroupIndexCache . clear ( ) ;
}
this . mCacheSpanGroupIndices = z2 ;
}
public void setSpanIndexCacheEnabled ( boolean z2 ) {
if ( ! z2 ) {
this . mSpanGroupIndexCache . clear ( ) ;
}
this . mCacheSpanIndices = z2 ;
}
}
public GridLayoutManager ( Context context , int i ) {
super ( context ) ;
setSpanCount ( i ) ;
}
public GridLayoutManager ( Context context , int i , int i2 , boolean z2 ) {
super ( context , i2 , z2 ) ;
setSpanCount ( i ) ;
}
public GridLayoutManager ( Context context , AttributeSet attributeSet , int i , int i2 ) {
super ( context , attributeSet , i , i2 ) ;
setSpanCount ( RecyclerView . LayoutManager . getProperties ( context , attributeSet , i , i2 ) . spanCount ) ;
}
private void assignSpans ( RecyclerView . Recycler recycler , RecyclerView . State state , int i , boolean z2 ) {
int i2 ;
int i3 ;
int i4 = 0 ;
int i5 = - 1 ;
if ( z2 ) {
i5 = i ;
i3 = 0 ;
i2 = 1 ;
} else {
i3 = i - 1 ;
i2 = - 1 ;
}
while ( i3 ! = i5 ) {
View view = this . mSet [ i3 ] ;
LayoutParams layoutParams = ( LayoutParams ) view . getLayoutParams ( ) ;
int spanSize = getSpanSize ( recycler , state , getPosition ( view ) ) ;
layoutParams . mSpanSize = spanSize ;
layoutParams . mSpanIndex = i4 ;
i4 + = spanSize ;
i3 + = i2 ;
}
}
private void cachePreLayoutSpanMapping ( ) {
int childCount = getChildCount ( ) ;
for ( int i = 0 ; i < childCount ; i + + ) {
LayoutParams layoutParams = ( LayoutParams ) getChildAt ( i ) . getLayoutParams ( ) ;
int viewLayoutPosition = layoutParams . getViewLayoutPosition ( ) ;
this . mPreLayoutSpanSizeCache . put ( viewLayoutPosition , layoutParams . getSpanSize ( ) ) ;
this . mPreLayoutSpanIndexCache . put ( viewLayoutPosition , layoutParams . getSpanIndex ( ) ) ;
}
}
private void calculateItemBorders ( int i ) {
this . mCachedBorders = calculateItemBorders ( this . mCachedBorders , this . mSpanCount , i ) ;
}
public static int [ ] calculateItemBorders ( int [ ] iArr , int i , int i2 ) {
int i3 ;
if ( ! ( iArr ! = null & & iArr . length = = i + 1 & & iArr [ iArr . length - 1 ] = = i2 ) ) {
iArr = new int [ ( i + 1 ) ] ;
}
int i4 = 0 ;
iArr [ 0 ] = 0 ;
int i5 = i2 / i ;
int i6 = i2 % i ;
int i7 = 0 ;
for ( int i8 = 1 ; i8 < = i ; i8 + + ) {
i4 + = i6 ;
if ( i4 < = 0 | | i - i4 > = i6 ) {
i3 = i5 ;
} else {
i3 = i5 + 1 ;
i4 - = i ;
}
i7 + = i3 ;
iArr [ i8 ] = i7 ;
}
return iArr ;
}
private void clearPreLayoutSpanMappingCache ( ) {
this . mPreLayoutSpanSizeCache . clear ( ) ;
this . mPreLayoutSpanIndexCache . clear ( ) ;
}
private int computeScrollOffsetWithSpanInfo ( RecyclerView . State state ) {
if ( ! ( getChildCount ( ) = = 0 | | state . getItemCount ( ) = = 0 ) ) {
ensureLayoutState ( ) ;
boolean isSmoothScrollbarEnabled = isSmoothScrollbarEnabled ( ) ;
View findFirstVisibleChildClosestToStart = findFirstVisibleChildClosestToStart ( ! isSmoothScrollbarEnabled , true ) ;
View findFirstVisibleChildClosestToEnd = findFirstVisibleChildClosestToEnd ( ! isSmoothScrollbarEnabled , true ) ;
if ( ! ( findFirstVisibleChildClosestToStart = = null | | findFirstVisibleChildClosestToEnd = = null ) ) {
int cachedSpanGroupIndex = this . mSpanSizeLookup . getCachedSpanGroupIndex ( getPosition ( findFirstVisibleChildClosestToStart ) , this . mSpanCount ) ;
int cachedSpanGroupIndex2 = this . mSpanSizeLookup . getCachedSpanGroupIndex ( getPosition ( findFirstVisibleChildClosestToEnd ) , this . mSpanCount ) ;
int min = Math . min ( cachedSpanGroupIndex , cachedSpanGroupIndex2 ) ;
int max = this . mShouldReverseLayout ? Math . max ( 0 , ( ( this . mSpanSizeLookup . getCachedSpanGroupIndex ( state . getItemCount ( ) - 1 , this . mSpanCount ) + 1 ) - Math . max ( cachedSpanGroupIndex , cachedSpanGroupIndex2 ) ) - 1 ) : Math . max ( 0 , min ) ;
if ( ! isSmoothScrollbarEnabled ) {
return max ;
}
return Math . round ( ( ( ( float ) max ) * ( ( ( float ) Math . abs ( this . mOrientationHelper . getDecoratedEnd ( findFirstVisibleChildClosestToEnd ) - this . mOrientationHelper . getDecoratedStart ( findFirstVisibleChildClosestToStart ) ) ) / ( ( float ) ( ( this . mSpanSizeLookup . getCachedSpanGroupIndex ( getPosition ( findFirstVisibleChildClosestToEnd ) , this . mSpanCount ) - this . mSpanSizeLookup . getCachedSpanGroupIndex ( getPosition ( findFirstVisibleChildClosestToStart ) , this . mSpanCount ) ) + 1 ) ) ) ) + ( ( float ) ( this . mOrientationHelper . getStartAfterPadding ( ) - this . mOrientationHelper . getDecoratedStart ( findFirstVisibleChildClosestToStart ) ) ) ) ;
}
}
return 0 ;
}
private int computeScrollRangeWithSpanInfo ( RecyclerView . State state ) {
if ( ! ( getChildCount ( ) = = 0 | | state . getItemCount ( ) = = 0 ) ) {
ensureLayoutState ( ) ;
View findFirstVisibleChildClosestToStart = findFirstVisibleChildClosestToStart ( ! isSmoothScrollbarEnabled ( ) , true ) ;
View findFirstVisibleChildClosestToEnd = findFirstVisibleChildClosestToEnd ( ! isSmoothScrollbarEnabled ( ) , true ) ;
if ( ! ( findFirstVisibleChildClosestToStart = = null | | findFirstVisibleChildClosestToEnd = = null ) ) {
if ( ! isSmoothScrollbarEnabled ( ) ) {
return this . mSpanSizeLookup . getCachedSpanGroupIndex ( state . getItemCount ( ) - 1 , this . mSpanCount ) + 1 ;
}
int decoratedEnd = this . mOrientationHelper . getDecoratedEnd ( findFirstVisibleChildClosestToEnd ) - this . mOrientationHelper . getDecoratedStart ( findFirstVisibleChildClosestToStart ) ;
int cachedSpanGroupIndex = this . mSpanSizeLookup . getCachedSpanGroupIndex ( getPosition ( findFirstVisibleChildClosestToStart ) , this . mSpanCount ) ;
return ( int ) ( ( ( ( float ) decoratedEnd ) / ( ( float ) ( ( this . mSpanSizeLookup . getCachedSpanGroupIndex ( getPosition ( findFirstVisibleChildClosestToEnd ) , this . mSpanCount ) - cachedSpanGroupIndex ) + 1 ) ) ) * ( ( float ) ( this . mSpanSizeLookup . getCachedSpanGroupIndex ( state . getItemCount ( ) - 1 , this . mSpanCount ) + 1 ) ) ) ;
}
}
return 0 ;
}
private void ensureAnchorIsInCorrectSpan ( RecyclerView . Recycler recycler , RecyclerView . State state , LinearLayoutManager . AnchorInfo anchorInfo , int i ) {
boolean z2 = i = = 1 ;
int spanIndex = getSpanIndex ( recycler , state , anchorInfo . mPosition ) ;
if ( z2 ) {
while ( spanIndex > 0 ) {
int i2 = anchorInfo . mPosition ;
if ( i2 > 0 ) {
int i3 = i2 - 1 ;
anchorInfo . mPosition = i3 ;
spanIndex = getSpanIndex ( recycler , state , i3 ) ;
} else {
return ;
}
}
return ;
}
int itemCount = state . getItemCount ( ) - 1 ;
int i4 = anchorInfo . mPosition ;
while ( i4 < itemCount ) {
int i5 = i4 + 1 ;
int spanIndex2 = getSpanIndex ( recycler , state , i5 ) ;
if ( spanIndex2 < = spanIndex ) {
break ;
}
i4 = i5 ;
spanIndex = spanIndex2 ;
}
anchorInfo . mPosition = i4 ;
}
private void ensureViewSet ( ) {
View [ ] viewArr = this . mSet ;
if ( viewArr = = null | | viewArr . length ! = this . mSpanCount ) {
this . mSet = new View [ this . mSpanCount ] ;
}
}
private int getSpanGroupIndex ( RecyclerView . Recycler recycler , RecyclerView . State state , int i ) {
if ( ! state . isPreLayout ( ) ) {
return this . mSpanSizeLookup . getCachedSpanGroupIndex ( i , this . mSpanCount ) ;
}
int convertPreLayoutPositionToPostLayout = recycler . convertPreLayoutPositionToPostLayout ( i ) ;
if ( convertPreLayoutPositionToPostLayout ! = - 1 ) {
return this . mSpanSizeLookup . getCachedSpanGroupIndex ( convertPreLayoutPositionToPostLayout , this . mSpanCount ) ;
}
a . f0 ( " Cannot find span size for pre layout position. " , i , " GridLayoutManager " ) ;
return 0 ;
}
private int getSpanIndex ( RecyclerView . Recycler recycler , RecyclerView . State state , int i ) {
if ( ! state . isPreLayout ( ) ) {
return this . mSpanSizeLookup . getCachedSpanIndex ( i , this . mSpanCount ) ;
}
int i2 = this . mPreLayoutSpanIndexCache . get ( i , - 1 ) ;
if ( i2 ! = - 1 ) {
return i2 ;
}
int convertPreLayoutPositionToPostLayout = recycler . convertPreLayoutPositionToPostLayout ( i ) ;
if ( convertPreLayoutPositionToPostLayout ! = - 1 ) {
return this . mSpanSizeLookup . getCachedSpanIndex ( convertPreLayoutPositionToPostLayout , this . mSpanCount ) ;
}
a . f0 ( " Cannot find span size for pre layout position. It is not cached, not in the adapter. Pos: " , i , " GridLayoutManager " ) ;
return 0 ;
}
private int getSpanSize ( RecyclerView . Recycler recycler , RecyclerView . State state , int i ) {
if ( ! state . isPreLayout ( ) ) {
return this . mSpanSizeLookup . getSpanSize ( i ) ;
}
int i2 = this . mPreLayoutSpanSizeCache . get ( i , - 1 ) ;
if ( i2 ! = - 1 ) {
return i2 ;
}
int convertPreLayoutPositionToPostLayout = recycler . convertPreLayoutPositionToPostLayout ( i ) ;
if ( convertPreLayoutPositionToPostLayout ! = - 1 ) {
return this . mSpanSizeLookup . getSpanSize ( convertPreLayoutPositionToPostLayout ) ;
}
a . f0 ( " Cannot find span size for pre layout position. It is not cached, not in the adapter. Pos: " , i , " GridLayoutManager " ) ;
return 1 ;
}
private void guessMeasurement ( float f , int i ) {
calculateItemBorders ( Math . max ( Math . round ( f * ( ( float ) this . mSpanCount ) ) , i ) ) ;
}
private void measureChild ( View view , int i , boolean z2 ) {
int i2 ;
int i3 ;
LayoutParams layoutParams = ( LayoutParams ) view . getLayoutParams ( ) ;
Rect rect = layoutParams . mDecorInsets ;
int i4 = rect . top + rect . bottom + ( ( ViewGroup . MarginLayoutParams ) layoutParams ) . topMargin + ( ( ViewGroup . MarginLayoutParams ) layoutParams ) . bottomMargin ;
int i5 = rect . left + rect . right + ( ( ViewGroup . MarginLayoutParams ) layoutParams ) . leftMargin + ( ( ViewGroup . MarginLayoutParams ) layoutParams ) . rightMargin ;
int spaceForSpanRange = getSpaceForSpanRange ( layoutParams . mSpanIndex , layoutParams . mSpanSize ) ;
if ( this . mOrientation = = 1 ) {
i2 = RecyclerView . LayoutManager . getChildMeasureSpec ( spaceForSpanRange , i , i5 , ( ( ViewGroup . MarginLayoutParams ) layoutParams ) . width , false ) ;
i3 = RecyclerView . LayoutManager . getChildMeasureSpec ( this . mOrientationHelper . getTotalSpace ( ) , getHeightMode ( ) , i4 , ( ( ViewGroup . MarginLayoutParams ) layoutParams ) . height , true ) ;
} else {
int childMeasureSpec = RecyclerView . LayoutManager . getChildMeasureSpec ( spaceForSpanRange , i , i4 , ( ( ViewGroup . MarginLayoutParams ) layoutParams ) . height , false ) ;
int childMeasureSpec2 = RecyclerView . LayoutManager . getChildMeasureSpec ( this . mOrientationHelper . getTotalSpace ( ) , getWidthMode ( ) , i5 , ( ( ViewGroup . MarginLayoutParams ) layoutParams ) . width , true ) ;
i3 = childMeasureSpec ;
i2 = childMeasureSpec2 ;
}
measureChildWithDecorationsAndMargin ( view , i2 , i3 , z2 ) ;
}
private void measureChildWithDecorationsAndMargin ( View view , int i , int i2 , boolean z2 ) {
RecyclerView . LayoutParams layoutParams = ( RecyclerView . LayoutParams ) view . getLayoutParams ( ) ;
if ( z2 ? shouldReMeasureChild ( view , i , i2 , layoutParams ) : shouldMeasureChild ( view , i , i2 , layoutParams ) ) {
view . measure ( i , i2 ) ;
}
}
private void updateMeasurements ( ) {
int i ;
int i2 ;
if ( getOrientation ( ) = = 1 ) {
i2 = getWidth ( ) - getPaddingRight ( ) ;
i = getPaddingLeft ( ) ;
} else {
i2 = getHeight ( ) - getPaddingBottom ( ) ;
i = getPaddingTop ( ) ;
}
calculateItemBorders ( i2 - i ) ;
}
@Override // androidx.recyclerview.widget.RecyclerView.LayoutManager
public boolean checkLayoutParams ( RecyclerView . LayoutParams layoutParams ) {
return layoutParams instanceof LayoutParams ;
}
@Override // androidx.recyclerview.widget.LinearLayoutManager
public void collectPrefetchPositionsForLayoutState ( RecyclerView . State state , LinearLayoutManager . LayoutState layoutState , RecyclerView . LayoutManager . LayoutPrefetchRegistry layoutPrefetchRegistry ) {
int i = this . mSpanCount ;
for ( int i2 = 0 ; i2 < this . mSpanCount & & layoutState . hasMore ( state ) & & i > 0 ; i2 + + ) {
int i3 = layoutState . mCurrentPosition ;
layoutPrefetchRegistry . addPosition ( i3 , Math . max ( 0 , layoutState . mScrollingOffset ) ) ;
i - = this . mSpanSizeLookup . getSpanSize ( i3 ) ;
layoutState . mCurrentPosition + = layoutState . mItemDirection ;
}
}
@Override // androidx.recyclerview.widget.LinearLayoutManager, androidx.recyclerview.widget.RecyclerView.LayoutManager
public int computeHorizontalScrollOffset ( RecyclerView . State state ) {
return this . mUsingSpansToEstimateScrollBarDimensions ? computeScrollOffsetWithSpanInfo ( state ) : super . computeHorizontalScrollOffset ( state ) ;
}
@Override // androidx.recyclerview.widget.LinearLayoutManager, androidx.recyclerview.widget.RecyclerView.LayoutManager
public int computeHorizontalScrollRange ( RecyclerView . State state ) {
return this . mUsingSpansToEstimateScrollBarDimensions ? computeScrollRangeWithSpanInfo ( state ) : super . computeHorizontalScrollRange ( state ) ;
}
@Override // androidx.recyclerview.widget.LinearLayoutManager, androidx.recyclerview.widget.RecyclerView.LayoutManager
public int computeVerticalScrollOffset ( RecyclerView . State state ) {
return this . mUsingSpansToEstimateScrollBarDimensions ? computeScrollOffsetWithSpanInfo ( state ) : super . computeVerticalScrollOffset ( state ) ;
}
@Override // androidx.recyclerview.widget.LinearLayoutManager, androidx.recyclerview.widget.RecyclerView.LayoutManager
public int computeVerticalScrollRange ( RecyclerView . State state ) {
return this . mUsingSpansToEstimateScrollBarDimensions ? computeScrollRangeWithSpanInfo ( state ) : super . computeVerticalScrollRange ( state ) ;
}
@Override // androidx.recyclerview.widget.LinearLayoutManager
public View findReferenceChild ( RecyclerView . Recycler recycler , RecyclerView . State state , int i , int i2 , int i3 ) {
ensureLayoutState ( ) ;
int startAfterPadding = this . mOrientationHelper . getStartAfterPadding ( ) ;
int endAfterPadding = this . mOrientationHelper . getEndAfterPadding ( ) ;
int i4 = i2 > i ? 1 : - 1 ;
View view = null ;
View view2 = null ;
while ( i ! = i2 ) {
View childAt = getChildAt ( i ) ;
int position = getPosition ( childAt ) ;
if ( position > = 0 & & position < i3 & & getSpanIndex ( recycler , state , position ) = = 0 ) {
if ( ( ( RecyclerView . LayoutParams ) childAt . getLayoutParams ( ) ) . isItemRemoved ( ) ) {
if ( view2 = = null ) {
view2 = childAt ;
}
} else if ( this . mOrientationHelper . getDecoratedStart ( childAt ) < endAfterPadding & & this . mOrientationHelper . getDecoratedEnd ( childAt ) > = startAfterPadding ) {
return childAt ;
} else {
if ( view = = null ) {
view = childAt ;
}
}
}
i + = i4 ;
}
return view ! = null ? view : view2 ;
}
@Override // androidx.recyclerview.widget.LinearLayoutManager, androidx.recyclerview.widget.RecyclerView.LayoutManager
public RecyclerView . LayoutParams generateDefaultLayoutParams ( ) {
return this . mOrientation = = 0 ? new LayoutParams ( - 2 , - 1 ) : new LayoutParams ( - 1 , - 2 ) ;
}
@Override // androidx.recyclerview.widget.RecyclerView.LayoutManager
public RecyclerView . LayoutParams generateLayoutParams ( Context context , AttributeSet attributeSet ) {
return new LayoutParams ( context , attributeSet ) ;
}
@Override // androidx.recyclerview.widget.RecyclerView.LayoutManager
public RecyclerView . LayoutParams generateLayoutParams ( ViewGroup . LayoutParams layoutParams ) {
return layoutParams instanceof ViewGroup . MarginLayoutParams ? new LayoutParams ( ( ViewGroup . MarginLayoutParams ) layoutParams ) : new LayoutParams ( layoutParams ) ;
}
@Override // androidx.recyclerview.widget.RecyclerView.LayoutManager
public int getColumnCountForAccessibility ( RecyclerView . Recycler recycler , RecyclerView . State state ) {
if ( this . mOrientation = = 1 ) {
return this . mSpanCount ;
}
if ( state . getItemCount ( ) < 1 ) {
return 0 ;
}
return getSpanGroupIndex ( recycler , state , state . getItemCount ( ) - 1 ) + 1 ;
}
@Override // androidx.recyclerview.widget.RecyclerView.LayoutManager
public int getRowCountForAccessibility ( RecyclerView . Recycler recycler , RecyclerView . State state ) {
if ( this . mOrientation = = 0 ) {
return this . mSpanCount ;
}
if ( state . getItemCount ( ) < 1 ) {
return 0 ;
}
return getSpanGroupIndex ( recycler , state , state . getItemCount ( ) - 1 ) + 1 ;
}
public int getSpaceForSpanRange ( int i , int i2 ) {
if ( this . mOrientation ! = 1 | | ! isLayoutRTL ( ) ) {
int [ ] iArr = this . mCachedBorders ;
return iArr [ i2 + i ] - iArr [ i ] ;
}
int [ ] iArr2 = this . mCachedBorders ;
int i3 = this . mSpanCount ;
return iArr2 [ i3 - i ] - iArr2 [ ( i3 - i ) - i2 ] ;
}
public int getSpanCount ( ) {
return this . mSpanCount ;
}
public SpanSizeLookup getSpanSizeLookup ( ) {
return this . mSpanSizeLookup ;
}
public boolean isUsingSpansToEstimateScrollbarDimensions ( ) {
return this . mUsingSpansToEstimateScrollBarDimensions ;
}
/* JADX DEBUG: Multi-variable search result rejected for r18v0, resolved type: androidx.recyclerview.widget.GridLayoutManager */
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARNING: Unknown variable types count: 1 */
@Override // androidx.recyclerview.widget.LinearLayoutManager
public void layoutChunk ( RecyclerView . Recycler recycler , RecyclerView . State state , LinearLayoutManager . LayoutState layoutState , LinearLayoutManager . LayoutChunkResult layoutChunkResult ) {
int i ;
int i2 ;
int i3 ;
int i4 ;
int i5 ;
int i6 ;
int i7 ;
int i8 ;
int i9 ;
int i10 ;
View next ;
int modeInOther = this . mOrientationHelper . getModeInOther ( ) ;
? ? r5 = 0 ;
boolean z2 = modeInOther ! = 1073741824 ;
int i11 = getChildCount ( ) > 0 ? this . mCachedBorders [ this . mSpanCount ] : 0 ;
if ( z2 ) {
updateMeasurements ( ) ;
}
boolean z3 = layoutState . mItemDirection = = 1 ;
int i12 = this . mSpanCount ;
if ( ! z3 ) {
i12 = getSpanIndex ( recycler , state , layoutState . mCurrentPosition ) + getSpanSize ( recycler , state , layoutState . mCurrentPosition ) ;
}
int i13 = 0 ;
while ( i13 < this . mSpanCount & & layoutState . hasMore ( state ) & & i12 > 0 ) {
int i14 = layoutState . mCurrentPosition ;
int spanSize = getSpanSize ( recycler , state , i14 ) ;
if ( spanSize < = this . mSpanCount ) {
i12 - = spanSize ;
if ( i12 < 0 | | ( next = layoutState . next ( recycler ) ) = = null ) {
break ;
}
this . mSet [ i13 ] = next ;
i13 + + ;
} else {
2021-07-13 20:23:20 +00:00
throw new IllegalArgumentException ( a . y ( a . N ( " Item at position " , i14 , " requires " , spanSize , " spans but GridLayoutManager has only " ) , this . mSpanCount , " spans. " ) ) ;
2021-06-27 20:44:35 +00:00
}
}
if ( i13 = = 0 ) {
layoutChunkResult . mFinished = true ;
return ;
}
float f = 0 . 0f ;
assignSpans ( recycler , state , i13 , z3 ) ;
int i15 = 0 ;
int i16 = 0 ;
while ( i15 < i13 ) {
View view = this . mSet [ i15 ] ;
if ( layoutState . mScrapList = = null ) {
if ( z3 ) {
addView ( view ) ;
} else {
addView ( view , r5 ) ;
}
} else if ( z3 ) {
addDisappearingView ( view ) ;
} else {
int i17 = r5 = = true ? 1 : 0 ;
int i18 = r5 = = true ? 1 : 0 ;
int i19 = r5 = = true ? 1 : 0 ;
addDisappearingView ( view , i17 ) ;
}
calculateItemDecorationsForChild ( view , this . mDecorInsets ) ;
measureChild ( view , modeInOther , ( boolean ) r5 ) ;
int decoratedMeasurement = this . mOrientationHelper . getDecoratedMeasurement ( view ) ;
if ( decoratedMeasurement > i16 ) {
i16 = decoratedMeasurement ;
}
float decoratedMeasurementInOther = ( ( ( float ) this . mOrientationHelper . getDecoratedMeasurementInOther ( view ) ) * 1 . 0f ) / ( ( float ) ( ( LayoutParams ) view . getLayoutParams ( ) ) . mSpanSize ) ;
if ( decoratedMeasurementInOther > f ) {
f = decoratedMeasurementInOther ;
}
i15 + + ;
r5 = 0 ;
}
if ( z2 ) {
guessMeasurement ( f , i11 ) ;
i16 = 0 ;
for ( int i20 = 0 ; i20 < i13 ; i20 + + ) {
View view2 = this . mSet [ i20 ] ;
measureChild ( view2 , 1073741824 , true ) ;
int decoratedMeasurement2 = this . mOrientationHelper . getDecoratedMeasurement ( view2 ) ;
if ( decoratedMeasurement2 > i16 ) {
i16 = decoratedMeasurement2 ;
}
}
}
for ( int i21 = 0 ; i21 < i13 ; i21 + + ) {
View view3 = this . mSet [ i21 ] ;
if ( this . mOrientationHelper . getDecoratedMeasurement ( view3 ) ! = i16 ) {
LayoutParams layoutParams = ( LayoutParams ) view3 . getLayoutParams ( ) ;
Rect rect = layoutParams . mDecorInsets ;
int i22 = rect . top + rect . bottom + ( ( ViewGroup . MarginLayoutParams ) layoutParams ) . topMargin + ( ( ViewGroup . MarginLayoutParams ) layoutParams ) . bottomMargin ;
int i23 = rect . left + rect . right + ( ( ViewGroup . MarginLayoutParams ) layoutParams ) . leftMargin + ( ( ViewGroup . MarginLayoutParams ) layoutParams ) . rightMargin ;
int spaceForSpanRange = getSpaceForSpanRange ( layoutParams . mSpanIndex , layoutParams . mSpanSize ) ;
if ( this . mOrientation = = 1 ) {
i10 = RecyclerView . LayoutManager . getChildMeasureSpec ( spaceForSpanRange , 1073741824 , i23 , ( ( ViewGroup . MarginLayoutParams ) layoutParams ) . width , false ) ;
i9 = View . MeasureSpec . makeMeasureSpec ( i16 - i22 , 1073741824 ) ;
} else {
int makeMeasureSpec = View . MeasureSpec . makeMeasureSpec ( i16 - i23 , 1073741824 ) ;
i9 = RecyclerView . LayoutManager . getChildMeasureSpec ( spaceForSpanRange , 1073741824 , i22 , ( ( ViewGroup . MarginLayoutParams ) layoutParams ) . height , false ) ;
i10 = makeMeasureSpec ;
}
measureChildWithDecorationsAndMargin ( view3 , i10 , i9 , true ) ;
}
}
layoutChunkResult . mConsumed = i16 ;
if ( this . mOrientation = = 1 ) {
if ( layoutState . mLayoutDirection = = - 1 ) {
i3 = layoutState . mOffset ;
i4 = i3 - i16 ;
} else {
int i24 = layoutState . mOffset ;
i3 = i16 + i24 ;
i4 = i24 ;
}
i2 = 0 ;
i = 0 ;
} else if ( layoutState . mLayoutDirection = = - 1 ) {
i2 = layoutState . mOffset ;
i = i2 - i16 ;
i4 = 0 ;
i3 = 0 ;
} else {
i = layoutState . mOffset ;
i2 = i16 + i ;
i3 = 0 ;
i4 = 0 ;
}
int i25 = 0 ;
while ( i25 < i13 ) {
View view4 = this . mSet [ i25 ] ;
LayoutParams layoutParams2 = ( LayoutParams ) view4 . getLayoutParams ( ) ;
if ( this . mOrientation ! = 1 ) {
i4 = this . mCachedBorders [ layoutParams2 . mSpanIndex ] + getPaddingTop ( ) ;
i3 = this . mOrientationHelper . getDecoratedMeasurementInOther ( view4 ) + i4 ;
} else if ( isLayoutRTL ( ) ) {
i2 = this . mCachedBorders [ this . mSpanCount - layoutParams2 . mSpanIndex ] + getPaddingLeft ( ) ;
i = i2 - this . mOrientationHelper . getDecoratedMeasurementInOther ( view4 ) ;
} else {
int paddingLeft = getPaddingLeft ( ) + this . mCachedBorders [ layoutParams2 . mSpanIndex ] ;
i5 = paddingLeft ;
i8 = i4 ;
i7 = i3 ;
i6 = this . mOrientationHelper . getDecoratedMeasurementInOther ( view4 ) + paddingLeft ;
layoutDecoratedWithMargins ( view4 , i5 , i8 , i6 , i7 ) ;
if ( ! layoutParams2 . isItemRemoved ( ) | | layoutParams2 . isItemChanged ( ) ) {
layoutChunkResult . mIgnoreConsumed = true ;
}
layoutChunkResult . mFocusable | = view4 . hasFocusable ( ) ;
i25 + + ;
i4 = i8 ;
i3 = i7 ;
i2 = i6 ;
i = i5 ;
}
i8 = i4 ;
i7 = i3 ;
i6 = i2 ;
i5 = i ;
layoutDecoratedWithMargins ( view4 , i5 , i8 , i6 , i7 ) ;
if ( ! layoutParams2 . isItemRemoved ( ) ) {
}
layoutChunkResult . mIgnoreConsumed = true ;
layoutChunkResult . mFocusable | = view4 . hasFocusable ( ) ;
i25 + + ;
i4 = i8 ;
i3 = i7 ;
i2 = i6 ;
i = i5 ;
}
Arrays . fill ( this . mSet , ( Object ) null ) ;
}
@Override // androidx.recyclerview.widget.LinearLayoutManager
public void onAnchorReady ( RecyclerView . Recycler recycler , RecyclerView . State state , LinearLayoutManager . AnchorInfo anchorInfo , int i ) {
super . onAnchorReady ( recycler , state , anchorInfo , i ) ;
updateMeasurements ( ) ;
if ( state . getItemCount ( ) > 0 & & ! state . isPreLayout ( ) ) {
ensureAnchorIsInCorrectSpan ( recycler , state , anchorInfo , i ) ;
}
ensureViewSet ( ) ;
}
/ * JADX WARNING : Code restructure failed : missing block : B : 54 : 0x00d6 , code lost :
if ( r13 = = ( r2 > r15 ) ) goto L_0x00b0 ;
* /
/ * JADX WARNING : Code restructure failed : missing block : B : 65 : 0x00f6 , code lost :
if ( r13 = = r11 ) goto L_0x00b8 ;
* /
/* JADX WARNING: Removed duplicated region for block: B:71:0x0107 */
@Override // androidx.recyclerview.widget.LinearLayoutManager, androidx.recyclerview.widget.RecyclerView.LayoutManager
public View onFocusSearchFailed ( View view , int i , RecyclerView . Recycler recycler , RecyclerView . State state ) {
int i2 ;
int i3 ;
int i4 ;
int i5 ;
View view2 ;
View view3 ;
int i6 ;
int i7 ;
int i8 ;
boolean z2 ;
RecyclerView . Recycler recycler2 = recycler ;
RecyclerView . State state2 = state ;
View findContainingItemView = findContainingItemView ( view ) ;
View view4 = null ;
if ( findContainingItemView = = null ) {
return null ;
}
LayoutParams layoutParams = ( LayoutParams ) findContainingItemView . getLayoutParams ( ) ;
int i9 = layoutParams . mSpanIndex ;
int i10 = layoutParams . mSpanSize + i9 ;
if ( super . onFocusSearchFailed ( view , i , recycler , state ) = = null ) {
return null ;
}
if ( ( convertFocusDirectionToLayoutDirection ( i ) = = 1 ) ! = this . mShouldReverseLayout ) {
i4 = getChildCount ( ) - 1 ;
i3 = - 1 ;
i2 = - 1 ;
} else {
i3 = getChildCount ( ) ;
i4 = 0 ;
i2 = 1 ;
}
boolean z3 = this . mOrientation = = 1 & & isLayoutRTL ( ) ;
int spanGroupIndex = getSpanGroupIndex ( recycler2 , state2 , i4 ) ;
int i11 = i4 ;
int i12 = 0 ;
int i13 = - 1 ;
int i14 = - 1 ;
int i15 = 0 ;
View view5 = null ;
while ( i11 ! = i3 ) {
int spanGroupIndex2 = getSpanGroupIndex ( recycler2 , state2 , i11 ) ;
View childAt = getChildAt ( i11 ) ;
if ( childAt = = findContainingItemView ) {
break ;
}
if ( ! childAt . hasFocusable ( ) | | spanGroupIndex2 = = spanGroupIndex ) {
LayoutParams layoutParams2 = ( LayoutParams ) childAt . getLayoutParams ( ) ;
int i16 = layoutParams2 . mSpanIndex ;
view2 = findContainingItemView ;
int i17 = layoutParams2 . mSpanSize + i16 ;
if ( childAt . hasFocusable ( ) & & i16 = = i9 & & i17 = = i10 ) {
return childAt ;
}
if ( ( ! childAt . hasFocusable ( ) | | view4 ! = null ) & & ( childAt . hasFocusable ( ) | | view5 ! = null ) ) {
view3 = view5 ;
int min = Math . min ( i17 , i10 ) - Math . max ( i16 , i9 ) ;
if ( childAt . hasFocusable ( ) ) {
if ( min < = i12 ) {
if ( min = = i12 ) {
}
}
} else if ( view4 = = null ) {
i6 = i12 ;
i5 = i3 ;
z2 = true ;
if ( isViewPartiallyVisible ( childAt , false , true ) ) {
i7 = i15 ;
if ( min > i7 ) {
i8 = i14 ;
if ( z2 ) {
if ( childAt . hasFocusable ( ) ) {
i13 = layoutParams2 . mSpanIndex ;
i14 = i8 ;
i15 = i7 ;
view5 = view3 ;
view4 = childAt ;
i12 = Math . min ( i17 , i10 ) - Math . max ( i16 , i9 ) ;
} else {
int i18 = layoutParams2 . mSpanIndex ;
i15 = Math . min ( i17 , i10 ) - Math . max ( i16 , i9 ) ;
i14 = i18 ;
i12 = i6 ;
view5 = childAt ;
}
i11 + = i2 ;
recycler2 = recycler ;
state2 = state ;
findContainingItemView = view2 ;
i3 = i5 ;
}
} else {
if ( min = = i7 ) {
i8 = i14 ;
if ( i16 < = i8 ) {
z2 = false ;
}
} else {
i8 = i14 ;
}
z2 = false ;
if ( z2 ) {
}
}
}
i8 = i14 ;
i7 = i15 ;
z2 = false ;
if ( z2 ) {
}
}
i6 = i12 ;
i5 = i3 ;
i8 = i14 ;
i7 = i15 ;
z2 = false ;
if ( z2 ) {
}
} else {
view3 = view5 ;
}
i6 = i12 ;
i5 = i3 ;
i8 = i14 ;
i7 = i15 ;
z2 = true ;
if ( z2 ) {
}
} else if ( view4 ! = null ) {
break ;
} else {
view2 = findContainingItemView ;
view3 = view5 ;
i6 = i12 ;
i5 = i3 ;
i8 = i14 ;
i7 = i15 ;
}
i14 = i8 ;
i15 = i7 ;
i12 = i6 ;
view5 = view3 ;
i11 + = i2 ;
recycler2 = recycler ;
state2 = state ;
findContainingItemView = view2 ;
i3 = i5 ;
}
return view4 ! = null ? view4 : view5 ;
}
@Override // androidx.recyclerview.widget.RecyclerView.LayoutManager
public void onInitializeAccessibilityNodeInfoForItem ( RecyclerView . Recycler recycler , RecyclerView . State state , View view , AccessibilityNodeInfoCompat accessibilityNodeInfoCompat ) {
ViewGroup . LayoutParams layoutParams = view . getLayoutParams ( ) ;
if ( ! ( layoutParams instanceof LayoutParams ) ) {
super . onInitializeAccessibilityNodeInfoForItem ( view , accessibilityNodeInfoCompat ) ;
return ;
}
LayoutParams layoutParams2 = ( LayoutParams ) layoutParams ;
int spanGroupIndex = getSpanGroupIndex ( recycler , state , layoutParams2 . getViewLayoutPosition ( ) ) ;
if ( this . mOrientation = = 0 ) {
accessibilityNodeInfoCompat . setCollectionItemInfo ( AccessibilityNodeInfoCompat . CollectionItemInfoCompat . obtain ( layoutParams2 . getSpanIndex ( ) , layoutParams2 . getSpanSize ( ) , spanGroupIndex , 1 , false , false ) ) ;
} else {
accessibilityNodeInfoCompat . setCollectionItemInfo ( AccessibilityNodeInfoCompat . CollectionItemInfoCompat . obtain ( spanGroupIndex , 1 , layoutParams2 . getSpanIndex ( ) , layoutParams2 . getSpanSize ( ) , false , false ) ) ;
}
}
@Override // androidx.recyclerview.widget.RecyclerView.LayoutManager
public void onItemsAdded ( RecyclerView recyclerView , int i , int i2 ) {
this . mSpanSizeLookup . invalidateSpanIndexCache ( ) ;
this . mSpanSizeLookup . invalidateSpanGroupIndexCache ( ) ;
}
@Override // androidx.recyclerview.widget.RecyclerView.LayoutManager
public void onItemsChanged ( RecyclerView recyclerView ) {
this . mSpanSizeLookup . invalidateSpanIndexCache ( ) ;
this . mSpanSizeLookup . invalidateSpanGroupIndexCache ( ) ;
}
@Override // androidx.recyclerview.widget.RecyclerView.LayoutManager
public void onItemsMoved ( RecyclerView recyclerView , int i , int i2 , int i3 ) {
this . mSpanSizeLookup . invalidateSpanIndexCache ( ) ;
this . mSpanSizeLookup . invalidateSpanGroupIndexCache ( ) ;
}
@Override // androidx.recyclerview.widget.RecyclerView.LayoutManager
public void onItemsRemoved ( RecyclerView recyclerView , int i , int i2 ) {
this . mSpanSizeLookup . invalidateSpanIndexCache ( ) ;
this . mSpanSizeLookup . invalidateSpanGroupIndexCache ( ) ;
}
@Override // androidx.recyclerview.widget.RecyclerView.LayoutManager
public void onItemsUpdated ( RecyclerView recyclerView , int i , int i2 , Object obj ) {
this . mSpanSizeLookup . invalidateSpanIndexCache ( ) ;
this . mSpanSizeLookup . invalidateSpanGroupIndexCache ( ) ;
}
@Override // androidx.recyclerview.widget.LinearLayoutManager, androidx.recyclerview.widget.RecyclerView.LayoutManager
public void onLayoutChildren ( RecyclerView . Recycler recycler , RecyclerView . State state ) {
if ( state . isPreLayout ( ) ) {
cachePreLayoutSpanMapping ( ) ;
}
super . onLayoutChildren ( recycler , state ) ;
clearPreLayoutSpanMappingCache ( ) ;
}
@Override // androidx.recyclerview.widget.LinearLayoutManager, androidx.recyclerview.widget.RecyclerView.LayoutManager
public void onLayoutCompleted ( RecyclerView . State state ) {
super . onLayoutCompleted ( state ) ;
this . mPendingSpanCountChange = false ;
}
@Override // androidx.recyclerview.widget.LinearLayoutManager, androidx.recyclerview.widget.RecyclerView.LayoutManager
public int scrollHorizontallyBy ( int i , RecyclerView . Recycler recycler , RecyclerView . State state ) {
updateMeasurements ( ) ;
ensureViewSet ( ) ;
return super . scrollHorizontallyBy ( i , recycler , state ) ;
}
@Override // androidx.recyclerview.widget.LinearLayoutManager, androidx.recyclerview.widget.RecyclerView.LayoutManager
public int scrollVerticallyBy ( int i , RecyclerView . Recycler recycler , RecyclerView . State state ) {
updateMeasurements ( ) ;
ensureViewSet ( ) ;
return super . scrollVerticallyBy ( i , recycler , state ) ;
}
@Override // androidx.recyclerview.widget.RecyclerView.LayoutManager
public void setMeasuredDimension ( Rect rect , int i , int i2 ) {
int i3 ;
int i4 ;
if ( this . mCachedBorders = = null ) {
super . setMeasuredDimension ( rect , i , i2 ) ;
}
int paddingRight = getPaddingRight ( ) + getPaddingLeft ( ) ;
int paddingBottom = getPaddingBottom ( ) + getPaddingTop ( ) ;
if ( this . mOrientation = = 1 ) {
i4 = RecyclerView . LayoutManager . chooseSize ( i2 , rect . height ( ) + paddingBottom , getMinimumHeight ( ) ) ;
int [ ] iArr = this . mCachedBorders ;
i3 = RecyclerView . LayoutManager . chooseSize ( i , iArr [ iArr . length - 1 ] + paddingRight , getMinimumWidth ( ) ) ;
} else {
i3 = RecyclerView . LayoutManager . chooseSize ( i , rect . width ( ) + paddingRight , getMinimumWidth ( ) ) ;
int [ ] iArr2 = this . mCachedBorders ;
i4 = RecyclerView . LayoutManager . chooseSize ( i2 , iArr2 [ iArr2 . length - 1 ] + paddingBottom , getMinimumHeight ( ) ) ;
}
setMeasuredDimension ( i3 , i4 ) ;
}
public void setSpanCount ( int i ) {
if ( i ! = this . mSpanCount ) {
this . mPendingSpanCountChange = true ;
if ( i > = 1 ) {
this . mSpanCount = i ;
this . mSpanSizeLookup . invalidateSpanIndexCache ( ) ;
requestLayout ( ) ;
return ;
}
2021-07-13 20:23:20 +00:00
throw new IllegalArgumentException ( a . k ( " Span count should be at least 1. Provided " , i ) ) ;
2021-06-27 20:44:35 +00:00
}
}
public void setSpanSizeLookup ( SpanSizeLookup spanSizeLookup ) {
this . mSpanSizeLookup = spanSizeLookup ;
}
@Override // androidx.recyclerview.widget.LinearLayoutManager
public void setStackFromEnd ( boolean z2 ) {
if ( ! z2 ) {
super . setStackFromEnd ( false ) ;
return ;
}
throw new UnsupportedOperationException ( " GridLayoutManager does not support stack from end. Consider using reverse layout " ) ;
}
public void setUsingSpansToEstimateScrollbarDimensions ( boolean z2 ) {
this . mUsingSpansToEstimateScrollBarDimensions = z2 ;
}
@Override // androidx.recyclerview.widget.LinearLayoutManager, androidx.recyclerview.widget.RecyclerView.LayoutManager
public boolean supportsPredictiveItemAnimations ( ) {
return this . mPendingSavedState = = null & & ! this . mPendingSpanCountChange ;
}
}