6408 lines
207 KiB
Java
6408 lines
207 KiB
Java
package androidx.recyclerview.widget;
|
|
|
|
import android.R;
|
|
import android.annotation.SuppressLint;
|
|
import android.content.Context;
|
|
import android.content.res.Resources;
|
|
import android.content.res.TypedArray;
|
|
import android.database.Observable;
|
|
import android.graphics.Canvas;
|
|
import android.graphics.Matrix;
|
|
import android.graphics.PointF;
|
|
import android.graphics.Rect;
|
|
import android.graphics.RectF;
|
|
import android.graphics.drawable.Drawable;
|
|
import android.graphics.drawable.StateListDrawable;
|
|
import android.os.Build;
|
|
import android.os.Bundle;
|
|
import android.os.Parcel;
|
|
import android.os.Parcelable;
|
|
import android.os.SystemClock;
|
|
import android.util.AttributeSet;
|
|
import android.util.Log;
|
|
import android.util.SparseArray;
|
|
import android.view.FocusFinder;
|
|
import android.view.MotionEvent;
|
|
import android.view.VelocityTracker;
|
|
import android.view.View;
|
|
import android.view.ViewConfiguration;
|
|
import android.view.ViewGroup;
|
|
import android.view.ViewParent;
|
|
import android.view.accessibility.AccessibilityEvent;
|
|
import android.view.accessibility.AccessibilityManager;
|
|
import android.view.animation.Interpolator;
|
|
import android.widget.EdgeEffect;
|
|
import android.widget.OverScroller;
|
|
import androidx.core.os.TraceCompat;
|
|
import androidx.core.util.Preconditions;
|
|
import androidx.core.view.AccessibilityDelegateCompat;
|
|
import androidx.core.view.MotionEventCompat;
|
|
import androidx.core.view.NestedScrollingChild2;
|
|
import androidx.core.view.NestedScrollingChildHelper;
|
|
import androidx.core.view.ScrollingView;
|
|
import androidx.core.view.ViewCompat;
|
|
import androidx.core.view.ViewConfigurationCompat;
|
|
import androidx.core.view.accessibility.AccessibilityEventCompat;
|
|
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;
|
|
import androidx.customview.view.AbsSavedState;
|
|
import androidx.recyclerview.R$dimen;
|
|
import androidx.recyclerview.R$styleable;
|
|
import androidx.recyclerview.widget.AdapterHelper;
|
|
import androidx.recyclerview.widget.ChildHelper;
|
|
import androidx.recyclerview.widget.GapWorker;
|
|
import androidx.recyclerview.widget.ViewBoundsCheck;
|
|
import androidx.recyclerview.widget.ViewInfoStore;
|
|
import com.ijm.dataencryption.de.DataDecryptTool;
|
|
import com.ubt.jimu.base.util.FileUtil;
|
|
import com.ubt.jimu.unity.bluetooth.UnityActivity;
|
|
import java.lang.ref.WeakReference;
|
|
import java.lang.reflect.Constructor;
|
|
import java.lang.reflect.InvocationTargetException;
|
|
import java.util.ArrayList;
|
|
import java.util.Collections;
|
|
import java.util.List;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class RecyclerView extends ViewGroup implements ScrollingView, NestedScrollingChild2 {
|
|
private static final int[] A0 = {R.attr.nestedScrollingEnabled};
|
|
private static final int[] B0 = {R.attr.clipToPadding};
|
|
static final boolean C0;
|
|
static final boolean D0;
|
|
static final boolean E0;
|
|
static final boolean F0;
|
|
private static final boolean G0;
|
|
private static final boolean H0;
|
|
private static final Class<?>[] I0;
|
|
static final Interpolator J0;
|
|
private int A;
|
|
boolean B;
|
|
private final AccessibilityManager C;
|
|
private List<OnChildAttachStateChangeListener> D;
|
|
boolean E;
|
|
boolean F;
|
|
private int G;
|
|
private int H;
|
|
private EdgeEffectFactory I;
|
|
private EdgeEffect J;
|
|
private EdgeEffect K;
|
|
private EdgeEffect L;
|
|
private EdgeEffect M;
|
|
ItemAnimator N;
|
|
private int O;
|
|
private int P;
|
|
private VelocityTracker Q;
|
|
private int R;
|
|
private int S;
|
|
private int T;
|
|
private int U;
|
|
private int V;
|
|
private OnFlingListener W;
|
|
private final RecyclerViewDataObserver a;
|
|
private final int a0;
|
|
final Recycler b;
|
|
private final int b0;
|
|
private SavedState c;
|
|
private float c0;
|
|
AdapterHelper d;
|
|
private float d0;
|
|
ChildHelper e;
|
|
private boolean e0;
|
|
final ViewInfoStore f;
|
|
final ViewFlinger f0;
|
|
boolean g;
|
|
GapWorker g0;
|
|
final Runnable h;
|
|
GapWorker.LayoutPrefetchRegistryImpl h0;
|
|
final Rect i;
|
|
final State i0;
|
|
private final Rect j;
|
|
private OnScrollListener j0;
|
|
final RectF k;
|
|
private List<OnScrollListener> k0;
|
|
Adapter l;
|
|
boolean l0;
|
|
LayoutManager m;
|
|
boolean m0;
|
|
RecyclerListener n;
|
|
private ItemAnimator.ItemAnimatorListener n0;
|
|
final ArrayList<ItemDecoration> o;
|
|
boolean o0;
|
|
private final ArrayList<OnItemTouchListener> p;
|
|
RecyclerViewAccessibilityDelegate p0;
|
|
private OnItemTouchListener q;
|
|
private ChildDrawingOrderCallback q0;
|
|
boolean r;
|
|
private final int[] r0;
|
|
boolean s;
|
|
private NestedScrollingChildHelper s0;
|
|
boolean t;
|
|
private final int[] t0;
|
|
boolean u;
|
|
final int[] u0;
|
|
private int v;
|
|
private final int[] v0;
|
|
final int[] w0;
|
|
boolean x;
|
|
final List<ViewHolder> x0;
|
|
boolean y;
|
|
private Runnable y0;
|
|
private boolean z;
|
|
private final ViewInfoStore.ProcessCallback z0;
|
|
|
|
public static abstract class Adapter<VH extends ViewHolder> {
|
|
private final AdapterDataObservable mObservable = new AdapterDataObservable();
|
|
private boolean mHasStableIds = false;
|
|
|
|
public final void bindViewHolder(VH vh, int i) {
|
|
vh.mPosition = i;
|
|
if (hasStableIds()) {
|
|
vh.mItemId = getItemId(i);
|
|
}
|
|
vh.setFlags(1, 519);
|
|
TraceCompat.a("RV OnBindView");
|
|
onBindViewHolder(vh, i, vh.getUnmodifiedPayloads());
|
|
vh.clearPayload();
|
|
ViewGroup.LayoutParams layoutParams = vh.itemView.getLayoutParams();
|
|
if (layoutParams instanceof LayoutParams) {
|
|
((LayoutParams) layoutParams).c = true;
|
|
}
|
|
TraceCompat.a();
|
|
}
|
|
|
|
public final VH createViewHolder(ViewGroup viewGroup, int i) {
|
|
try {
|
|
TraceCompat.a("RV CreateView");
|
|
VH onCreateViewHolder = onCreateViewHolder(viewGroup, i);
|
|
if (onCreateViewHolder.itemView.getParent() != null) {
|
|
throw new IllegalStateException("ViewHolder views must not be attached when created. Ensure that you are not passing 'true' to the attachToRoot parameter of LayoutInflater.inflate(..., boolean attachToRoot)");
|
|
}
|
|
onCreateViewHolder.mItemViewType = i;
|
|
return onCreateViewHolder;
|
|
} finally {
|
|
TraceCompat.a();
|
|
}
|
|
}
|
|
|
|
public abstract int getItemCount();
|
|
|
|
public long getItemId(int i) {
|
|
return -1L;
|
|
}
|
|
|
|
public int getItemViewType(int i) {
|
|
return 0;
|
|
}
|
|
|
|
public final boolean hasObservers() {
|
|
return this.mObservable.a();
|
|
}
|
|
|
|
public final boolean hasStableIds() {
|
|
return this.mHasStableIds;
|
|
}
|
|
|
|
public final void notifyDataSetChanged() {
|
|
this.mObservable.b();
|
|
}
|
|
|
|
public final void notifyItemChanged(int i) {
|
|
this.mObservable.b(i, 1);
|
|
}
|
|
|
|
public final void notifyItemInserted(int i) {
|
|
this.mObservable.c(i, 1);
|
|
}
|
|
|
|
public final void notifyItemMoved(int i, int i2) {
|
|
this.mObservable.a(i, i2);
|
|
}
|
|
|
|
public final void notifyItemRangeChanged(int i, int i2) {
|
|
this.mObservable.b(i, i2);
|
|
}
|
|
|
|
public final void notifyItemRangeInserted(int i, int i2) {
|
|
this.mObservable.c(i, i2);
|
|
}
|
|
|
|
public final void notifyItemRangeRemoved(int i, int i2) {
|
|
this.mObservable.d(i, i2);
|
|
}
|
|
|
|
public final void notifyItemRemoved(int i) {
|
|
this.mObservable.d(i, 1);
|
|
}
|
|
|
|
public void onAttachedToRecyclerView(RecyclerView recyclerView) {
|
|
}
|
|
|
|
public abstract void onBindViewHolder(VH vh, int i);
|
|
|
|
public void onBindViewHolder(VH vh, int i, List<Object> list) {
|
|
onBindViewHolder(vh, i);
|
|
}
|
|
|
|
public abstract VH onCreateViewHolder(ViewGroup viewGroup, int i);
|
|
|
|
public void onDetachedFromRecyclerView(RecyclerView recyclerView) {
|
|
}
|
|
|
|
public boolean onFailedToRecycleView(VH vh) {
|
|
return false;
|
|
}
|
|
|
|
public void onViewAttachedToWindow(VH vh) {
|
|
}
|
|
|
|
public void onViewDetachedFromWindow(VH vh) {
|
|
}
|
|
|
|
public void onViewRecycled(VH vh) {
|
|
}
|
|
|
|
public void registerAdapterDataObserver(AdapterDataObserver adapterDataObserver) {
|
|
this.mObservable.registerObserver(adapterDataObserver);
|
|
}
|
|
|
|
public void setHasStableIds(boolean z) {
|
|
if (hasObservers()) {
|
|
throw new IllegalStateException("Cannot change whether this adapter has stable IDs while the adapter has registered observers.");
|
|
}
|
|
this.mHasStableIds = z;
|
|
}
|
|
|
|
public void unregisterAdapterDataObserver(AdapterDataObserver adapterDataObserver) {
|
|
this.mObservable.unregisterObserver(adapterDataObserver);
|
|
}
|
|
|
|
public final void notifyItemChanged(int i, Object obj) {
|
|
this.mObservable.a(i, 1, obj);
|
|
}
|
|
|
|
public final void notifyItemRangeChanged(int i, int i2, Object obj) {
|
|
this.mObservable.a(i, i2, obj);
|
|
}
|
|
}
|
|
|
|
static class AdapterDataObservable extends Observable<AdapterDataObserver> {
|
|
AdapterDataObservable() {
|
|
}
|
|
|
|
public boolean a() {
|
|
return !((Observable) this).mObservers.isEmpty();
|
|
}
|
|
|
|
public void b() {
|
|
for (int size = ((Observable) this).mObservers.size() - 1; size >= 0; size--) {
|
|
((AdapterDataObserver) ((Observable) this).mObservers.get(size)).a();
|
|
}
|
|
}
|
|
|
|
public void c(int i, int i2) {
|
|
for (int size = ((Observable) this).mObservers.size() - 1; size >= 0; size--) {
|
|
((AdapterDataObserver) ((Observable) this).mObservers.get(size)).b(i, i2);
|
|
}
|
|
}
|
|
|
|
public void d(int i, int i2) {
|
|
for (int size = ((Observable) this).mObservers.size() - 1; size >= 0; size--) {
|
|
((AdapterDataObserver) ((Observable) this).mObservers.get(size)).c(i, i2);
|
|
}
|
|
}
|
|
|
|
public void a(int i, int i2, Object obj) {
|
|
for (int size = ((Observable) this).mObservers.size() - 1; size >= 0; size--) {
|
|
((AdapterDataObserver) ((Observable) this).mObservers.get(size)).a(i, i2, obj);
|
|
}
|
|
}
|
|
|
|
public void b(int i, int i2) {
|
|
a(i, i2, null);
|
|
}
|
|
|
|
public void a(int i, int i2) {
|
|
for (int size = ((Observable) this).mObservers.size() - 1; size >= 0; size--) {
|
|
((AdapterDataObserver) ((Observable) this).mObservers.get(size)).a(i, i2, 1);
|
|
}
|
|
}
|
|
}
|
|
|
|
public static abstract class AdapterDataObserver {
|
|
public void a() {
|
|
}
|
|
|
|
public void a(int i, int i2) {
|
|
}
|
|
|
|
public void a(int i, int i2, int i3) {
|
|
}
|
|
|
|
public void a(int i, int i2, Object obj) {
|
|
a(i, i2);
|
|
}
|
|
|
|
public void b(int i, int i2) {
|
|
}
|
|
|
|
public void c(int i, int i2) {
|
|
}
|
|
}
|
|
|
|
public interface ChildDrawingOrderCallback {
|
|
int a(int i, int i2);
|
|
}
|
|
|
|
public static class EdgeEffectFactory {
|
|
protected EdgeEffect a(RecyclerView recyclerView, int i) {
|
|
return new EdgeEffect(recyclerView.getContext());
|
|
}
|
|
}
|
|
|
|
public static abstract class ItemAnimator {
|
|
private ItemAnimatorListener a = null;
|
|
private ArrayList<ItemAnimatorFinishedListener> b = new ArrayList<>();
|
|
private long c = 120;
|
|
private long d = 120;
|
|
private long e = 250;
|
|
private long f = 250;
|
|
|
|
public interface ItemAnimatorFinishedListener {
|
|
void a();
|
|
}
|
|
|
|
interface ItemAnimatorListener {
|
|
void a(ViewHolder viewHolder);
|
|
}
|
|
|
|
public static class ItemHolderInfo {
|
|
public int a;
|
|
public int b;
|
|
|
|
public ItemHolderInfo a(ViewHolder viewHolder) {
|
|
a(viewHolder, 0);
|
|
return this;
|
|
}
|
|
|
|
public ItemHolderInfo a(ViewHolder viewHolder, int i) {
|
|
View view = viewHolder.itemView;
|
|
this.a = view.getLeft();
|
|
this.b = view.getTop();
|
|
view.getRight();
|
|
view.getBottom();
|
|
return this;
|
|
}
|
|
}
|
|
|
|
void a(ItemAnimatorListener itemAnimatorListener) {
|
|
this.a = itemAnimatorListener;
|
|
}
|
|
|
|
public abstract boolean a(ViewHolder viewHolder);
|
|
|
|
public abstract boolean a(ViewHolder viewHolder, ItemHolderInfo itemHolderInfo, ItemHolderInfo itemHolderInfo2);
|
|
|
|
public abstract boolean a(ViewHolder viewHolder, ViewHolder viewHolder2, ItemHolderInfo itemHolderInfo, ItemHolderInfo itemHolderInfo2);
|
|
|
|
public abstract void b();
|
|
|
|
public final void b(ViewHolder viewHolder) {
|
|
d(viewHolder);
|
|
ItemAnimatorListener itemAnimatorListener = this.a;
|
|
if (itemAnimatorListener != null) {
|
|
itemAnimatorListener.a(viewHolder);
|
|
}
|
|
}
|
|
|
|
public abstract boolean b(ViewHolder viewHolder, ItemHolderInfo itemHolderInfo, ItemHolderInfo itemHolderInfo2);
|
|
|
|
public long c() {
|
|
return this.c;
|
|
}
|
|
|
|
public abstract void c(ViewHolder viewHolder);
|
|
|
|
public abstract boolean c(ViewHolder viewHolder, ItemHolderInfo itemHolderInfo, ItemHolderInfo itemHolderInfo2);
|
|
|
|
public long d() {
|
|
return this.f;
|
|
}
|
|
|
|
public void d(ViewHolder viewHolder) {
|
|
}
|
|
|
|
public long e() {
|
|
return this.e;
|
|
}
|
|
|
|
public long f() {
|
|
return this.d;
|
|
}
|
|
|
|
public abstract boolean g();
|
|
|
|
public ItemHolderInfo h() {
|
|
return new ItemHolderInfo();
|
|
}
|
|
|
|
public abstract void i();
|
|
|
|
static int e(ViewHolder viewHolder) {
|
|
int i = viewHolder.mFlags & 14;
|
|
if (viewHolder.isInvalid()) {
|
|
return 4;
|
|
}
|
|
if ((i & 4) != 0) {
|
|
return i;
|
|
}
|
|
int oldPosition = viewHolder.getOldPosition();
|
|
int adapterPosition = viewHolder.getAdapterPosition();
|
|
return (oldPosition == -1 || adapterPosition == -1 || oldPosition == adapterPosition) ? i : i | 2048;
|
|
}
|
|
|
|
public ItemHolderInfo a(State state, ViewHolder viewHolder, int i, List<Object> list) {
|
|
ItemHolderInfo h = h();
|
|
h.a(viewHolder);
|
|
return h;
|
|
}
|
|
|
|
public ItemHolderInfo a(State state, ViewHolder viewHolder) {
|
|
ItemHolderInfo h = h();
|
|
h.a(viewHolder);
|
|
return h;
|
|
}
|
|
|
|
public boolean a(ViewHolder viewHolder, List<Object> list) {
|
|
return a(viewHolder);
|
|
}
|
|
|
|
public final void a() {
|
|
int size = this.b.size();
|
|
for (int i = 0; i < size; i++) {
|
|
this.b.get(i).a();
|
|
}
|
|
this.b.clear();
|
|
}
|
|
}
|
|
|
|
private class ItemAnimatorRestoreListener implements ItemAnimator.ItemAnimatorListener {
|
|
ItemAnimatorRestoreListener() {
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemAnimatorListener
|
|
public void a(ViewHolder viewHolder) {
|
|
viewHolder.setIsRecyclable(true);
|
|
if (viewHolder.mShadowedHolder != null && viewHolder.mShadowingHolder == null) {
|
|
viewHolder.mShadowedHolder = null;
|
|
}
|
|
viewHolder.mShadowingHolder = null;
|
|
if (viewHolder.shouldBeKeptAsChild() || RecyclerView.this.k(viewHolder.itemView) || !viewHolder.isTmpDetached()) {
|
|
return;
|
|
}
|
|
RecyclerView.this.removeDetachedView(viewHolder.itemView, false);
|
|
}
|
|
}
|
|
|
|
public static abstract class ItemDecoration {
|
|
@Deprecated
|
|
public void getItemOffsets(Rect rect, int i, RecyclerView recyclerView) {
|
|
rect.set(0, 0, 0, 0);
|
|
}
|
|
|
|
@Deprecated
|
|
public void onDraw(Canvas canvas, RecyclerView recyclerView) {
|
|
}
|
|
|
|
public void onDraw(Canvas canvas, RecyclerView recyclerView, State state) {
|
|
onDraw(canvas, recyclerView);
|
|
}
|
|
|
|
@Deprecated
|
|
public void onDrawOver(Canvas canvas, RecyclerView recyclerView) {
|
|
}
|
|
|
|
public void onDrawOver(Canvas canvas, RecyclerView recyclerView, State state) {
|
|
onDrawOver(canvas, recyclerView);
|
|
}
|
|
|
|
public void getItemOffsets(Rect rect, View view, RecyclerView recyclerView, State state) {
|
|
getItemOffsets(rect, ((LayoutParams) view.getLayoutParams()).a(), recyclerView);
|
|
}
|
|
}
|
|
|
|
public static abstract class LayoutManager {
|
|
ChildHelper a;
|
|
RecyclerView b;
|
|
SmoothScroller g;
|
|
int m;
|
|
boolean n;
|
|
private int o;
|
|
private int p;
|
|
private int q;
|
|
private int r;
|
|
private final ViewBoundsCheck.Callback c = new ViewBoundsCheck.Callback() { // from class: androidx.recyclerview.widget.RecyclerView.LayoutManager.1
|
|
@Override // androidx.recyclerview.widget.ViewBoundsCheck.Callback
|
|
public View a(int i) {
|
|
return LayoutManager.this.d(i);
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.ViewBoundsCheck.Callback
|
|
public int b() {
|
|
return LayoutManager.this.r() - LayoutManager.this.p();
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.ViewBoundsCheck.Callback
|
|
public int a() {
|
|
return LayoutManager.this.o();
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.ViewBoundsCheck.Callback
|
|
public int b(View view) {
|
|
return LayoutManager.this.i(view) + ((ViewGroup.MarginLayoutParams) ((LayoutParams) view.getLayoutParams())).rightMargin;
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.ViewBoundsCheck.Callback
|
|
public int a(View view) {
|
|
return LayoutManager.this.f(view) - ((ViewGroup.MarginLayoutParams) ((LayoutParams) view.getLayoutParams())).leftMargin;
|
|
}
|
|
};
|
|
private final ViewBoundsCheck.Callback d = new ViewBoundsCheck.Callback() { // from class: androidx.recyclerview.widget.RecyclerView.LayoutManager.2
|
|
@Override // androidx.recyclerview.widget.ViewBoundsCheck.Callback
|
|
public View a(int i) {
|
|
return LayoutManager.this.d(i);
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.ViewBoundsCheck.Callback
|
|
public int b() {
|
|
return LayoutManager.this.h() - LayoutManager.this.n();
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.ViewBoundsCheck.Callback
|
|
public int a() {
|
|
return LayoutManager.this.q();
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.ViewBoundsCheck.Callback
|
|
public int a(View view) {
|
|
return LayoutManager.this.j(view) - ((ViewGroup.MarginLayoutParams) ((LayoutParams) view.getLayoutParams())).topMargin;
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.ViewBoundsCheck.Callback
|
|
public int b(View view) {
|
|
return LayoutManager.this.e(view) + ((ViewGroup.MarginLayoutParams) ((LayoutParams) view.getLayoutParams())).bottomMargin;
|
|
}
|
|
};
|
|
ViewBoundsCheck e = new ViewBoundsCheck(this.c);
|
|
ViewBoundsCheck f = new ViewBoundsCheck(this.d);
|
|
boolean h = false;
|
|
boolean i = false;
|
|
boolean j = false;
|
|
private boolean k = true;
|
|
private boolean l = true;
|
|
|
|
public interface LayoutPrefetchRegistry {
|
|
void a(int i, int i2);
|
|
}
|
|
|
|
public static class Properties {
|
|
public int orientation;
|
|
public boolean reverseLayout;
|
|
public int spanCount;
|
|
public boolean stackFromEnd;
|
|
}
|
|
|
|
public void A() {
|
|
this.h = true;
|
|
}
|
|
|
|
boolean B() {
|
|
return false;
|
|
}
|
|
|
|
void C() {
|
|
SmoothScroller smoothScroller = this.g;
|
|
if (smoothScroller != null) {
|
|
smoothScroller.h();
|
|
}
|
|
}
|
|
|
|
public boolean D() {
|
|
return false;
|
|
}
|
|
|
|
public int a(int i, Recycler recycler, State state) {
|
|
return 0;
|
|
}
|
|
|
|
public int a(State state) {
|
|
return 0;
|
|
}
|
|
|
|
public View a(View view, int i, Recycler recycler, State state) {
|
|
return null;
|
|
}
|
|
|
|
public void a(int i, int i2, State state, LayoutPrefetchRegistry layoutPrefetchRegistry) {
|
|
}
|
|
|
|
public void a(int i, LayoutPrefetchRegistry layoutPrefetchRegistry) {
|
|
}
|
|
|
|
public void a(Rect rect, int i, int i2) {
|
|
c(a(i, rect.width() + o() + p(), m()), a(i2, rect.height() + q() + n(), l()));
|
|
}
|
|
|
|
public void a(Parcelable parcelable) {
|
|
}
|
|
|
|
public void a(Adapter adapter, Adapter adapter2) {
|
|
}
|
|
|
|
public void a(RecyclerView recyclerView, int i, int i2) {
|
|
}
|
|
|
|
public void a(RecyclerView recyclerView, int i, int i2, int i3) {
|
|
}
|
|
|
|
public boolean a() {
|
|
return false;
|
|
}
|
|
|
|
public boolean a(LayoutParams layoutParams) {
|
|
return layoutParams != null;
|
|
}
|
|
|
|
public boolean a(Recycler recycler, State state, View view, int i, Bundle bundle) {
|
|
return false;
|
|
}
|
|
|
|
public boolean a(RecyclerView recyclerView, ArrayList<View> arrayList, int i, int i2) {
|
|
return false;
|
|
}
|
|
|
|
public int b(int i, Recycler recycler, State state) {
|
|
return 0;
|
|
}
|
|
|
|
public int b(State state) {
|
|
return 0;
|
|
}
|
|
|
|
void b(int i, int i2) {
|
|
this.q = View.MeasureSpec.getSize(i);
|
|
this.o = View.MeasureSpec.getMode(i);
|
|
if (this.o == 0 && !RecyclerView.D0) {
|
|
this.q = 0;
|
|
}
|
|
this.r = View.MeasureSpec.getSize(i2);
|
|
this.p = View.MeasureSpec.getMode(i2);
|
|
if (this.p != 0 || RecyclerView.D0) {
|
|
return;
|
|
}
|
|
this.r = 0;
|
|
}
|
|
|
|
public void b(RecyclerView recyclerView) {
|
|
}
|
|
|
|
public void b(RecyclerView recyclerView, int i, int i2) {
|
|
}
|
|
|
|
public boolean b() {
|
|
return false;
|
|
}
|
|
|
|
public int c(Recycler recycler, State state) {
|
|
return 0;
|
|
}
|
|
|
|
public int c(State state) {
|
|
return 0;
|
|
}
|
|
|
|
public View c(View view) {
|
|
View c;
|
|
RecyclerView recyclerView = this.b;
|
|
if (recyclerView == null || (c = recyclerView.c(view)) == null || this.a.c(c)) {
|
|
return null;
|
|
}
|
|
return c;
|
|
}
|
|
|
|
public abstract LayoutParams c();
|
|
|
|
@Deprecated
|
|
public void c(RecyclerView recyclerView) {
|
|
}
|
|
|
|
public void c(RecyclerView recyclerView, int i, int i2) {
|
|
}
|
|
|
|
public int d() {
|
|
return -1;
|
|
}
|
|
|
|
public int d(State state) {
|
|
return 0;
|
|
}
|
|
|
|
public View d(View view, int i) {
|
|
return null;
|
|
}
|
|
|
|
void d(int i, int i2) {
|
|
int e = e();
|
|
if (e == 0) {
|
|
this.b.c(i, i2);
|
|
return;
|
|
}
|
|
int i3 = Integer.MAX_VALUE;
|
|
int i4 = Integer.MAX_VALUE;
|
|
int i5 = Integer.MIN_VALUE;
|
|
int i6 = Integer.MIN_VALUE;
|
|
for (int i7 = 0; i7 < e; i7++) {
|
|
View d = d(i7);
|
|
Rect rect = this.b.i;
|
|
b(d, rect);
|
|
int i8 = rect.left;
|
|
if (i8 < i3) {
|
|
i3 = i8;
|
|
}
|
|
int i9 = rect.right;
|
|
if (i9 > i5) {
|
|
i5 = i9;
|
|
}
|
|
int i10 = rect.top;
|
|
if (i10 < i4) {
|
|
i4 = i10;
|
|
}
|
|
int i11 = rect.bottom;
|
|
if (i11 > i6) {
|
|
i6 = i11;
|
|
}
|
|
}
|
|
this.b.i.set(i3, i4, i5, i6);
|
|
a(this.b.i, i, i2);
|
|
}
|
|
|
|
public void d(RecyclerView recyclerView) {
|
|
}
|
|
|
|
public boolean d(Recycler recycler, State state) {
|
|
return false;
|
|
}
|
|
|
|
public int e(State state) {
|
|
return 0;
|
|
}
|
|
|
|
public void e(Recycler recycler, State state) {
|
|
Log.e("RecyclerView", "You must override onLayoutChildren(Recycler recycler, State state) ");
|
|
}
|
|
|
|
public int f(State state) {
|
|
return 0;
|
|
}
|
|
|
|
void f(RecyclerView recyclerView) {
|
|
if (recyclerView == null) {
|
|
this.b = null;
|
|
this.a = null;
|
|
this.q = 0;
|
|
this.r = 0;
|
|
} else {
|
|
this.b = recyclerView;
|
|
this.a = recyclerView.e;
|
|
this.q = recyclerView.getWidth();
|
|
this.r = recyclerView.getHeight();
|
|
}
|
|
this.o = 1073741824;
|
|
this.p = 1073741824;
|
|
}
|
|
|
|
public View g() {
|
|
View focusedChild;
|
|
RecyclerView recyclerView = this.b;
|
|
if (recyclerView == null || (focusedChild = recyclerView.getFocusedChild()) == null || this.a.c(focusedChild)) {
|
|
return null;
|
|
}
|
|
return focusedChild;
|
|
}
|
|
|
|
public void g(int i) {
|
|
}
|
|
|
|
public void g(State state) {
|
|
}
|
|
|
|
public void h(int i) {
|
|
if (d(i) != null) {
|
|
this.a.e(i);
|
|
}
|
|
}
|
|
|
|
public int i() {
|
|
return this.p;
|
|
}
|
|
|
|
public void i(int i) {
|
|
}
|
|
|
|
public int j() {
|
|
RecyclerView recyclerView = this.b;
|
|
Adapter adapter = recyclerView != null ? recyclerView.getAdapter() : null;
|
|
if (adapter != null) {
|
|
return adapter.getItemCount();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public int k() {
|
|
return ViewCompat.k(this.b);
|
|
}
|
|
|
|
public int l(View view) {
|
|
return ((LayoutParams) view.getLayoutParams()).a();
|
|
}
|
|
|
|
public int m(View view) {
|
|
return ((LayoutParams) view.getLayoutParams()).b.right;
|
|
}
|
|
|
|
public int n() {
|
|
RecyclerView recyclerView = this.b;
|
|
if (recyclerView != null) {
|
|
return recyclerView.getPaddingBottom();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public void o(View view) {
|
|
this.a.d(view);
|
|
}
|
|
|
|
public int p() {
|
|
RecyclerView recyclerView = this.b;
|
|
if (recyclerView != null) {
|
|
return recyclerView.getPaddingRight();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public int q() {
|
|
RecyclerView recyclerView = this.b;
|
|
if (recyclerView != null) {
|
|
return recyclerView.getPaddingTop();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public int r() {
|
|
return this.q;
|
|
}
|
|
|
|
public int s() {
|
|
return this.o;
|
|
}
|
|
|
|
boolean t() {
|
|
int e = e();
|
|
for (int i = 0; i < e; i++) {
|
|
ViewGroup.LayoutParams layoutParams = d(i).getLayoutParams();
|
|
if (layoutParams.width < 0 && layoutParams.height < 0) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public boolean u() {
|
|
return this.i;
|
|
}
|
|
|
|
public boolean v() {
|
|
return this.j;
|
|
}
|
|
|
|
public final boolean w() {
|
|
return this.l;
|
|
}
|
|
|
|
public boolean x() {
|
|
SmoothScroller smoothScroller = this.g;
|
|
return smoothScroller != null && smoothScroller.e();
|
|
}
|
|
|
|
public Parcelable y() {
|
|
return null;
|
|
}
|
|
|
|
public void z() {
|
|
RecyclerView recyclerView = this.b;
|
|
if (recyclerView != null) {
|
|
recyclerView.requestLayout();
|
|
}
|
|
}
|
|
|
|
public int e() {
|
|
ChildHelper childHelper = this.a;
|
|
if (childHelper != null) {
|
|
return childHelper.a();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public int i(View view) {
|
|
return view.getRight() + m(view);
|
|
}
|
|
|
|
public int k(View view) {
|
|
return ((LayoutParams) view.getLayoutParams()).b.left;
|
|
}
|
|
|
|
public int l() {
|
|
return ViewCompat.l(this.b);
|
|
}
|
|
|
|
public int m() {
|
|
return ViewCompat.m(this.b);
|
|
}
|
|
|
|
public int n(View view) {
|
|
return ((LayoutParams) view.getLayoutParams()).b.top;
|
|
}
|
|
|
|
public int o() {
|
|
RecyclerView recyclerView = this.b;
|
|
if (recyclerView != null) {
|
|
return recyclerView.getPaddingLeft();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public void e(int i) {
|
|
RecyclerView recyclerView = this.b;
|
|
if (recyclerView != null) {
|
|
recyclerView.g(i);
|
|
}
|
|
}
|
|
|
|
public int h() {
|
|
return this.r;
|
|
}
|
|
|
|
public int j(View view) {
|
|
return view.getTop() - n(view);
|
|
}
|
|
|
|
public View c(int i) {
|
|
int e = e();
|
|
for (int i2 = 0; i2 < e; i2++) {
|
|
View d = d(i2);
|
|
ViewHolder m = RecyclerView.m(d);
|
|
if (m != null && m.getLayoutPosition() == i && !m.shouldIgnore() && (this.b.i0.d() || !m.isRemoved())) {
|
|
return d;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public int g(View view) {
|
|
Rect rect = ((LayoutParams) view.getLayoutParams()).b;
|
|
return view.getMeasuredHeight() + rect.top + rect.bottom;
|
|
}
|
|
|
|
public int h(View view) {
|
|
Rect rect = ((LayoutParams) view.getLayoutParams()).b;
|
|
return view.getMeasuredWidth() + rect.left + rect.right;
|
|
}
|
|
|
|
public int e(View view) {
|
|
return view.getBottom() + d(view);
|
|
}
|
|
|
|
public static int a(int i, int i2, int i3) {
|
|
int mode = View.MeasureSpec.getMode(i);
|
|
int size = View.MeasureSpec.getSize(i);
|
|
if (mode != Integer.MIN_VALUE) {
|
|
return mode != 1073741824 ? Math.max(i2, i3) : size;
|
|
}
|
|
return Math.min(size, Math.max(i2, i3));
|
|
}
|
|
|
|
void e(RecyclerView recyclerView) {
|
|
b(View.MeasureSpec.makeMeasureSpec(recyclerView.getWidth(), 1073741824), View.MeasureSpec.makeMeasureSpec(recyclerView.getHeight(), 1073741824));
|
|
}
|
|
|
|
public void b(RecyclerView recyclerView, Recycler recycler) {
|
|
c(recyclerView);
|
|
}
|
|
|
|
public void c(View view, int i) {
|
|
a(view, i, (LayoutParams) view.getLayoutParams());
|
|
}
|
|
|
|
public void a(String str) {
|
|
RecyclerView recyclerView = this.b;
|
|
if (recyclerView != null) {
|
|
recyclerView.a(str);
|
|
}
|
|
}
|
|
|
|
public void b(SmoothScroller smoothScroller) {
|
|
SmoothScroller smoothScroller2 = this.g;
|
|
if (smoothScroller2 != null && smoothScroller != smoothScroller2 && smoothScroller2.e()) {
|
|
this.g.h();
|
|
}
|
|
this.g = smoothScroller;
|
|
this.g.a(this.b, this);
|
|
}
|
|
|
|
void c(Recycler recycler) {
|
|
int e = recycler.e();
|
|
for (int i = e - 1; i >= 0; i--) {
|
|
View c = recycler.c(i);
|
|
ViewHolder m = RecyclerView.m(c);
|
|
if (!m.shouldIgnore()) {
|
|
m.setIsRecyclable(false);
|
|
if (m.isTmpDetached()) {
|
|
this.b.removeDetachedView(c, false);
|
|
}
|
|
ItemAnimator itemAnimator = this.b.N;
|
|
if (itemAnimator != null) {
|
|
itemAnimator.c(m);
|
|
}
|
|
m.setIsRecyclable(true);
|
|
recycler.a(c);
|
|
}
|
|
}
|
|
recycler.c();
|
|
if (e > 0) {
|
|
this.b.invalidate();
|
|
}
|
|
}
|
|
|
|
public boolean f() {
|
|
RecyclerView recyclerView = this.b;
|
|
return recyclerView != null && recyclerView.g;
|
|
}
|
|
|
|
void a(RecyclerView recyclerView) {
|
|
this.i = true;
|
|
b(recyclerView);
|
|
}
|
|
|
|
public View d(int i) {
|
|
ChildHelper childHelper = this.a;
|
|
if (childHelper != null) {
|
|
return childHelper.c(i);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public void f(int i) {
|
|
RecyclerView recyclerView = this.b;
|
|
if (recyclerView != null) {
|
|
recyclerView.h(i);
|
|
}
|
|
}
|
|
|
|
public int d(View view) {
|
|
return ((LayoutParams) view.getLayoutParams()).b.bottom;
|
|
}
|
|
|
|
private boolean d(RecyclerView recyclerView, int i, int i2) {
|
|
View focusedChild = recyclerView.getFocusedChild();
|
|
if (focusedChild == null) {
|
|
return false;
|
|
}
|
|
int o = o();
|
|
int q = q();
|
|
int r = r() - p();
|
|
int h = h() - n();
|
|
Rect rect = this.b.i;
|
|
b(focusedChild, rect);
|
|
return rect.left - i < r && rect.right - i > o && rect.top - i2 < h && rect.bottom - i2 > q;
|
|
}
|
|
|
|
void a(RecyclerView recyclerView, Recycler recycler) {
|
|
this.i = false;
|
|
b(recyclerView, recycler);
|
|
}
|
|
|
|
public int f(View view) {
|
|
return view.getLeft() - k(view);
|
|
}
|
|
|
|
public void b(View view) {
|
|
b(view, -1);
|
|
}
|
|
|
|
public boolean a(Runnable runnable) {
|
|
RecyclerView recyclerView = this.b;
|
|
if (recyclerView != null) {
|
|
return recyclerView.removeCallbacks(runnable);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public void b(View view, int i) {
|
|
a(view, i, false);
|
|
}
|
|
|
|
public void b(int i) {
|
|
a(i, d(i));
|
|
}
|
|
|
|
public LayoutParams a(ViewGroup.LayoutParams layoutParams) {
|
|
if (layoutParams instanceof LayoutParams) {
|
|
return new LayoutParams((LayoutParams) layoutParams);
|
|
}
|
|
if (layoutParams instanceof ViewGroup.MarginLayoutParams) {
|
|
return new LayoutParams((ViewGroup.MarginLayoutParams) layoutParams);
|
|
}
|
|
return new LayoutParams(layoutParams);
|
|
}
|
|
|
|
boolean b(View view, int i, int i2, LayoutParams layoutParams) {
|
|
return (this.k && b(view.getMeasuredWidth(), i, ((ViewGroup.MarginLayoutParams) layoutParams).width) && b(view.getMeasuredHeight(), i2, ((ViewGroup.MarginLayoutParams) layoutParams).height)) ? false : true;
|
|
}
|
|
|
|
private static boolean b(int i, int i2, int i3) {
|
|
int mode = View.MeasureSpec.getMode(i2);
|
|
int size = View.MeasureSpec.getSize(i2);
|
|
if (i3 > 0 && i != i3) {
|
|
return false;
|
|
}
|
|
if (mode == Integer.MIN_VALUE) {
|
|
return size >= i;
|
|
}
|
|
if (mode != 0) {
|
|
return mode == 1073741824 && size == i;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public LayoutParams a(Context context, AttributeSet attributeSet) {
|
|
return new LayoutParams(context, attributeSet);
|
|
}
|
|
|
|
public void b(View view, int i, int i2, int i3, int i4) {
|
|
LayoutParams layoutParams = (LayoutParams) view.getLayoutParams();
|
|
Rect rect = layoutParams.b;
|
|
view.layout(i + rect.left + ((ViewGroup.MarginLayoutParams) layoutParams).leftMargin, i2 + rect.top + ((ViewGroup.MarginLayoutParams) layoutParams).topMargin, (i3 - rect.right) - ((ViewGroup.MarginLayoutParams) layoutParams).rightMargin, (i4 - rect.bottom) - ((ViewGroup.MarginLayoutParams) layoutParams).bottomMargin);
|
|
}
|
|
|
|
public void c(int i, int i2) {
|
|
this.b.setMeasuredDimension(i, i2);
|
|
}
|
|
|
|
public void a(RecyclerView recyclerView, State state, int i) {
|
|
Log.e("RecyclerView", "You must override smoothScrollToPosition to support smooth scrolling");
|
|
}
|
|
|
|
public void a(View view) {
|
|
a(view, -1);
|
|
}
|
|
|
|
public void a(View view, int i) {
|
|
a(view, i, true);
|
|
}
|
|
|
|
public void b(View view, Rect rect) {
|
|
RecyclerView.b(view, rect);
|
|
}
|
|
|
|
private void a(View view, int i, boolean z) {
|
|
ViewHolder m = RecyclerView.m(view);
|
|
if (!z && !m.isRemoved()) {
|
|
this.b.f.g(m);
|
|
} else {
|
|
this.b.f.a(m);
|
|
}
|
|
LayoutParams layoutParams = (LayoutParams) view.getLayoutParams();
|
|
if (!m.wasReturnedFromScrap() && !m.isScrap()) {
|
|
if (view.getParent() == this.b) {
|
|
int b = this.a.b(view);
|
|
if (i == -1) {
|
|
i = this.a.a();
|
|
}
|
|
if (b == -1) {
|
|
throw new IllegalStateException("Added View has RecyclerView as parent but view is not a real child. Unfiltered index:" + this.b.indexOfChild(view) + this.b.i());
|
|
}
|
|
if (b != i) {
|
|
this.b.m.a(b, i);
|
|
}
|
|
} else {
|
|
this.a.a(view, i, false);
|
|
layoutParams.c = true;
|
|
SmoothScroller smoothScroller = this.g;
|
|
if (smoothScroller != null && smoothScroller.e()) {
|
|
this.g.b(view);
|
|
}
|
|
}
|
|
} else {
|
|
if (m.isScrap()) {
|
|
m.unScrap();
|
|
} else {
|
|
m.clearReturnedFromScrapFlag();
|
|
}
|
|
this.a.a(view, i, view.getLayoutParams(), false);
|
|
}
|
|
if (layoutParams.d) {
|
|
m.itemView.invalidate();
|
|
layoutParams.d = false;
|
|
}
|
|
}
|
|
|
|
private int[] b(RecyclerView recyclerView, View view, Rect rect, boolean z) {
|
|
int[] iArr = new int[2];
|
|
int o = o();
|
|
int q = q();
|
|
int r = r() - p();
|
|
int h = h() - n();
|
|
int left = (view.getLeft() + rect.left) - view.getScrollX();
|
|
int top = (view.getTop() + rect.top) - view.getScrollY();
|
|
int width = rect.width() + left;
|
|
int height = rect.height() + top;
|
|
int i = left - o;
|
|
int min = Math.min(0, i);
|
|
int i2 = top - q;
|
|
int min2 = Math.min(0, i2);
|
|
int i3 = width - r;
|
|
int max = Math.max(0, i3);
|
|
int max2 = Math.max(0, height - h);
|
|
if (k() != 1) {
|
|
if (min == 0) {
|
|
min = Math.min(i, max);
|
|
}
|
|
max = min;
|
|
} else if (max == 0) {
|
|
max = Math.max(min, i3);
|
|
}
|
|
if (min2 == 0) {
|
|
min2 = Math.min(i2, max2);
|
|
}
|
|
iArr[0] = max;
|
|
iArr[1] = min2;
|
|
return iArr;
|
|
}
|
|
|
|
public void b(Recycler recycler) {
|
|
for (int e = e() - 1; e >= 0; e--) {
|
|
if (!RecyclerView.m(d(e)).shouldIgnore()) {
|
|
a(e, recycler);
|
|
}
|
|
}
|
|
}
|
|
|
|
public int b(Recycler recycler, State state) {
|
|
RecyclerView recyclerView = this.b;
|
|
if (recyclerView == null || recyclerView.l == null || !b()) {
|
|
return 1;
|
|
}
|
|
return this.b.l.getItemCount();
|
|
}
|
|
|
|
private void a(int i, View view) {
|
|
this.a.a(i);
|
|
}
|
|
|
|
public void a(View view, int i, LayoutParams layoutParams) {
|
|
ViewHolder m = RecyclerView.m(view);
|
|
if (m.isRemoved()) {
|
|
this.b.f.a(m);
|
|
} else {
|
|
this.b.f.g(m);
|
|
}
|
|
this.a.a(view, i, layoutParams, m.isRemoved());
|
|
}
|
|
|
|
public void a(int i, int i2) {
|
|
View d = d(i);
|
|
if (d != null) {
|
|
b(i);
|
|
c(d, i2);
|
|
} else {
|
|
throw new IllegalArgumentException("Cannot move a child from non-existing index:" + i + this.b.toString());
|
|
}
|
|
}
|
|
|
|
public void a(View view, Recycler recycler) {
|
|
o(view);
|
|
recycler.b(view);
|
|
}
|
|
|
|
public void a(int i, Recycler recycler) {
|
|
View d = d(i);
|
|
h(i);
|
|
recycler.b(d);
|
|
}
|
|
|
|
public void a(Recycler recycler) {
|
|
for (int e = e() - 1; e >= 0; e--) {
|
|
a(recycler, e, d(e));
|
|
}
|
|
}
|
|
|
|
private void a(Recycler recycler, int i, View view) {
|
|
ViewHolder m = RecyclerView.m(view);
|
|
if (m.shouldIgnore()) {
|
|
return;
|
|
}
|
|
if (m.isInvalid() && !m.isRemoved() && !this.b.l.hasStableIds()) {
|
|
h(i);
|
|
recycler.b(m);
|
|
} else {
|
|
b(i);
|
|
recycler.c(view);
|
|
this.b.f.d(m);
|
|
}
|
|
}
|
|
|
|
boolean a(View view, int i, int i2, LayoutParams layoutParams) {
|
|
return (!view.isLayoutRequested() && this.k && b(view.getWidth(), i, ((ViewGroup.MarginLayoutParams) layoutParams).width) && b(view.getHeight(), i2, ((ViewGroup.MarginLayoutParams) layoutParams).height)) ? false : true;
|
|
}
|
|
|
|
public void a(View view, int i, int i2) {
|
|
LayoutParams layoutParams = (LayoutParams) view.getLayoutParams();
|
|
Rect h = this.b.h(view);
|
|
int i3 = i + h.left + h.right;
|
|
int i4 = i2 + h.top + h.bottom;
|
|
int a = a(r(), s(), o() + p() + ((ViewGroup.MarginLayoutParams) layoutParams).leftMargin + ((ViewGroup.MarginLayoutParams) layoutParams).rightMargin + i3, ((ViewGroup.MarginLayoutParams) layoutParams).width, a());
|
|
int a2 = a(h(), i(), q() + n() + ((ViewGroup.MarginLayoutParams) layoutParams).topMargin + ((ViewGroup.MarginLayoutParams) layoutParams).bottomMargin + i4, ((ViewGroup.MarginLayoutParams) layoutParams).height, b());
|
|
if (a(view, a, a2, layoutParams)) {
|
|
view.measure(a, a2);
|
|
}
|
|
}
|
|
|
|
public static int a(int i, int i2, int i3, int i4, boolean z) {
|
|
int i5;
|
|
int i6 = i - i3;
|
|
int i7 = 0;
|
|
int max = Math.max(0, i6);
|
|
if (z) {
|
|
if (i4 < 0) {
|
|
if (i4 == -1) {
|
|
if (i2 == Integer.MIN_VALUE || (i2 != 0 && i2 == 1073741824)) {
|
|
i5 = max;
|
|
} else {
|
|
i2 = 0;
|
|
i5 = 0;
|
|
}
|
|
i7 = i2;
|
|
max = i5;
|
|
}
|
|
max = 0;
|
|
}
|
|
max = i4;
|
|
i7 = 1073741824;
|
|
} else {
|
|
if (i4 < 0) {
|
|
if (i4 == -1) {
|
|
i7 = i2;
|
|
} else {
|
|
if (i4 == -2) {
|
|
if (i2 == Integer.MIN_VALUE || i2 == 1073741824) {
|
|
i7 = Integer.MIN_VALUE;
|
|
}
|
|
}
|
|
max = 0;
|
|
}
|
|
}
|
|
max = i4;
|
|
i7 = 1073741824;
|
|
}
|
|
return View.MeasureSpec.makeMeasureSpec(max, i7);
|
|
}
|
|
|
|
public void a(View view, int i, int i2, int i3, int i4) {
|
|
Rect rect = ((LayoutParams) view.getLayoutParams()).b;
|
|
view.layout(i + rect.left, i2 + rect.top, i3 - rect.right, i4 - rect.bottom);
|
|
}
|
|
|
|
public void a(View view, boolean z, Rect rect) {
|
|
Matrix matrix;
|
|
if (z) {
|
|
Rect rect2 = ((LayoutParams) view.getLayoutParams()).b;
|
|
rect.set(-rect2.left, -rect2.top, view.getWidth() + rect2.right, view.getHeight() + rect2.bottom);
|
|
} else {
|
|
rect.set(0, 0, view.getWidth(), view.getHeight());
|
|
}
|
|
if (this.b != null && (matrix = view.getMatrix()) != null && !matrix.isIdentity()) {
|
|
RectF rectF = this.b.k;
|
|
rectF.set(rect);
|
|
matrix.mapRect(rectF);
|
|
rect.set((int) Math.floor(rectF.left), (int) Math.floor(rectF.top), (int) Math.ceil(rectF.right), (int) Math.ceil(rectF.bottom));
|
|
}
|
|
rect.offset(view.getLeft(), view.getTop());
|
|
}
|
|
|
|
public void a(View view, Rect rect) {
|
|
RecyclerView recyclerView = this.b;
|
|
if (recyclerView == null) {
|
|
rect.set(0, 0, 0, 0);
|
|
} else {
|
|
rect.set(recyclerView.h(view));
|
|
}
|
|
}
|
|
|
|
public boolean a(RecyclerView recyclerView, View view, Rect rect, boolean z) {
|
|
return a(recyclerView, view, rect, z, false);
|
|
}
|
|
|
|
public boolean a(RecyclerView recyclerView, View view, Rect rect, boolean z, boolean z2) {
|
|
int[] b = b(recyclerView, view, rect, z);
|
|
int i = b[0];
|
|
int i2 = b[1];
|
|
if ((z2 && !d(recyclerView, i, i2)) || (i == 0 && i2 == 0)) {
|
|
return false;
|
|
}
|
|
if (z) {
|
|
recyclerView.scrollBy(i, i2);
|
|
} else {
|
|
recyclerView.i(i, i2);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public boolean a(View view, boolean z, boolean z2) {
|
|
boolean z3 = this.e.a(view, 24579) && this.f.a(view, 24579);
|
|
return z ? z3 : !z3;
|
|
}
|
|
|
|
@Deprecated
|
|
public boolean a(RecyclerView recyclerView, View view, View view2) {
|
|
return x() || recyclerView.n();
|
|
}
|
|
|
|
public boolean a(RecyclerView recyclerView, State state, View view, View view2) {
|
|
return a(recyclerView, view, view2);
|
|
}
|
|
|
|
public void a(RecyclerView recyclerView, int i, int i2, Object obj) {
|
|
c(recyclerView, i, i2);
|
|
}
|
|
|
|
public void a(Recycler recycler, State state, int i, int i2) {
|
|
this.b.c(i, i2);
|
|
}
|
|
|
|
void a(SmoothScroller smoothScroller) {
|
|
if (this.g == smoothScroller) {
|
|
this.g = null;
|
|
}
|
|
}
|
|
|
|
void a(AccessibilityNodeInfoCompat accessibilityNodeInfoCompat) {
|
|
RecyclerView recyclerView = this.b;
|
|
a(recyclerView.b, recyclerView.i0, accessibilityNodeInfoCompat);
|
|
}
|
|
|
|
public void a(Recycler recycler, State state, AccessibilityNodeInfoCompat accessibilityNodeInfoCompat) {
|
|
if (this.b.canScrollVertically(-1) || this.b.canScrollHorizontally(-1)) {
|
|
accessibilityNodeInfoCompat.a(UnityActivity.BLOCKLY_TYPE_NONE);
|
|
accessibilityNodeInfoCompat.d(true);
|
|
}
|
|
if (this.b.canScrollVertically(1) || this.b.canScrollHorizontally(1)) {
|
|
accessibilityNodeInfoCompat.a(FileUtil.ZIP_BUFFER_SIZE);
|
|
accessibilityNodeInfoCompat.d(true);
|
|
}
|
|
accessibilityNodeInfoCompat.a(AccessibilityNodeInfoCompat.CollectionInfoCompat.a(b(recycler, state), a(recycler, state), d(recycler, state), c(recycler, state)));
|
|
}
|
|
|
|
public void a(AccessibilityEvent accessibilityEvent) {
|
|
RecyclerView recyclerView = this.b;
|
|
a(recyclerView.b, recyclerView.i0, accessibilityEvent);
|
|
}
|
|
|
|
public void a(Recycler recycler, State state, AccessibilityEvent accessibilityEvent) {
|
|
RecyclerView recyclerView = this.b;
|
|
if (recyclerView == null || accessibilityEvent == null) {
|
|
return;
|
|
}
|
|
boolean z = true;
|
|
if (!recyclerView.canScrollVertically(1) && !this.b.canScrollVertically(-1) && !this.b.canScrollHorizontally(-1) && !this.b.canScrollHorizontally(1)) {
|
|
z = false;
|
|
}
|
|
accessibilityEvent.setScrollable(z);
|
|
Adapter adapter = this.b.l;
|
|
if (adapter != null) {
|
|
accessibilityEvent.setItemCount(adapter.getItemCount());
|
|
}
|
|
}
|
|
|
|
void a(View view, AccessibilityNodeInfoCompat accessibilityNodeInfoCompat) {
|
|
ViewHolder m = RecyclerView.m(view);
|
|
if (m == null || m.isRemoved() || this.a.c(m.itemView)) {
|
|
return;
|
|
}
|
|
RecyclerView recyclerView = this.b;
|
|
a(recyclerView.b, recyclerView.i0, view, accessibilityNodeInfoCompat);
|
|
}
|
|
|
|
public void a(Recycler recycler, State state, View view, AccessibilityNodeInfoCompat accessibilityNodeInfoCompat) {
|
|
accessibilityNodeInfoCompat.b(AccessibilityNodeInfoCompat.CollectionItemInfoCompat.a(b() ? l(view) : 0, 1, a() ? l(view) : 0, 1, false, false));
|
|
}
|
|
|
|
public int a(Recycler recycler, State state) {
|
|
RecyclerView recyclerView = this.b;
|
|
if (recyclerView == null || recyclerView.l == null || !a()) {
|
|
return 1;
|
|
}
|
|
return this.b.l.getItemCount();
|
|
}
|
|
|
|
boolean a(int i, Bundle bundle) {
|
|
RecyclerView recyclerView = this.b;
|
|
return a(recyclerView.b, recyclerView.i0, i, bundle);
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:12:0x0070 A[ADDED_TO_REGION] */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
|
*/
|
|
public boolean a(androidx.recyclerview.widget.RecyclerView.Recycler r2, androidx.recyclerview.widget.RecyclerView.State r3, int r4, android.os.Bundle r5) {
|
|
/*
|
|
r1 = this;
|
|
androidx.recyclerview.widget.RecyclerView r2 = r1.b
|
|
r3 = 0
|
|
if (r2 != 0) goto L6
|
|
return r3
|
|
L6:
|
|
r5 = 4096(0x1000, float:5.74E-42)
|
|
r0 = 1
|
|
if (r4 == r5) goto L42
|
|
r5 = 8192(0x2000, float:1.148E-41)
|
|
if (r4 == r5) goto L12
|
|
r2 = 0
|
|
L10:
|
|
r4 = 0
|
|
goto L6e
|
|
L12:
|
|
r4 = -1
|
|
boolean r2 = r2.canScrollVertically(r4)
|
|
if (r2 == 0) goto L29
|
|
int r2 = r1.h()
|
|
int r5 = r1.q()
|
|
int r2 = r2 - r5
|
|
int r5 = r1.n()
|
|
int r2 = r2 - r5
|
|
int r2 = -r2
|
|
goto L2a
|
|
L29:
|
|
r2 = 0
|
|
L2a:
|
|
androidx.recyclerview.widget.RecyclerView r5 = r1.b
|
|
boolean r4 = r5.canScrollHorizontally(r4)
|
|
if (r4 == 0) goto L10
|
|
int r4 = r1.r()
|
|
int r5 = r1.o()
|
|
int r4 = r4 - r5
|
|
int r5 = r1.p()
|
|
int r4 = r4 - r5
|
|
int r4 = -r4
|
|
goto L6e
|
|
L42:
|
|
boolean r2 = r2.canScrollVertically(r0)
|
|
if (r2 == 0) goto L57
|
|
int r2 = r1.h()
|
|
int r4 = r1.q()
|
|
int r2 = r2 - r4
|
|
int r4 = r1.n()
|
|
int r2 = r2 - r4
|
|
goto L58
|
|
L57:
|
|
r2 = 0
|
|
L58:
|
|
androidx.recyclerview.widget.RecyclerView r4 = r1.b
|
|
boolean r4 = r4.canScrollHorizontally(r0)
|
|
if (r4 == 0) goto L10
|
|
int r4 = r1.r()
|
|
int r5 = r1.o()
|
|
int r4 = r4 - r5
|
|
int r5 = r1.p()
|
|
int r4 = r4 - r5
|
|
L6e:
|
|
if (r2 != 0) goto L73
|
|
if (r4 != 0) goto L73
|
|
return r3
|
|
L73:
|
|
androidx.recyclerview.widget.RecyclerView r3 = r1.b
|
|
r3.i(r4, r2)
|
|
return r0
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.LayoutManager.a(androidx.recyclerview.widget.RecyclerView$Recycler, androidx.recyclerview.widget.RecyclerView$State, int, android.os.Bundle):boolean");
|
|
}
|
|
|
|
boolean a(View view, int i, Bundle bundle) {
|
|
RecyclerView recyclerView = this.b;
|
|
return a(recyclerView.b, recyclerView.i0, view, i, bundle);
|
|
}
|
|
|
|
public static Properties a(Context context, AttributeSet attributeSet, int i, int i2) {
|
|
Properties properties = new Properties();
|
|
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, R$styleable.RecyclerView, i, i2);
|
|
properties.orientation = obtainStyledAttributes.getInt(R$styleable.RecyclerView_android_orientation, 1);
|
|
properties.spanCount = obtainStyledAttributes.getInt(R$styleable.RecyclerView_spanCount, 1);
|
|
properties.reverseLayout = obtainStyledAttributes.getBoolean(R$styleable.RecyclerView_reverseLayout, false);
|
|
properties.stackFromEnd = obtainStyledAttributes.getBoolean(R$styleable.RecyclerView_stackFromEnd, false);
|
|
obtainStyledAttributes.recycle();
|
|
return properties;
|
|
}
|
|
}
|
|
|
|
public interface OnChildAttachStateChangeListener {
|
|
void a(View view);
|
|
|
|
void b(View view);
|
|
}
|
|
|
|
public static abstract class OnFlingListener {
|
|
public abstract boolean a(int i, int i2);
|
|
}
|
|
|
|
public interface OnItemTouchListener {
|
|
boolean onInterceptTouchEvent(RecyclerView recyclerView, MotionEvent motionEvent);
|
|
|
|
void onRequestDisallowInterceptTouchEvent(boolean z);
|
|
|
|
void onTouchEvent(RecyclerView recyclerView, MotionEvent motionEvent);
|
|
}
|
|
|
|
public static abstract class OnScrollListener {
|
|
public void a(RecyclerView recyclerView, int i) {
|
|
}
|
|
|
|
public void a(RecyclerView recyclerView, int i, int i2) {
|
|
}
|
|
}
|
|
|
|
public final class Recycler {
|
|
final ArrayList<ViewHolder> a = new ArrayList<>();
|
|
ArrayList<ViewHolder> b = null;
|
|
final ArrayList<ViewHolder> c = new ArrayList<>();
|
|
private final List<ViewHolder> d = Collections.unmodifiableList(this.a);
|
|
private int e = 2;
|
|
int f = 2;
|
|
RecycledViewPool g;
|
|
private ViewCacheExtension h;
|
|
|
|
public Recycler() {
|
|
}
|
|
|
|
private void e(ViewHolder viewHolder) {
|
|
if (RecyclerView.this.m()) {
|
|
View view = viewHolder.itemView;
|
|
if (ViewCompat.i(view) == 0) {
|
|
ViewCompat.f(view, 1);
|
|
}
|
|
if (ViewCompat.s(view)) {
|
|
return;
|
|
}
|
|
viewHolder.addFlags(16384);
|
|
ViewCompat.a(view, RecyclerView.this.p0.b());
|
|
}
|
|
}
|
|
|
|
public void a() {
|
|
this.a.clear();
|
|
i();
|
|
}
|
|
|
|
View b(int i, boolean z) {
|
|
return a(i, z, Long.MAX_VALUE).itemView;
|
|
}
|
|
|
|
void c(View view) {
|
|
ViewHolder m = RecyclerView.m(view);
|
|
if (!m.hasAnyOfTheFlags(12) && m.isUpdated() && !RecyclerView.this.a(m)) {
|
|
if (this.b == null) {
|
|
this.b = new ArrayList<>();
|
|
}
|
|
m.setScrapContainer(this, true);
|
|
this.b.add(m);
|
|
return;
|
|
}
|
|
if (!m.isInvalid() || m.isRemoved() || RecyclerView.this.l.hasStableIds()) {
|
|
m.setScrapContainer(this, false);
|
|
this.a.add(m);
|
|
} else {
|
|
throw new IllegalArgumentException("Called scrap view with an invalid view. Invalid views cannot be reused from scrap, they should rebound from recycler pool." + RecyclerView.this.i());
|
|
}
|
|
}
|
|
|
|
boolean d(ViewHolder viewHolder) {
|
|
if (viewHolder.isRemoved()) {
|
|
return RecyclerView.this.i0.d();
|
|
}
|
|
int i = viewHolder.mPosition;
|
|
if (i >= 0 && i < RecyclerView.this.l.getItemCount()) {
|
|
if (RecyclerView.this.i0.d() || RecyclerView.this.l.getItemViewType(viewHolder.mPosition) == viewHolder.getItemViewType()) {
|
|
return !RecyclerView.this.l.hasStableIds() || viewHolder.getItemId() == RecyclerView.this.l.getItemId(viewHolder.mPosition);
|
|
}
|
|
return false;
|
|
}
|
|
throw new IndexOutOfBoundsException("Inconsistency detected. Invalid view holder adapter position" + viewHolder + RecyclerView.this.i());
|
|
}
|
|
|
|
public void f(int i) {
|
|
this.e = i;
|
|
j();
|
|
}
|
|
|
|
void g() {
|
|
int size = this.c.size();
|
|
for (int i = 0; i < size; i++) {
|
|
LayoutParams layoutParams = (LayoutParams) this.c.get(i).itemView.getLayoutParams();
|
|
if (layoutParams != null) {
|
|
layoutParams.c = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
void h() {
|
|
int size = this.c.size();
|
|
for (int i = 0; i < size; i++) {
|
|
ViewHolder viewHolder = this.c.get(i);
|
|
if (viewHolder != null) {
|
|
viewHolder.addFlags(6);
|
|
viewHolder.addChangePayload(null);
|
|
}
|
|
}
|
|
Adapter adapter = RecyclerView.this.l;
|
|
if (adapter == null || !adapter.hasStableIds()) {
|
|
i();
|
|
}
|
|
}
|
|
|
|
void i() {
|
|
for (int size = this.c.size() - 1; size >= 0; size--) {
|
|
e(size);
|
|
}
|
|
this.c.clear();
|
|
if (RecyclerView.F0) {
|
|
RecyclerView.this.h0.a();
|
|
}
|
|
}
|
|
|
|
void j() {
|
|
LayoutManager layoutManager = RecyclerView.this.m;
|
|
this.f = this.e + (layoutManager != null ? layoutManager.m : 0);
|
|
for (int size = this.c.size() - 1; size >= 0 && this.c.size() > this.f; size--) {
|
|
e(size);
|
|
}
|
|
}
|
|
|
|
public void b(View view) {
|
|
ViewHolder m = RecyclerView.m(view);
|
|
if (m.isTmpDetached()) {
|
|
RecyclerView.this.removeDetachedView(view, false);
|
|
}
|
|
if (m.isScrap()) {
|
|
m.unScrap();
|
|
} else if (m.wasReturnedFromScrap()) {
|
|
m.clearReturnedFromScrapFlag();
|
|
}
|
|
b(m);
|
|
}
|
|
|
|
private boolean a(ViewHolder viewHolder, int i, int i2, long j) {
|
|
viewHolder.mOwnerRecyclerView = RecyclerView.this;
|
|
int itemViewType = viewHolder.getItemViewType();
|
|
long nanoTime = RecyclerView.this.getNanoTime();
|
|
if (j != Long.MAX_VALUE && !this.g.a(itemViewType, nanoTime, j)) {
|
|
return false;
|
|
}
|
|
RecyclerView.this.l.bindViewHolder(viewHolder, i);
|
|
this.g.a(viewHolder.getItemViewType(), RecyclerView.this.getNanoTime() - nanoTime);
|
|
e(viewHolder);
|
|
if (!RecyclerView.this.i0.d()) {
|
|
return true;
|
|
}
|
|
viewHolder.mPreLayoutPosition = i2;
|
|
return true;
|
|
}
|
|
|
|
public List<ViewHolder> f() {
|
|
return this.d;
|
|
}
|
|
|
|
private void f(ViewHolder viewHolder) {
|
|
View view = viewHolder.itemView;
|
|
if (view instanceof ViewGroup) {
|
|
a((ViewGroup) view, false);
|
|
}
|
|
}
|
|
|
|
void b(ViewHolder viewHolder) {
|
|
boolean z;
|
|
if (!viewHolder.isScrap() && viewHolder.itemView.getParent() == null) {
|
|
if (!viewHolder.isTmpDetached()) {
|
|
if (!viewHolder.shouldIgnore()) {
|
|
boolean doesTransientStatePreventRecycling = viewHolder.doesTransientStatePreventRecycling();
|
|
Adapter adapter = RecyclerView.this.l;
|
|
if ((adapter != null && doesTransientStatePreventRecycling && adapter.onFailedToRecycleView(viewHolder)) || viewHolder.isRecyclable()) {
|
|
if (this.f <= 0 || viewHolder.hasAnyOfTheFlags(526)) {
|
|
z = false;
|
|
} else {
|
|
int size = this.c.size();
|
|
if (size >= this.f && size > 0) {
|
|
e(0);
|
|
size--;
|
|
}
|
|
if (RecyclerView.F0 && size > 0 && !RecyclerView.this.h0.a(viewHolder.mPosition)) {
|
|
int i = size - 1;
|
|
while (i >= 0) {
|
|
if (!RecyclerView.this.h0.a(this.c.get(i).mPosition)) {
|
|
break;
|
|
} else {
|
|
i--;
|
|
}
|
|
}
|
|
size = i + 1;
|
|
}
|
|
this.c.add(size, viewHolder);
|
|
z = true;
|
|
}
|
|
if (!z) {
|
|
a(viewHolder, true);
|
|
r1 = true;
|
|
}
|
|
} else {
|
|
z = false;
|
|
}
|
|
RecyclerView.this.f.h(viewHolder);
|
|
if (z || r1 || !doesTransientStatePreventRecycling) {
|
|
return;
|
|
}
|
|
viewHolder.mOwnerRecyclerView = null;
|
|
return;
|
|
}
|
|
throw new IllegalArgumentException("Trying to recycle an ignored view holder. You should first call stopIgnoringView(view) before calling recycle." + RecyclerView.this.i());
|
|
}
|
|
throw new IllegalArgumentException("Tmp detached view should be removed from RecyclerView before it can be recycled: " + viewHolder + RecyclerView.this.i());
|
|
}
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("Scrapped or attached views may not be recycled. isScrap:");
|
|
sb.append(viewHolder.isScrap());
|
|
sb.append(" isAttached:");
|
|
sb.append(viewHolder.itemView.getParent() != null);
|
|
sb.append(RecyclerView.this.i());
|
|
throw new IllegalArgumentException(sb.toString());
|
|
}
|
|
|
|
void e(int i) {
|
|
a(this.c.get(i), true);
|
|
this.c.remove(i);
|
|
}
|
|
|
|
public View d(int i) {
|
|
return b(i, false);
|
|
}
|
|
|
|
RecycledViewPool d() {
|
|
if (this.g == null) {
|
|
this.g = new RecycledViewPool();
|
|
}
|
|
return this.g;
|
|
}
|
|
|
|
void c(ViewHolder viewHolder) {
|
|
if (viewHolder.mInChangeScrap) {
|
|
this.b.remove(viewHolder);
|
|
} else {
|
|
this.a.remove(viewHolder);
|
|
}
|
|
viewHolder.mScrapContainer = null;
|
|
viewHolder.mInChangeScrap = false;
|
|
viewHolder.clearReturnedFromScrapFlag();
|
|
}
|
|
|
|
int e() {
|
|
return this.a.size();
|
|
}
|
|
|
|
public int a(int i) {
|
|
if (i >= 0 && i < RecyclerView.this.i0.a()) {
|
|
return !RecyclerView.this.i0.d() ? i : RecyclerView.this.d.b(i);
|
|
}
|
|
throw new IndexOutOfBoundsException("invalid position " + i + ". State item count is " + RecyclerView.this.i0.a() + RecyclerView.this.i());
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:15:0x0037 */
|
|
/* JADX WARN: Removed duplicated region for block: B:24:0x005c */
|
|
/* JADX WARN: Removed duplicated region for block: B:26:0x005f */
|
|
/* JADX WARN: Removed duplicated region for block: B:69:0x0189 */
|
|
/* JADX WARN: Removed duplicated region for block: B:75:0x01a6 */
|
|
/* JADX WARN: Removed duplicated region for block: B:78:0x01c9 */
|
|
/* JADX WARN: Removed duplicated region for block: B:84:0x0202 */
|
|
/* JADX WARN: Removed duplicated region for block: B:87:0x022c A[ADDED_TO_REGION] */
|
|
/* JADX WARN: Removed duplicated region for block: B:91:0x0210 */
|
|
/* JADX WARN: Removed duplicated region for block: B:97:0x01d8 */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
|
*/
|
|
androidx.recyclerview.widget.RecyclerView.ViewHolder a(int r17, boolean r18, long r19) {
|
|
/*
|
|
Method dump skipped, instructions count: 619
|
|
To view this dump change 'Code comments level' option to 'DEBUG'
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.Recycler.a(int, boolean, long):androidx.recyclerview.widget.RecyclerView$ViewHolder");
|
|
}
|
|
|
|
View c(int i) {
|
|
return this.a.get(i).itemView;
|
|
}
|
|
|
|
void c() {
|
|
this.a.clear();
|
|
ArrayList<ViewHolder> arrayList = this.b;
|
|
if (arrayList != null) {
|
|
arrayList.clear();
|
|
}
|
|
}
|
|
|
|
void c(int i, int i2) {
|
|
int i3;
|
|
int i4 = i2 + i;
|
|
for (int size = this.c.size() - 1; size >= 0; size--) {
|
|
ViewHolder viewHolder = this.c.get(size);
|
|
if (viewHolder != null && (i3 = viewHolder.mPosition) >= i && i3 < i4) {
|
|
viewHolder.addFlags(2);
|
|
e(size);
|
|
}
|
|
}
|
|
}
|
|
|
|
ViewHolder b(int i) {
|
|
int size;
|
|
int b;
|
|
ArrayList<ViewHolder> arrayList = this.b;
|
|
if (arrayList != null && (size = arrayList.size()) != 0) {
|
|
for (int i2 = 0; i2 < size; i2++) {
|
|
ViewHolder viewHolder = this.b.get(i2);
|
|
if (!viewHolder.wasReturnedFromScrap() && viewHolder.getLayoutPosition() == i) {
|
|
viewHolder.addFlags(32);
|
|
return viewHolder;
|
|
}
|
|
}
|
|
if (RecyclerView.this.l.hasStableIds() && (b = RecyclerView.this.d.b(i)) > 0 && b < RecyclerView.this.l.getItemCount()) {
|
|
long itemId = RecyclerView.this.l.getItemId(b);
|
|
for (int i3 = 0; i3 < size; i3++) {
|
|
ViewHolder viewHolder2 = this.b.get(i3);
|
|
if (!viewHolder2.wasReturnedFromScrap() && viewHolder2.getItemId() == itemId) {
|
|
viewHolder2.addFlags(32);
|
|
return viewHolder2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
void b(int i, int i2) {
|
|
int i3;
|
|
int i4;
|
|
int i5;
|
|
int i6;
|
|
if (i < i2) {
|
|
i4 = i;
|
|
i3 = i2;
|
|
i5 = -1;
|
|
} else {
|
|
i3 = i;
|
|
i4 = i2;
|
|
i5 = 1;
|
|
}
|
|
int size = this.c.size();
|
|
for (int i7 = 0; i7 < size; i7++) {
|
|
ViewHolder viewHolder = this.c.get(i7);
|
|
if (viewHolder != null && (i6 = viewHolder.mPosition) >= i4 && i6 <= i3) {
|
|
if (i6 == i) {
|
|
viewHolder.offsetPosition(i2 - i, false);
|
|
} else {
|
|
viewHolder.offsetPosition(i5, false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
void b() {
|
|
int size = this.c.size();
|
|
for (int i = 0; i < size; i++) {
|
|
this.c.get(i).clearOldPosition();
|
|
}
|
|
int size2 = this.a.size();
|
|
for (int i2 = 0; i2 < size2; i2++) {
|
|
this.a.get(i2).clearOldPosition();
|
|
}
|
|
ArrayList<ViewHolder> arrayList = this.b;
|
|
if (arrayList != null) {
|
|
int size3 = arrayList.size();
|
|
for (int i3 = 0; i3 < size3; i3++) {
|
|
this.b.get(i3).clearOldPosition();
|
|
}
|
|
}
|
|
}
|
|
|
|
private void a(ViewGroup viewGroup, boolean z) {
|
|
for (int childCount = viewGroup.getChildCount() - 1; childCount >= 0; childCount--) {
|
|
View childAt = viewGroup.getChildAt(childCount);
|
|
if (childAt instanceof ViewGroup) {
|
|
a((ViewGroup) childAt, true);
|
|
}
|
|
}
|
|
if (z) {
|
|
if (viewGroup.getVisibility() == 4) {
|
|
viewGroup.setVisibility(0);
|
|
viewGroup.setVisibility(4);
|
|
} else {
|
|
int visibility = viewGroup.getVisibility();
|
|
viewGroup.setVisibility(4);
|
|
viewGroup.setVisibility(visibility);
|
|
}
|
|
}
|
|
}
|
|
|
|
void a(ViewHolder viewHolder, boolean z) {
|
|
RecyclerView.e(viewHolder);
|
|
if (viewHolder.hasAnyOfTheFlags(16384)) {
|
|
viewHolder.setFlags(0, 16384);
|
|
ViewCompat.a(viewHolder.itemView, (AccessibilityDelegateCompat) null);
|
|
}
|
|
if (z) {
|
|
a(viewHolder);
|
|
}
|
|
viewHolder.mOwnerRecyclerView = null;
|
|
d().a(viewHolder);
|
|
}
|
|
|
|
void a(View view) {
|
|
ViewHolder m = RecyclerView.m(view);
|
|
m.mScrapContainer = null;
|
|
m.mInChangeScrap = false;
|
|
m.clearReturnedFromScrapFlag();
|
|
b(m);
|
|
}
|
|
|
|
ViewHolder a(int i, boolean z) {
|
|
View b;
|
|
int size = this.a.size();
|
|
for (int i2 = 0; i2 < size; i2++) {
|
|
ViewHolder viewHolder = this.a.get(i2);
|
|
if (!viewHolder.wasReturnedFromScrap() && viewHolder.getLayoutPosition() == i && !viewHolder.isInvalid() && (RecyclerView.this.i0.h || !viewHolder.isRemoved())) {
|
|
viewHolder.addFlags(32);
|
|
return viewHolder;
|
|
}
|
|
}
|
|
if (!z && (b = RecyclerView.this.e.b(i)) != null) {
|
|
ViewHolder m = RecyclerView.m(b);
|
|
RecyclerView.this.e.f(b);
|
|
int b2 = RecyclerView.this.e.b(b);
|
|
if (b2 != -1) {
|
|
RecyclerView.this.e.a(b2);
|
|
c(b);
|
|
m.addFlags(8224);
|
|
return m;
|
|
}
|
|
throw new IllegalStateException("layout index should not be -1 after unhiding a view:" + m + RecyclerView.this.i());
|
|
}
|
|
int size2 = this.c.size();
|
|
for (int i3 = 0; i3 < size2; i3++) {
|
|
ViewHolder viewHolder2 = this.c.get(i3);
|
|
if (!viewHolder2.isInvalid() && viewHolder2.getLayoutPosition() == i) {
|
|
if (!z) {
|
|
this.c.remove(i3);
|
|
}
|
|
return viewHolder2;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
ViewHolder a(long j, int i, boolean z) {
|
|
for (int size = this.a.size() - 1; size >= 0; size--) {
|
|
ViewHolder viewHolder = this.a.get(size);
|
|
if (viewHolder.getItemId() == j && !viewHolder.wasReturnedFromScrap()) {
|
|
if (i == viewHolder.getItemViewType()) {
|
|
viewHolder.addFlags(32);
|
|
if (viewHolder.isRemoved() && !RecyclerView.this.i0.d()) {
|
|
viewHolder.setFlags(2, 14);
|
|
}
|
|
return viewHolder;
|
|
}
|
|
if (!z) {
|
|
this.a.remove(size);
|
|
RecyclerView.this.removeDetachedView(viewHolder.itemView, false);
|
|
a(viewHolder.itemView);
|
|
}
|
|
}
|
|
}
|
|
int size2 = this.c.size();
|
|
while (true) {
|
|
size2--;
|
|
if (size2 < 0) {
|
|
return null;
|
|
}
|
|
ViewHolder viewHolder2 = this.c.get(size2);
|
|
if (viewHolder2.getItemId() == j) {
|
|
if (i == viewHolder2.getItemViewType()) {
|
|
if (!z) {
|
|
this.c.remove(size2);
|
|
}
|
|
return viewHolder2;
|
|
}
|
|
if (!z) {
|
|
e(size2);
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
void a(ViewHolder viewHolder) {
|
|
RecyclerListener recyclerListener = RecyclerView.this.n;
|
|
if (recyclerListener != null) {
|
|
recyclerListener.a(viewHolder);
|
|
}
|
|
Adapter adapter = RecyclerView.this.l;
|
|
if (adapter != null) {
|
|
adapter.onViewRecycled(viewHolder);
|
|
}
|
|
RecyclerView recyclerView = RecyclerView.this;
|
|
if (recyclerView.i0 != null) {
|
|
recyclerView.f.h(viewHolder);
|
|
}
|
|
}
|
|
|
|
void a(Adapter adapter, Adapter adapter2, boolean z) {
|
|
a();
|
|
d().a(adapter, adapter2, z);
|
|
}
|
|
|
|
void a(int i, int i2) {
|
|
int size = this.c.size();
|
|
for (int i3 = 0; i3 < size; i3++) {
|
|
ViewHolder viewHolder = this.c.get(i3);
|
|
if (viewHolder != null && viewHolder.mPosition >= i) {
|
|
viewHolder.offsetPosition(i2, true);
|
|
}
|
|
}
|
|
}
|
|
|
|
void a(int i, int i2, boolean z) {
|
|
int i3 = i + i2;
|
|
for (int size = this.c.size() - 1; size >= 0; size--) {
|
|
ViewHolder viewHolder = this.c.get(size);
|
|
if (viewHolder != null) {
|
|
int i4 = viewHolder.mPosition;
|
|
if (i4 >= i3) {
|
|
viewHolder.offsetPosition(-i2, z);
|
|
} else if (i4 >= i) {
|
|
viewHolder.addFlags(8);
|
|
e(size);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
void a(ViewCacheExtension viewCacheExtension) {
|
|
this.h = viewCacheExtension;
|
|
}
|
|
|
|
void a(RecycledViewPool recycledViewPool) {
|
|
RecycledViewPool recycledViewPool2 = this.g;
|
|
if (recycledViewPool2 != null) {
|
|
recycledViewPool2.c();
|
|
}
|
|
this.g = recycledViewPool;
|
|
if (this.g == null || RecyclerView.this.getAdapter() == null) {
|
|
return;
|
|
}
|
|
this.g.a();
|
|
}
|
|
}
|
|
|
|
public interface RecyclerListener {
|
|
void a(ViewHolder viewHolder);
|
|
}
|
|
|
|
public static abstract class SmoothScroller {
|
|
private RecyclerView b;
|
|
private LayoutManager c;
|
|
private boolean d;
|
|
private boolean e;
|
|
private View f;
|
|
private boolean h;
|
|
private int a = -1;
|
|
private final Action g = new Action(0, 0);
|
|
|
|
public static class Action {
|
|
private int a;
|
|
private int b;
|
|
private int c;
|
|
private int d;
|
|
private Interpolator e;
|
|
private boolean f;
|
|
private int g;
|
|
|
|
public Action(int i, int i2) {
|
|
this(i, i2, Integer.MIN_VALUE, null);
|
|
}
|
|
|
|
private void b() {
|
|
if (this.e != null && this.c < 1) {
|
|
throw new IllegalStateException("If you provide an interpolator, you must set a positive duration");
|
|
}
|
|
if (this.c < 1) {
|
|
throw new IllegalStateException("Scroll duration must be a positive number");
|
|
}
|
|
}
|
|
|
|
public void a(int i) {
|
|
this.d = i;
|
|
}
|
|
|
|
public Action(int i, int i2, int i3, Interpolator interpolator) {
|
|
this.d = -1;
|
|
this.f = false;
|
|
this.g = 0;
|
|
this.a = i;
|
|
this.b = i2;
|
|
this.c = i3;
|
|
this.e = interpolator;
|
|
}
|
|
|
|
boolean a() {
|
|
return this.d >= 0;
|
|
}
|
|
|
|
void a(RecyclerView recyclerView) {
|
|
int i = this.d;
|
|
if (i >= 0) {
|
|
this.d = -1;
|
|
recyclerView.f(i);
|
|
this.f = false;
|
|
return;
|
|
}
|
|
if (this.f) {
|
|
b();
|
|
Interpolator interpolator = this.e;
|
|
if (interpolator == null) {
|
|
int i2 = this.c;
|
|
if (i2 == Integer.MIN_VALUE) {
|
|
recyclerView.f0.b(this.a, this.b);
|
|
} else {
|
|
recyclerView.f0.a(this.a, this.b, i2);
|
|
}
|
|
} else {
|
|
recyclerView.f0.a(this.a, this.b, this.c, interpolator);
|
|
}
|
|
this.g++;
|
|
if (this.g > 10) {
|
|
Log.e("RecyclerView", "Smooth Scroll action is being updated too frequently. Make sure you are not changing it unless necessary");
|
|
}
|
|
this.f = false;
|
|
return;
|
|
}
|
|
this.g = 0;
|
|
}
|
|
|
|
public void a(int i, int i2, int i3, Interpolator interpolator) {
|
|
this.a = i;
|
|
this.b = i2;
|
|
this.c = i3;
|
|
this.e = interpolator;
|
|
this.f = true;
|
|
}
|
|
}
|
|
|
|
public interface ScrollVectorProvider {
|
|
PointF a(int i);
|
|
}
|
|
|
|
protected abstract void a(int i, int i2, State state, Action action);
|
|
|
|
protected abstract void a(View view, State state, Action action);
|
|
|
|
void a(RecyclerView recyclerView, LayoutManager layoutManager) {
|
|
if (this.h) {
|
|
Log.w("RecyclerView", "An instance of " + getClass().getSimpleName() + " was started more than once. Each instance of" + getClass().getSimpleName() + " is intended to only be used once. You should create a new instance for each use.");
|
|
}
|
|
this.b = recyclerView;
|
|
this.c = layoutManager;
|
|
int i = this.a;
|
|
if (i == -1) {
|
|
throw new IllegalArgumentException("Invalid target position");
|
|
}
|
|
this.b.i0.a = i;
|
|
this.e = true;
|
|
this.d = true;
|
|
this.f = b(c());
|
|
f();
|
|
this.b.f0.a();
|
|
this.h = true;
|
|
}
|
|
|
|
public LayoutManager b() {
|
|
return this.c;
|
|
}
|
|
|
|
public void c(int i) {
|
|
this.a = i;
|
|
}
|
|
|
|
public boolean d() {
|
|
return this.d;
|
|
}
|
|
|
|
public boolean e() {
|
|
return this.e;
|
|
}
|
|
|
|
protected abstract void f();
|
|
|
|
protected abstract void g();
|
|
|
|
protected final void h() {
|
|
if (this.e) {
|
|
this.e = false;
|
|
g();
|
|
this.b.i0.a = -1;
|
|
this.f = null;
|
|
this.a = -1;
|
|
this.d = false;
|
|
this.c.a(this);
|
|
this.c = null;
|
|
this.b = null;
|
|
}
|
|
}
|
|
|
|
public View b(int i) {
|
|
return this.b.m.c(i);
|
|
}
|
|
|
|
public int c() {
|
|
return this.a;
|
|
}
|
|
|
|
protected void b(View view) {
|
|
if (a(view) == c()) {
|
|
this.f = view;
|
|
}
|
|
}
|
|
|
|
public PointF a(int i) {
|
|
Object b = b();
|
|
if (b instanceof ScrollVectorProvider) {
|
|
return ((ScrollVectorProvider) b).a(i);
|
|
}
|
|
Log.w("RecyclerView", "You should override computeScrollVectorForPosition when the LayoutManager does not implement " + ScrollVectorProvider.class.getCanonicalName());
|
|
return null;
|
|
}
|
|
|
|
void a(int i, int i2) {
|
|
PointF a;
|
|
RecyclerView recyclerView = this.b;
|
|
if (!this.e || this.a == -1 || recyclerView == null) {
|
|
h();
|
|
}
|
|
if (this.d && this.f == null && this.c != null && (a = a(this.a)) != null && (a.x != 0.0f || a.y != 0.0f)) {
|
|
recyclerView.a((int) Math.signum(a.x), (int) Math.signum(a.y), (int[]) null);
|
|
}
|
|
this.d = false;
|
|
View view = this.f;
|
|
if (view != null) {
|
|
if (a(view) == this.a) {
|
|
a(this.f, recyclerView.i0, this.g);
|
|
this.g.a(recyclerView);
|
|
h();
|
|
} else {
|
|
Log.e("RecyclerView", "Passed over target position while smooth scrolling.");
|
|
this.f = null;
|
|
}
|
|
}
|
|
if (this.e) {
|
|
a(i, i2, recyclerView.i0, this.g);
|
|
boolean a2 = this.g.a();
|
|
this.g.a(recyclerView);
|
|
if (a2) {
|
|
if (this.e) {
|
|
this.d = true;
|
|
recyclerView.f0.a();
|
|
} else {
|
|
h();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public int a(View view) {
|
|
return this.b.f(view);
|
|
}
|
|
|
|
public int a() {
|
|
return this.b.m.e();
|
|
}
|
|
|
|
protected void a(PointF pointF) {
|
|
float f = pointF.x;
|
|
float f2 = pointF.y;
|
|
float sqrt = (float) Math.sqrt((f * f) + (f2 * f2));
|
|
pointF.x /= sqrt;
|
|
pointF.y /= sqrt;
|
|
}
|
|
}
|
|
|
|
public static abstract class ViewCacheExtension {
|
|
public abstract View a(Recycler recycler, int i, int i2);
|
|
}
|
|
|
|
class ViewFlinger implements Runnable {
|
|
private int a;
|
|
private int b;
|
|
OverScroller c;
|
|
Interpolator d = RecyclerView.J0;
|
|
private boolean e = false;
|
|
private boolean f = false;
|
|
|
|
ViewFlinger() {
|
|
this.c = new OverScroller(RecyclerView.this.getContext(), RecyclerView.J0);
|
|
}
|
|
|
|
private void c() {
|
|
this.f = false;
|
|
this.e = true;
|
|
}
|
|
|
|
private void d() {
|
|
this.e = false;
|
|
if (this.f) {
|
|
a();
|
|
}
|
|
}
|
|
|
|
void a() {
|
|
if (this.e) {
|
|
this.f = true;
|
|
} else {
|
|
RecyclerView.this.removeCallbacks(this);
|
|
ViewCompat.a(RecyclerView.this, this);
|
|
}
|
|
}
|
|
|
|
public void b(int i, int i2) {
|
|
a(i, i2, 0, 0);
|
|
}
|
|
|
|
/* JADX WARN: Code restructure failed: missing block: B:55:0x00eb, code lost:
|
|
|
|
if (r8 > 0) goto L50;
|
|
*/
|
|
/* JADX WARN: Removed duplicated region for block: B:41:0x00e7 */
|
|
/* JADX WARN: Removed duplicated region for block: B:45:0x00f7 */
|
|
/* JADX WARN: Removed duplicated region for block: B:47:0x00fe A[ADDED_TO_REGION] */
|
|
@Override // java.lang.Runnable
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
|
*/
|
|
public void run() {
|
|
/*
|
|
Method dump skipped, instructions count: 418
|
|
To view this dump change 'Code comments level' option to 'DEBUG'
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.ViewFlinger.run():void");
|
|
}
|
|
|
|
private int b(int i, int i2, int i3, int i4) {
|
|
int i5;
|
|
int abs = Math.abs(i);
|
|
int abs2 = Math.abs(i2);
|
|
boolean z = abs > abs2;
|
|
int sqrt = (int) Math.sqrt((i3 * i3) + (i4 * i4));
|
|
int sqrt2 = (int) Math.sqrt((i * i) + (i2 * i2));
|
|
RecyclerView recyclerView = RecyclerView.this;
|
|
int width = z ? recyclerView.getWidth() : recyclerView.getHeight();
|
|
int i6 = width / 2;
|
|
float f = width;
|
|
float f2 = i6;
|
|
float a = f2 + (a(Math.min(1.0f, (sqrt2 * 1.0f) / f)) * f2);
|
|
if (sqrt > 0) {
|
|
i5 = Math.round(Math.abs(a / sqrt) * 1000.0f) * 4;
|
|
} else {
|
|
if (!z) {
|
|
abs = abs2;
|
|
}
|
|
i5 = (int) (((abs / f) + 1.0f) * 300.0f);
|
|
}
|
|
return Math.min(i5, 2000);
|
|
}
|
|
|
|
public void a(int i, int i2) {
|
|
RecyclerView.this.setScrollState(2);
|
|
this.b = 0;
|
|
this.a = 0;
|
|
this.c.fling(0, 0, i, i2, Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, Integer.MAX_VALUE);
|
|
a();
|
|
}
|
|
|
|
public void a(int i, int i2, int i3, int i4) {
|
|
a(i, i2, b(i, i2, i3, i4));
|
|
}
|
|
|
|
private float a(float f) {
|
|
return (float) Math.sin((f - 0.5f) * 0.47123894f);
|
|
}
|
|
|
|
public void a(int i, int i2, int i3) {
|
|
a(i, i2, i3, RecyclerView.J0);
|
|
}
|
|
|
|
public void a(int i, int i2, Interpolator interpolator) {
|
|
int b = b(i, i2, 0, 0);
|
|
if (interpolator == null) {
|
|
interpolator = RecyclerView.J0;
|
|
}
|
|
a(i, i2, b, interpolator);
|
|
}
|
|
|
|
public void b() {
|
|
RecyclerView.this.removeCallbacks(this);
|
|
this.c.abortAnimation();
|
|
}
|
|
|
|
public void a(int i, int i2, int i3, Interpolator interpolator) {
|
|
if (this.d != interpolator) {
|
|
this.d = interpolator;
|
|
this.c = new OverScroller(RecyclerView.this.getContext(), interpolator);
|
|
}
|
|
RecyclerView.this.setScrollState(2);
|
|
this.b = 0;
|
|
this.a = 0;
|
|
this.c.startScroll(0, 0, i, i2, i3);
|
|
if (Build.VERSION.SDK_INT < 23) {
|
|
this.c.computeScrollOffset();
|
|
}
|
|
a();
|
|
}
|
|
}
|
|
|
|
public static abstract class ViewHolder {
|
|
static final int FLAG_ADAPTER_FULLUPDATE = 1024;
|
|
static final int FLAG_ADAPTER_POSITION_UNKNOWN = 512;
|
|
static final int FLAG_APPEARED_IN_PRE_LAYOUT = 4096;
|
|
static final int FLAG_BOUNCED_FROM_HIDDEN_LIST = 8192;
|
|
static final int FLAG_BOUND = 1;
|
|
static final int FLAG_IGNORE = 128;
|
|
static final int FLAG_INVALID = 4;
|
|
static final int FLAG_MOVED = 2048;
|
|
static final int FLAG_NOT_RECYCLABLE = 16;
|
|
static final int FLAG_REMOVED = 8;
|
|
static final int FLAG_RETURNED_FROM_SCRAP = 32;
|
|
static final int FLAG_SET_A11Y_ITEM_DELEGATE = 16384;
|
|
static final int FLAG_TMP_DETACHED = 256;
|
|
static final int FLAG_UPDATE = 2;
|
|
private static final List<Object> FULLUPDATE_PAYLOADS = Collections.emptyList();
|
|
static final int PENDING_ACCESSIBILITY_STATE_NOT_SET = -1;
|
|
public final View itemView;
|
|
int mFlags;
|
|
WeakReference<RecyclerView> mNestedRecyclerView;
|
|
RecyclerView mOwnerRecyclerView;
|
|
int mPosition = -1;
|
|
int mOldPosition = -1;
|
|
long mItemId = -1;
|
|
int mItemViewType = -1;
|
|
int mPreLayoutPosition = -1;
|
|
ViewHolder mShadowedHolder = null;
|
|
ViewHolder mShadowingHolder = null;
|
|
List<Object> mPayloads = null;
|
|
List<Object> mUnmodifiedPayloads = null;
|
|
private int mIsRecyclableCount = 0;
|
|
Recycler mScrapContainer = null;
|
|
boolean mInChangeScrap = false;
|
|
private int mWasImportantForAccessibilityBeforeHidden = 0;
|
|
int mPendingAccessibilityState = -1;
|
|
|
|
public ViewHolder(View view) {
|
|
if (view == null) {
|
|
throw new IllegalArgumentException("itemView may not be null");
|
|
}
|
|
this.itemView = view;
|
|
}
|
|
|
|
private void createPayloadsIfNeeded() {
|
|
if (this.mPayloads == null) {
|
|
this.mPayloads = new ArrayList();
|
|
this.mUnmodifiedPayloads = Collections.unmodifiableList(this.mPayloads);
|
|
}
|
|
}
|
|
|
|
void addChangePayload(Object obj) {
|
|
if (obj == null) {
|
|
addFlags(1024);
|
|
} else if ((1024 & this.mFlags) == 0) {
|
|
createPayloadsIfNeeded();
|
|
this.mPayloads.add(obj);
|
|
}
|
|
}
|
|
|
|
void addFlags(int i) {
|
|
this.mFlags = i | this.mFlags;
|
|
}
|
|
|
|
void clearOldPosition() {
|
|
this.mOldPosition = -1;
|
|
this.mPreLayoutPosition = -1;
|
|
}
|
|
|
|
void clearPayload() {
|
|
List<Object> list = this.mPayloads;
|
|
if (list != null) {
|
|
list.clear();
|
|
}
|
|
this.mFlags &= -1025;
|
|
}
|
|
|
|
void clearReturnedFromScrapFlag() {
|
|
this.mFlags &= -33;
|
|
}
|
|
|
|
void clearTmpDetachFlag() {
|
|
this.mFlags &= -257;
|
|
}
|
|
|
|
boolean doesTransientStatePreventRecycling() {
|
|
return (this.mFlags & 16) == 0 && ViewCompat.v(this.itemView);
|
|
}
|
|
|
|
void flagRemovedAndOffsetPosition(int i, int i2, boolean z) {
|
|
addFlags(8);
|
|
offsetPosition(i2, z);
|
|
this.mPosition = i;
|
|
}
|
|
|
|
public final int getAdapterPosition() {
|
|
RecyclerView recyclerView = this.mOwnerRecyclerView;
|
|
if (recyclerView == null) {
|
|
return -1;
|
|
}
|
|
return recyclerView.b(this);
|
|
}
|
|
|
|
public final long getItemId() {
|
|
return this.mItemId;
|
|
}
|
|
|
|
public final int getItemViewType() {
|
|
return this.mItemViewType;
|
|
}
|
|
|
|
public final int getLayoutPosition() {
|
|
int i = this.mPreLayoutPosition;
|
|
return i == -1 ? this.mPosition : i;
|
|
}
|
|
|
|
public final int getOldPosition() {
|
|
return this.mOldPosition;
|
|
}
|
|
|
|
@Deprecated
|
|
public final int getPosition() {
|
|
int i = this.mPreLayoutPosition;
|
|
return i == -1 ? this.mPosition : i;
|
|
}
|
|
|
|
List<Object> getUnmodifiedPayloads() {
|
|
if ((this.mFlags & 1024) != 0) {
|
|
return FULLUPDATE_PAYLOADS;
|
|
}
|
|
List<Object> list = this.mPayloads;
|
|
return (list == null || list.size() == 0) ? FULLUPDATE_PAYLOADS : this.mUnmodifiedPayloads;
|
|
}
|
|
|
|
boolean hasAnyOfTheFlags(int i) {
|
|
return (i & this.mFlags) != 0;
|
|
}
|
|
|
|
boolean isAdapterPositionUnknown() {
|
|
return (this.mFlags & 512) != 0 || isInvalid();
|
|
}
|
|
|
|
boolean isBound() {
|
|
return (this.mFlags & 1) != 0;
|
|
}
|
|
|
|
boolean isInvalid() {
|
|
return (this.mFlags & 4) != 0;
|
|
}
|
|
|
|
public final boolean isRecyclable() {
|
|
return (this.mFlags & 16) == 0 && !ViewCompat.v(this.itemView);
|
|
}
|
|
|
|
boolean isRemoved() {
|
|
return (this.mFlags & 8) != 0;
|
|
}
|
|
|
|
boolean isScrap() {
|
|
return this.mScrapContainer != null;
|
|
}
|
|
|
|
boolean isTmpDetached() {
|
|
return (this.mFlags & 256) != 0;
|
|
}
|
|
|
|
boolean isUpdated() {
|
|
return (this.mFlags & 2) != 0;
|
|
}
|
|
|
|
boolean needsUpdate() {
|
|
return (this.mFlags & 2) != 0;
|
|
}
|
|
|
|
void offsetPosition(int i, boolean z) {
|
|
if (this.mOldPosition == -1) {
|
|
this.mOldPosition = this.mPosition;
|
|
}
|
|
if (this.mPreLayoutPosition == -1) {
|
|
this.mPreLayoutPosition = this.mPosition;
|
|
}
|
|
if (z) {
|
|
this.mPreLayoutPosition += i;
|
|
}
|
|
this.mPosition += i;
|
|
if (this.itemView.getLayoutParams() != null) {
|
|
((LayoutParams) this.itemView.getLayoutParams()).c = true;
|
|
}
|
|
}
|
|
|
|
void onEnteredHiddenState(RecyclerView recyclerView) {
|
|
int i = this.mPendingAccessibilityState;
|
|
if (i != -1) {
|
|
this.mWasImportantForAccessibilityBeforeHidden = i;
|
|
} else {
|
|
this.mWasImportantForAccessibilityBeforeHidden = ViewCompat.i(this.itemView);
|
|
}
|
|
recyclerView.a(this, 4);
|
|
}
|
|
|
|
void onLeftHiddenState(RecyclerView recyclerView) {
|
|
recyclerView.a(this, this.mWasImportantForAccessibilityBeforeHidden);
|
|
this.mWasImportantForAccessibilityBeforeHidden = 0;
|
|
}
|
|
|
|
void resetInternal() {
|
|
this.mFlags = 0;
|
|
this.mPosition = -1;
|
|
this.mOldPosition = -1;
|
|
this.mItemId = -1L;
|
|
this.mPreLayoutPosition = -1;
|
|
this.mIsRecyclableCount = 0;
|
|
this.mShadowedHolder = null;
|
|
this.mShadowingHolder = null;
|
|
clearPayload();
|
|
this.mWasImportantForAccessibilityBeforeHidden = 0;
|
|
this.mPendingAccessibilityState = -1;
|
|
RecyclerView.e(this);
|
|
}
|
|
|
|
void saveOldPosition() {
|
|
if (this.mOldPosition == -1) {
|
|
this.mOldPosition = this.mPosition;
|
|
}
|
|
}
|
|
|
|
void setFlags(int i, int i2) {
|
|
this.mFlags = (i & i2) | (this.mFlags & (~i2));
|
|
}
|
|
|
|
public final void setIsRecyclable(boolean z) {
|
|
int i = this.mIsRecyclableCount;
|
|
this.mIsRecyclableCount = z ? i - 1 : i + 1;
|
|
int i2 = this.mIsRecyclableCount;
|
|
if (i2 < 0) {
|
|
this.mIsRecyclableCount = 0;
|
|
Log.e("View", "isRecyclable decremented below 0: unmatched pair of setIsRecyable() calls for " + this);
|
|
return;
|
|
}
|
|
if (!z && i2 == 1) {
|
|
this.mFlags |= 16;
|
|
} else if (z && this.mIsRecyclableCount == 0) {
|
|
this.mFlags &= -17;
|
|
}
|
|
}
|
|
|
|
void setScrapContainer(Recycler recycler, boolean z) {
|
|
this.mScrapContainer = recycler;
|
|
this.mInChangeScrap = z;
|
|
}
|
|
|
|
boolean shouldBeKeptAsChild() {
|
|
return (this.mFlags & 16) != 0;
|
|
}
|
|
|
|
boolean shouldIgnore() {
|
|
return (this.mFlags & 128) != 0;
|
|
}
|
|
|
|
void stopIgnoring() {
|
|
this.mFlags &= -129;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder("ViewHolder{" + Integer.toHexString(hashCode()) + " position=" + this.mPosition + " id=" + this.mItemId + ", oldPos=" + this.mOldPosition + ", pLpos:" + this.mPreLayoutPosition);
|
|
if (isScrap()) {
|
|
sb.append(" scrap ");
|
|
sb.append(this.mInChangeScrap ? "[changeScrap]" : "[attachedScrap]");
|
|
}
|
|
if (isInvalid()) {
|
|
sb.append(" invalid");
|
|
}
|
|
if (!isBound()) {
|
|
sb.append(" unbound");
|
|
}
|
|
if (needsUpdate()) {
|
|
sb.append(" update");
|
|
}
|
|
if (isRemoved()) {
|
|
sb.append(" removed");
|
|
}
|
|
if (shouldIgnore()) {
|
|
sb.append(" ignored");
|
|
}
|
|
if (isTmpDetached()) {
|
|
sb.append(" tmpDetached");
|
|
}
|
|
if (!isRecyclable()) {
|
|
sb.append(" not recyclable(" + this.mIsRecyclableCount + ")");
|
|
}
|
|
if (isAdapterPositionUnknown()) {
|
|
sb.append(" undefined adapter position");
|
|
}
|
|
if (this.itemView.getParent() == null) {
|
|
sb.append(" no parent");
|
|
}
|
|
sb.append("}");
|
|
return sb.toString();
|
|
}
|
|
|
|
void unScrap() {
|
|
this.mScrapContainer.c(this);
|
|
}
|
|
|
|
boolean wasReturnedFromScrap() {
|
|
return (this.mFlags & 32) != 0;
|
|
}
|
|
}
|
|
|
|
static {
|
|
int i = Build.VERSION.SDK_INT;
|
|
C0 = i == 18 || i == 19 || i == 20;
|
|
D0 = Build.VERSION.SDK_INT >= 23;
|
|
E0 = Build.VERSION.SDK_INT >= 16;
|
|
F0 = Build.VERSION.SDK_INT >= 21;
|
|
G0 = Build.VERSION.SDK_INT <= 15;
|
|
H0 = Build.VERSION.SDK_INT <= 15;
|
|
Class<?> cls = Integer.TYPE;
|
|
I0 = new Class[]{Context.class, AttributeSet.class, cls, cls};
|
|
J0 = new Interpolator() { // from class: androidx.recyclerview.widget.RecyclerView.3
|
|
@Override // android.animation.TimeInterpolator
|
|
public float getInterpolation(float f) {
|
|
float f2 = f - 1.0f;
|
|
return (f2 * f2 * f2 * f2 * f2) + 1.0f;
|
|
}
|
|
};
|
|
}
|
|
|
|
public RecyclerView(Context context) {
|
|
this(context, null);
|
|
}
|
|
|
|
private void A() {
|
|
this.i0.a(1);
|
|
a(this.i0);
|
|
this.i0.j = false;
|
|
w();
|
|
this.f.a();
|
|
q();
|
|
I();
|
|
N();
|
|
State state = this.i0;
|
|
state.i = state.k && this.m0;
|
|
this.m0 = false;
|
|
this.l0 = false;
|
|
State state2 = this.i0;
|
|
state2.h = state2.l;
|
|
state2.f = this.l.getItemCount();
|
|
a(this.r0);
|
|
if (this.i0.k) {
|
|
int a = this.e.a();
|
|
for (int i = 0; i < a; i++) {
|
|
ViewHolder m = m(this.e.c(i));
|
|
if (!m.shouldIgnore() && (!m.isInvalid() || this.l.hasStableIds())) {
|
|
this.f.c(m, this.N.a(this.i0, m, ItemAnimator.e(m), m.getUnmodifiedPayloads()));
|
|
if (this.i0.i && m.isUpdated() && !m.isRemoved() && !m.shouldIgnore() && !m.isInvalid()) {
|
|
this.f.a(c(m), m);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (this.i0.l) {
|
|
v();
|
|
State state3 = this.i0;
|
|
boolean z = state3.g;
|
|
state3.g = false;
|
|
this.m.e(this.b, state3);
|
|
this.i0.g = z;
|
|
for (int i2 = 0; i2 < this.e.a(); i2++) {
|
|
ViewHolder m2 = m(this.e.c(i2));
|
|
if (!m2.shouldIgnore() && !this.f.c(m2)) {
|
|
int e = ItemAnimator.e(m2);
|
|
boolean hasAnyOfTheFlags = m2.hasAnyOfTheFlags(UnityActivity.BLOCKLY_TYPE_NONE);
|
|
if (!hasAnyOfTheFlags) {
|
|
e |= FileUtil.ZIP_BUFFER_SIZE;
|
|
}
|
|
ItemAnimator.ItemHolderInfo a2 = this.N.a(this.i0, m2, e, m2.getUnmodifiedPayloads());
|
|
if (hasAnyOfTheFlags) {
|
|
a(m2, a2);
|
|
} else {
|
|
this.f.a(m2, a2);
|
|
}
|
|
}
|
|
}
|
|
a();
|
|
} else {
|
|
a();
|
|
}
|
|
r();
|
|
c(false);
|
|
this.i0.e = 2;
|
|
}
|
|
|
|
private void B() {
|
|
w();
|
|
q();
|
|
this.i0.a(6);
|
|
this.d.b();
|
|
this.i0.f = this.l.getItemCount();
|
|
State state = this.i0;
|
|
state.d = 0;
|
|
state.h = false;
|
|
this.m.e(this.b, state);
|
|
State state2 = this.i0;
|
|
state2.g = false;
|
|
this.c = null;
|
|
state2.k = state2.k && this.N != null;
|
|
this.i0.e = 4;
|
|
r();
|
|
c(false);
|
|
}
|
|
|
|
private void C() {
|
|
this.i0.a(4);
|
|
w();
|
|
q();
|
|
State state = this.i0;
|
|
state.e = 1;
|
|
if (state.k) {
|
|
for (int a = this.e.a() - 1; a >= 0; a--) {
|
|
ViewHolder m = m(this.e.c(a));
|
|
if (!m.shouldIgnore()) {
|
|
long c = c(m);
|
|
ItemAnimator.ItemHolderInfo a2 = this.N.a(this.i0, m);
|
|
ViewHolder a3 = this.f.a(c);
|
|
if (a3 == null || a3.shouldIgnore()) {
|
|
this.f.b(m, a2);
|
|
} else {
|
|
boolean b = this.f.b(a3);
|
|
boolean b2 = this.f.b(m);
|
|
if (b && a3 == m) {
|
|
this.f.b(m, a2);
|
|
} else {
|
|
ItemAnimator.ItemHolderInfo f = this.f.f(a3);
|
|
this.f.b(m, a2);
|
|
ItemAnimator.ItemHolderInfo e = this.f.e(m);
|
|
if (f == null) {
|
|
a(c, m, a3);
|
|
} else {
|
|
a(a3, m, f, e, b, b2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.f.a(this.z0);
|
|
}
|
|
this.m.c(this.b);
|
|
State state2 = this.i0;
|
|
state2.c = state2.f;
|
|
this.E = false;
|
|
this.F = false;
|
|
state2.k = false;
|
|
state2.l = false;
|
|
this.m.h = false;
|
|
ArrayList<ViewHolder> arrayList = this.b.b;
|
|
if (arrayList != null) {
|
|
arrayList.clear();
|
|
}
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager.n) {
|
|
layoutManager.m = 0;
|
|
layoutManager.n = false;
|
|
this.b.j();
|
|
}
|
|
this.m.g(this.i0);
|
|
r();
|
|
c(false);
|
|
this.f.a();
|
|
int[] iArr = this.r0;
|
|
if (k(iArr[0], iArr[1])) {
|
|
d(0, 0);
|
|
}
|
|
J();
|
|
L();
|
|
}
|
|
|
|
private View D() {
|
|
ViewHolder c;
|
|
int i = this.i0.m;
|
|
if (i == -1) {
|
|
i = 0;
|
|
}
|
|
int a = this.i0.a();
|
|
for (int i2 = i; i2 < a; i2++) {
|
|
ViewHolder c2 = c(i2);
|
|
if (c2 == null) {
|
|
break;
|
|
}
|
|
if (c2.itemView.hasFocusable()) {
|
|
return c2.itemView;
|
|
}
|
|
}
|
|
int min = Math.min(a, i);
|
|
do {
|
|
min--;
|
|
if (min < 0 || (c = c(min)) == null) {
|
|
return null;
|
|
}
|
|
} while (!c.itemView.hasFocusable());
|
|
return c.itemView;
|
|
}
|
|
|
|
private boolean E() {
|
|
int a = this.e.a();
|
|
for (int i = 0; i < a; i++) {
|
|
ViewHolder m = m(this.e.c(i));
|
|
if (m != null && !m.shouldIgnore() && m.isUpdated()) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@SuppressLint({"InlinedApi"})
|
|
private void F() {
|
|
if (ViewCompat.j(this) == 0) {
|
|
ViewCompat.g((View) this, 8);
|
|
}
|
|
}
|
|
|
|
private void G() {
|
|
this.e = new ChildHelper(new ChildHelper.Callback() { // from class: androidx.recyclerview.widget.RecyclerView.5
|
|
@Override // androidx.recyclerview.widget.ChildHelper.Callback
|
|
public int a() {
|
|
return RecyclerView.this.getChildCount();
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.ChildHelper.Callback
|
|
public int b(View view) {
|
|
return RecyclerView.this.indexOfChild(view);
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.ChildHelper.Callback
|
|
public void c(int i) {
|
|
View childAt = RecyclerView.this.getChildAt(i);
|
|
if (childAt != null) {
|
|
RecyclerView.this.b(childAt);
|
|
childAt.clearAnimation();
|
|
}
|
|
RecyclerView.this.removeViewAt(i);
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.ChildHelper.Callback
|
|
public void d(View view) {
|
|
ViewHolder m = RecyclerView.m(view);
|
|
if (m != null) {
|
|
m.onLeftHiddenState(RecyclerView.this);
|
|
}
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.ChildHelper.Callback
|
|
public void a(View view, int i) {
|
|
RecyclerView.this.addView(view, i);
|
|
RecyclerView.this.a(view);
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.ChildHelper.Callback
|
|
public void b() {
|
|
int a = a();
|
|
for (int i = 0; i < a; i++) {
|
|
View a2 = a(i);
|
|
RecyclerView.this.b(a2);
|
|
a2.clearAnimation();
|
|
}
|
|
RecyclerView.this.removeAllViews();
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.ChildHelper.Callback
|
|
public View a(int i) {
|
|
return RecyclerView.this.getChildAt(i);
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.ChildHelper.Callback
|
|
public void a(View view, int i, ViewGroup.LayoutParams layoutParams) {
|
|
ViewHolder m = RecyclerView.m(view);
|
|
if (m != null) {
|
|
if (!m.isTmpDetached() && !m.shouldIgnore()) {
|
|
throw new IllegalArgumentException("Called attach on a child which is not detached: " + m + RecyclerView.this.i());
|
|
}
|
|
m.clearTmpDetachFlag();
|
|
}
|
|
RecyclerView.this.attachViewToParent(view, i, layoutParams);
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.ChildHelper.Callback
|
|
public ViewHolder c(View view) {
|
|
return RecyclerView.m(view);
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.ChildHelper.Callback
|
|
public void b(int i) {
|
|
ViewHolder m;
|
|
View a = a(i);
|
|
if (a != null && (m = RecyclerView.m(a)) != null) {
|
|
if (m.isTmpDetached() && !m.shouldIgnore()) {
|
|
throw new IllegalArgumentException("called detach on an already detached child " + m + RecyclerView.this.i());
|
|
}
|
|
m.addFlags(DataDecryptTool.DECRYPT_ALL_FILE);
|
|
}
|
|
RecyclerView.this.detachViewFromParent(i);
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.ChildHelper.Callback
|
|
public void a(View view) {
|
|
ViewHolder m = RecyclerView.m(view);
|
|
if (m != null) {
|
|
m.onEnteredHiddenState(RecyclerView.this);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
private boolean H() {
|
|
return this.N != null && this.m.D();
|
|
}
|
|
|
|
private void I() {
|
|
if (this.E) {
|
|
this.d.f();
|
|
if (this.F) {
|
|
this.m.d(this);
|
|
}
|
|
}
|
|
if (H()) {
|
|
this.d.e();
|
|
} else {
|
|
this.d.b();
|
|
}
|
|
boolean z = false;
|
|
boolean z2 = this.l0 || this.m0;
|
|
this.i0.k = this.u && this.N != null && (this.E || z2 || this.m.h) && (!this.E || this.l.hasStableIds());
|
|
State state = this.i0;
|
|
if (state.k && z2 && !this.E && H()) {
|
|
z = true;
|
|
}
|
|
state.l = z;
|
|
}
|
|
|
|
private void J() {
|
|
View view;
|
|
if (!this.e0 || this.l == null || !hasFocus() || getDescendantFocusability() == 393216) {
|
|
return;
|
|
}
|
|
if (getDescendantFocusability() == 131072 && isFocused()) {
|
|
return;
|
|
}
|
|
if (!isFocused()) {
|
|
View focusedChild = getFocusedChild();
|
|
if (!H0 || (focusedChild.getParent() != null && focusedChild.hasFocus())) {
|
|
if (!this.e.c(focusedChild)) {
|
|
return;
|
|
}
|
|
} else if (this.e.a() == 0) {
|
|
requestFocus();
|
|
return;
|
|
}
|
|
}
|
|
View view2 = null;
|
|
ViewHolder a = (this.i0.n == -1 || !this.l.hasStableIds()) ? null : a(this.i0.n);
|
|
if (a != null && !this.e.c(a.itemView) && a.itemView.hasFocusable()) {
|
|
view2 = a.itemView;
|
|
} else if (this.e.a() > 0) {
|
|
view2 = D();
|
|
}
|
|
if (view2 != null) {
|
|
int i = this.i0.o;
|
|
if (i == -1 || (view = view2.findViewById(i)) == null || !view.isFocusable()) {
|
|
view = view2;
|
|
}
|
|
view.requestFocus();
|
|
}
|
|
}
|
|
|
|
private void K() {
|
|
boolean z;
|
|
EdgeEffect edgeEffect = this.J;
|
|
if (edgeEffect != null) {
|
|
edgeEffect.onRelease();
|
|
z = this.J.isFinished();
|
|
} else {
|
|
z = false;
|
|
}
|
|
EdgeEffect edgeEffect2 = this.K;
|
|
if (edgeEffect2 != null) {
|
|
edgeEffect2.onRelease();
|
|
z |= this.K.isFinished();
|
|
}
|
|
EdgeEffect edgeEffect3 = this.L;
|
|
if (edgeEffect3 != null) {
|
|
edgeEffect3.onRelease();
|
|
z |= this.L.isFinished();
|
|
}
|
|
EdgeEffect edgeEffect4 = this.M;
|
|
if (edgeEffect4 != null) {
|
|
edgeEffect4.onRelease();
|
|
z |= this.M.isFinished();
|
|
}
|
|
if (z) {
|
|
ViewCompat.A(this);
|
|
}
|
|
}
|
|
|
|
private void L() {
|
|
State state = this.i0;
|
|
state.n = -1L;
|
|
state.m = -1;
|
|
state.o = -1;
|
|
}
|
|
|
|
private void M() {
|
|
VelocityTracker velocityTracker = this.Q;
|
|
if (velocityTracker != null) {
|
|
velocityTracker.clear();
|
|
}
|
|
a(0);
|
|
K();
|
|
}
|
|
|
|
private void N() {
|
|
View focusedChild = (this.e0 && hasFocus() && this.l != null) ? getFocusedChild() : null;
|
|
ViewHolder d = focusedChild != null ? d(focusedChild) : null;
|
|
if (d == null) {
|
|
L();
|
|
return;
|
|
}
|
|
this.i0.n = this.l.hasStableIds() ? d.getItemId() : -1L;
|
|
this.i0.m = this.E ? -1 : d.isRemoved() ? d.mOldPosition : d.getAdapterPosition();
|
|
this.i0.o = n(d.itemView);
|
|
}
|
|
|
|
private void O() {
|
|
this.f0.b();
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager != null) {
|
|
layoutManager.C();
|
|
}
|
|
}
|
|
|
|
private void d(ViewHolder viewHolder) {
|
|
View view = viewHolder.itemView;
|
|
boolean z = view.getParent() == this;
|
|
this.b.c(g(view));
|
|
if (viewHolder.isTmpDetached()) {
|
|
this.e.a(view, -1, view.getLayoutParams(), true);
|
|
} else if (z) {
|
|
this.e.a(view);
|
|
} else {
|
|
this.e.a(view, true);
|
|
}
|
|
}
|
|
|
|
private NestedScrollingChildHelper getScrollingChildHelper() {
|
|
if (this.s0 == null) {
|
|
this.s0 = new NestedScrollingChildHelper(this);
|
|
}
|
|
return this.s0;
|
|
}
|
|
|
|
private void y() {
|
|
M();
|
|
setScrollState(0);
|
|
}
|
|
|
|
private void z() {
|
|
int i = this.A;
|
|
this.A = 0;
|
|
if (i == 0 || !m()) {
|
|
return;
|
|
}
|
|
AccessibilityEvent obtain = AccessibilityEvent.obtain();
|
|
obtain.setEventType(2048);
|
|
AccessibilityEventCompat.a(obtain, i);
|
|
sendAccessibilityEventUnchecked(obtain);
|
|
}
|
|
|
|
@Override // android.view.ViewGroup, android.view.View
|
|
public void addFocusables(ArrayList<View> arrayList, int i, int i2) {
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager == null || !layoutManager.a(this, arrayList, i, i2)) {
|
|
super.addFocusables(arrayList, i, i2);
|
|
}
|
|
}
|
|
|
|
public void b(ItemDecoration itemDecoration) {
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager != null) {
|
|
layoutManager.a("Cannot remove item decoration during a scroll or layout");
|
|
}
|
|
this.o.remove(itemDecoration);
|
|
if (this.o.isEmpty()) {
|
|
setWillNotDraw(getOverScrollMode() == 2);
|
|
}
|
|
o();
|
|
requestLayout();
|
|
}
|
|
|
|
void c(boolean z) {
|
|
if (this.v < 1) {
|
|
this.v = 1;
|
|
}
|
|
if (!z && !this.y) {
|
|
this.x = false;
|
|
}
|
|
if (this.v == 1) {
|
|
if (z && this.x && !this.y && this.m != null && this.l != null) {
|
|
c();
|
|
}
|
|
if (!this.y) {
|
|
this.x = false;
|
|
}
|
|
}
|
|
this.v--;
|
|
}
|
|
|
|
@Override // android.view.ViewGroup
|
|
protected boolean checkLayoutParams(ViewGroup.LayoutParams layoutParams) {
|
|
return (layoutParams instanceof LayoutParams) && this.m.a((LayoutParams) layoutParams);
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public int computeHorizontalScrollExtent() {
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager != null && layoutManager.a()) {
|
|
return this.m.a(this.i0);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public int computeHorizontalScrollOffset() {
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager != null && layoutManager.a()) {
|
|
return this.m.b(this.i0);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public int computeHorizontalScrollRange() {
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager != null && layoutManager.a()) {
|
|
return this.m.c(this.i0);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public int computeVerticalScrollExtent() {
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager != null && layoutManager.b()) {
|
|
return this.m.d(this.i0);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public int computeVerticalScrollOffset() {
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager != null && layoutManager.b()) {
|
|
return this.m.e(this.i0);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public int computeVerticalScrollRange() {
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager != null && layoutManager.b()) {
|
|
return this.m.f(this.i0);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public boolean dispatchNestedFling(float f, float f2, boolean z) {
|
|
return getScrollingChildHelper().a(f, f2, z);
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public boolean dispatchNestedPreFling(float f, float f2) {
|
|
return getScrollingChildHelper().a(f, f2);
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public boolean dispatchNestedPreScroll(int i, int i2, int[] iArr, int[] iArr2) {
|
|
return getScrollingChildHelper().a(i, i2, iArr, iArr2);
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public boolean dispatchNestedScroll(int i, int i2, int i3, int i4, int[] iArr) {
|
|
return getScrollingChildHelper().a(i, i2, i3, i4, iArr);
|
|
}
|
|
|
|
@Override // android.view.ViewGroup, android.view.View
|
|
protected void dispatchRestoreInstanceState(SparseArray<Parcelable> sparseArray) {
|
|
dispatchThawSelfOnly(sparseArray);
|
|
}
|
|
|
|
@Override // android.view.ViewGroup, android.view.View
|
|
protected void dispatchSaveInstanceState(SparseArray<Parcelable> sparseArray) {
|
|
dispatchFreezeSelfOnly(sparseArray);
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void draw(Canvas canvas) {
|
|
boolean z;
|
|
boolean z2;
|
|
super.draw(canvas);
|
|
int size = this.o.size();
|
|
boolean z3 = false;
|
|
for (int i = 0; i < size; i++) {
|
|
this.o.get(i).onDrawOver(canvas, this, this.i0);
|
|
}
|
|
EdgeEffect edgeEffect = this.J;
|
|
if (edgeEffect == null || edgeEffect.isFinished()) {
|
|
z = false;
|
|
} else {
|
|
int save = canvas.save();
|
|
int paddingBottom = this.g ? getPaddingBottom() : 0;
|
|
canvas.rotate(270.0f);
|
|
canvas.translate((-getHeight()) + paddingBottom, 0.0f);
|
|
EdgeEffect edgeEffect2 = this.J;
|
|
z = edgeEffect2 != null && edgeEffect2.draw(canvas);
|
|
canvas.restoreToCount(save);
|
|
}
|
|
EdgeEffect edgeEffect3 = this.K;
|
|
if (edgeEffect3 != null && !edgeEffect3.isFinished()) {
|
|
int save2 = canvas.save();
|
|
if (this.g) {
|
|
canvas.translate(getPaddingLeft(), getPaddingTop());
|
|
}
|
|
EdgeEffect edgeEffect4 = this.K;
|
|
z |= edgeEffect4 != null && edgeEffect4.draw(canvas);
|
|
canvas.restoreToCount(save2);
|
|
}
|
|
EdgeEffect edgeEffect5 = this.L;
|
|
if (edgeEffect5 != null && !edgeEffect5.isFinished()) {
|
|
int save3 = canvas.save();
|
|
int width = getWidth();
|
|
int paddingTop = this.g ? getPaddingTop() : 0;
|
|
canvas.rotate(90.0f);
|
|
canvas.translate(-paddingTop, -width);
|
|
EdgeEffect edgeEffect6 = this.L;
|
|
z |= edgeEffect6 != null && edgeEffect6.draw(canvas);
|
|
canvas.restoreToCount(save3);
|
|
}
|
|
EdgeEffect edgeEffect7 = this.M;
|
|
if (edgeEffect7 == null || edgeEffect7.isFinished()) {
|
|
z2 = z;
|
|
} else {
|
|
int save4 = canvas.save();
|
|
canvas.rotate(180.0f);
|
|
if (this.g) {
|
|
canvas.translate((-getWidth()) + getPaddingRight(), (-getHeight()) + getPaddingBottom());
|
|
} else {
|
|
canvas.translate(-getWidth(), -getHeight());
|
|
}
|
|
EdgeEffect edgeEffect8 = this.M;
|
|
if (edgeEffect8 != null && edgeEffect8.draw(canvas)) {
|
|
z3 = true;
|
|
}
|
|
z2 = z3 | z;
|
|
canvas.restoreToCount(save4);
|
|
}
|
|
if (!z2 && this.N != null && this.o.size() > 0 && this.N.g()) {
|
|
z2 = true;
|
|
}
|
|
if (z2) {
|
|
ViewCompat.A(this);
|
|
}
|
|
}
|
|
|
|
@Override // android.view.ViewGroup
|
|
public boolean drawChild(Canvas canvas, View view, long j) {
|
|
return super.drawChild(canvas, view, j);
|
|
}
|
|
|
|
public boolean e(int i, int i2) {
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager == null) {
|
|
Log.e("RecyclerView", "Cannot fling without a LayoutManager set. Call setLayoutManager with a non-null argument.");
|
|
return false;
|
|
}
|
|
if (this.y) {
|
|
return false;
|
|
}
|
|
boolean a = layoutManager.a();
|
|
boolean b = this.m.b();
|
|
if (!a || Math.abs(i) < this.a0) {
|
|
i = 0;
|
|
}
|
|
if (!b || Math.abs(i2) < this.a0) {
|
|
i2 = 0;
|
|
}
|
|
if (i == 0 && i2 == 0) {
|
|
return false;
|
|
}
|
|
float f = i;
|
|
float f2 = i2;
|
|
if (!dispatchNestedPreFling(f, f2)) {
|
|
boolean z = a || b;
|
|
dispatchNestedFling(f, f2, z);
|
|
OnFlingListener onFlingListener = this.W;
|
|
if (onFlingListener != null && onFlingListener.a(i, i2)) {
|
|
return true;
|
|
}
|
|
if (z) {
|
|
int i3 = a ? 1 : 0;
|
|
if (b) {
|
|
i3 |= 2;
|
|
}
|
|
j(i3, 1);
|
|
int i4 = this.b0;
|
|
int max = Math.max(-i4, Math.min(i, i4));
|
|
int i5 = this.b0;
|
|
this.f0.a(max, Math.max(-i5, Math.min(i2, i5)));
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
void f(int i) {
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager == null) {
|
|
return;
|
|
}
|
|
layoutManager.i(i);
|
|
awakenScrollBars();
|
|
}
|
|
|
|
@Override // android.view.ViewGroup, android.view.ViewParent
|
|
public View focusSearch(View view, int i) {
|
|
View view2;
|
|
boolean z;
|
|
View d = this.m.d(view, i);
|
|
if (d != null) {
|
|
return d;
|
|
}
|
|
boolean z2 = (this.l == null || this.m == null || n() || this.y) ? false : true;
|
|
FocusFinder focusFinder = FocusFinder.getInstance();
|
|
if (z2 && (i == 2 || i == 1)) {
|
|
if (this.m.b()) {
|
|
int i2 = i == 2 ? 130 : 33;
|
|
z = focusFinder.findNextFocus(this, view, i2) == null;
|
|
if (G0) {
|
|
i = i2;
|
|
}
|
|
} else {
|
|
z = false;
|
|
}
|
|
if (!z && this.m.a()) {
|
|
int i3 = (this.m.k() == 1) ^ (i == 2) ? 66 : 17;
|
|
z = focusFinder.findNextFocus(this, view, i3) == null;
|
|
if (G0) {
|
|
i = i3;
|
|
}
|
|
}
|
|
if (z) {
|
|
b();
|
|
if (c(view) == null) {
|
|
return null;
|
|
}
|
|
w();
|
|
this.m.a(view, i, this.b, this.i0);
|
|
c(false);
|
|
}
|
|
view2 = focusFinder.findNextFocus(this, view, i);
|
|
} else {
|
|
View findNextFocus = focusFinder.findNextFocus(this, view, i);
|
|
if (findNextFocus == null && z2) {
|
|
b();
|
|
if (c(view) == null) {
|
|
return null;
|
|
}
|
|
w();
|
|
view2 = this.m.a(view, i, this.b, this.i0);
|
|
c(false);
|
|
} else {
|
|
view2 = findNextFocus;
|
|
}
|
|
}
|
|
if (view2 == null || view2.hasFocusable()) {
|
|
return a(view, view2, i) ? view2 : super.focusSearch(view, i);
|
|
}
|
|
if (getFocusedChild() == null) {
|
|
return super.focusSearch(view, i);
|
|
}
|
|
a(view2, (View) null);
|
|
return view;
|
|
}
|
|
|
|
void g() {
|
|
if (this.L != null) {
|
|
return;
|
|
}
|
|
this.L = this.I.a(this, 2);
|
|
if (this.g) {
|
|
this.L.setSize((getMeasuredHeight() - getPaddingTop()) - getPaddingBottom(), (getMeasuredWidth() - getPaddingLeft()) - getPaddingRight());
|
|
} else {
|
|
this.L.setSize(getMeasuredHeight(), getMeasuredWidth());
|
|
}
|
|
}
|
|
|
|
@Override // android.view.ViewGroup
|
|
protected ViewGroup.LayoutParams generateDefaultLayoutParams() {
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager != null) {
|
|
return layoutManager.c();
|
|
}
|
|
throw new IllegalStateException("RecyclerView has no LayoutManager" + i());
|
|
}
|
|
|
|
@Override // android.view.ViewGroup
|
|
public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager != null) {
|
|
return layoutManager.a(getContext(), attributeSet);
|
|
}
|
|
throw new IllegalStateException("RecyclerView has no LayoutManager" + i());
|
|
}
|
|
|
|
public Adapter getAdapter() {
|
|
return this.l;
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public int getBaseline() {
|
|
LayoutManager layoutManager = this.m;
|
|
return layoutManager != null ? layoutManager.d() : super.getBaseline();
|
|
}
|
|
|
|
@Override // android.view.ViewGroup
|
|
protected int getChildDrawingOrder(int i, int i2) {
|
|
ChildDrawingOrderCallback childDrawingOrderCallback = this.q0;
|
|
return childDrawingOrderCallback == null ? super.getChildDrawingOrder(i, i2) : childDrawingOrderCallback.a(i, i2);
|
|
}
|
|
|
|
@Override // android.view.ViewGroup
|
|
public boolean getClipToPadding() {
|
|
return this.g;
|
|
}
|
|
|
|
public RecyclerViewAccessibilityDelegate getCompatAccessibilityDelegate() {
|
|
return this.p0;
|
|
}
|
|
|
|
public EdgeEffectFactory getEdgeEffectFactory() {
|
|
return this.I;
|
|
}
|
|
|
|
public ItemAnimator getItemAnimator() {
|
|
return this.N;
|
|
}
|
|
|
|
public int getItemDecorationCount() {
|
|
return this.o.size();
|
|
}
|
|
|
|
public LayoutManager getLayoutManager() {
|
|
return this.m;
|
|
}
|
|
|
|
public int getMaxFlingVelocity() {
|
|
return this.b0;
|
|
}
|
|
|
|
public int getMinFlingVelocity() {
|
|
return this.a0;
|
|
}
|
|
|
|
long getNanoTime() {
|
|
if (F0) {
|
|
return System.nanoTime();
|
|
}
|
|
return 0L;
|
|
}
|
|
|
|
public OnFlingListener getOnFlingListener() {
|
|
return this.W;
|
|
}
|
|
|
|
public boolean getPreserveFocusAfterLayout() {
|
|
return this.e0;
|
|
}
|
|
|
|
public RecycledViewPool getRecycledViewPool() {
|
|
return this.b.d();
|
|
}
|
|
|
|
public int getScrollState() {
|
|
return this.O;
|
|
}
|
|
|
|
void h() {
|
|
if (this.K != null) {
|
|
return;
|
|
}
|
|
this.K = this.I.a(this, 1);
|
|
if (this.g) {
|
|
this.K.setSize((getMeasuredWidth() - getPaddingLeft()) - getPaddingRight(), (getMeasuredHeight() - getPaddingTop()) - getPaddingBottom());
|
|
} else {
|
|
this.K.setSize(getMeasuredWidth(), getMeasuredHeight());
|
|
}
|
|
}
|
|
|
|
public void h(int i, int i2) {
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public boolean hasNestedScrollingParent() {
|
|
return getScrollingChildHelper().a();
|
|
}
|
|
|
|
String i() {
|
|
return " " + super.toString() + ", adapter:" + this.l + ", layout:" + this.m + ", context:" + getContext();
|
|
}
|
|
|
|
public void i(int i) {
|
|
}
|
|
|
|
public void i(View view) {
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public boolean isAttachedToWindow() {
|
|
return this.r;
|
|
}
|
|
|
|
@Override // android.view.View, androidx.core.view.NestedScrollingChild
|
|
public boolean isNestedScrollingEnabled() {
|
|
return getScrollingChildHelper().b();
|
|
}
|
|
|
|
public void j(int i) {
|
|
if (this.y) {
|
|
return;
|
|
}
|
|
x();
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager == null) {
|
|
Log.e("RecyclerView", "Cannot scroll to position a LayoutManager set. Call setLayoutManager with a non-null argument.");
|
|
} else {
|
|
layoutManager.i(i);
|
|
awakenScrollBars();
|
|
}
|
|
}
|
|
|
|
public void j(View view) {
|
|
}
|
|
|
|
void k() {
|
|
this.d = new AdapterHelper(new AdapterHelper.Callback() { // from class: androidx.recyclerview.widget.RecyclerView.6
|
|
@Override // androidx.recyclerview.widget.AdapterHelper.Callback
|
|
public ViewHolder a(int i) {
|
|
ViewHolder a = RecyclerView.this.a(i, true);
|
|
if (a == null || RecyclerView.this.e.c(a.itemView)) {
|
|
return null;
|
|
}
|
|
return a;
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.AdapterHelper.Callback
|
|
public void b(int i, int i2) {
|
|
RecyclerView.this.a(i, i2, false);
|
|
RecyclerView.this.l0 = true;
|
|
}
|
|
|
|
void c(AdapterHelper.UpdateOp updateOp) {
|
|
int i = updateOp.a;
|
|
if (i == 1) {
|
|
RecyclerView recyclerView = RecyclerView.this;
|
|
recyclerView.m.a(recyclerView, updateOp.b, updateOp.d);
|
|
return;
|
|
}
|
|
if (i == 2) {
|
|
RecyclerView recyclerView2 = RecyclerView.this;
|
|
recyclerView2.m.b(recyclerView2, updateOp.b, updateOp.d);
|
|
} else if (i == 4) {
|
|
RecyclerView recyclerView3 = RecyclerView.this;
|
|
recyclerView3.m.a(recyclerView3, updateOp.b, updateOp.d, updateOp.c);
|
|
} else {
|
|
if (i != 8) {
|
|
return;
|
|
}
|
|
RecyclerView recyclerView4 = RecyclerView.this;
|
|
recyclerView4.m.a(recyclerView4, updateOp.b, updateOp.d, 1);
|
|
}
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.AdapterHelper.Callback
|
|
public void d(int i, int i2) {
|
|
RecyclerView.this.a(i, i2, true);
|
|
RecyclerView recyclerView = RecyclerView.this;
|
|
recyclerView.l0 = true;
|
|
recyclerView.i0.d += i2;
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.AdapterHelper.Callback
|
|
public void a(int i, int i2, Object obj) {
|
|
RecyclerView.this.a(i, i2, obj);
|
|
RecyclerView.this.m0 = true;
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.AdapterHelper.Callback
|
|
public void b(AdapterHelper.UpdateOp updateOp) {
|
|
c(updateOp);
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.AdapterHelper.Callback
|
|
public void a(AdapterHelper.UpdateOp updateOp) {
|
|
c(updateOp);
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.AdapterHelper.Callback
|
|
public void a(int i, int i2) {
|
|
RecyclerView.this.g(i, i2);
|
|
RecyclerView.this.l0 = true;
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.AdapterHelper.Callback
|
|
public void c(int i, int i2) {
|
|
RecyclerView.this.f(i, i2);
|
|
RecyclerView.this.l0 = true;
|
|
}
|
|
});
|
|
}
|
|
|
|
void l() {
|
|
this.M = null;
|
|
this.K = null;
|
|
this.L = null;
|
|
this.J = null;
|
|
}
|
|
|
|
boolean m() {
|
|
AccessibilityManager accessibilityManager = this.C;
|
|
return accessibilityManager != null && accessibilityManager.isEnabled();
|
|
}
|
|
|
|
public boolean n() {
|
|
return this.G > 0;
|
|
}
|
|
|
|
void o() {
|
|
int b = this.e.b();
|
|
for (int i = 0; i < b; i++) {
|
|
((LayoutParams) this.e.d(i).getLayoutParams()).c = true;
|
|
}
|
|
this.b.g();
|
|
}
|
|
|
|
/* JADX WARN: Code restructure failed: missing block: B:16:0x004f, code lost:
|
|
|
|
if (r0 >= 30.0f) goto L22;
|
|
*/
|
|
@Override // android.view.ViewGroup, android.view.View
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
|
*/
|
|
protected void onAttachedToWindow() {
|
|
/*
|
|
r4 = this;
|
|
super.onAttachedToWindow()
|
|
r0 = 0
|
|
r4.G = r0
|
|
r1 = 1
|
|
r4.r = r1
|
|
boolean r2 = r4.u
|
|
if (r2 == 0) goto L14
|
|
boolean r2 = r4.isLayoutRequested()
|
|
if (r2 != 0) goto L14
|
|
goto L15
|
|
L14:
|
|
r1 = 0
|
|
L15:
|
|
r4.u = r1
|
|
androidx.recyclerview.widget.RecyclerView$LayoutManager r1 = r4.m
|
|
if (r1 == 0) goto L1e
|
|
r1.a(r4)
|
|
L1e:
|
|
r4.o0 = r0
|
|
boolean r0 = androidx.recyclerview.widget.RecyclerView.F0
|
|
if (r0 == 0) goto L67
|
|
java.lang.ThreadLocal<androidx.recyclerview.widget.GapWorker> r0 = androidx.recyclerview.widget.GapWorker.e
|
|
java.lang.Object r0 = r0.get()
|
|
androidx.recyclerview.widget.GapWorker r0 = (androidx.recyclerview.widget.GapWorker) r0
|
|
r4.g0 = r0
|
|
androidx.recyclerview.widget.GapWorker r0 = r4.g0
|
|
if (r0 != 0) goto L62
|
|
androidx.recyclerview.widget.GapWorker r0 = new androidx.recyclerview.widget.GapWorker
|
|
r0.<init>()
|
|
r4.g0 = r0
|
|
android.view.Display r0 = androidx.core.view.ViewCompat.f(r4)
|
|
r1 = 1114636288(0x42700000, float:60.0)
|
|
boolean r2 = r4.isInEditMode()
|
|
if (r2 != 0) goto L52
|
|
if (r0 == 0) goto L52
|
|
float r0 = r0.getRefreshRate()
|
|
r2 = 1106247680(0x41f00000, float:30.0)
|
|
int r2 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1))
|
|
if (r2 < 0) goto L52
|
|
goto L54
|
|
L52:
|
|
r0 = 1114636288(0x42700000, float:60.0)
|
|
L54:
|
|
androidx.recyclerview.widget.GapWorker r1 = r4.g0
|
|
r2 = 1315859240(0x4e6e6b28, float:1.0E9)
|
|
float r2 = r2 / r0
|
|
long r2 = (long) r2
|
|
r1.c = r2
|
|
java.lang.ThreadLocal<androidx.recyclerview.widget.GapWorker> r0 = androidx.recyclerview.widget.GapWorker.e
|
|
r0.set(r1)
|
|
L62:
|
|
androidx.recyclerview.widget.GapWorker r0 = r4.g0
|
|
r0.a(r4)
|
|
L67:
|
|
return
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.onAttachedToWindow():void");
|
|
}
|
|
|
|
@Override // android.view.ViewGroup, android.view.View
|
|
protected void onDetachedFromWindow() {
|
|
GapWorker gapWorker;
|
|
super.onDetachedFromWindow();
|
|
ItemAnimator itemAnimator = this.N;
|
|
if (itemAnimator != null) {
|
|
itemAnimator.b();
|
|
}
|
|
x();
|
|
this.r = false;
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager != null) {
|
|
layoutManager.a(this, this.b);
|
|
}
|
|
this.x0.clear();
|
|
removeCallbacks(this.y0);
|
|
this.f.b();
|
|
if (!F0 || (gapWorker = this.g0) == null) {
|
|
return;
|
|
}
|
|
gapWorker.b(this);
|
|
this.g0 = null;
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void onDraw(Canvas canvas) {
|
|
super.onDraw(canvas);
|
|
int size = this.o.size();
|
|
for (int i = 0; i < size; i++) {
|
|
this.o.get(i).onDraw(canvas, this, this.i0);
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:20:0x0066 */
|
|
@Override // android.view.View
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
|
*/
|
|
public boolean onGenericMotionEvent(android.view.MotionEvent r6) {
|
|
/*
|
|
r5 = this;
|
|
androidx.recyclerview.widget.RecyclerView$LayoutManager r0 = r5.m
|
|
r1 = 0
|
|
if (r0 != 0) goto L6
|
|
return r1
|
|
L6:
|
|
boolean r0 = r5.y
|
|
if (r0 == 0) goto Lb
|
|
return r1
|
|
Lb:
|
|
int r0 = r6.getAction()
|
|
r2 = 8
|
|
if (r0 != r2) goto L77
|
|
int r0 = r6.getSource()
|
|
r0 = r0 & 2
|
|
r2 = 0
|
|
if (r0 == 0) goto L3c
|
|
androidx.recyclerview.widget.RecyclerView$LayoutManager r0 = r5.m
|
|
boolean r0 = r0.b()
|
|
if (r0 == 0) goto L2c
|
|
r0 = 9
|
|
float r0 = r6.getAxisValue(r0)
|
|
float r0 = -r0
|
|
goto L2d
|
|
L2c:
|
|
r0 = 0
|
|
L2d:
|
|
androidx.recyclerview.widget.RecyclerView$LayoutManager r3 = r5.m
|
|
boolean r3 = r3.a()
|
|
if (r3 == 0) goto L61
|
|
r3 = 10
|
|
float r3 = r6.getAxisValue(r3)
|
|
goto L62
|
|
L3c:
|
|
int r0 = r6.getSource()
|
|
r3 = 4194304(0x400000, float:5.877472E-39)
|
|
r0 = r0 & r3
|
|
if (r0 == 0) goto L60
|
|
r0 = 26
|
|
float r0 = r6.getAxisValue(r0)
|
|
androidx.recyclerview.widget.RecyclerView$LayoutManager r3 = r5.m
|
|
boolean r3 = r3.b()
|
|
if (r3 == 0) goto L55
|
|
float r0 = -r0
|
|
goto L61
|
|
L55:
|
|
androidx.recyclerview.widget.RecyclerView$LayoutManager r3 = r5.m
|
|
boolean r3 = r3.a()
|
|
if (r3 == 0) goto L60
|
|
r3 = r0
|
|
r0 = 0
|
|
goto L62
|
|
L60:
|
|
r0 = 0
|
|
L61:
|
|
r3 = 0
|
|
L62:
|
|
int r4 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1))
|
|
if (r4 != 0) goto L6a
|
|
int r2 = (r3 > r2 ? 1 : (r3 == r2 ? 0 : -1))
|
|
if (r2 == 0) goto L77
|
|
L6a:
|
|
float r2 = r5.c0
|
|
float r3 = r3 * r2
|
|
int r2 = (int) r3
|
|
float r3 = r5.d0
|
|
float r0 = r0 * r3
|
|
int r0 = (int) r0
|
|
r5.a(r2, r0, r6)
|
|
L77:
|
|
return r1
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.onGenericMotionEvent(android.view.MotionEvent):boolean");
|
|
}
|
|
|
|
@Override // android.view.ViewGroup
|
|
public boolean onInterceptTouchEvent(MotionEvent motionEvent) {
|
|
boolean z;
|
|
if (this.y) {
|
|
return false;
|
|
}
|
|
if (b(motionEvent)) {
|
|
y();
|
|
return true;
|
|
}
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager == null) {
|
|
return false;
|
|
}
|
|
boolean a = layoutManager.a();
|
|
boolean b = this.m.b();
|
|
if (this.Q == null) {
|
|
this.Q = VelocityTracker.obtain();
|
|
}
|
|
this.Q.addMovement(motionEvent);
|
|
int actionMasked = motionEvent.getActionMasked();
|
|
int actionIndex = motionEvent.getActionIndex();
|
|
if (actionMasked == 0) {
|
|
if (this.z) {
|
|
this.z = false;
|
|
}
|
|
this.P = motionEvent.getPointerId(0);
|
|
int x = (int) (motionEvent.getX() + 0.5f);
|
|
this.T = x;
|
|
this.R = x;
|
|
int y = (int) (motionEvent.getY() + 0.5f);
|
|
this.U = y;
|
|
this.S = y;
|
|
if (this.O == 2) {
|
|
getParent().requestDisallowInterceptTouchEvent(true);
|
|
setScrollState(1);
|
|
}
|
|
int[] iArr = this.v0;
|
|
iArr[1] = 0;
|
|
iArr[0] = 0;
|
|
int i = a ? 1 : 0;
|
|
if (b) {
|
|
i |= 2;
|
|
}
|
|
j(i, 0);
|
|
} else if (actionMasked == 1) {
|
|
this.Q.clear();
|
|
a(0);
|
|
} else if (actionMasked == 2) {
|
|
int findPointerIndex = motionEvent.findPointerIndex(this.P);
|
|
if (findPointerIndex < 0) {
|
|
Log.e("RecyclerView", "Error processing scroll; pointer index for id " + this.P + " not found. Did any MotionEvents get skipped?");
|
|
return false;
|
|
}
|
|
int x2 = (int) (motionEvent.getX(findPointerIndex) + 0.5f);
|
|
int y2 = (int) (motionEvent.getY(findPointerIndex) + 0.5f);
|
|
if (this.O != 1) {
|
|
int i2 = x2 - this.R;
|
|
int i3 = y2 - this.S;
|
|
if (!a || Math.abs(i2) <= this.V) {
|
|
z = false;
|
|
} else {
|
|
this.T = x2;
|
|
z = true;
|
|
}
|
|
if (b && Math.abs(i3) > this.V) {
|
|
this.U = y2;
|
|
z = true;
|
|
}
|
|
if (z) {
|
|
setScrollState(1);
|
|
}
|
|
}
|
|
} else if (actionMasked == 3) {
|
|
y();
|
|
} else if (actionMasked == 5) {
|
|
this.P = motionEvent.getPointerId(actionIndex);
|
|
int x3 = (int) (motionEvent.getX(actionIndex) + 0.5f);
|
|
this.T = x3;
|
|
this.R = x3;
|
|
int y3 = (int) (motionEvent.getY(actionIndex) + 0.5f);
|
|
this.U = y3;
|
|
this.S = y3;
|
|
} else if (actionMasked == 6) {
|
|
c(motionEvent);
|
|
}
|
|
return this.O == 1;
|
|
}
|
|
|
|
@Override // android.view.ViewGroup, android.view.View
|
|
protected void onLayout(boolean z, int i, int i2, int i3, int i4) {
|
|
TraceCompat.a("RV OnLayout");
|
|
c();
|
|
TraceCompat.a();
|
|
this.u = true;
|
|
}
|
|
|
|
@Override // android.view.View
|
|
protected void onMeasure(int i, int i2) {
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager == null) {
|
|
c(i, i2);
|
|
return;
|
|
}
|
|
boolean z = false;
|
|
if (layoutManager.v()) {
|
|
int mode = View.MeasureSpec.getMode(i);
|
|
int mode2 = View.MeasureSpec.getMode(i2);
|
|
this.m.a(this.b, this.i0, i, i2);
|
|
if (mode == 1073741824 && mode2 == 1073741824) {
|
|
z = true;
|
|
}
|
|
if (z || this.l == null) {
|
|
return;
|
|
}
|
|
if (this.i0.e == 1) {
|
|
A();
|
|
}
|
|
this.m.b(i, i2);
|
|
this.i0.j = true;
|
|
B();
|
|
this.m.d(i, i2);
|
|
if (this.m.B()) {
|
|
this.m.b(View.MeasureSpec.makeMeasureSpec(getMeasuredWidth(), 1073741824), View.MeasureSpec.makeMeasureSpec(getMeasuredHeight(), 1073741824));
|
|
this.i0.j = true;
|
|
B();
|
|
this.m.d(i, i2);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (this.s) {
|
|
this.m.a(this.b, this.i0, i, i2);
|
|
return;
|
|
}
|
|
if (this.B) {
|
|
w();
|
|
q();
|
|
I();
|
|
r();
|
|
State state = this.i0;
|
|
if (state.l) {
|
|
state.h = true;
|
|
} else {
|
|
this.d.b();
|
|
this.i0.h = false;
|
|
}
|
|
this.B = false;
|
|
c(false);
|
|
} else if (this.i0.l) {
|
|
setMeasuredDimension(getMeasuredWidth(), getMeasuredHeight());
|
|
return;
|
|
}
|
|
Adapter adapter = this.l;
|
|
if (adapter != null) {
|
|
this.i0.f = adapter.getItemCount();
|
|
} else {
|
|
this.i0.f = 0;
|
|
}
|
|
w();
|
|
this.m.a(this.b, this.i0, i, i2);
|
|
c(false);
|
|
this.i0.h = false;
|
|
}
|
|
|
|
@Override // android.view.ViewGroup
|
|
protected boolean onRequestFocusInDescendants(int i, Rect rect) {
|
|
if (n()) {
|
|
return false;
|
|
}
|
|
return super.onRequestFocusInDescendants(i, rect);
|
|
}
|
|
|
|
@Override // android.view.View
|
|
protected void onRestoreInstanceState(Parcelable parcelable) {
|
|
Parcelable parcelable2;
|
|
if (!(parcelable instanceof SavedState)) {
|
|
super.onRestoreInstanceState(parcelable);
|
|
return;
|
|
}
|
|
this.c = (SavedState) parcelable;
|
|
super.onRestoreInstanceState(this.c.getSuperState());
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager == null || (parcelable2 = this.c.mLayoutState) == null) {
|
|
return;
|
|
}
|
|
layoutManager.a(parcelable2);
|
|
}
|
|
|
|
@Override // android.view.View
|
|
protected Parcelable onSaveInstanceState() {
|
|
SavedState savedState = new SavedState(super.onSaveInstanceState());
|
|
SavedState savedState2 = this.c;
|
|
if (savedState2 != null) {
|
|
savedState.copyFrom(savedState2);
|
|
} else {
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager != null) {
|
|
savedState.mLayoutState = layoutManager.y();
|
|
} else {
|
|
savedState.mLayoutState = null;
|
|
}
|
|
}
|
|
return savedState;
|
|
}
|
|
|
|
@Override // android.view.View
|
|
protected void onSizeChanged(int i, int i2, int i3, int i4) {
|
|
super.onSizeChanged(i, i2, i3, i4);
|
|
if (i == i3 && i2 == i4) {
|
|
return;
|
|
}
|
|
l();
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:53:0x010c */
|
|
/* JADX WARN: Removed duplicated region for block: B:60:0x011c */
|
|
@Override // android.view.View
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
|
*/
|
|
public boolean onTouchEvent(android.view.MotionEvent r15) {
|
|
/*
|
|
Method dump skipped, instructions count: 456
|
|
To view this dump change 'Code comments level' option to 'DEBUG'
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.onTouchEvent(android.view.MotionEvent):boolean");
|
|
}
|
|
|
|
void p() {
|
|
int b = this.e.b();
|
|
for (int i = 0; i < b; i++) {
|
|
ViewHolder m = m(this.e.d(i));
|
|
if (m != null && !m.shouldIgnore()) {
|
|
m.addFlags(6);
|
|
}
|
|
}
|
|
o();
|
|
this.b.h();
|
|
}
|
|
|
|
void q() {
|
|
this.G++;
|
|
}
|
|
|
|
void r() {
|
|
a(true);
|
|
}
|
|
|
|
@Override // android.view.ViewGroup
|
|
protected void removeDetachedView(View view, boolean z) {
|
|
ViewHolder m = m(view);
|
|
if (m != null) {
|
|
if (m.isTmpDetached()) {
|
|
m.clearTmpDetachFlag();
|
|
} else if (!m.shouldIgnore()) {
|
|
throw new IllegalArgumentException("Called removeDetachedView with a view which is not flagged as tmp detached." + m + i());
|
|
}
|
|
}
|
|
view.clearAnimation();
|
|
b(view);
|
|
super.removeDetachedView(view, z);
|
|
}
|
|
|
|
@Override // android.view.ViewGroup, android.view.ViewParent
|
|
public void requestChildFocus(View view, View view2) {
|
|
if (!this.m.a(this, this.i0, view, view2) && view2 != null) {
|
|
a(view, view2);
|
|
}
|
|
super.requestChildFocus(view, view2);
|
|
}
|
|
|
|
@Override // android.view.ViewGroup, android.view.ViewParent
|
|
public boolean requestChildRectangleOnScreen(View view, Rect rect, boolean z) {
|
|
return this.m.a(this, view, rect, z);
|
|
}
|
|
|
|
@Override // android.view.ViewGroup, android.view.ViewParent
|
|
public void requestDisallowInterceptTouchEvent(boolean z) {
|
|
int size = this.p.size();
|
|
for (int i = 0; i < size; i++) {
|
|
this.p.get(i).onRequestDisallowInterceptTouchEvent(z);
|
|
}
|
|
super.requestDisallowInterceptTouchEvent(z);
|
|
}
|
|
|
|
@Override // android.view.View, android.view.ViewParent
|
|
public void requestLayout() {
|
|
if (this.v != 0 || this.y) {
|
|
this.x = true;
|
|
} else {
|
|
super.requestLayout();
|
|
}
|
|
}
|
|
|
|
void s() {
|
|
if (this.o0 || !this.r) {
|
|
return;
|
|
}
|
|
ViewCompat.a(this, this.y0);
|
|
this.o0 = true;
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void scrollBy(int i, int i2) {
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager == null) {
|
|
Log.e("RecyclerView", "Cannot scroll without a LayoutManager set. Call setLayoutManager with a non-null argument.");
|
|
return;
|
|
}
|
|
if (this.y) {
|
|
return;
|
|
}
|
|
boolean a = layoutManager.a();
|
|
boolean b = this.m.b();
|
|
if (a || b) {
|
|
if (!a) {
|
|
i = 0;
|
|
}
|
|
if (!b) {
|
|
i2 = 0;
|
|
}
|
|
a(i, i2, (MotionEvent) null);
|
|
}
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void scrollTo(int i, int i2) {
|
|
Log.w("RecyclerView", "RecyclerView does not support scrolling to an absolute position. Use scrollToPosition instead");
|
|
}
|
|
|
|
@Override // android.view.View, android.view.accessibility.AccessibilityEventSource
|
|
public void sendAccessibilityEventUnchecked(AccessibilityEvent accessibilityEvent) {
|
|
if (a(accessibilityEvent)) {
|
|
return;
|
|
}
|
|
super.sendAccessibilityEventUnchecked(accessibilityEvent);
|
|
}
|
|
|
|
public void setAccessibilityDelegateCompat(RecyclerViewAccessibilityDelegate recyclerViewAccessibilityDelegate) {
|
|
this.p0 = recyclerViewAccessibilityDelegate;
|
|
ViewCompat.a(this, this.p0);
|
|
}
|
|
|
|
public void setAdapter(Adapter adapter) {
|
|
setLayoutFrozen(false);
|
|
a(adapter, false, true);
|
|
b(false);
|
|
requestLayout();
|
|
}
|
|
|
|
public void setChildDrawingOrderCallback(ChildDrawingOrderCallback childDrawingOrderCallback) {
|
|
if (childDrawingOrderCallback == this.q0) {
|
|
return;
|
|
}
|
|
this.q0 = childDrawingOrderCallback;
|
|
setChildrenDrawingOrderEnabled(this.q0 != null);
|
|
}
|
|
|
|
@Override // android.view.ViewGroup
|
|
public void setClipToPadding(boolean z) {
|
|
if (z != this.g) {
|
|
l();
|
|
}
|
|
this.g = z;
|
|
super.setClipToPadding(z);
|
|
if (this.u) {
|
|
requestLayout();
|
|
}
|
|
}
|
|
|
|
public void setEdgeEffectFactory(EdgeEffectFactory edgeEffectFactory) {
|
|
Preconditions.a(edgeEffectFactory);
|
|
this.I = edgeEffectFactory;
|
|
l();
|
|
}
|
|
|
|
public void setHasFixedSize(boolean z) {
|
|
this.s = z;
|
|
}
|
|
|
|
public void setItemAnimator(ItemAnimator itemAnimator) {
|
|
ItemAnimator itemAnimator2 = this.N;
|
|
if (itemAnimator2 != null) {
|
|
itemAnimator2.b();
|
|
this.N.a((ItemAnimator.ItemAnimatorListener) null);
|
|
}
|
|
this.N = itemAnimator;
|
|
ItemAnimator itemAnimator3 = this.N;
|
|
if (itemAnimator3 != null) {
|
|
itemAnimator3.a(this.n0);
|
|
}
|
|
}
|
|
|
|
public void setItemViewCacheSize(int i) {
|
|
this.b.f(i);
|
|
}
|
|
|
|
public void setLayoutFrozen(boolean z) {
|
|
if (z != this.y) {
|
|
a("Do not setLayoutFrozen in layout or scroll");
|
|
if (z) {
|
|
long uptimeMillis = SystemClock.uptimeMillis();
|
|
onTouchEvent(MotionEvent.obtain(uptimeMillis, uptimeMillis, 3, 0.0f, 0.0f, 0));
|
|
this.y = true;
|
|
this.z = true;
|
|
x();
|
|
return;
|
|
}
|
|
this.y = false;
|
|
if (this.x && this.m != null && this.l != null) {
|
|
requestLayout();
|
|
}
|
|
this.x = false;
|
|
}
|
|
}
|
|
|
|
public void setLayoutManager(LayoutManager layoutManager) {
|
|
if (layoutManager == this.m) {
|
|
return;
|
|
}
|
|
x();
|
|
if (this.m != null) {
|
|
ItemAnimator itemAnimator = this.N;
|
|
if (itemAnimator != null) {
|
|
itemAnimator.b();
|
|
}
|
|
this.m.b(this.b);
|
|
this.m.c(this.b);
|
|
this.b.a();
|
|
if (this.r) {
|
|
this.m.a(this, this.b);
|
|
}
|
|
this.m.f((RecyclerView) null);
|
|
this.m = null;
|
|
} else {
|
|
this.b.a();
|
|
}
|
|
this.e.c();
|
|
this.m = layoutManager;
|
|
if (layoutManager != null) {
|
|
if (layoutManager.b != null) {
|
|
throw new IllegalArgumentException("LayoutManager " + layoutManager + " is already attached to a RecyclerView:" + layoutManager.b.i());
|
|
}
|
|
this.m.f(this);
|
|
if (this.r) {
|
|
this.m.a(this);
|
|
}
|
|
}
|
|
this.b.j();
|
|
requestLayout();
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void setNestedScrollingEnabled(boolean z) {
|
|
getScrollingChildHelper().a(z);
|
|
}
|
|
|
|
public void setOnFlingListener(OnFlingListener onFlingListener) {
|
|
this.W = onFlingListener;
|
|
}
|
|
|
|
@Deprecated
|
|
public void setOnScrollListener(OnScrollListener onScrollListener) {
|
|
this.j0 = onScrollListener;
|
|
}
|
|
|
|
public void setPreserveFocusAfterLayout(boolean z) {
|
|
this.e0 = z;
|
|
}
|
|
|
|
public void setRecycledViewPool(RecycledViewPool recycledViewPool) {
|
|
this.b.a(recycledViewPool);
|
|
}
|
|
|
|
public void setRecyclerListener(RecyclerListener recyclerListener) {
|
|
this.n = recyclerListener;
|
|
}
|
|
|
|
void setScrollState(int i) {
|
|
if (i == this.O) {
|
|
return;
|
|
}
|
|
this.O = i;
|
|
if (i != 2) {
|
|
O();
|
|
}
|
|
b(i);
|
|
}
|
|
|
|
public void setScrollingTouchSlop(int i) {
|
|
ViewConfiguration viewConfiguration = ViewConfiguration.get(getContext());
|
|
if (i != 0) {
|
|
if (i == 1) {
|
|
this.V = viewConfiguration.getScaledPagingTouchSlop();
|
|
return;
|
|
}
|
|
Log.w("RecyclerView", "setScrollingTouchSlop(): bad argument constant " + i + "; using default value");
|
|
}
|
|
this.V = viewConfiguration.getScaledTouchSlop();
|
|
}
|
|
|
|
public void setViewCacheExtension(ViewCacheExtension viewCacheExtension) {
|
|
this.b.a(viewCacheExtension);
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public boolean startNestedScroll(int i) {
|
|
return getScrollingChildHelper().b(i);
|
|
}
|
|
|
|
@Override // android.view.View, androidx.core.view.NestedScrollingChild
|
|
public void stopNestedScroll() {
|
|
getScrollingChildHelper().c();
|
|
}
|
|
|
|
void t() {
|
|
ItemAnimator itemAnimator = this.N;
|
|
if (itemAnimator != null) {
|
|
itemAnimator.b();
|
|
}
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager != null) {
|
|
layoutManager.b(this.b);
|
|
this.m.c(this.b);
|
|
}
|
|
this.b.a();
|
|
}
|
|
|
|
void u() {
|
|
ViewHolder viewHolder;
|
|
int a = this.e.a();
|
|
for (int i = 0; i < a; i++) {
|
|
View c = this.e.c(i);
|
|
ViewHolder g = g(c);
|
|
if (g != null && (viewHolder = g.mShadowingHolder) != null) {
|
|
View view = viewHolder.itemView;
|
|
int left = c.getLeft();
|
|
int top = c.getTop();
|
|
if (left != view.getLeft() || top != view.getTop()) {
|
|
view.layout(left, top, view.getWidth() + left, view.getHeight() + top);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
void v() {
|
|
int b = this.e.b();
|
|
for (int i = 0; i < b; i++) {
|
|
ViewHolder m = m(this.e.d(i));
|
|
if (!m.shouldIgnore()) {
|
|
m.saveOldPosition();
|
|
}
|
|
}
|
|
}
|
|
|
|
void w() {
|
|
this.v++;
|
|
if (this.v != 1 || this.y) {
|
|
return;
|
|
}
|
|
this.x = false;
|
|
}
|
|
|
|
public void x() {
|
|
setScrollState(0);
|
|
O();
|
|
}
|
|
|
|
public RecyclerView(Context context, AttributeSet attributeSet) {
|
|
this(context, attributeSet, 0);
|
|
}
|
|
|
|
static RecyclerView l(View view) {
|
|
if (!(view instanceof ViewGroup)) {
|
|
return null;
|
|
}
|
|
if (view instanceof RecyclerView) {
|
|
return (RecyclerView) view;
|
|
}
|
|
ViewGroup viewGroup = (ViewGroup) view;
|
|
int childCount = viewGroup.getChildCount();
|
|
for (int i = 0; i < childCount; i++) {
|
|
RecyclerView l = l(viewGroup.getChildAt(i));
|
|
if (l != null) {
|
|
return l;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
static ViewHolder m(View view) {
|
|
if (view == null) {
|
|
return null;
|
|
}
|
|
return ((LayoutParams) view.getLayoutParams()).a;
|
|
}
|
|
|
|
private int n(View view) {
|
|
int id = view.getId();
|
|
while (!view.isFocused() && (view instanceof ViewGroup) && view.hasFocus()) {
|
|
view = ((ViewGroup) view).getFocusedChild();
|
|
if (view.getId() != -1) {
|
|
id = view.getId();
|
|
}
|
|
}
|
|
return id;
|
|
}
|
|
|
|
boolean k(View view) {
|
|
w();
|
|
boolean e = this.e.e(view);
|
|
if (e) {
|
|
ViewHolder m = m(view);
|
|
this.b.c(m);
|
|
this.b.b(m);
|
|
}
|
|
c(!e);
|
|
return e;
|
|
}
|
|
|
|
public static class RecycledViewPool {
|
|
SparseArray<ScrapData> a = new SparseArray<>();
|
|
private int b = 0;
|
|
|
|
static class ScrapData {
|
|
final ArrayList<ViewHolder> a = new ArrayList<>();
|
|
int b = 5;
|
|
long c = 0;
|
|
long d = 0;
|
|
|
|
ScrapData() {
|
|
}
|
|
}
|
|
|
|
public ViewHolder a(int i) {
|
|
ScrapData scrapData = this.a.get(i);
|
|
if (scrapData == null || scrapData.a.isEmpty()) {
|
|
return null;
|
|
}
|
|
return scrapData.a.remove(r2.size() - 1);
|
|
}
|
|
|
|
public void b() {
|
|
for (int i = 0; i < this.a.size(); i++) {
|
|
this.a.valueAt(i).a.clear();
|
|
}
|
|
}
|
|
|
|
void c() {
|
|
this.b--;
|
|
}
|
|
|
|
void b(int i, long j) {
|
|
ScrapData b = b(i);
|
|
b.c = a(b.c, j);
|
|
}
|
|
|
|
public void a(ViewHolder viewHolder) {
|
|
int itemViewType = viewHolder.getItemViewType();
|
|
ArrayList<ViewHolder> arrayList = b(itemViewType).a;
|
|
if (this.a.get(itemViewType).b <= arrayList.size()) {
|
|
return;
|
|
}
|
|
viewHolder.resetInternal();
|
|
arrayList.add(viewHolder);
|
|
}
|
|
|
|
boolean b(int i, long j, long j2) {
|
|
long j3 = b(i).c;
|
|
return j3 == 0 || j + j3 < j2;
|
|
}
|
|
|
|
private ScrapData b(int i) {
|
|
ScrapData scrapData = this.a.get(i);
|
|
if (scrapData != null) {
|
|
return scrapData;
|
|
}
|
|
ScrapData scrapData2 = new ScrapData();
|
|
this.a.put(i, scrapData2);
|
|
return scrapData2;
|
|
}
|
|
|
|
long a(long j, long j2) {
|
|
return j == 0 ? j2 : ((j / 4) * 3) + (j2 / 4);
|
|
}
|
|
|
|
void a(int i, long j) {
|
|
ScrapData b = b(i);
|
|
b.d = a(b.d, j);
|
|
}
|
|
|
|
boolean a(int i, long j, long j2) {
|
|
long j3 = b(i).d;
|
|
return j3 == 0 || j + j3 < j2;
|
|
}
|
|
|
|
void a() {
|
|
this.b++;
|
|
}
|
|
|
|
void a(Adapter adapter, Adapter adapter2, boolean z) {
|
|
if (adapter != null) {
|
|
c();
|
|
}
|
|
if (!z && this.b == 0) {
|
|
b();
|
|
}
|
|
if (adapter2 != null) {
|
|
a();
|
|
}
|
|
}
|
|
}
|
|
|
|
private class RecyclerViewDataObserver extends AdapterDataObserver {
|
|
RecyclerViewDataObserver() {
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.RecyclerView.AdapterDataObserver
|
|
public void a() {
|
|
RecyclerView.this.a((String) null);
|
|
RecyclerView recyclerView = RecyclerView.this;
|
|
recyclerView.i0.g = true;
|
|
recyclerView.b(true);
|
|
if (RecyclerView.this.d.c()) {
|
|
return;
|
|
}
|
|
RecyclerView.this.requestLayout();
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.RecyclerView.AdapterDataObserver
|
|
public void b(int i, int i2) {
|
|
RecyclerView.this.a((String) null);
|
|
if (RecyclerView.this.d.b(i, i2)) {
|
|
b();
|
|
}
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.RecyclerView.AdapterDataObserver
|
|
public void c(int i, int i2) {
|
|
RecyclerView.this.a((String) null);
|
|
if (RecyclerView.this.d.c(i, i2)) {
|
|
b();
|
|
}
|
|
}
|
|
|
|
void b() {
|
|
if (RecyclerView.E0) {
|
|
RecyclerView recyclerView = RecyclerView.this;
|
|
if (recyclerView.s && recyclerView.r) {
|
|
ViewCompat.a(recyclerView, recyclerView.h);
|
|
return;
|
|
}
|
|
}
|
|
RecyclerView recyclerView2 = RecyclerView.this;
|
|
recyclerView2.B = true;
|
|
recyclerView2.requestLayout();
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.RecyclerView.AdapterDataObserver
|
|
public void a(int i, int i2, Object obj) {
|
|
RecyclerView.this.a((String) null);
|
|
if (RecyclerView.this.d.a(i, i2, obj)) {
|
|
b();
|
|
}
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.RecyclerView.AdapterDataObserver
|
|
public void a(int i, int i2, int i3) {
|
|
RecyclerView.this.a((String) null);
|
|
if (RecyclerView.this.d.a(i, i2, i3)) {
|
|
b();
|
|
}
|
|
}
|
|
}
|
|
|
|
public RecyclerView(Context context, AttributeSet attributeSet, int i) {
|
|
super(context, attributeSet, i);
|
|
this.a = new RecyclerViewDataObserver();
|
|
this.b = new Recycler();
|
|
this.f = new ViewInfoStore();
|
|
this.h = new Runnable() { // from class: androidx.recyclerview.widget.RecyclerView.1
|
|
@Override // java.lang.Runnable
|
|
public void run() {
|
|
RecyclerView recyclerView = RecyclerView.this;
|
|
if (!recyclerView.u || recyclerView.isLayoutRequested()) {
|
|
return;
|
|
}
|
|
RecyclerView recyclerView2 = RecyclerView.this;
|
|
if (!recyclerView2.r) {
|
|
recyclerView2.requestLayout();
|
|
} else if (recyclerView2.y) {
|
|
recyclerView2.x = true;
|
|
} else {
|
|
recyclerView2.b();
|
|
}
|
|
}
|
|
};
|
|
this.i = new Rect();
|
|
this.j = new Rect();
|
|
this.k = new RectF();
|
|
this.o = new ArrayList<>();
|
|
this.p = new ArrayList<>();
|
|
this.v = 0;
|
|
this.E = false;
|
|
this.F = false;
|
|
this.G = 0;
|
|
this.H = 0;
|
|
this.I = new EdgeEffectFactory();
|
|
this.N = new DefaultItemAnimator();
|
|
this.O = 0;
|
|
this.P = -1;
|
|
this.c0 = Float.MIN_VALUE;
|
|
this.d0 = Float.MIN_VALUE;
|
|
boolean z = true;
|
|
this.e0 = true;
|
|
this.f0 = new ViewFlinger();
|
|
this.h0 = F0 ? new GapWorker.LayoutPrefetchRegistryImpl() : null;
|
|
this.i0 = new State();
|
|
this.l0 = false;
|
|
this.m0 = false;
|
|
this.n0 = new ItemAnimatorRestoreListener();
|
|
this.o0 = false;
|
|
this.r0 = new int[2];
|
|
this.t0 = new int[2];
|
|
this.u0 = new int[2];
|
|
this.v0 = new int[2];
|
|
this.w0 = new int[2];
|
|
this.x0 = new ArrayList();
|
|
this.y0 = new Runnable() { // from class: androidx.recyclerview.widget.RecyclerView.2
|
|
@Override // java.lang.Runnable
|
|
public void run() {
|
|
ItemAnimator itemAnimator = RecyclerView.this.N;
|
|
if (itemAnimator != null) {
|
|
itemAnimator.i();
|
|
}
|
|
RecyclerView.this.o0 = false;
|
|
}
|
|
};
|
|
this.z0 = new ViewInfoStore.ProcessCallback() { // from class: androidx.recyclerview.widget.RecyclerView.4
|
|
@Override // androidx.recyclerview.widget.ViewInfoStore.ProcessCallback
|
|
public void a(ViewHolder viewHolder, ItemAnimator.ItemHolderInfo itemHolderInfo, ItemAnimator.ItemHolderInfo itemHolderInfo2) {
|
|
RecyclerView.this.a(viewHolder, itemHolderInfo, itemHolderInfo2);
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.ViewInfoStore.ProcessCallback
|
|
public void b(ViewHolder viewHolder, ItemAnimator.ItemHolderInfo itemHolderInfo, ItemAnimator.ItemHolderInfo itemHolderInfo2) {
|
|
RecyclerView.this.b.c(viewHolder);
|
|
RecyclerView.this.b(viewHolder, itemHolderInfo, itemHolderInfo2);
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.ViewInfoStore.ProcessCallback
|
|
public void c(ViewHolder viewHolder, ItemAnimator.ItemHolderInfo itemHolderInfo, ItemAnimator.ItemHolderInfo itemHolderInfo2) {
|
|
viewHolder.setIsRecyclable(false);
|
|
RecyclerView recyclerView = RecyclerView.this;
|
|
if (recyclerView.E) {
|
|
if (recyclerView.N.a(viewHolder, viewHolder, itemHolderInfo, itemHolderInfo2)) {
|
|
RecyclerView.this.s();
|
|
}
|
|
} else if (recyclerView.N.c(viewHolder, itemHolderInfo, itemHolderInfo2)) {
|
|
RecyclerView.this.s();
|
|
}
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.ViewInfoStore.ProcessCallback
|
|
public void a(ViewHolder viewHolder) {
|
|
RecyclerView recyclerView = RecyclerView.this;
|
|
recyclerView.m.a(viewHolder.itemView, recyclerView.b);
|
|
}
|
|
};
|
|
if (attributeSet != null) {
|
|
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, B0, i, 0);
|
|
this.g = obtainStyledAttributes.getBoolean(0, true);
|
|
obtainStyledAttributes.recycle();
|
|
} else {
|
|
this.g = true;
|
|
}
|
|
setScrollContainer(true);
|
|
setFocusableInTouchMode(true);
|
|
ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
|
|
this.V = viewConfiguration.getScaledTouchSlop();
|
|
this.c0 = ViewConfigurationCompat.b(viewConfiguration, context);
|
|
this.d0 = ViewConfigurationCompat.c(viewConfiguration, context);
|
|
this.a0 = viewConfiguration.getScaledMinimumFlingVelocity();
|
|
this.b0 = viewConfiguration.getScaledMaximumFlingVelocity();
|
|
setWillNotDraw(getOverScrollMode() == 2);
|
|
this.N.a(this.n0);
|
|
k();
|
|
G();
|
|
F();
|
|
if (ViewCompat.i(this) == 0) {
|
|
ViewCompat.f((View) this, 1);
|
|
}
|
|
this.C = (AccessibilityManager) getContext().getSystemService("accessibility");
|
|
setAccessibilityDelegateCompat(new RecyclerViewAccessibilityDelegate(this));
|
|
if (attributeSet != null) {
|
|
TypedArray obtainStyledAttributes2 = context.obtainStyledAttributes(attributeSet, R$styleable.RecyclerView, i, 0);
|
|
String string = obtainStyledAttributes2.getString(R$styleable.RecyclerView_layoutManager);
|
|
if (obtainStyledAttributes2.getInt(R$styleable.RecyclerView_android_descendantFocusability, -1) == -1) {
|
|
setDescendantFocusability(262144);
|
|
}
|
|
this.t = obtainStyledAttributes2.getBoolean(R$styleable.RecyclerView_fastScrollEnabled, false);
|
|
if (this.t) {
|
|
a((StateListDrawable) obtainStyledAttributes2.getDrawable(R$styleable.RecyclerView_fastScrollVerticalThumbDrawable), obtainStyledAttributes2.getDrawable(R$styleable.RecyclerView_fastScrollVerticalTrackDrawable), (StateListDrawable) obtainStyledAttributes2.getDrawable(R$styleable.RecyclerView_fastScrollHorizontalThumbDrawable), obtainStyledAttributes2.getDrawable(R$styleable.RecyclerView_fastScrollHorizontalTrackDrawable));
|
|
}
|
|
obtainStyledAttributes2.recycle();
|
|
a(context, string, attributeSet, i, 0);
|
|
if (Build.VERSION.SDK_INT >= 21) {
|
|
TypedArray obtainStyledAttributes3 = context.obtainStyledAttributes(attributeSet, A0, i, 0);
|
|
boolean z2 = obtainStyledAttributes3.getBoolean(0, true);
|
|
obtainStyledAttributes3.recycle();
|
|
z = z2;
|
|
}
|
|
} else {
|
|
setDescendantFocusability(262144);
|
|
}
|
|
setNestedScrollingEnabled(z);
|
|
}
|
|
|
|
public void i(int i, int i2) {
|
|
a(i, i2, (Interpolator) null);
|
|
}
|
|
|
|
public static class LayoutParams extends ViewGroup.MarginLayoutParams {
|
|
ViewHolder a;
|
|
final Rect b;
|
|
boolean c;
|
|
boolean d;
|
|
|
|
public LayoutParams(Context context, AttributeSet attributeSet) {
|
|
super(context, attributeSet);
|
|
this.b = new Rect();
|
|
this.c = true;
|
|
this.d = false;
|
|
}
|
|
|
|
public int a() {
|
|
return this.a.getLayoutPosition();
|
|
}
|
|
|
|
public boolean b() {
|
|
return this.a.isUpdated();
|
|
}
|
|
|
|
public boolean c() {
|
|
return this.a.isRemoved();
|
|
}
|
|
|
|
public boolean d() {
|
|
return this.a.isInvalid();
|
|
}
|
|
|
|
public LayoutParams(int i, int i2) {
|
|
super(i, i2);
|
|
this.b = new Rect();
|
|
this.c = true;
|
|
this.d = false;
|
|
}
|
|
|
|
public LayoutParams(ViewGroup.MarginLayoutParams marginLayoutParams) {
|
|
super(marginLayoutParams);
|
|
this.b = new Rect();
|
|
this.c = true;
|
|
this.d = false;
|
|
}
|
|
|
|
public LayoutParams(ViewGroup.LayoutParams layoutParams) {
|
|
super(layoutParams);
|
|
this.b = new Rect();
|
|
this.c = true;
|
|
this.d = false;
|
|
}
|
|
|
|
public LayoutParams(LayoutParams layoutParams) {
|
|
super((ViewGroup.LayoutParams) layoutParams);
|
|
this.b = new Rect();
|
|
this.c = true;
|
|
this.d = false;
|
|
}
|
|
}
|
|
|
|
public static class SavedState extends AbsSavedState {
|
|
public static final Parcelable.Creator<SavedState> CREATOR = new Parcelable.ClassLoaderCreator<SavedState>() { // from class: androidx.recyclerview.widget.RecyclerView.SavedState.1
|
|
@Override // android.os.Parcelable.Creator
|
|
public SavedState[] newArray(int i) {
|
|
return new SavedState[i];
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // android.os.Parcelable.ClassLoaderCreator
|
|
public SavedState createFromParcel(Parcel parcel, ClassLoader classLoader) {
|
|
return new SavedState(parcel, classLoader);
|
|
}
|
|
|
|
@Override // android.os.Parcelable.Creator
|
|
public SavedState createFromParcel(Parcel parcel) {
|
|
return new SavedState(parcel, null);
|
|
}
|
|
};
|
|
Parcelable mLayoutState;
|
|
|
|
SavedState(Parcel parcel, ClassLoader classLoader) {
|
|
super(parcel, classLoader);
|
|
this.mLayoutState = parcel.readParcelable(classLoader == null ? LayoutManager.class.getClassLoader() : classLoader);
|
|
}
|
|
|
|
void copyFrom(SavedState savedState) {
|
|
this.mLayoutState = savedState.mLayoutState;
|
|
}
|
|
|
|
@Override // androidx.customview.view.AbsSavedState, android.os.Parcelable
|
|
public void writeToParcel(Parcel parcel, int i) {
|
|
super.writeToParcel(parcel, i);
|
|
parcel.writeParcelable(this.mLayoutState, 0);
|
|
}
|
|
|
|
SavedState(Parcelable parcelable) {
|
|
super(parcelable);
|
|
}
|
|
}
|
|
|
|
public static class State {
|
|
private SparseArray<Object> b;
|
|
int m;
|
|
long n;
|
|
int o;
|
|
int p;
|
|
int q;
|
|
int a = -1;
|
|
int c = 0;
|
|
int d = 0;
|
|
int e = 1;
|
|
int f = 0;
|
|
boolean g = false;
|
|
boolean h = false;
|
|
boolean i = false;
|
|
boolean j = false;
|
|
boolean k = false;
|
|
boolean l = false;
|
|
|
|
void a(int i) {
|
|
if ((this.e & i) != 0) {
|
|
return;
|
|
}
|
|
throw new IllegalStateException("Layout state should be one of " + Integer.toBinaryString(i) + " but it is " + Integer.toBinaryString(this.e));
|
|
}
|
|
|
|
public int b() {
|
|
return this.a;
|
|
}
|
|
|
|
public boolean c() {
|
|
return this.a != -1;
|
|
}
|
|
|
|
public boolean d() {
|
|
return this.h;
|
|
}
|
|
|
|
public boolean e() {
|
|
return this.l;
|
|
}
|
|
|
|
public String toString() {
|
|
return "State{mTargetPosition=" + this.a + ", mData=" + this.b + ", mItemCount=" + this.f + ", mIsMeasuring=" + this.j + ", mPreviousLayoutItemCount=" + this.c + ", mDeletedInvisibleItemCountSincePreviousLayout=" + this.d + ", mStructureChanged=" + this.g + ", mInPreLayout=" + this.h + ", mRunSimpleAnimations=" + this.k + ", mRunPredictiveAnimations=" + this.l + '}';
|
|
}
|
|
|
|
void a(Adapter adapter) {
|
|
this.e = 1;
|
|
this.f = adapter.getItemCount();
|
|
this.h = false;
|
|
this.i = false;
|
|
this.j = false;
|
|
}
|
|
|
|
public int a() {
|
|
return this.h ? this.c - this.d : this.f;
|
|
}
|
|
}
|
|
|
|
void f() {
|
|
if (this.J != null) {
|
|
return;
|
|
}
|
|
this.J = this.I.a(this, 0);
|
|
if (this.g) {
|
|
this.J.setSize((getMeasuredHeight() - getPaddingTop()) - getPaddingBottom(), (getMeasuredWidth() - getPaddingLeft()) - getPaddingRight());
|
|
} else {
|
|
this.J.setSize(getMeasuredHeight(), getMeasuredWidth());
|
|
}
|
|
}
|
|
|
|
@Override // android.view.ViewGroup
|
|
protected ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams layoutParams) {
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager != null) {
|
|
return layoutManager.a(layoutParams);
|
|
}
|
|
throw new IllegalStateException("RecyclerView has no LayoutManager" + i());
|
|
}
|
|
|
|
private void a(Context context, String str, AttributeSet attributeSet, int i, int i2) {
|
|
ClassLoader classLoader;
|
|
Constructor constructor;
|
|
if (str != null) {
|
|
String trim = str.trim();
|
|
if (trim.isEmpty()) {
|
|
return;
|
|
}
|
|
String a = a(context, trim);
|
|
try {
|
|
if (isInEditMode()) {
|
|
classLoader = getClass().getClassLoader();
|
|
} else {
|
|
classLoader = context.getClassLoader();
|
|
}
|
|
Class<? extends U> asSubclass = classLoader.loadClass(a).asSubclass(LayoutManager.class);
|
|
Object[] objArr = null;
|
|
try {
|
|
constructor = asSubclass.getConstructor(I0);
|
|
objArr = new Object[]{context, attributeSet, Integer.valueOf(i), Integer.valueOf(i2)};
|
|
} catch (NoSuchMethodException e) {
|
|
try {
|
|
constructor = asSubclass.getConstructor(new Class[0]);
|
|
} catch (NoSuchMethodException e2) {
|
|
e2.initCause(e);
|
|
throw new IllegalStateException(attributeSet.getPositionDescription() + ": Error creating LayoutManager " + a, e2);
|
|
}
|
|
}
|
|
constructor.setAccessible(true);
|
|
setLayoutManager((LayoutManager) constructor.newInstance(objArr));
|
|
} catch (ClassCastException e3) {
|
|
throw new IllegalStateException(attributeSet.getPositionDescription() + ": Class is not a LayoutManager " + a, e3);
|
|
} catch (ClassNotFoundException e4) {
|
|
throw new IllegalStateException(attributeSet.getPositionDescription() + ": Unable to find LayoutManager " + a, e4);
|
|
} catch (IllegalAccessException e5) {
|
|
throw new IllegalStateException(attributeSet.getPositionDescription() + ": Cannot access non-public constructor " + a, e5);
|
|
} catch (InstantiationException e6) {
|
|
throw new IllegalStateException(attributeSet.getPositionDescription() + ": Could not instantiate the LayoutManager: " + a, e6);
|
|
} catch (InvocationTargetException e7) {
|
|
throw new IllegalStateException(attributeSet.getPositionDescription() + ": Could not instantiate the LayoutManager: " + a, e7);
|
|
}
|
|
}
|
|
}
|
|
|
|
public boolean j() {
|
|
return !this.u || this.E || this.d.c();
|
|
}
|
|
|
|
public void b(OnScrollListener onScrollListener) {
|
|
List<OnScrollListener> list = this.k0;
|
|
if (list != null) {
|
|
list.remove(onScrollListener);
|
|
}
|
|
}
|
|
|
|
public ViewHolder d(View view) {
|
|
View c = c(view);
|
|
if (c == null) {
|
|
return null;
|
|
}
|
|
return g(c);
|
|
}
|
|
|
|
void g(int i, int i2) {
|
|
int i3;
|
|
int i4;
|
|
int i5;
|
|
int i6;
|
|
int b = this.e.b();
|
|
if (i < i2) {
|
|
i4 = i;
|
|
i3 = i2;
|
|
i5 = -1;
|
|
} else {
|
|
i3 = i;
|
|
i4 = i2;
|
|
i5 = 1;
|
|
}
|
|
for (int i7 = 0; i7 < b; i7++) {
|
|
ViewHolder m = m(this.e.d(i7));
|
|
if (m != null && (i6 = m.mPosition) >= i4 && i6 <= i3) {
|
|
if (i6 == i) {
|
|
m.offsetPosition(i2 - i, false);
|
|
} else {
|
|
m.offsetPosition(i5, false);
|
|
}
|
|
this.i0.g = true;
|
|
}
|
|
}
|
|
this.b.b(i, i2);
|
|
requestLayout();
|
|
}
|
|
|
|
public void h(int i) {
|
|
int a = this.e.a();
|
|
for (int i2 = 0; i2 < a; i2++) {
|
|
this.e.c(i2).offsetTopAndBottom(i);
|
|
}
|
|
}
|
|
|
|
public void k(int i) {
|
|
if (this.y) {
|
|
return;
|
|
}
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager == null) {
|
|
Log.e("RecyclerView", "Cannot smooth scroll without a LayoutManager set. Call setLayoutManager with a non-null argument.");
|
|
} else {
|
|
layoutManager.a(this, this.i0, i);
|
|
}
|
|
}
|
|
|
|
public boolean j(int i, int i2) {
|
|
return getScrollingChildHelper().a(i, i2);
|
|
}
|
|
|
|
void b() {
|
|
if (this.u && !this.E) {
|
|
if (this.d.c()) {
|
|
if (this.d.c(4) && !this.d.c(11)) {
|
|
TraceCompat.a("RV PartialInvalidate");
|
|
w();
|
|
q();
|
|
this.d.e();
|
|
if (!this.x) {
|
|
if (E()) {
|
|
c();
|
|
} else {
|
|
this.d.a();
|
|
}
|
|
}
|
|
c(true);
|
|
r();
|
|
TraceCompat.a();
|
|
return;
|
|
}
|
|
if (this.d.c()) {
|
|
TraceCompat.a("RV FullInvalidate");
|
|
c();
|
|
TraceCompat.a();
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
TraceCompat.a("RV FullInvalidate");
|
|
c();
|
|
TraceCompat.a();
|
|
}
|
|
|
|
public ViewHolder d(int i) {
|
|
return a(i, false);
|
|
}
|
|
|
|
Rect h(View view) {
|
|
LayoutParams layoutParams = (LayoutParams) view.getLayoutParams();
|
|
if (!layoutParams.c) {
|
|
return layoutParams.b;
|
|
}
|
|
if (this.i0.d() && (layoutParams.b() || layoutParams.d())) {
|
|
return layoutParams.b;
|
|
}
|
|
Rect rect = layoutParams.b;
|
|
rect.set(0, 0, 0, 0);
|
|
int size = this.o.size();
|
|
for (int i = 0; i < size; i++) {
|
|
this.i.set(0, 0, 0, 0);
|
|
this.o.get(i).getItemOffsets(this.i, view, this, this.i0);
|
|
int i2 = rect.left;
|
|
Rect rect2 = this.i;
|
|
rect.left = i2 + rect2.left;
|
|
rect.top += rect2.top;
|
|
rect.right += rect2.right;
|
|
rect.bottom += rect2.bottom;
|
|
}
|
|
layoutParams.c = false;
|
|
return rect;
|
|
}
|
|
|
|
private void c(MotionEvent motionEvent) {
|
|
int actionIndex = motionEvent.getActionIndex();
|
|
if (motionEvent.getPointerId(actionIndex) == this.P) {
|
|
int i = actionIndex == 0 ? 1 : 0;
|
|
this.P = motionEvent.getPointerId(i);
|
|
int x = (int) (motionEvent.getX(i) + 0.5f);
|
|
this.T = x;
|
|
this.R = x;
|
|
int y = (int) (motionEvent.getY(i) + 0.5f);
|
|
this.U = y;
|
|
this.S = y;
|
|
}
|
|
}
|
|
|
|
void d(int i, int i2) {
|
|
this.H++;
|
|
int scrollX = getScrollX();
|
|
int scrollY = getScrollY();
|
|
onScrollChanged(scrollX, scrollY, scrollX, scrollY);
|
|
h(i, i2);
|
|
OnScrollListener onScrollListener = this.j0;
|
|
if (onScrollListener != null) {
|
|
onScrollListener.a(this, i, i2);
|
|
}
|
|
List<OnScrollListener> list = this.k0;
|
|
if (list != null) {
|
|
for (int size = list.size() - 1; size >= 0; size--) {
|
|
this.k0.get(size).a(this, i, i2);
|
|
}
|
|
}
|
|
this.H--;
|
|
}
|
|
|
|
void f(int i, int i2) {
|
|
int b = this.e.b();
|
|
for (int i3 = 0; i3 < b; i3++) {
|
|
ViewHolder m = m(this.e.d(i3));
|
|
if (m != null && !m.shouldIgnore() && m.mPosition >= i) {
|
|
m.offsetPosition(i2, false);
|
|
this.i0.g = true;
|
|
}
|
|
}
|
|
this.b.a(i, i2);
|
|
requestLayout();
|
|
}
|
|
|
|
private boolean k(int i, int i2) {
|
|
a(this.r0);
|
|
int[] iArr = this.r0;
|
|
return (iArr[0] == i && iArr[1] == i2) ? false : true;
|
|
}
|
|
|
|
void e() {
|
|
if (this.M != null) {
|
|
return;
|
|
}
|
|
this.M = this.I.a(this, 3);
|
|
if (this.g) {
|
|
this.M.setSize((getMeasuredWidth() - getPaddingLeft()) - getPaddingRight(), (getMeasuredHeight() - getPaddingTop()) - getPaddingBottom());
|
|
} else {
|
|
this.M.setSize(getMeasuredWidth(), getMeasuredHeight());
|
|
}
|
|
}
|
|
|
|
void c(int i, int i2) {
|
|
setMeasuredDimension(LayoutManager.a(i, getPaddingLeft() + getPaddingRight(), ViewCompat.m(this)), LayoutManager.a(i2, getPaddingTop() + getPaddingBottom(), ViewCompat.l(this)));
|
|
}
|
|
|
|
public ViewHolder g(View view) {
|
|
ViewParent parent = view.getParent();
|
|
if (parent != null && parent != this) {
|
|
throw new IllegalArgumentException("View " + view + " is not a direct child of " + this);
|
|
}
|
|
return m(view);
|
|
}
|
|
|
|
public int f(View view) {
|
|
ViewHolder m = m(view);
|
|
if (m != null) {
|
|
return m.getLayoutPosition();
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
public void g(int i) {
|
|
int a = this.e.a();
|
|
for (int i2 = 0; i2 < a; i2++) {
|
|
this.e.c(i2).offsetLeftAndRight(i);
|
|
}
|
|
}
|
|
|
|
void d() {
|
|
int i;
|
|
for (int size = this.x0.size() - 1; size >= 0; size--) {
|
|
ViewHolder viewHolder = this.x0.get(size);
|
|
if (viewHolder.itemView.getParent() == this && !viewHolder.shouldIgnore() && (i = viewHolder.mPendingAccessibilityState) != -1) {
|
|
ViewCompat.f(viewHolder.itemView, i);
|
|
viewHolder.mPendingAccessibilityState = -1;
|
|
}
|
|
}
|
|
this.x0.clear();
|
|
}
|
|
|
|
public int e(View view) {
|
|
ViewHolder m = m(view);
|
|
if (m != null) {
|
|
return m.getAdapterPosition();
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
void c() {
|
|
if (this.l == null) {
|
|
Log.e("RecyclerView", "No adapter attached; skipping layout");
|
|
return;
|
|
}
|
|
if (this.m == null) {
|
|
Log.e("RecyclerView", "No layout manager attached; skipping layout");
|
|
return;
|
|
}
|
|
State state = this.i0;
|
|
state.j = false;
|
|
if (state.e == 1) {
|
|
A();
|
|
this.m.e(this);
|
|
B();
|
|
} else if (!this.d.d() && this.m.r() == getWidth() && this.m.h() == getHeight()) {
|
|
this.m.e(this);
|
|
} else {
|
|
this.m.e(this);
|
|
B();
|
|
}
|
|
C();
|
|
}
|
|
|
|
static void e(ViewHolder viewHolder) {
|
|
WeakReference<RecyclerView> weakReference = viewHolder.mNestedRecyclerView;
|
|
if (weakReference != null) {
|
|
RecyclerView recyclerView = weakReference.get();
|
|
while (recyclerView != null) {
|
|
if (recyclerView == viewHolder.itemView) {
|
|
return;
|
|
}
|
|
Object parent = recyclerView.getParent();
|
|
recyclerView = parent instanceof View ? (View) parent : null;
|
|
}
|
|
viewHolder.mNestedRecyclerView = null;
|
|
}
|
|
}
|
|
|
|
private String a(Context context, String str) {
|
|
if (str.charAt(0) == '.') {
|
|
return context.getPackageName() + str;
|
|
}
|
|
if (str.contains(".")) {
|
|
return str;
|
|
}
|
|
return RecyclerView.class.getPackage().getName() + '.' + str;
|
|
}
|
|
|
|
private void a(Adapter adapter, boolean z, boolean z2) {
|
|
Adapter adapter2 = this.l;
|
|
if (adapter2 != null) {
|
|
adapter2.unregisterAdapterDataObserver(this.a);
|
|
this.l.onDetachedFromRecyclerView(this);
|
|
}
|
|
if (!z || z2) {
|
|
t();
|
|
}
|
|
this.d.f();
|
|
Adapter adapter3 = this.l;
|
|
this.l = adapter;
|
|
if (adapter != null) {
|
|
adapter.registerAdapterDataObserver(this.a);
|
|
adapter.onAttachedToRecyclerView(this);
|
|
}
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager != null) {
|
|
layoutManager.a(adapter3, this.l);
|
|
}
|
|
this.b.a(adapter3, this.l, z);
|
|
this.i0.g = true;
|
|
}
|
|
|
|
public boolean e(int i) {
|
|
return getScrollingChildHelper().a(i);
|
|
}
|
|
|
|
void b(int i, int i2) {
|
|
boolean z;
|
|
EdgeEffect edgeEffect = this.J;
|
|
if (edgeEffect == null || edgeEffect.isFinished() || i <= 0) {
|
|
z = false;
|
|
} else {
|
|
this.J.onRelease();
|
|
z = this.J.isFinished();
|
|
}
|
|
EdgeEffect edgeEffect2 = this.L;
|
|
if (edgeEffect2 != null && !edgeEffect2.isFinished() && i < 0) {
|
|
this.L.onRelease();
|
|
z |= this.L.isFinished();
|
|
}
|
|
EdgeEffect edgeEffect3 = this.K;
|
|
if (edgeEffect3 != null && !edgeEffect3.isFinished() && i2 > 0) {
|
|
this.K.onRelease();
|
|
z |= this.K.isFinished();
|
|
}
|
|
EdgeEffect edgeEffect4 = this.M;
|
|
if (edgeEffect4 != null && !edgeEffect4.isFinished() && i2 < 0) {
|
|
this.M.onRelease();
|
|
z |= this.M.isFinished();
|
|
}
|
|
if (z) {
|
|
ViewCompat.A(this);
|
|
}
|
|
}
|
|
|
|
long c(ViewHolder viewHolder) {
|
|
return this.l.hasStableIds() ? viewHolder.getItemId() : viewHolder.mPosition;
|
|
}
|
|
|
|
/* JADX WARN: Code restructure failed: missing block: B:11:?, code lost:
|
|
|
|
return r3;
|
|
*/
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
|
*/
|
|
public android.view.View c(android.view.View r3) {
|
|
/*
|
|
r2 = this;
|
|
android.view.ViewParent r0 = r3.getParent()
|
|
L4:
|
|
if (r0 == 0) goto L14
|
|
if (r0 == r2) goto L14
|
|
boolean r1 = r0 instanceof android.view.View
|
|
if (r1 == 0) goto L14
|
|
r3 = r0
|
|
android.view.View r3 = (android.view.View) r3
|
|
android.view.ViewParent r0 = r3.getParent()
|
|
goto L4
|
|
L14:
|
|
if (r0 != r2) goto L17
|
|
goto L18
|
|
L17:
|
|
r3 = 0
|
|
L18:
|
|
return r3
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.c(android.view.View):android.view.View");
|
|
}
|
|
|
|
public void a(ItemDecoration itemDecoration, int i) {
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager != null) {
|
|
layoutManager.a("Cannot add item decoration during a scroll or layout");
|
|
}
|
|
if (this.o.isEmpty()) {
|
|
setWillNotDraw(false);
|
|
}
|
|
if (i < 0) {
|
|
this.o.add(itemDecoration);
|
|
} else {
|
|
this.o.add(i, itemDecoration);
|
|
}
|
|
o();
|
|
requestLayout();
|
|
}
|
|
|
|
public ViewHolder c(int i) {
|
|
ViewHolder viewHolder = null;
|
|
if (this.E) {
|
|
return null;
|
|
}
|
|
int b = this.e.b();
|
|
for (int i2 = 0; i2 < b; i2++) {
|
|
ViewHolder m = m(this.e.d(i2));
|
|
if (m != null && !m.isRemoved() && b(m) == i) {
|
|
if (!this.e.c(m.itemView)) {
|
|
return m;
|
|
}
|
|
viewHolder = m;
|
|
}
|
|
}
|
|
return viewHolder;
|
|
}
|
|
|
|
public void b(OnItemTouchListener onItemTouchListener) {
|
|
this.p.remove(onItemTouchListener);
|
|
if (this.q == onItemTouchListener) {
|
|
this.q = null;
|
|
}
|
|
}
|
|
|
|
private boolean b(MotionEvent motionEvent) {
|
|
int action = motionEvent.getAction();
|
|
if (action == 3 || action == 0) {
|
|
this.q = null;
|
|
}
|
|
int size = this.p.size();
|
|
for (int i = 0; i < size; i++) {
|
|
OnItemTouchListener onItemTouchListener = this.p.get(i);
|
|
if (onItemTouchListener.onInterceptTouchEvent(this, motionEvent) && action != 3) {
|
|
this.q = onItemTouchListener;
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public void a(ItemDecoration itemDecoration) {
|
|
a(itemDecoration, -1);
|
|
}
|
|
|
|
public void a(OnScrollListener onScrollListener) {
|
|
if (this.k0 == null) {
|
|
this.k0 = new ArrayList();
|
|
}
|
|
this.k0.add(onScrollListener);
|
|
}
|
|
|
|
void a(int i, int i2, int[] iArr) {
|
|
w();
|
|
q();
|
|
TraceCompat.a("RV Scroll");
|
|
a(this.i0);
|
|
int a = i != 0 ? this.m.a(i, this.b, this.i0) : 0;
|
|
int b = i2 != 0 ? this.m.b(i2, this.b, this.i0) : 0;
|
|
TraceCompat.a();
|
|
u();
|
|
r();
|
|
c(false);
|
|
if (iArr != null) {
|
|
iArr[0] = a;
|
|
iArr[1] = b;
|
|
}
|
|
}
|
|
|
|
void b(ViewHolder viewHolder, ItemAnimator.ItemHolderInfo itemHolderInfo, ItemAnimator.ItemHolderInfo itemHolderInfo2) {
|
|
d(viewHolder);
|
|
viewHolder.setIsRecyclable(false);
|
|
if (this.N.b(viewHolder, itemHolderInfo, itemHolderInfo2)) {
|
|
s();
|
|
}
|
|
}
|
|
|
|
void b(boolean z) {
|
|
this.F = z | this.F;
|
|
this.E = true;
|
|
p();
|
|
}
|
|
|
|
static void b(View view, Rect rect) {
|
|
LayoutParams layoutParams = (LayoutParams) view.getLayoutParams();
|
|
Rect rect2 = layoutParams.b;
|
|
rect.set((view.getLeft() - rect2.left) - ((ViewGroup.MarginLayoutParams) layoutParams).leftMargin, (view.getTop() - rect2.top) - ((ViewGroup.MarginLayoutParams) layoutParams).topMargin, view.getRight() + rect2.right + ((ViewGroup.MarginLayoutParams) layoutParams).rightMargin, view.getBottom() + rect2.bottom + ((ViewGroup.MarginLayoutParams) layoutParams).bottomMargin);
|
|
}
|
|
|
|
boolean a(int i, int i2, MotionEvent motionEvent) {
|
|
int i3;
|
|
int i4;
|
|
int i5;
|
|
int i6;
|
|
b();
|
|
if (this.l != null) {
|
|
a(i, i2, this.w0);
|
|
int[] iArr = this.w0;
|
|
int i7 = iArr[0];
|
|
int i8 = iArr[1];
|
|
i3 = i8;
|
|
i6 = i7;
|
|
i4 = i - i7;
|
|
i5 = i2 - i8;
|
|
} else {
|
|
i3 = 0;
|
|
i4 = 0;
|
|
i5 = 0;
|
|
i6 = 0;
|
|
}
|
|
if (!this.o.isEmpty()) {
|
|
invalidate();
|
|
}
|
|
int i9 = i3;
|
|
if (a(i6, i3, i4, i5, this.t0, 0)) {
|
|
int i10 = this.T;
|
|
int[] iArr2 = this.t0;
|
|
this.T = i10 - iArr2[0];
|
|
this.U -= iArr2[1];
|
|
if (motionEvent != null) {
|
|
motionEvent.offsetLocation(iArr2[0], iArr2[1]);
|
|
}
|
|
int[] iArr3 = this.v0;
|
|
int i11 = iArr3[0];
|
|
int[] iArr4 = this.t0;
|
|
iArr3[0] = i11 + iArr4[0];
|
|
iArr3[1] = iArr3[1] + iArr4[1];
|
|
} else if (getOverScrollMode() != 2) {
|
|
if (motionEvent != null && !MotionEventCompat.a(motionEvent, UnityActivity.BLOCKLY_TYPE_COURSE)) {
|
|
a(motionEvent.getX(), i4, motionEvent.getY(), i5);
|
|
}
|
|
b(i, i2);
|
|
}
|
|
if (i6 != 0 || i9 != 0) {
|
|
d(i6, i9);
|
|
}
|
|
if (!awakenScrollBars()) {
|
|
invalidate();
|
|
}
|
|
return (i6 == 0 && i9 == 0) ? false : true;
|
|
}
|
|
|
|
void b(int i) {
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager != null) {
|
|
layoutManager.g(i);
|
|
}
|
|
i(i);
|
|
OnScrollListener onScrollListener = this.j0;
|
|
if (onScrollListener != null) {
|
|
onScrollListener.a(this, i);
|
|
}
|
|
List<OnScrollListener> list = this.k0;
|
|
if (list != null) {
|
|
for (int size = list.size() - 1; size >= 0; size--) {
|
|
this.k0.get(size).a(this, i);
|
|
}
|
|
}
|
|
}
|
|
|
|
void b(View view) {
|
|
ViewHolder m = m(view);
|
|
j(view);
|
|
Adapter adapter = this.l;
|
|
if (adapter != null && m != null) {
|
|
adapter.onViewDetachedFromWindow(m);
|
|
}
|
|
List<OnChildAttachStateChangeListener> list = this.D;
|
|
if (list != null) {
|
|
for (int size = list.size() - 1; size >= 0; size--) {
|
|
this.D.get(size).a(view);
|
|
}
|
|
}
|
|
}
|
|
|
|
int b(ViewHolder viewHolder) {
|
|
if (viewHolder.hasAnyOfTheFlags(524) || !viewHolder.isBound()) {
|
|
return -1;
|
|
}
|
|
return this.d.a(viewHolder.mPosition);
|
|
}
|
|
|
|
public void a(int i, int i2, Interpolator interpolator) {
|
|
LayoutManager layoutManager = this.m;
|
|
if (layoutManager == null) {
|
|
Log.e("RecyclerView", "Cannot smooth scroll without a LayoutManager set. Call setLayoutManager with a non-null argument.");
|
|
return;
|
|
}
|
|
if (this.y) {
|
|
return;
|
|
}
|
|
if (!layoutManager.a()) {
|
|
i = 0;
|
|
}
|
|
if (!this.m.b()) {
|
|
i2 = 0;
|
|
}
|
|
if (i == 0 && i2 == 0) {
|
|
return;
|
|
}
|
|
this.f0.a(i, i2, interpolator);
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:17:0x0056 */
|
|
/* JADX WARN: Removed duplicated region for block: B:7:0x0040 */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
|
*/
|
|
private void a(float r7, float r8, float r9, float r10) {
|
|
/*
|
|
r6 = this;
|
|
r0 = 1065353216(0x3f800000, float:1.0)
|
|
r1 = 1
|
|
r2 = 0
|
|
int r3 = (r8 > r2 ? 1 : (r8 == r2 ? 0 : -1))
|
|
if (r3 >= 0) goto L21
|
|
r6.f()
|
|
android.widget.EdgeEffect r3 = r6.J
|
|
float r4 = -r8
|
|
int r5 = r6.getWidth()
|
|
float r5 = (float) r5
|
|
float r4 = r4 / r5
|
|
int r5 = r6.getHeight()
|
|
float r5 = (float) r5
|
|
float r9 = r9 / r5
|
|
float r9 = r0 - r9
|
|
androidx.core.widget.EdgeEffectCompat.a(r3, r4, r9)
|
|
L1f:
|
|
r9 = 1
|
|
goto L3c
|
|
L21:
|
|
int r3 = (r8 > r2 ? 1 : (r8 == r2 ? 0 : -1))
|
|
if (r3 <= 0) goto L3b
|
|
r6.g()
|
|
android.widget.EdgeEffect r3 = r6.L
|
|
int r4 = r6.getWidth()
|
|
float r4 = (float) r4
|
|
float r4 = r8 / r4
|
|
int r5 = r6.getHeight()
|
|
float r5 = (float) r5
|
|
float r9 = r9 / r5
|
|
androidx.core.widget.EdgeEffectCompat.a(r3, r4, r9)
|
|
goto L1f
|
|
L3b:
|
|
r9 = 0
|
|
L3c:
|
|
int r3 = (r10 > r2 ? 1 : (r10 == r2 ? 0 : -1))
|
|
if (r3 >= 0) goto L56
|
|
r6.h()
|
|
android.widget.EdgeEffect r9 = r6.K
|
|
float r0 = -r10
|
|
int r3 = r6.getHeight()
|
|
float r3 = (float) r3
|
|
float r0 = r0 / r3
|
|
int r3 = r6.getWidth()
|
|
float r3 = (float) r3
|
|
float r7 = r7 / r3
|
|
androidx.core.widget.EdgeEffectCompat.a(r9, r0, r7)
|
|
goto L72
|
|
L56:
|
|
int r3 = (r10 > r2 ? 1 : (r10 == r2 ? 0 : -1))
|
|
if (r3 <= 0) goto L71
|
|
r6.e()
|
|
android.widget.EdgeEffect r9 = r6.M
|
|
int r3 = r6.getHeight()
|
|
float r3 = (float) r3
|
|
float r3 = r10 / r3
|
|
int r4 = r6.getWidth()
|
|
float r4 = (float) r4
|
|
float r7 = r7 / r4
|
|
float r0 = r0 - r7
|
|
androidx.core.widget.EdgeEffectCompat.a(r9, r3, r0)
|
|
goto L72
|
|
L71:
|
|
r1 = r9
|
|
L72:
|
|
if (r1 != 0) goto L7c
|
|
int r7 = (r8 > r2 ? 1 : (r8 == r2 ? 0 : -1))
|
|
if (r7 != 0) goto L7c
|
|
int r7 = (r10 > r2 ? 1 : (r10 == r2 ? 0 : -1))
|
|
if (r7 == 0) goto L7f
|
|
L7c:
|
|
androidx.core.view.ViewCompat.A(r6)
|
|
L7f:
|
|
return
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.a(float, float, float, float):void");
|
|
}
|
|
|
|
void a(int i, int i2) {
|
|
if (i < 0) {
|
|
f();
|
|
this.J.onAbsorb(-i);
|
|
} else if (i > 0) {
|
|
g();
|
|
this.L.onAbsorb(i);
|
|
}
|
|
if (i2 < 0) {
|
|
h();
|
|
this.K.onAbsorb(-i2);
|
|
} else if (i2 > 0) {
|
|
e();
|
|
this.M.onAbsorb(i2);
|
|
}
|
|
if (i == 0 && i2 == 0) {
|
|
return;
|
|
}
|
|
ViewCompat.A(this);
|
|
}
|
|
|
|
private boolean a(View view, View view2, int i) {
|
|
int i2;
|
|
if (view2 == null || view2 == this || c(view2) == null) {
|
|
return false;
|
|
}
|
|
if (view == null || c(view) == null) {
|
|
return true;
|
|
}
|
|
this.i.set(0, 0, view.getWidth(), view.getHeight());
|
|
this.j.set(0, 0, view2.getWidth(), view2.getHeight());
|
|
offsetDescendantRectToMyCoords(view, this.i);
|
|
offsetDescendantRectToMyCoords(view2, this.j);
|
|
char c = 65535;
|
|
int i3 = this.m.k() == 1 ? -1 : 1;
|
|
Rect rect = this.i;
|
|
int i4 = rect.left;
|
|
int i5 = this.j.left;
|
|
if ((i4 < i5 || rect.right <= i5) && this.i.right < this.j.right) {
|
|
i2 = 1;
|
|
} else {
|
|
Rect rect2 = this.i;
|
|
int i6 = rect2.right;
|
|
int i7 = this.j.right;
|
|
i2 = ((i6 > i7 || rect2.left >= i7) && this.i.left > this.j.left) ? -1 : 0;
|
|
}
|
|
Rect rect3 = this.i;
|
|
int i8 = rect3.top;
|
|
int i9 = this.j.top;
|
|
if ((i8 < i9 || rect3.bottom <= i9) && this.i.bottom < this.j.bottom) {
|
|
c = 1;
|
|
} else {
|
|
Rect rect4 = this.i;
|
|
int i10 = rect4.bottom;
|
|
int i11 = this.j.bottom;
|
|
if ((i10 <= i11 && rect4.top < i11) || this.i.top <= this.j.top) {
|
|
c = 0;
|
|
}
|
|
}
|
|
if (i == 1) {
|
|
return c < 0 || (c == 0 && i2 * i3 <= 0);
|
|
}
|
|
if (i == 2) {
|
|
return c > 0 || (c == 0 && i2 * i3 >= 0);
|
|
}
|
|
if (i == 17) {
|
|
return i2 < 0;
|
|
}
|
|
if (i == 33) {
|
|
return c < 0;
|
|
}
|
|
if (i == 66) {
|
|
return i2 > 0;
|
|
}
|
|
if (i == 130) {
|
|
return c > 0;
|
|
}
|
|
throw new IllegalArgumentException("Invalid direction: " + i + i());
|
|
}
|
|
|
|
private void a(View view, View view2) {
|
|
View view3 = view2 != null ? view2 : view;
|
|
this.i.set(0, 0, view3.getWidth(), view3.getHeight());
|
|
ViewGroup.LayoutParams layoutParams = view3.getLayoutParams();
|
|
if (layoutParams instanceof LayoutParams) {
|
|
LayoutParams layoutParams2 = (LayoutParams) layoutParams;
|
|
if (!layoutParams2.c) {
|
|
Rect rect = layoutParams2.b;
|
|
Rect rect2 = this.i;
|
|
rect2.left -= rect.left;
|
|
rect2.right += rect.right;
|
|
rect2.top -= rect.top;
|
|
rect2.bottom += rect.bottom;
|
|
}
|
|
}
|
|
if (view2 != null) {
|
|
offsetDescendantRectToMyCoords(view2, this.i);
|
|
offsetRectIntoDescendantCoords(view, this.i);
|
|
}
|
|
this.m.a(this, view, this.i, !this.u, view2 == null);
|
|
}
|
|
|
|
void a(String str) {
|
|
if (n()) {
|
|
if (str == null) {
|
|
throw new IllegalStateException("Cannot call this method while RecyclerView is computing a layout or scrolling" + i());
|
|
}
|
|
throw new IllegalStateException(str);
|
|
}
|
|
if (this.H > 0) {
|
|
Log.w("RecyclerView", "Cannot call this method in a scroll callback. Scroll callbacks mightbe run during a measure & layout pass where you cannot change theRecyclerView data. Any method call that might change the structureof the RecyclerView or the adapter contents should be postponed tothe next frame.", new IllegalStateException("" + i()));
|
|
}
|
|
}
|
|
|
|
public void a(OnItemTouchListener onItemTouchListener) {
|
|
this.p.add(onItemTouchListener);
|
|
}
|
|
|
|
private boolean a(MotionEvent motionEvent) {
|
|
int action = motionEvent.getAction();
|
|
OnItemTouchListener onItemTouchListener = this.q;
|
|
if (onItemTouchListener != null) {
|
|
if (action == 0) {
|
|
this.q = null;
|
|
} else {
|
|
onItemTouchListener.onTouchEvent(this, motionEvent);
|
|
if (action == 3 || action == 1) {
|
|
this.q = null;
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
if (action != 0) {
|
|
int size = this.p.size();
|
|
for (int i = 0; i < size; i++) {
|
|
OnItemTouchListener onItemTouchListener2 = this.p.get(i);
|
|
if (onItemTouchListener2.onInterceptTouchEvent(this, motionEvent)) {
|
|
this.q = onItemTouchListener2;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
void a(boolean z) {
|
|
this.G--;
|
|
if (this.G < 1) {
|
|
this.G = 0;
|
|
if (z) {
|
|
z();
|
|
d();
|
|
}
|
|
}
|
|
}
|
|
|
|
boolean a(AccessibilityEvent accessibilityEvent) {
|
|
if (!n()) {
|
|
return false;
|
|
}
|
|
int a = accessibilityEvent != null ? AccessibilityEventCompat.a(accessibilityEvent) : 0;
|
|
if (a == 0) {
|
|
a = 0;
|
|
}
|
|
this.A = a | this.A;
|
|
return true;
|
|
}
|
|
|
|
final void a(State state) {
|
|
if (getScrollState() == 2) {
|
|
OverScroller overScroller = this.f0.c;
|
|
state.p = overScroller.getFinalX() - overScroller.getCurrX();
|
|
state.q = overScroller.getFinalY() - overScroller.getCurrY();
|
|
} else {
|
|
state.p = 0;
|
|
state.q = 0;
|
|
}
|
|
}
|
|
|
|
private void a(long j, ViewHolder viewHolder, ViewHolder viewHolder2) {
|
|
int a = this.e.a();
|
|
for (int i = 0; i < a; i++) {
|
|
ViewHolder m = m(this.e.c(i));
|
|
if (m != viewHolder && c(m) == j) {
|
|
Adapter adapter = this.l;
|
|
if (adapter != null && adapter.hasStableIds()) {
|
|
throw new IllegalStateException("Two different ViewHolders have the same stable ID. Stable IDs in your adapter MUST BE unique and SHOULD NOT change.\n ViewHolder 1:" + m + " \n View Holder 2:" + viewHolder + i());
|
|
}
|
|
throw new IllegalStateException("Two different ViewHolders have the same change ID. This might happen due to inconsistent Adapter update events or if the LayoutManager lays out the same View multiple times.\n ViewHolder 1:" + m + " \n View Holder 2:" + viewHolder + i());
|
|
}
|
|
}
|
|
Log.e("RecyclerView", "Problem while matching changed view holders with the newones. The pre-layout information for the change holder " + viewHolder2 + " cannot be found but it is necessary for " + viewHolder + i());
|
|
}
|
|
|
|
void a(ViewHolder viewHolder, ItemAnimator.ItemHolderInfo itemHolderInfo) {
|
|
viewHolder.setFlags(0, UnityActivity.BLOCKLY_TYPE_NONE);
|
|
if (this.i0.i && viewHolder.isUpdated() && !viewHolder.isRemoved() && !viewHolder.shouldIgnore()) {
|
|
this.f.a(c(viewHolder), viewHolder);
|
|
}
|
|
this.f.c(viewHolder, itemHolderInfo);
|
|
}
|
|
|
|
private void a(int[] iArr) {
|
|
int a = this.e.a();
|
|
if (a == 0) {
|
|
iArr[0] = -1;
|
|
iArr[1] = -1;
|
|
return;
|
|
}
|
|
int i = Integer.MAX_VALUE;
|
|
int i2 = Integer.MIN_VALUE;
|
|
for (int i3 = 0; i3 < a; i3++) {
|
|
ViewHolder m = m(this.e.c(i3));
|
|
if (!m.shouldIgnore()) {
|
|
int layoutPosition = m.getLayoutPosition();
|
|
if (layoutPosition < i) {
|
|
i = layoutPosition;
|
|
}
|
|
if (layoutPosition > i2) {
|
|
i2 = layoutPosition;
|
|
}
|
|
}
|
|
}
|
|
iArr[0] = i;
|
|
iArr[1] = i2;
|
|
}
|
|
|
|
void a(ViewHolder viewHolder, ItemAnimator.ItemHolderInfo itemHolderInfo, ItemAnimator.ItemHolderInfo itemHolderInfo2) {
|
|
viewHolder.setIsRecyclable(false);
|
|
if (this.N.a(viewHolder, itemHolderInfo, itemHolderInfo2)) {
|
|
s();
|
|
}
|
|
}
|
|
|
|
private void a(ViewHolder viewHolder, ViewHolder viewHolder2, ItemAnimator.ItemHolderInfo itemHolderInfo, ItemAnimator.ItemHolderInfo itemHolderInfo2, boolean z, boolean z2) {
|
|
viewHolder.setIsRecyclable(false);
|
|
if (z) {
|
|
d(viewHolder);
|
|
}
|
|
if (viewHolder != viewHolder2) {
|
|
if (z2) {
|
|
d(viewHolder2);
|
|
}
|
|
viewHolder.mShadowedHolder = viewHolder2;
|
|
d(viewHolder);
|
|
this.b.c(viewHolder);
|
|
viewHolder2.setIsRecyclable(false);
|
|
viewHolder2.mShadowingHolder = viewHolder;
|
|
}
|
|
if (this.N.a(viewHolder, viewHolder2, itemHolderInfo, itemHolderInfo2)) {
|
|
s();
|
|
}
|
|
}
|
|
|
|
void a() {
|
|
int b = this.e.b();
|
|
for (int i = 0; i < b; i++) {
|
|
ViewHolder m = m(this.e.d(i));
|
|
if (!m.shouldIgnore()) {
|
|
m.clearOldPosition();
|
|
}
|
|
}
|
|
this.b.b();
|
|
}
|
|
|
|
void a(int i, int i2, boolean z) {
|
|
int i3 = i + i2;
|
|
int b = this.e.b();
|
|
for (int i4 = 0; i4 < b; i4++) {
|
|
ViewHolder m = m(this.e.d(i4));
|
|
if (m != null && !m.shouldIgnore()) {
|
|
int i5 = m.mPosition;
|
|
if (i5 >= i3) {
|
|
m.offsetPosition(-i2, z);
|
|
this.i0.g = true;
|
|
} else if (i5 >= i) {
|
|
m.flagRemovedAndOffsetPosition(i - 1, -i2, z);
|
|
this.i0.g = true;
|
|
}
|
|
}
|
|
}
|
|
this.b.a(i, i2, z);
|
|
requestLayout();
|
|
}
|
|
|
|
void a(int i, int i2, Object obj) {
|
|
int i3;
|
|
int b = this.e.b();
|
|
int i4 = i + i2;
|
|
for (int i5 = 0; i5 < b; i5++) {
|
|
View d = this.e.d(i5);
|
|
ViewHolder m = m(d);
|
|
if (m != null && !m.shouldIgnore() && (i3 = m.mPosition) >= i && i3 < i4) {
|
|
m.addFlags(2);
|
|
m.addChangePayload(obj);
|
|
((LayoutParams) d.getLayoutParams()).c = true;
|
|
}
|
|
}
|
|
this.b.c(i, i2);
|
|
}
|
|
|
|
boolean a(ViewHolder viewHolder) {
|
|
ItemAnimator itemAnimator = this.N;
|
|
return itemAnimator == null || itemAnimator.a(viewHolder, viewHolder.getUnmodifiedPayloads());
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:12:0x0034 */
|
|
/* JADX WARN: Removed duplicated region for block: B:15:0x0036 A[SYNTHETIC] */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
|
*/
|
|
androidx.recyclerview.widget.RecyclerView.ViewHolder a(int r6, boolean r7) {
|
|
/*
|
|
r5 = this;
|
|
androidx.recyclerview.widget.ChildHelper r0 = r5.e
|
|
int r0 = r0.b()
|
|
r1 = 0
|
|
r2 = 0
|
|
L8:
|
|
if (r2 >= r0) goto L3a
|
|
androidx.recyclerview.widget.ChildHelper r3 = r5.e
|
|
android.view.View r3 = r3.d(r2)
|
|
androidx.recyclerview.widget.RecyclerView$ViewHolder r3 = m(r3)
|
|
if (r3 == 0) goto L37
|
|
boolean r4 = r3.isRemoved()
|
|
if (r4 != 0) goto L37
|
|
if (r7 == 0) goto L23
|
|
int r4 = r3.mPosition
|
|
if (r4 == r6) goto L2a
|
|
goto L37
|
|
L23:
|
|
int r4 = r3.getLayoutPosition()
|
|
if (r4 == r6) goto L2a
|
|
goto L37
|
|
L2a:
|
|
androidx.recyclerview.widget.ChildHelper r1 = r5.e
|
|
android.view.View r4 = r3.itemView
|
|
boolean r1 = r1.c(r4)
|
|
if (r1 == 0) goto L36
|
|
r1 = r3
|
|
goto L37
|
|
L36:
|
|
return r3
|
|
L37:
|
|
int r2 = r2 + 1
|
|
goto L8
|
|
L3a:
|
|
return r1
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.a(int, boolean):androidx.recyclerview.widget.RecyclerView$ViewHolder");
|
|
}
|
|
|
|
public ViewHolder a(long j) {
|
|
Adapter adapter = this.l;
|
|
ViewHolder viewHolder = null;
|
|
if (adapter != null && adapter.hasStableIds()) {
|
|
int b = this.e.b();
|
|
for (int i = 0; i < b; i++) {
|
|
ViewHolder m = m(this.e.d(i));
|
|
if (m != null && !m.isRemoved() && m.getItemId() == j) {
|
|
if (!this.e.c(m.itemView)) {
|
|
return m;
|
|
}
|
|
viewHolder = m;
|
|
}
|
|
}
|
|
}
|
|
return viewHolder;
|
|
}
|
|
|
|
public View a(float f, float f2) {
|
|
for (int a = this.e.a() - 1; a >= 0; a--) {
|
|
View c = this.e.c(a);
|
|
float translationX = c.getTranslationX();
|
|
float translationY = c.getTranslationY();
|
|
if (f >= c.getLeft() + translationX && f <= c.getRight() + translationX && f2 >= c.getTop() + translationY && f2 <= c.getBottom() + translationY) {
|
|
return c;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public void a(View view, Rect rect) {
|
|
b(view, rect);
|
|
}
|
|
|
|
void a(View view) {
|
|
ViewHolder m = m(view);
|
|
i(view);
|
|
Adapter adapter = this.l;
|
|
if (adapter != null && m != null) {
|
|
adapter.onViewAttachedToWindow(m);
|
|
}
|
|
List<OnChildAttachStateChangeListener> list = this.D;
|
|
if (list != null) {
|
|
for (int size = list.size() - 1; size >= 0; size--) {
|
|
this.D.get(size).b(view);
|
|
}
|
|
}
|
|
}
|
|
|
|
boolean a(ViewHolder viewHolder, int i) {
|
|
if (n()) {
|
|
viewHolder.mPendingAccessibilityState = i;
|
|
this.x0.add(viewHolder);
|
|
return false;
|
|
}
|
|
ViewCompat.f(viewHolder.itemView, i);
|
|
return true;
|
|
}
|
|
|
|
void a(StateListDrawable stateListDrawable, Drawable drawable, StateListDrawable stateListDrawable2, Drawable drawable2) {
|
|
if (stateListDrawable != null && drawable != null && stateListDrawable2 != null && drawable2 != null) {
|
|
Resources resources = getContext().getResources();
|
|
new FastScroller(this, stateListDrawable, drawable, stateListDrawable2, drawable2, resources.getDimensionPixelSize(R$dimen.fastscroll_default_thickness), resources.getDimensionPixelSize(R$dimen.fastscroll_minimum_range), resources.getDimensionPixelOffset(R$dimen.fastscroll_margin));
|
|
} else {
|
|
throw new IllegalArgumentException("Trying to set fast scroller without both required drawables." + i());
|
|
}
|
|
}
|
|
|
|
@Override // androidx.core.view.NestedScrollingChild2
|
|
public void a(int i) {
|
|
getScrollingChildHelper().c(i);
|
|
}
|
|
|
|
public boolean a(int i, int i2, int i3, int i4, int[] iArr, int i5) {
|
|
return getScrollingChildHelper().a(i, i2, i3, i4, iArr, i5);
|
|
}
|
|
|
|
public boolean a(int i, int i2, int[] iArr, int[] iArr2, int i3) {
|
|
return getScrollingChildHelper().a(i, i2, iArr, iArr2, i3);
|
|
}
|
|
}
|