475 lines
13 KiB
Smali
475 lines
13 KiB
Smali
.class public Lcom/moji/swiperefreshlayout/RefreshView;
|
|
.super Ljava/lang/Object;
|
|
.source "RefreshView.java"
|
|
|
|
# interfaces
|
|
.implements Lcom/moji/swiperefreshlayout/ViewControl;
|
|
|
|
|
|
# instance fields
|
|
.field private a:Landroid/content/Context;
|
|
|
|
.field private b:Ljava/util/Random;
|
|
|
|
.field private c:Z
|
|
|
|
.field private d:Landroid/widget/FrameLayout;
|
|
|
|
.field private e:Lcom/moji/swiperefreshlayout/CubicCircle;
|
|
|
|
.field private f:Lcom/moji/lottie/LottieAnimationView;
|
|
|
|
.field private g:Landroid/widget/TextView;
|
|
|
|
.field private h:Landroid/animation/Animator$AnimatorListener;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;)V
|
|
.locals 1
|
|
|
|
.line 29
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
.line 137
|
|
new-instance v0, Lcom/moji/swiperefreshlayout/RefreshView$1;
|
|
|
|
invoke-direct {v0, p0}, Lcom/moji/swiperefreshlayout/RefreshView$1;-><init>(Lcom/moji/swiperefreshlayout/RefreshView;)V
|
|
|
|
iput-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->h:Landroid/animation/Animator$AnimatorListener;
|
|
|
|
.line 30
|
|
iput-object p1, p0, Lcom/moji/swiperefreshlayout/RefreshView;->a:Landroid/content/Context;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static synthetic a(Lcom/moji/swiperefreshlayout/RefreshView;)Lcom/moji/lottie/LottieAnimationView;
|
|
.locals 0
|
|
|
|
.line 18
|
|
iget-object p0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->f:Lcom/moji/lottie/LottieAnimationView;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method static synthetic a(Lcom/moji/swiperefreshlayout/RefreshView;Ljava/lang/String;)V
|
|
.locals 0
|
|
|
|
.line 18
|
|
invoke-direct {p0, p1}, Lcom/moji/swiperefreshlayout/RefreshView;->a(Ljava/lang/String;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private a(Ljava/lang/String;)V
|
|
.locals 2
|
|
|
|
.line 103
|
|
new-instance v0, Lcom/moji/lottie/LottieAnimationView;
|
|
|
|
iget-object v1, p0, Lcom/moji/swiperefreshlayout/RefreshView;->a:Landroid/content/Context;
|
|
|
|
invoke-direct {v0, v1}, Lcom/moji/lottie/LottieAnimationView;-><init>(Landroid/content/Context;)V
|
|
|
|
iput-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->f:Lcom/moji/lottie/LottieAnimationView;
|
|
|
|
.line 104
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->f:Lcom/moji/lottie/LottieAnimationView;
|
|
|
|
invoke-virtual {v0, p1}, Lcom/moji/lottie/LottieAnimationView;->setAnimation(Ljava/lang/String;)V
|
|
|
|
const/high16 p1, 0x41e00000 # 28.0f
|
|
|
|
.line 105
|
|
invoke-static {p1}, Lcom/moji/tool/DeviceTool;->a(F)I
|
|
|
|
move-result p1
|
|
|
|
.line 106
|
|
new-instance v0, Landroid/widget/FrameLayout$LayoutParams;
|
|
|
|
invoke-direct {v0, p1, p1}, Landroid/widget/FrameLayout$LayoutParams;-><init>(II)V
|
|
|
|
const/16 p1, 0x51
|
|
|
|
.line 107
|
|
iput p1, v0, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
|
|
|
|
const/high16 p1, 0x41a00000 # 20.0f
|
|
|
|
.line 108
|
|
invoke-static {p1}, Lcom/moji/tool/DeviceTool;->a(F)I
|
|
|
|
move-result p1
|
|
|
|
iput p1, v0, Landroid/widget/FrameLayout$LayoutParams;->bottomMargin:I
|
|
|
|
.line 109
|
|
iget-object p1, p0, Lcom/moji/swiperefreshlayout/RefreshView;->d:Landroid/widget/FrameLayout;
|
|
|
|
iget-object v1, p0, Lcom/moji/swiperefreshlayout/RefreshView;->f:Lcom/moji/lottie/LottieAnimationView;
|
|
|
|
invoke-virtual {p1, v1, v0}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static synthetic b(Lcom/moji/swiperefreshlayout/RefreshView;)Landroid/widget/FrameLayout;
|
|
.locals 0
|
|
|
|
.line 18
|
|
iget-object p0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->d:Landroid/widget/FrameLayout;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method static synthetic c(Lcom/moji/swiperefreshlayout/RefreshView;)Z
|
|
.locals 0
|
|
|
|
.line 18
|
|
iget-boolean p0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->c:Z
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method private g()V
|
|
.locals 2
|
|
|
|
.line 70
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->e:Lcom/moji/swiperefreshlayout/CubicCircle;
|
|
|
|
invoke-virtual {v0}, Lcom/moji/swiperefreshlayout/CubicCircle;->getVisibility()I
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 71
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->e:Lcom/moji/swiperefreshlayout/CubicCircle;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {v0, v1}, Lcom/moji/swiperefreshlayout/CubicCircle;->setVisibility(I)V
|
|
|
|
.line 73
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->f:Lcom/moji/lottie/LottieAnimationView;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->f:Lcom/moji/lottie/LottieAnimationView;
|
|
|
|
invoke-virtual {v0}, Lcom/moji/lottie/LottieAnimationView;->getVisibility()I
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
.line 74
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->f:Lcom/moji/lottie/LottieAnimationView;
|
|
|
|
const/16 v1, 0x8
|
|
|
|
invoke-virtual {v0, v1}, Lcom/moji/lottie/LottieAnimationView;->setVisibility(I)V
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method private h()V
|
|
.locals 2
|
|
|
|
.line 79
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->e:Lcom/moji/swiperefreshlayout/CubicCircle;
|
|
|
|
invoke-virtual {v0}, Lcom/moji/swiperefreshlayout/CubicCircle;->getVisibility()I
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 80
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->e:Lcom/moji/swiperefreshlayout/CubicCircle;
|
|
|
|
const/16 v1, 0x8
|
|
|
|
invoke-virtual {v0, v1}, Lcom/moji/swiperefreshlayout/CubicCircle;->setVisibility(I)V
|
|
|
|
.line 82
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->f:Lcom/moji/lottie/LottieAnimationView;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->f:Lcom/moji/lottie/LottieAnimationView;
|
|
|
|
invoke-virtual {v0}, Lcom/moji/lottie/LottieAnimationView;->getVisibility()I
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 83
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->f:Lcom/moji/lottie/LottieAnimationView;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {v0, v1}, Lcom/moji/lottie/LottieAnimationView;->setVisibility(I)V
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public a()Landroid/view/View;
|
|
.locals 3
|
|
|
|
.line 35
|
|
new-instance v0, Landroid/widget/FrameLayout;
|
|
|
|
iget-object v1, p0, Lcom/moji/swiperefreshlayout/RefreshView;->a:Landroid/content/Context;
|
|
|
|
invoke-direct {v0, v1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V
|
|
|
|
iput-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->d:Landroid/widget/FrameLayout;
|
|
|
|
.line 36
|
|
new-instance v0, Lcom/moji/swiperefreshlayout/CubicCircle;
|
|
|
|
iget-object v1, p0, Lcom/moji/swiperefreshlayout/RefreshView;->a:Landroid/content/Context;
|
|
|
|
invoke-direct {v0, v1}, Lcom/moji/swiperefreshlayout/CubicCircle;-><init>(Landroid/content/Context;)V
|
|
|
|
iput-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->e:Lcom/moji/swiperefreshlayout/CubicCircle;
|
|
|
|
.line 37
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->d:Landroid/widget/FrameLayout;
|
|
|
|
iget-object v1, p0, Lcom/moji/swiperefreshlayout/RefreshView;->e:Lcom/moji/swiperefreshlayout/CubicCircle;
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;)V
|
|
|
|
.line 38
|
|
new-instance v0, Landroid/widget/TextView;
|
|
|
|
iget-object v1, p0, Lcom/moji/swiperefreshlayout/RefreshView;->a:Landroid/content/Context;
|
|
|
|
invoke-direct {v0, v1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V
|
|
|
|
iput-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->g:Landroid/widget/TextView;
|
|
|
|
.line 39
|
|
new-instance v0, Landroid/widget/FrameLayout$LayoutParams;
|
|
|
|
const/4 v1, -0x2
|
|
|
|
invoke-direct {v0, v1, v1}, Landroid/widget/FrameLayout$LayoutParams;-><init>(II)V
|
|
|
|
const/16 v1, 0x51
|
|
|
|
.line 40
|
|
iput v1, v0, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
|
|
|
|
const/high16 v1, 0x40800000 # 4.0f
|
|
|
|
.line 41
|
|
invoke-static {v1}, Lcom/moji/tool/DeviceTool;->a(F)I
|
|
|
|
move-result v1
|
|
|
|
iput v1, v0, Landroid/widget/FrameLayout$LayoutParams;->bottomMargin:I
|
|
|
|
.line 42
|
|
iget-object v1, p0, Lcom/moji/swiperefreshlayout/RefreshView;->d:Landroid/widget/FrameLayout;
|
|
|
|
iget-object v2, p0, Lcom/moji/swiperefreshlayout/RefreshView;->g:Landroid/widget/TextView;
|
|
|
|
invoke-virtual {v1, v2, v0}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V
|
|
|
|
.line 43
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->g:Landroid/widget/TextView;
|
|
|
|
const v1, -0x262627
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setTextColor(I)V
|
|
|
|
.line 44
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->g:Landroid/widget/TextView;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/high16 v2, 0x41400000 # 12.0f
|
|
|
|
invoke-virtual {v0, v1, v2}, Landroid/widget/TextView;->setTextSize(IF)V
|
|
|
|
.line 45
|
|
new-instance v0, Ljava/util/Random;
|
|
|
|
invoke-direct {v0}, Ljava/util/Random;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->b:Ljava/util/Random;
|
|
|
|
.line 46
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->d:Landroid/widget/FrameLayout;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public a(F)V
|
|
.locals 1
|
|
|
|
.line 133
|
|
invoke-direct {p0}, Lcom/moji/swiperefreshlayout/RefreshView;->g()V
|
|
|
|
.line 134
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->e:Lcom/moji/swiperefreshlayout/CubicCircle;
|
|
|
|
invoke-virtual {v0, p1}, Lcom/moji/swiperefreshlayout/CubicCircle;->setPercent(F)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public a(I)V
|
|
.locals 1
|
|
.param p1 # I
|
|
.annotation build Landroid/support/annotation/StringRes;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 89
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->g:Landroid/widget/TextView;
|
|
|
|
invoke-virtual {v0, p1}, Landroid/widget/TextView;->setText(I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public b()I
|
|
.locals 1
|
|
|
|
const/high16 v0, 0x42700000 # 60.0f
|
|
|
|
.line 61
|
|
invoke-static {v0}, Lcom/moji/tool/DeviceTool;->a(F)I
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public c()I
|
|
.locals 1
|
|
|
|
const/high16 v0, 0x42700000 # 60.0f
|
|
|
|
.line 66
|
|
invoke-static {v0}, Lcom/moji/tool/DeviceTool;->a(F)I
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public d()V
|
|
.locals 1
|
|
|
|
.line 94
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->b:Ljava/util/Random;
|
|
|
|
invoke-virtual {v0}, Ljava/util/Random;->nextBoolean()Z
|
|
|
|
move-result v0
|
|
|
|
iput-boolean v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->c:Z
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 95
|
|
iput-boolean v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->c:Z
|
|
|
|
.line 96
|
|
iget-boolean v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->c:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const-string v0, "swipe_refresh_layout_white_sun_first.json"
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const-string v0, "swipe_refresh_layout_white_cloud_first.json"
|
|
|
|
.line 97
|
|
:goto_0
|
|
invoke-direct {p0, v0}, Lcom/moji/swiperefreshlayout/RefreshView;->a(Ljava/lang/String;)V
|
|
|
|
.line 99
|
|
invoke-direct {p0}, Lcom/moji/swiperefreshlayout/RefreshView;->h()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public e()V
|
|
.locals 2
|
|
|
|
.line 114
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->f:Lcom/moji/lottie/LottieAnimationView;
|
|
|
|
invoke-virtual {v0}, Lcom/moji/lottie/LottieAnimationView;->c()V
|
|
|
|
.line 115
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->f:Lcom/moji/lottie/LottieAnimationView;
|
|
|
|
iget-object v1, p0, Lcom/moji/swiperefreshlayout/RefreshView;->h:Landroid/animation/Animator$AnimatorListener;
|
|
|
|
invoke-virtual {v0, v1}, Lcom/moji/lottie/LottieAnimationView;->a(Landroid/animation/Animator$AnimatorListener;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public f()V
|
|
.locals 2
|
|
|
|
.line 120
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->f:Lcom/moji/lottie/LottieAnimationView;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 121
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->f:Lcom/moji/lottie/LottieAnimationView;
|
|
|
|
iget-object v1, p0, Lcom/moji/swiperefreshlayout/RefreshView;->h:Landroid/animation/Animator$AnimatorListener;
|
|
|
|
invoke-virtual {v0, v1}, Lcom/moji/lottie/LottieAnimationView;->b(Landroid/animation/Animator$AnimatorListener;)V
|
|
|
|
.line 122
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->f:Lcom/moji/lottie/LottieAnimationView;
|
|
|
|
invoke-virtual {v0}, Lcom/moji/lottie/LottieAnimationView;->e()V
|
|
|
|
.line 123
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->f:Lcom/moji/lottie/LottieAnimationView;
|
|
|
|
invoke-virtual {v0}, Lcom/moji/lottie/LottieAnimationView;->d()V
|
|
|
|
.line 124
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->d:Landroid/widget/FrameLayout;
|
|
|
|
iget-object v1, p0, Lcom/moji/swiperefreshlayout/RefreshView;->f:Lcom/moji/lottie/LottieAnimationView;
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->removeView(Landroid/view/View;)V
|
|
|
|
.line 127
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/moji/swiperefreshlayout/RefreshView;->e:Lcom/moji/swiperefreshlayout/CubicCircle;
|
|
|
|
invoke-virtual {v0}, Lcom/moji/swiperefreshlayout/CubicCircle;->a()V
|
|
|
|
.line 128
|
|
invoke-direct {p0}, Lcom/moji/swiperefreshlayout/RefreshView;->g()V
|
|
|
|
return-void
|
|
.end method
|