.class public final Landroidx/recyclerview/widget/n;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Landroidx/recyclerview/widget/n$b;,
        Landroidx/recyclerview/widget/n$c;
    }
.end annotation


# static fields
.field public static final v:Ljava/lang/ThreadLocal;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/ThreadLocal<",
            "Landroidx/recyclerview/widget/n;",
            ">;"
        }
    .end annotation
.end field

.field public static w:Ljava/util/Comparator;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Comparator<",
            "Landroidx/recyclerview/widget/n$c;",
            ">;"
        }
    .end annotation
.end field


# instance fields
.field public r:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList<",
            "Landroidx/recyclerview/widget/RecyclerView;",
            ">;"
        }
    .end annotation
.end field

.field public s:J

.field public t:J

.field public u:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList<",
            "Landroidx/recyclerview/widget/n$c;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public static constructor <clinit>()V
    .registers 1

    new-instance v0, Ljava/lang/ThreadLocal;

    invoke-direct {v0}, Ljava/lang/ThreadLocal;-><init>()V

    sput-object v0, Landroidx/recyclerview/widget/n;->v:Ljava/lang/ThreadLocal;

    new-instance v0, Landroidx/recyclerview/widget/n$a;

    invoke-direct {v0}, Landroidx/recyclerview/widget/n$a;-><init>()V

    sput-object v0, Landroidx/recyclerview/widget/n;->w:Ljava/util/Comparator;

    return-void
.end method

.method public constructor <init>()V
    .registers 2

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Landroidx/recyclerview/widget/n;->r:Ljava/util/ArrayList;

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Landroidx/recyclerview/widget/n;->u:Ljava/util/ArrayList;

    return-void
.end method


# virtual methods
.method public a(Landroidx/recyclerview/widget/RecyclerView;II)V
    .registers 8

    invoke-virtual {p1}, Landroidx/recyclerview/widget/RecyclerView;->isAttachedToWindow()Z

    move-result v0

    if-eqz v0, :cond_17

    iget-wide v0, p0, Landroidx/recyclerview/widget/n;->s:J

    const-wide/16 v2, 0x0

    cmp-long v0, v0, v2

    if-nez v0, :cond_17

    invoke-virtual {p1}, Landroidx/recyclerview/widget/RecyclerView;->getNanoTime()J

    move-result-wide v0

    iput-wide v0, p0, Landroidx/recyclerview/widget/n;->s:J

    invoke-virtual {p1, p0}, Landroid/view/ViewGroup;->post(Ljava/lang/Runnable;)Z

    :cond_17
    iget-object p1, p1, Landroidx/recyclerview/widget/RecyclerView;->v0:Landroidx/recyclerview/widget/n$b;

    .line 1
    iput p2, p1, Landroidx/recyclerview/widget/n$b;->a:I

    iput p3, p1, Landroidx/recyclerview/widget/n$b;->b:I

    return-void
.end method

