434 lines
13 KiB
Smali
434 lines
13 KiB
Smali
.class Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;
|
|
.super Landroid/support/v7/widget/RecyclerView$Adapter;
|
|
.source "TsNearByPhotoAdapter.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter$PhotoViewHolder;
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Landroid/support/v7/widget/RecyclerView$Adapter<",
|
|
"Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter$PhotoViewHolder;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final a:Ljava/lang/String;
|
|
|
|
.field private static final b:Ljava/lang/String;
|
|
|
|
|
|
# instance fields
|
|
.field private c:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Lcom/moji/http/snsforum/entity/NearByPhoto$ListBean;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private d:Landroid/content/Context;
|
|
|
|
.field private e:Ljava/text/DecimalFormat;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
const v0, 0x7f0e04c2
|
|
|
|
.line 33
|
|
invoke-static {v0}, Lcom/moji/tool/DeviceTool;->f(I)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->a:Ljava/lang/String;
|
|
|
|
const v0, 0x7f0e041a
|
|
|
|
.line 34
|
|
invoke-static {v0}, Lcom/moji/tool/DeviceTool;->f(I)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->b:Ljava/lang/String;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method constructor <init>(Ljava/util/List;Landroid/content/Context;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List<",
|
|
"Lcom/moji/http/snsforum/entity/NearByPhoto$ListBean;",
|
|
">;",
|
|
"Landroid/content/Context;",
|
|
")V"
|
|
}
|
|
.end annotation
|
|
|
|
.line 42
|
|
invoke-direct {p0}, Landroid/support/v7/widget/RecyclerView$Adapter;-><init>()V
|
|
|
|
.line 37
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->c:Ljava/util/List;
|
|
|
|
.line 43
|
|
iput-object p1, p0, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->c:Ljava/util/List;
|
|
|
|
.line 44
|
|
iput-object p2, p0, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->d:Landroid/content/Context;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static synthetic a(Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;)Landroid/content/Context;
|
|
.locals 0
|
|
|
|
.line 30
|
|
iget-object p0, p0, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->d:Landroid/content/Context;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private a(J)Ljava/lang/String;
|
|
.locals 4
|
|
|
|
.line 107
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-wide/16 v1, 0x3e8
|
|
|
|
cmp-long v3, p1, v1
|
|
|
|
if-gez v3, :cond_0
|
|
|
|
.line 110
|
|
invoke-virtual {v0, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
|
|
|
.line 111
|
|
sget-object p1, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->a:Ljava/lang/String;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
long-to-double p1, p1
|
|
|
|
const-wide/high16 v1, 0x3ff0000000000000L # 1.0
|
|
|
|
.line 113
|
|
invoke-static {p1, p2}, Ljava/lang/Double;->isNaN(D)Z
|
|
|
|
mul-double p1, p1, v1
|
|
|
|
const-wide v1, 0x408f400000000000L # 1000.0
|
|
|
|
div-double/2addr p1, v1
|
|
|
|
.line 115
|
|
:try_start_0
|
|
iget-object v1, p0, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->e:Ljava/text/DecimalFormat;
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
.line 116
|
|
new-instance v1, Ljava/text/DecimalFormat;
|
|
|
|
const-string v2, "0.0"
|
|
|
|
invoke-direct {v1, v2}, Ljava/text/DecimalFormat;-><init>(Ljava/lang/String;)V
|
|
|
|
iput-object v1, p0, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->e:Ljava/text/DecimalFormat;
|
|
|
|
.line 118
|
|
:cond_1
|
|
iget-object v1, p0, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->e:Ljava/text/DecimalFormat;
|
|
|
|
invoke-virtual {v1, p1, p2}, Ljava/text/DecimalFormat;->format(D)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
.line 119
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
sget-object v1, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->b:Ljava/lang/String;
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 121
|
|
:catch_0
|
|
invoke-virtual {v0, p1, p2}, Ljava/lang/StringBuilder;->append(D)Ljava/lang/StringBuilder;
|
|
|
|
sget-object p1, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->b:Ljava/lang/String;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
.line 124
|
|
:goto_0
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method static synthetic a(Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;I)V
|
|
.locals 0
|
|
|
|
.line 30
|
|
invoke-direct {p0, p1}, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->f(I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static synthetic b(Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;)Ljava/util/List;
|
|
.locals 0
|
|
|
|
.line 30
|
|
iget-object p0, p0, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->c:Ljava/util/List;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private f(I)V
|
|
.locals 4
|
|
|
|
.line 90
|
|
new-instance v0, Landroid/content/Intent;
|
|
|
|
iget-object v1, p0, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->d:Landroid/content/Context;
|
|
|
|
const-class v2, Lcom/moji/newliveview/detail/PictureDetailActivity;
|
|
|
|
invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
|
|
|
|
const-string v1, "extra_data_picture_id"
|
|
|
|
int-to-long v2, p1
|
|
|
|
.line 91
|
|
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v0, v1, p1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/io/Serializable;)Landroid/content/Intent;
|
|
|
|
.line 92
|
|
iget-object p1, p0, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->d:Landroid/content/Context;
|
|
|
|
invoke-virtual {p1, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public a()I
|
|
.locals 1
|
|
|
|
.line 97
|
|
iget-object v0, p0, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->c:Ljava/util/List;
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->size()I
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public synthetic a(Landroid/view/ViewGroup;I)Landroid/support/v7/widget/RecyclerView$ViewHolder;
|
|
.locals 0
|
|
|
|
.line 30
|
|
invoke-virtual {p0, p1, p2}, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->c(Landroid/view/ViewGroup;I)Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter$PhotoViewHolder;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public bridge synthetic a(Landroid/support/v7/widget/RecyclerView$ViewHolder;I)V
|
|
.locals 0
|
|
|
|
.line 30
|
|
check-cast p1, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter$PhotoViewHolder;
|
|
|
|
invoke-virtual {p0, p1, p2}, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->a(Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter$PhotoViewHolder;I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method a(Lcom/moji/http/snsforum/entity/NearByPhoto$ListBean;)V
|
|
.locals 2
|
|
|
|
.line 102
|
|
iget-object v0, p0, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->c:Ljava/util/List;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-interface {v0, v1, p1}, Ljava/util/List;->add(ILjava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public a(Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter$PhotoViewHolder;I)V
|
|
.locals 4
|
|
|
|
.line 56
|
|
iget-object v0, p0, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->c:Ljava/util/List;
|
|
|
|
invoke-interface {v0, p2}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/moji/http/snsforum/entity/NearByPhoto$ListBean;
|
|
|
|
.line 58
|
|
iget-boolean v1, v0, Lcom/moji/http/snsforum/entity/NearByPhoto$ListBean;->isFromPhoto:Z
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 59
|
|
iput-boolean v1, v0, Lcom/moji/http/snsforum/entity/NearByPhoto$ListBean;->isFromPhoto:Z
|
|
|
|
.line 61
|
|
invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1}, Lcom/squareup/picasso/Picasso;->a(Landroid/content/Context;)Lcom/squareup/picasso/Picasso;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, v0, Lcom/moji/http/snsforum/entity/NearByPhoto$ListBean;->path:Ljava/lang/String;
|
|
|
|
invoke-virtual {v1, v2}, Lcom/squareup/picasso/Picasso;->a(Ljava/lang/String;)Lcom/squareup/picasso/RequestCreator;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lcom/squareup/picasso/RequestCreator;->b()Lcom/squareup/picasso/RequestCreator;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lcom/squareup/picasso/RequestCreator;->f()Lcom/squareup/picasso/RequestCreator;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, p1, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter$PhotoViewHolder;->n:Landroid/widget/ImageView;
|
|
|
|
new-instance v3, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter$1;
|
|
|
|
invoke-direct {v3, p0, p1}, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter$1;-><init>(Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter$PhotoViewHolder;)V
|
|
|
|
invoke-virtual {v1, v2, v3}, Lcom/squareup/picasso/RequestCreator;->a(Landroid/widget/ImageView;Lcom/squareup/picasso/Callback;)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 75
|
|
:cond_0
|
|
invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1}, Lcom/squareup/picasso/Picasso;->a(Landroid/content/Context;)Lcom/squareup/picasso/Picasso;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, v0, Lcom/moji/http/snsforum/entity/NearByPhoto$ListBean;->path:Ljava/lang/String;
|
|
|
|
invoke-virtual {v1, v2}, Lcom/squareup/picasso/Picasso;->a(Ljava/lang/String;)Lcom/squareup/picasso/RequestCreator;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lcom/squareup/picasso/RequestCreator;->b()Lcom/squareup/picasso/RequestCreator;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lcom/squareup/picasso/RequestCreator;->f()Lcom/squareup/picasso/RequestCreator;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, p1, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter$PhotoViewHolder;->n:Landroid/widget/ImageView;
|
|
|
|
invoke-virtual {v1, v2}, Lcom/squareup/picasso/RequestCreator;->a(Landroid/widget/ImageView;)V
|
|
|
|
.line 79
|
|
:goto_0
|
|
iget-object v1, p1, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter$PhotoViewHolder;->o:Landroid/widget/TextView;
|
|
|
|
iget v0, v0, Lcom/moji/http/snsforum/entity/NearByPhoto$ListBean;->distance:I
|
|
|
|
int-to-long v2, v0
|
|
|
|
invoke-direct {p0, v2, v3}, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;->a(J)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v1, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
.line 80
|
|
iget-object p1, p1, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter$PhotoViewHolder;->n:Landroid/widget/ImageView;
|
|
|
|
new-instance v0, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter$2;
|
|
|
|
invoke-direct {v0, p0, p2}, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter$2;-><init>(Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter;I)V
|
|
|
|
invoke-virtual {p1, v0}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public c(Landroid/view/ViewGroup;I)Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter$PhotoViewHolder;
|
|
.locals 2
|
|
|
|
.line 50
|
|
invoke-virtual {p1}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-static {p2}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;
|
|
|
|
move-result-object p2
|
|
|
|
const v0, 0x7f0b03db
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {p2, v0, p1, v1}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
.line 51
|
|
new-instance p2, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter$PhotoViewHolder;
|
|
|
|
invoke-direct {p2, p1}, Lcom/moji/mjweather/thunderstorm/TsNearByPhotoAdapter$PhotoViewHolder;-><init>(Landroid/view/View;)V
|
|
|
|
return-object p2
|
|
.end method
|