584 lines
14 KiB
Smali
584 lines
14 KiB
Smali
.class public Lcom/moji/newliveview/detail/LableView;
|
|
.super Landroid/widget/RelativeLayout;
|
|
.source "LableView.java"
|
|
|
|
|
|
# instance fields
|
|
.field public a:Landroid/widget/ImageView;
|
|
.annotation build Landroid/support/annotation/NonNull;
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private b:Landroid/content/Context;
|
|
|
|
.field private c:Ljava/util/HashMap;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/HashMap<",
|
|
"Lcom/moji/http/snsforum/entity/Label;",
|
|
"Lcom/moji/newliveview/camera/view/Lable;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private d:I
|
|
|
|
.field private e:I
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;)V
|
|
.locals 1
|
|
|
|
.line 34
|
|
invoke-direct {p0, p1}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;)V
|
|
|
|
.line 28
|
|
new-instance v0, Ljava/util/HashMap;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/moji/newliveview/detail/LableView;->c:Ljava/util/HashMap;
|
|
|
|
.line 35
|
|
invoke-direct {p0, p1}, Lcom/moji/newliveview/detail/LableView;->a(Landroid/content/Context;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
.locals 0
|
|
|
|
.line 39
|
|
invoke-direct {p0, p1, p2}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
.line 28
|
|
new-instance p2, Ljava/util/HashMap;
|
|
|
|
invoke-direct {p2}, Ljava/util/HashMap;-><init>()V
|
|
|
|
iput-object p2, p0, Lcom/moji/newliveview/detail/LableView;->c:Ljava/util/HashMap;
|
|
|
|
.line 40
|
|
invoke-direct {p0, p1}, Lcom/moji/newliveview/detail/LableView;->a(Landroid/content/Context;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
.locals 0
|
|
|
|
.line 44
|
|
invoke-direct {p0, p1, p2, p3}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
|
|
.line 28
|
|
new-instance p2, Ljava/util/HashMap;
|
|
|
|
invoke-direct {p2}, Ljava/util/HashMap;-><init>()V
|
|
|
|
iput-object p2, p0, Lcom/moji/newliveview/detail/LableView;->c:Ljava/util/HashMap;
|
|
|
|
.line 45
|
|
invoke-direct {p0, p1}, Lcom/moji/newliveview/detail/LableView;->a(Landroid/content/Context;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private a(Landroid/content/Context;)V
|
|
.locals 2
|
|
|
|
.line 49
|
|
iput-object p1, p0, Lcom/moji/newliveview/detail/LableView;->b:Landroid/content/Context;
|
|
|
|
.line 50
|
|
new-instance v0, Landroid/widget/ImageView;
|
|
|
|
invoke-direct {v0, p1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V
|
|
|
|
iput-object v0, p0, Lcom/moji/newliveview/detail/LableView;->a:Landroid/widget/ImageView;
|
|
|
|
.line 51
|
|
iget-object p1, p0, Lcom/moji/newliveview/detail/LableView;->a:Landroid/widget/ImageView;
|
|
|
|
sget-object v0, Landroid/widget/ImageView$ScaleType;->CENTER_CROP:Landroid/widget/ImageView$ScaleType;
|
|
|
|
invoke-virtual {p1, v0}, Landroid/widget/ImageView;->setScaleType(Landroid/widget/ImageView$ScaleType;)V
|
|
|
|
.line 52
|
|
iget-object p1, p0, Lcom/moji/newliveview/detail/LableView;->a:Landroid/widget/ImageView;
|
|
|
|
const/4 v0, 0x1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {p1, v0, v1}, Landroid/widget/ImageView;->setLayerType(ILandroid/graphics/Paint;)V
|
|
|
|
.line 53
|
|
new-instance p1, Landroid/widget/RelativeLayout$LayoutParams;
|
|
|
|
const/4 v0, -0x1
|
|
|
|
invoke-direct {p1, v0, v0}, Landroid/widget/RelativeLayout$LayoutParams;-><init>(II)V
|
|
|
|
.line 54
|
|
iget-object v0, p0, Lcom/moji/newliveview/detail/LableView;->a:Landroid/widget/ImageView;
|
|
|
|
invoke-virtual {p0, v0, p1}, Lcom/moji/newliveview/detail/LableView;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private b()V
|
|
.locals 4
|
|
|
|
.line 99
|
|
iget v0, p0, Lcom/moji/newliveview/detail/LableView;->d:I
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
iget v0, p0, Lcom/moji/newliveview/detail/LableView;->e:I
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
iget-object v0, p0, Lcom/moji/newliveview/detail/LableView;->c:Ljava/util/HashMap;
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
iget-object v0, p0, Lcom/moji/newliveview/detail/LableView;->c:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {v0}, Ljava/util/HashMap;->size()I
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 102
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/moji/newliveview/detail/LableView;->c:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {v0}, Ljava/util/HashMap;->entrySet()Ljava/util/Set;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_0
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/util/Map$Entry;
|
|
|
|
.line 103
|
|
invoke-interface {v1}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
.line 106
|
|
:cond_1
|
|
invoke-interface {v1}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lcom/moji/http/snsforum/entity/Label;
|
|
|
|
.line 107
|
|
new-instance v2, Lcom/moji/newliveview/camera/view/Lable;
|
|
|
|
iget-object v3, p0, Lcom/moji/newliveview/detail/LableView;->b:Landroid/content/Context;
|
|
|
|
invoke-direct {v2, v3}, Lcom/moji/newliveview/camera/view/Lable;-><init>(Landroid/content/Context;)V
|
|
|
|
const/4 v3, 0x1
|
|
|
|
.line 108
|
|
invoke-virtual {v2, v3}, Lcom/moji/newliveview/camera/view/Lable;->setPinned(Z)V
|
|
|
|
.line 109
|
|
iget-object v3, v1, Lcom/moji/http/snsforum/entity/Label;->tag_name:Ljava/lang/String;
|
|
|
|
invoke-virtual {v2, v3}, Lcom/moji/newliveview/camera/view/Lable;->setText(Ljava/lang/String;)V
|
|
|
|
const/high16 v3, -0x40800000 # -1.0f
|
|
|
|
.line 110
|
|
iput v3, v2, Lcom/moji/newliveview/camera/view/Lable;->a:F
|
|
|
|
.line 111
|
|
iput v3, v2, Lcom/moji/newliveview/camera/view/Lable;->b:F
|
|
|
|
.line 112
|
|
iget-object v3, p0, Lcom/moji/newliveview/detail/LableView;->c:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {v3, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.line 113
|
|
invoke-virtual {p0, v2}, Lcom/moji/newliveview/detail/LableView;->addView(Landroid/view/View;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
return-void
|
|
|
|
:cond_3
|
|
:goto_1
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public a()V
|
|
.locals 4
|
|
|
|
.line 58
|
|
new-instance v0, Landroid/widget/ImageView;
|
|
|
|
invoke-virtual {p0}, Lcom/moji/newliveview/detail/LableView;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V
|
|
|
|
.line 59
|
|
sget-object v1, Landroid/widget/ImageView$ScaleType;->CENTER_CROP:Landroid/widget/ImageView$ScaleType;
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setScaleType(Landroid/widget/ImageView$ScaleType;)V
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
.line 60
|
|
invoke-virtual {v0, v1, v2}, Landroid/widget/ImageView;->setLayerType(ILandroid/graphics/Paint;)V
|
|
|
|
.line 61
|
|
new-instance v1, Landroid/widget/RelativeLayout$LayoutParams;
|
|
|
|
const/4 v2, -0x2
|
|
|
|
invoke-direct {v1, v2, v2}, Landroid/widget/RelativeLayout$LayoutParams;-><init>(II)V
|
|
|
|
const/4 v2, -0x1
|
|
|
|
const/16 v3, 0xb
|
|
|
|
.line 62
|
|
invoke-virtual {v1, v3, v2}, Landroid/widget/RelativeLayout$LayoutParams;->addRule(II)V
|
|
|
|
const/16 v3, 0xc
|
|
|
|
.line 63
|
|
invoke-virtual {v1, v3, v2}, Landroid/widget/RelativeLayout$LayoutParams;->addRule(II)V
|
|
|
|
const/high16 v2, 0x41200000 # 10.0f
|
|
|
|
.line 64
|
|
invoke-static {v2}, Lcom/moji/tool/DeviceTool;->a(F)I
|
|
|
|
move-result v3
|
|
|
|
iput v3, v1, Landroid/widget/RelativeLayout$LayoutParams;->bottomMargin:I
|
|
|
|
.line 65
|
|
invoke-static {v2}, Lcom/moji/tool/DeviceTool;->a(F)I
|
|
|
|
move-result v2
|
|
|
|
iput v2, v1, Landroid/widget/RelativeLayout$LayoutParams;->rightMargin:I
|
|
|
|
.line 66
|
|
invoke-virtual {p0, v0, v1}, Lcom/moji/newliveview/detail/LableView;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V
|
|
|
|
.line 67
|
|
sget v1, Lcom/moji/newliveview/R$drawable;->activity_picture_detail_tag_hot:I
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setImageResource(I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public a(Ljava/util/ArrayList;)V
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/ArrayList<",
|
|
"Lcom/moji/http/snsforum/entity/PictureDetail$PictureLable;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
.line 71
|
|
invoke-virtual {p1}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 74
|
|
:cond_0
|
|
invoke-virtual {p1}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_0
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/moji/http/snsforum/entity/PictureDetail$PictureLable;
|
|
|
|
.line 75
|
|
iget-object v1, v0, Lcom/moji/http/snsforum/entity/PictureDetail$PictureLable;->tag_name:Ljava/lang/String;
|
|
|
|
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
.line 78
|
|
:cond_1
|
|
new-instance v1, Lcom/moji/http/snsforum/entity/Label;
|
|
|
|
invoke-direct {v1}, Lcom/moji/http/snsforum/entity/Label;-><init>()V
|
|
|
|
.line 79
|
|
iget-object v2, v0, Lcom/moji/http/snsforum/entity/PictureDetail$PictureLable;->tag_name:Ljava/lang/String;
|
|
|
|
iput-object v2, v1, Lcom/moji/http/snsforum/entity/Label;->tag_name:Ljava/lang/String;
|
|
|
|
.line 80
|
|
iget v2, v0, Lcom/moji/http/snsforum/entity/PictureDetail$PictureLable;->tag_x:F
|
|
|
|
iput v2, v1, Lcom/moji/http/snsforum/entity/Label;->tag_x:F
|
|
|
|
.line 81
|
|
iget v0, v0, Lcom/moji/http/snsforum/entity/PictureDetail$PictureLable;->tag_y:F
|
|
|
|
iput v0, v1, Lcom/moji/http/snsforum/entity/Label;->tag_y:F
|
|
|
|
.line 82
|
|
iget-object v0, p0, Lcom/moji/newliveview/detail/LableView;->c:Ljava/util/HashMap;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto :goto_0
|
|
|
|
.line 84
|
|
:cond_2
|
|
invoke-direct {p0}, Lcom/moji/newliveview/detail/LableView;->b()V
|
|
|
|
return-void
|
|
|
|
:cond_3
|
|
:goto_1
|
|
return-void
|
|
.end method
|
|
|
|
.method protected onLayout(ZIIII)V
|
|
.locals 3
|
|
|
|
.line 119
|
|
invoke-super/range {p0 .. p5}, Landroid/widget/RelativeLayout;->onLayout(ZIIII)V
|
|
|
|
.line 120
|
|
iget-object p1, p0, Lcom/moji/newliveview/detail/LableView;->c:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {p1}, Ljava/util/HashMap;->entrySet()Ljava/util/Set;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-interface {p1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:cond_0
|
|
:goto_0
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result p2
|
|
|
|
if-eqz p2, :cond_7
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p2, Ljava/util/Map$Entry;
|
|
|
|
.line 121
|
|
invoke-interface {p2}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
|
|
|
move-result-object p3
|
|
|
|
check-cast p3, Lcom/moji/newliveview/camera/view/Lable;
|
|
|
|
if-nez p3, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
.line 125
|
|
:cond_1
|
|
iget p4, p3, Lcom/moji/newliveview/camera/view/Lable;->a:F
|
|
|
|
const/high16 p5, -0x40800000 # -1.0f
|
|
|
|
cmpl-float p4, p4, p5
|
|
|
|
if-eqz p4, :cond_2
|
|
|
|
iget p4, p3, Lcom/moji/newliveview/camera/view/Lable;->b:F
|
|
|
|
cmpl-float p4, p4, p5
|
|
|
|
if-nez p4, :cond_0
|
|
|
|
.line 126
|
|
:cond_2
|
|
invoke-interface {p2}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p2, Lcom/moji/http/snsforum/entity/Label;
|
|
|
|
.line 127
|
|
iget p4, p2, Lcom/moji/http/snsforum/entity/Label;->tag_x:F
|
|
|
|
iget p5, p0, Lcom/moji/newliveview/detail/LableView;->d:I
|
|
|
|
int-to-float p5, p5
|
|
|
|
mul-float p4, p4, p5
|
|
|
|
.line 128
|
|
iget p2, p2, Lcom/moji/http/snsforum/entity/Label;->tag_y:F
|
|
|
|
iget p5, p0, Lcom/moji/newliveview/detail/LableView;->e:I
|
|
|
|
int-to-float p5, p5
|
|
|
|
mul-float p2, p2, p5
|
|
|
|
.line 129
|
|
iget p5, p0, Lcom/moji/newliveview/detail/LableView;->d:I
|
|
|
|
invoke-virtual {p3}, Lcom/moji/newliveview/camera/view/Lable;->getWidth()I
|
|
|
|
move-result v0
|
|
|
|
sub-int/2addr p5, v0
|
|
|
|
.line 130
|
|
iget v0, p0, Lcom/moji/newliveview/detail/LableView;->e:I
|
|
|
|
invoke-virtual {p3}, Lcom/moji/newliveview/camera/view/Lable;->getHeight()I
|
|
|
|
move-result v1
|
|
|
|
sub-int/2addr v0, v1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
cmpg-float v2, p4, v1
|
|
|
|
if-gez v2, :cond_3
|
|
|
|
const/4 p4, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
int-to-float p5, p5
|
|
|
|
cmpl-float v2, p4, p5
|
|
|
|
if-lez v2, :cond_4
|
|
|
|
move p4, p5
|
|
|
|
:cond_4
|
|
:goto_1
|
|
cmpg-float p5, p2, v1
|
|
|
|
if-gez p5, :cond_5
|
|
|
|
const/4 p2, 0x0
|
|
|
|
goto :goto_2
|
|
|
|
:cond_5
|
|
int-to-float p5, v0
|
|
|
|
cmpl-float v0, p2, p5
|
|
|
|
if-lez v0, :cond_6
|
|
|
|
move p2, p5
|
|
|
|
.line 133
|
|
:cond_6
|
|
:goto_2
|
|
invoke-virtual {p3, p4}, Lcom/moji/newliveview/camera/view/Lable;->setX(F)V
|
|
|
|
.line 134
|
|
invoke-virtual {p3, p2}, Lcom/moji/newliveview/camera/view/Lable;->setY(F)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_7
|
|
return-void
|
|
.end method
|
|
|
|
.method protected onSizeChanged(IIII)V
|
|
.locals 0
|
|
|
|
.line 89
|
|
invoke-virtual {p0}, Lcom/moji/newliveview/detail/LableView;->getWidth()I
|
|
|
|
move-result p1
|
|
|
|
iput p1, p0, Lcom/moji/newliveview/detail/LableView;->d:I
|
|
|
|
.line 90
|
|
invoke-virtual {p0}, Lcom/moji/newliveview/detail/LableView;->getHeight()I
|
|
|
|
move-result p1
|
|
|
|
iput p1, p0, Lcom/moji/newliveview/detail/LableView;->e:I
|
|
|
|
.line 91
|
|
invoke-direct {p0}, Lcom/moji/newliveview/detail/LableView;->b()V
|
|
|
|
return-void
|
|
.end method
|