.method public b(J)V
    .registers 16

    .line 1
    iget-object v0, p0, Landroidx/recyclerview/widget/n;->r:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    const/4 v1, 0x0

    move v2, v1

    move v3, v2

    :goto_9
    if-ge v2, v0, :cond_26

    iget-object v4, p0, Landroidx/recyclerview/widget/n;->r:Ljava/util/ArrayList;

    invoke-virtual {v4, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Landroidx/recyclerview/widget/RecyclerView;

    invoke-virtual {v4}, Landroid/view/ViewGroup;->getWindowVisibility()I

    move-result v5

    if-nez v5, :cond_23

    iget-object v5, v4, Landroidx/recyclerview/widget/RecyclerView;->v0:Landroidx/recyclerview/widget/n$b;

    invoke-virtual {v5, v4, v1}, Landroidx/recyclerview/widget/n$b;->b(Landroidx/recyclerview/widget/RecyclerView;Z)V

    iget-object v4, v4, Landroidx/recyclerview/widget/RecyclerView;->v0:Landroidx/recyclerview/widget/n$b;

    iget v4, v4, Landroidx/recyclerview/widget/n$b;->d:I

    add-int/2addr v3, v4

    :cond_23
    add-int/lit8 v2, v2, 0x1

    goto :goto_9

    :cond_26
    iget-object v2, p0, Landroidx/recyclerview/widget/n;->u:Ljava/util/ArrayList;

    invoke-virtual {v2, v3}, Ljava/util/ArrayList;->ensureCapacity(I)V

    move v2, v1

    move v3, v2

    :goto_2d
    const/4 v4, 0x1

    if-ge v2, v0, :cond_8f

    iget-object v5, p0, Landroidx/recyclerview/widget/n;->r:Ljava/util/ArrayList;

    invoke-virtual {v5, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Landroidx/recyclerview/widget/RecyclerView;

    invoke-virtual {v5}, Landroid/view/ViewGroup;->getWindowVisibility()I

    move-result v6

    if-eqz v6, :cond_3f

    goto :goto_8c

    :cond_3f
    iget-object v6, v5, Landroidx/recyclerview/widget/RecyclerView;->v0:Landroidx/recyclerview/widget/n$b;

    iget v7, v6, Landroidx/recyclerview/widget/n$b;->a:I

    invoke-static {v7}, Ljava/lang/Math;->abs(I)I

    move-result v7

    iget v8, v6, Landroidx/recyclerview/widget/n$b;->b:I

    invoke-static {v8}, Ljava/lang/Math;->abs(I)I

    move-result v8

    add-int/2addr v8, v7

    move v7, v1

    :goto_4f
    iget v9, v6, Landroidx/recyclerview/widget/n$b;->d:I

    mul-int/lit8 v9, v9, 0x2

    if-ge v7, v9, :cond_8c

    iget-object v9, p0, Landroidx/recyclerview/widget/n;->u:Ljava/util/ArrayList;

    invoke-virtual {v9}, Ljava/util/ArrayList;->size()I

    move-result v9

    if-lt v3, v9, :cond_68

    new-instance v9, Landroidx/recyclerview/widget/n$c;

    invoke-direct {v9}, Landroidx/recyclerview/widget/n$c;-><init>()V

    iget-object v10, p0, Landroidx/recyclerview/widget/n;->u:Ljava/util/ArrayList;

    invoke-virtual {v10, v9}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto :goto_70

    :cond_68
    iget-object v9, p0, Landroidx/recyclerview/widget/n;->u:Ljava/util/ArrayList;

    invoke-virtual {v9, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v9

    check-cast v9, Landroidx/recyclerview/widget/n$c;

    :goto_70
    iget-object v10, v6, Landroidx/recyclerview/widget/n$b;->c:[I

    add-int/lit8 v11, v7, 0x1

    aget v11, v10, v11

    if-gt v11, v8, :cond_7a

    move v12, v4

    goto :goto_7b

    :cond_7a
    move v12, v1

    :goto_7b
    iput-boolean v12, v9, Landroidx/recyclerview/widget/n$c;->a:Z

    iput v8, v9, Landroidx/recyclerview/widget/n$c;->b:I

    iput v11, v9, Landroidx/recyclerview/widget/n$c;->c:I

    iput-object v5, v9, Landroidx/recyclerview/widget/n$c;->d:Landroidx/recyclerview/widget/RecyclerView;

    aget v10, v10, v7

    iput v10, v9, Landroidx/recyclerview/widget/n$c;->e:I

    add-int/lit8 v3, v3, 0x1

    add-int/lit8 v7, v7, 0x2

    goto :goto_4f

    :cond_8c
    :goto_8c
    add-int/lit8 v2, v2, 0x1

    goto :goto_2d

    :cond_8f
    iget-object v0, p0, Landroidx/recyclerview/widget/n;->u:Ljava/util/ArrayList;

    sget-object v2, Landroidx/recyclerview/widget/n;->w:Ljava/util/Comparator;

    invoke-static {v0, v2}, Ljava/util/Collections;->sort(Ljava/util/List;Ljava/util/Comparator;)V

    move v0, v1

    .line 2
    :goto_97
    iget-object v2, p0, Landroidx/recyclerview/widget/n;->u:Ljava/util/ArrayList;

    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v2

    if-ge v0, v2, :cond_137

    iget-object v2, p0, Landroidx/recyclerview/widget/n;->u:Ljava/util/ArrayList;

    invoke-virtual {v2, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroidx/recyclerview/widget/n$c;

    iget-object v3, v2, Landroidx/recyclerview/widget/n$c;->d:Landroidx/recyclerview/widget/RecyclerView;

    if-nez v3, :cond_ad

    goto/16 :goto_137

    .line 3
    :cond_ad
    iget-boolean v5, v2, Landroidx/recyclerview/widget/n$c;->a:Z

    if-eqz v5, :cond_b7

    const-wide v5, 0x7fffffffffffffffL

    goto :goto_b8

    :cond_b7
    move-wide v5, p1

    :goto_b8
    iget v7, v2, Landroidx/recyclerview/widget/n$c;->e:I

    invoke-virtual {p0, v3, v7, v5, v6}, Landroidx/recyclerview/widget/n;->c(Landroidx/recyclerview/widget/RecyclerView;IJ)Landroidx/recyclerview/widget/RecyclerView$a0;

    move-result-object v3

    if-eqz v3, :cond_128

    iget-object v5, v3, Landroidx/recyclerview/widget/RecyclerView$a0;->b:Ljava/lang/ref/WeakReference;

    if-eqz v5, :cond_128

    invoke-virtual {v3}, Landroidx/recyclerview/widget/RecyclerView$a0;->i()Z

    move-result v5

    if-eqz v5, :cond_128

    invoke-virtual {v3}, Landroidx/recyclerview/widget/RecyclerView$a0;->j()Z

    move-result v5

    if-nez v5, :cond_128

    iget-object v3, v3, Landroidx/recyclerview/widget/RecyclerView$a0;->b:Ljava/lang/ref/WeakReference;

    invoke-virtual {v3}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Landroidx/recyclerview/widget/RecyclerView;

    if-nez v3, :cond_db

    goto :goto_128

    .line 4
    :cond_db
    iget-boolean v5, v3, Landroidx/recyclerview/widget/RecyclerView;->S:Z

    if-eqz v5, :cond_ea

    iget-object v5, v3, Landroidx/recyclerview/widget/RecyclerView;->v:Landroidx/recyclerview/widget/c;

    invoke-virtual {v5}, Landroidx/recyclerview/widget/c;->h()I

    move-result v5

    if-eqz v5, :cond_ea

    invoke-virtual {v3}, Landroidx/recyclerview/widget/RecyclerView;->Z()V

    :cond_ea
    iget-object v5, v3, Landroidx/recyclerview/widget/RecyclerView;->v0:Landroidx/recyclerview/widget/n$b;

    invoke-virtual {v5, v3, v4}, Landroidx/recyclerview/widget/n$b;->b(Landroidx/recyclerview/widget/RecyclerView;Z)V

    iget v6, v5, Landroidx/recyclerview/widget/n$b;->d:I

    if-eqz v6, :cond_128

    :try_start_f3
    const-string v6, "RV Nested Prefetch"

    sget v7, Lh0/e;->a:I

    .line 5
    invoke-static {v6}, Landroid/os/Trace;->beginSection(Ljava/lang/String;)V

    .line 6
    iget-object v6, v3, Landroidx/recyclerview/widget/RecyclerView;->w0:Landroidx/recyclerview/widget/RecyclerView$x;

    iget-object v7, v3, Landroidx/recyclerview/widget/RecyclerView;->C:Landroidx/recyclerview/widget/RecyclerView$e;

    .line 7
    iput v4, v6, Landroidx/recyclerview/widget/RecyclerView$x;->d:I

    invoke-virtual {v7}, Landroidx/recyclerview/widget/RecyclerView$e;->a()I

    move-result v7

    iput v7, v6, Landroidx/recyclerview/widget/RecyclerView$x;->e:I

    iput-boolean v1, v6, Landroidx/recyclerview/widget/RecyclerView$x;->g:Z

    iput-boolean v1, v6, Landroidx/recyclerview/widget/RecyclerView$x;->h:Z

    iput-boolean v1, v6, Landroidx/recyclerview/widget/RecyclerView$x;->i:Z

    move v6, v1

    .line 8
    :goto_10d
    iget v7, v5, Landroidx/recyclerview/widget/n$b;->d:I

    mul-int/lit8 v7, v7, 0x2

    if-ge v6, v7, :cond_11d

    iget-object v7, v5, Landroidx/recyclerview/widget/n$b;->c:[I

    aget v7, v7, v6

    invoke-virtual {p0, v3, v7, p1, p2}, Landroidx/recyclerview/widget/n;->c(Landroidx/recyclerview/widget/RecyclerView;IJ)Landroidx/recyclerview/widget/RecyclerView$a0;
    :try_end_11a
    .catchall {:try_start_f3 .. :try_end_11a} :catchall_121

    add-int/lit8 v6, v6, 0x2

    goto :goto_10d

    .line 9
    :cond_11d
    invoke-static {}, Landroid/os/Trace;->endSection()V

    goto :goto_128

    :catchall_121
    move-exception p1

    .line 10
    sget p2, Lh0/e;->a:I

    .line 11
    invoke-static {}, Landroid/os/Trace;->endSection()V

    .line 12
    throw p1

    .line 13
    :cond_128
    :goto_128
    iput-boolean v1, v2, Landroidx/recyclerview/widget/n$c;->a:Z

    iput v1, v2, Landroidx/recyclerview/widget/n$c;->b:I

    iput v1, v2, Landroidx/recyclerview/widget/n$c;->c:I

    const/4 v3, 0x0

    iput-object v3, v2, Landroidx/recyclerview/widget/n$c;->d:Landroidx/recyclerview/widget/RecyclerView;

    iput v1, v2, Landroidx/recyclerview/widget/n$c;->e:I

    add-int/lit8 v0, v0, 0x1

    goto/16 :goto_97

    :cond_137
    :goto_137
    return-void
.end method

.method public final c(Landroidx/recyclerview/widget/RecyclerView;IJ)Landroidx/recyclerview/widget/RecyclerView$a0;
    .registers 10

    .line 1
    iget-object v0, p1, Landroidx/recyclerview/widget/RecyclerView;->v:Landroidx/recyclerview/widget/c;

    invoke-virtual {v0}, Landroidx/recyclerview/widget/c;->h()I

    move-result v0

    const/4 v1, 0x0

    move v2, v1

    :goto_8
    if-ge v2, v0, :cond_23

    iget-object v3, p1, Landroidx/recyclerview/widget/RecyclerView;->v:Landroidx/recyclerview/widget/c;

    invoke-virtual {v3, v2}, Landroidx/recyclerview/widget/c;->g(I)Landroid/view/View;

    move-result-object v3

    invoke-static {v3}, Landroidx/recyclerview/widget/RecyclerView;->K(Landroid/view/View;)Landroidx/recyclerview/widget/RecyclerView$a0;

    move-result-object v3

    iget v4, v3, Landroidx/recyclerview/widget/RecyclerView$a0;->c:I

    if-ne v4, p2, :cond_20

    invoke-virtual {v3}, Landroidx/recyclerview/widget/RecyclerView$a0;->j()Z

    move-result v3

    if-nez v3, :cond_20

    const/4 v0, 0x1

    goto :goto_24

    :cond_20
    add-int/lit8 v2, v2, 0x1

    goto :goto_8

    :cond_23
    move v0, v1

    :goto_24
    if-eqz v0, :cond_28

    const/4 p1, 0x0

    return-object p1

    .line 2
    :cond_28
    iget-object v0, p1, Landroidx/recyclerview/widget/RecyclerView;->s:Landroidx/recyclerview/widget/RecyclerView$s;

    :try_start_2a
    invoke-virtual {p1}, Landroidx/recyclerview/widget/RecyclerView;->S()V

    invoke-virtual {v0, p2, v1, p3, p4}, Landroidx/recyclerview/widget/RecyclerView$s;->j(IZJ)Landroidx/recyclerview/widget/RecyclerView$a0;

    move-result-object p2

    if-eqz p2, :cond_48

    invoke-virtual {p2}, Landroidx/recyclerview/widget/RecyclerView$a0;->i()Z

    move-result p3

    if-eqz p3, :cond_45

    invoke-virtual {p2}, Landroidx/recyclerview/widget/RecyclerView$a0;->j()Z

    move-result p3

    if-nez p3, :cond_45

    iget-object p3, p2, Landroidx/recyclerview/widget/RecyclerView$a0;->a:Landroid/view/View;

    invoke-virtual {v0, p3}, Landroidx/recyclerview/widget/RecyclerView$s;->g(Landroid/view/View;)V

    goto :goto_48

    :cond_45
    invoke-virtual {v0, p2, v1}, Landroidx/recyclerview/widget/RecyclerView$s;->a(Landroidx/recyclerview/widget/RecyclerView$a0;Z)V
    :try_end_48
    .catchall {:try_start_2a .. :try_end_48} :catchall_4c

    :cond_48
    :goto_48
    invoke-virtual {p1, v1}, Landroidx/recyclerview/widget/RecyclerView;->T(Z)V

    return-object p2

    :catchall_4c
    move-exception p2

    invoke-virtual {p1, v1}, Landroidx/recyclerview/widget/RecyclerView;->T(Z)V

    throw p2
.end method

.method public run()V
    .registers 9

    const-wide/16 v0, 0x0

    :try_start_2
    const-string v2, "RV Prefetch"

    sget v3, Lh0/e;->a:I

    .line 1
    invoke-static {v2}, Landroid/os/Trace;->beginSection(Ljava/lang/String;)V

    .line 2
    iget-object v2, p0, Landroidx/recyclerview/widget/n;->r:Ljava/util/ArrayList;

    invoke-virtual {v2}, Ljava/util/ArrayList;->isEmpty()Z

    move-result v2
    :try_end_f
    .catchall {:try_start_2 .. :try_end_f} :catchall_56

    if-eqz v2, :cond_17

    iput-wide v0, p0, Landroidx/recyclerview/widget/n;->s:J

    .line 3
    invoke-static {}, Landroid/os/Trace;->endSection()V

    return-void

    .line 4
    :cond_17
    :try_start_17
    iget-object v2, p0, Landroidx/recyclerview/widget/n;->r:Ljava/util/ArrayList;

    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v2

    const/4 v3, 0x0

    move-wide v4, v0

    :goto_1f
    if-ge v3, v2, :cond_3a

    iget-object v6, p0, Landroidx/recyclerview/widget/n;->r:Ljava/util/ArrayList;

    invoke-virtual {v6, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Landroidx/recyclerview/widget/RecyclerView;

    invoke-virtual {v6}, Landroid/view/ViewGroup;->getWindowVisibility()I

    move-result v7

    if-nez v7, :cond_37

    invoke-virtual {v6}, Landroid/view/ViewGroup;->getDrawingTime()J

    move-result-wide v6

    invoke-static {v6, v7, v4, v5}, Ljava/lang/Math;->max(JJ)J

    move-result-wide v4
    :try_end_37
    .catchall {:try_start_17 .. :try_end_37} :catchall_56

    :cond_37
    add-int/lit8 v3, v3, 0x1

    goto :goto_1f

    :cond_3a
    cmp-long v2, v4, v0

    if-nez v2, :cond_44

    iput-wide v0, p0, Landroidx/recyclerview/widget/n;->s:J

    .line 5
    invoke-static {}, Landroid/os/Trace;->endSection()V

    return-void

    .line 6
    :cond_44
    :try_start_44
    sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;

    invoke-virtual {v2, v4, v5}, Ljava/util/concurrent/TimeUnit;->toNanos(J)J

    move-result-wide v2

    iget-wide v4, p0, Landroidx/recyclerview/widget/n;->t:J

    add-long/2addr v2, v4

    invoke-virtual {p0, v2, v3}, Landroidx/recyclerview/widget/n;->b(J)V
    :try_end_50
    .catchall {:try_start_44 .. :try_end_50} :catchall_56

    iput-wide v0, p0, Landroidx/recyclerview/widget/n;->s:J

    .line 7
    invoke-static {}, Landroid/os/Trace;->endSection()V

    return-void

    :catchall_56
    move-exception v2

    .line 8
    iput-wide v0, p0, Landroidx/recyclerview/widget/n;->s:J

    sget v0, Lh0/e;->a:I

    .line 9
    invoke-static {}, Landroid/os/Trace;->endSection()V

    .line 10
    throw v2
.end method
