518 lines
15 KiB
Smali
518 lines
15 KiB
Smali
.class public Lcom/moji/newliveview/camera/activity/EditLableFragment;
|
|
.super Lcom/moji/base/MJFragment;
|
|
.source "EditLableFragment.java"
|
|
|
|
# interfaces
|
|
.implements Landroid/view/View$OnClickListener;
|
|
.implements Lcom/moji/newliveview/camera/view/LableContainer$OnLableTouchListener;
|
|
|
|
|
|
# instance fields
|
|
.field private b:Landroid/view/View;
|
|
|
|
.field private c:Landroid/view/View;
|
|
|
|
.field private d:Landroid/widget/ImageView;
|
|
|
|
.field private e:Lcom/moji/newliveview/camera/view/LableContainer;
|
|
|
|
.field private f:Lcom/moji/newliveview/camera/model/LiveViewItem;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 34
|
|
invoke-direct {p0}, Lcom/moji/base/MJFragment;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static synthetic a(Lcom/moji/newliveview/camera/activity/EditLableFragment;)Landroid/widget/ImageView;
|
|
.locals 0
|
|
|
|
.line 34
|
|
iget-object p0, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->d:Landroid/widget/ImageView;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private a(Landroid/os/Bundle;)V
|
|
.locals 2
|
|
|
|
const-string v0, "extra_image_item"
|
|
|
|
.line 71
|
|
invoke-virtual {p1, v0}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Lcom/moji/newliveview/camera/model/LiveViewItem;
|
|
|
|
iput-object p1, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->f:Lcom/moji/newliveview/camera/model/LiveViewItem;
|
|
|
|
.line 72
|
|
iget-object p1, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->f:Lcom/moji/newliveview/camera/model/LiveViewItem;
|
|
|
|
iget p1, p1, Lcom/moji/newliveview/camera/model/LiveViewItem;->width:I
|
|
|
|
int-to-float p1, p1
|
|
|
|
const/high16 v0, 0x3f800000 # 1.0f
|
|
|
|
mul-float p1, p1, v0
|
|
|
|
iget-object v0, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->f:Lcom/moji/newliveview/camera/model/LiveViewItem;
|
|
|
|
iget v0, v0, Lcom/moji/newliveview/camera/model/LiveViewItem;->height:I
|
|
|
|
int-to-float v0, v0
|
|
|
|
div-float/2addr p1, v0
|
|
|
|
const/high16 v0, 0x3f000000 # 0.5f
|
|
|
|
cmpl-float v0, p1, v0
|
|
|
|
if-ltz v0, :cond_0
|
|
|
|
const/high16 v0, 0x40000000 # 2.0f
|
|
|
|
cmpg-float p1, p1, v0
|
|
|
|
if-gtz p1, :cond_0
|
|
|
|
.line 74
|
|
iget-object p1, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->e:Lcom/moji/newliveview/camera/view/LableContainer;
|
|
|
|
invoke-virtual {p1}, Lcom/moji/newliveview/camera/view/LableContainer;->a()V
|
|
|
|
.line 76
|
|
:cond_0
|
|
invoke-virtual {p0}, Lcom/moji/newliveview/camera/activity/EditLableFragment;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p1}, Lcom/squareup/picasso/Picasso;->a(Landroid/content/Context;)Lcom/squareup/picasso/Picasso;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "file://"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v1, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->f:Lcom/moji/newliveview/camera/model/LiveViewItem;
|
|
|
|
iget-object v1, v1, Lcom/moji/newliveview/camera/model/LiveViewItem;->originalUri:Landroid/net/Uri;
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
.line 77
|
|
invoke-virtual {p1, v0}, Lcom/squareup/picasso/Picasso;->a(Ljava/lang/String;)Lcom/squareup/picasso/RequestCreator;
|
|
|
|
move-result-object p1
|
|
|
|
sget-object v0, Landroid/graphics/Bitmap$Config;->RGB_565:Landroid/graphics/Bitmap$Config;
|
|
|
|
.line 78
|
|
invoke-virtual {p1, v0}, Lcom/squareup/picasso/RequestCreator;->a(Landroid/graphics/Bitmap$Config;)Lcom/squareup/picasso/RequestCreator;
|
|
|
|
move-result-object p1
|
|
|
|
.line 79
|
|
invoke-virtual {p1}, Lcom/squareup/picasso/RequestCreator;->g()Lcom/squareup/picasso/RequestCreator;
|
|
|
|
move-result-object p1
|
|
|
|
.line 80
|
|
invoke-virtual {p1}, Lcom/squareup/picasso/RequestCreator;->b()Lcom/squareup/picasso/RequestCreator;
|
|
|
|
move-result-object p1
|
|
|
|
iget-object v0, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->d:Landroid/widget/ImageView;
|
|
|
|
new-instance v1, Lcom/moji/newliveview/camera/activity/EditLableFragment$1;
|
|
|
|
invoke-direct {v1, p0}, Lcom/moji/newliveview/camera/activity/EditLableFragment$1;-><init>(Lcom/moji/newliveview/camera/activity/EditLableFragment;)V
|
|
|
|
.line 81
|
|
invoke-virtual {p1, v0, v1}, Lcom/squareup/picasso/RequestCreator;->a(Landroid/widget/ImageView;Lcom/squareup/picasso/Callback;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private a(Landroid/view/View;)V
|
|
.locals 1
|
|
|
|
.line 60
|
|
sget v0, Lcom/moji/newliveview/R$id;->fl_layout:I
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->c:Landroid/view/View;
|
|
|
|
.line 61
|
|
sget v0, Lcom/moji/newliveview/R$id;->image:I
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/widget/ImageView;
|
|
|
|
iput-object v0, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->d:Landroid/widget/ImageView;
|
|
|
|
.line 62
|
|
sget v0, Lcom/moji/newliveview/R$id;->lable_layout:I
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Lcom/moji/newliveview/camera/view/LableContainer;
|
|
|
|
iput-object p1, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->e:Lcom/moji/newliveview/camera/view/LableContainer;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static synthetic b(Lcom/moji/newliveview/camera/activity/EditLableFragment;)Landroid/view/View;
|
|
.locals 0
|
|
|
|
.line 34
|
|
iget-object p0, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->c:Landroid/view/View;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private d()V
|
|
.locals 1
|
|
|
|
.line 66
|
|
iget-object v0, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->e:Lcom/moji/newliveview/camera/view/LableContainer;
|
|
|
|
invoke-virtual {v0, p0}, Lcom/moji/newliveview/camera/view/LableContainer;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
.line 67
|
|
iget-object v0, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->e:Lcom/moji/newliveview/camera/view/LableContainer;
|
|
|
|
invoke-virtual {v0, p0}, Lcom/moji/newliveview/camera/view/LableContainer;->setOnLableTouchListener(Lcom/moji/newliveview/camera/view/LableContainer$OnLableTouchListener;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public a()V
|
|
.locals 2
|
|
|
|
.line 143
|
|
iget-object v0, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->f:Lcom/moji/newliveview/camera/model/LiveViewItem;
|
|
|
|
iget-object v1, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->e:Lcom/moji/newliveview/camera/view/LableContainer;
|
|
|
|
invoke-virtual {v1}, Lcom/moji/newliveview/camera/view/LableContainer;->b()Ljava/util/ArrayList;
|
|
|
|
move-result-object v1
|
|
|
|
iput-object v1, v0, Lcom/moji/newliveview/camera/model/LiveViewItem;->labels:Ljava/util/ArrayList;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public b()V
|
|
.locals 2
|
|
|
|
.line 148
|
|
invoke-virtual {p0}, Lcom/moji/newliveview/camera/activity/EditLableFragment;->getActivity()Landroid/support/v4/app/FragmentActivity;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 149
|
|
instance-of v1, v0, Lcom/moji/newliveview/camera/activity/EditLableActivity;
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
.line 150
|
|
check-cast v0, Lcom/moji/newliveview/camera/activity/EditLableActivity;
|
|
|
|
.line 151
|
|
new-instance v1, Lcom/moji/newliveview/camera/activity/EditLableFragment$2;
|
|
|
|
invoke-direct {v1, p0}, Lcom/moji/newliveview/camera/activity/EditLableFragment$2;-><init>(Lcom/moji/newliveview/camera/activity/EditLableFragment;)V
|
|
|
|
invoke-virtual {v0, v1}, Lcom/moji/newliveview/camera/activity/EditLableActivity;->hideTitleAndIndicator(Ljava/lang/Runnable;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public c()V
|
|
.locals 3
|
|
|
|
.line 165
|
|
invoke-virtual {p0}, Lcom/moji/newliveview/camera/activity/EditLableFragment;->getActivity()Landroid/support/v4/app/FragmentActivity;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 166
|
|
instance-of v1, v0, Lcom/moji/newliveview/camera/activity/EditLableActivity;
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
.line 167
|
|
check-cast v0, Lcom/moji/newliveview/camera/activity/EditLableActivity;
|
|
|
|
.line 168
|
|
invoke-virtual {v0}, Lcom/moji/newliveview/camera/activity/EditLableActivity;->showTitleAndIndicator()V
|
|
|
|
.line 169
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v1, 0x13
|
|
|
|
if-ge v0, v1, :cond_0
|
|
|
|
.line 170
|
|
iget-object v0, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->c:Landroid/view/View;
|
|
|
|
invoke-virtual {v0}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/widget/LinearLayout$LayoutParams;
|
|
|
|
.line 171
|
|
iget v1, v0, Landroid/widget/LinearLayout$LayoutParams;->topMargin:I
|
|
|
|
invoke-static {}, Lcom/moji/tool/DeviceTool;->d()I
|
|
|
|
move-result v2
|
|
|
|
sub-int/2addr v1, v2
|
|
|
|
iput v1, v0, Landroid/widget/LinearLayout$LayoutParams;->topMargin:I
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public onActivityResult(IILandroid/content/Intent;)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x2
|
|
|
|
if-ne p1, v0, :cond_1
|
|
|
|
const/4 p1, -0x1
|
|
|
|
if-ne p2, p1, :cond_1
|
|
|
|
const-string p1, "extra_data"
|
|
|
|
.line 132
|
|
invoke-virtual {p3, p1}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
.line 133
|
|
iget-object p2, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->e:Lcom/moji/newliveview/camera/view/LableContainer;
|
|
|
|
invoke-virtual {p2, p1}, Lcom/moji/newliveview/camera/view/LableContainer;->b(Ljava/lang/String;)Z
|
|
|
|
move-result p2
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
.line 134
|
|
sget p1, Lcom/moji/newliveview/R$string;->cant_add_same_lable:I
|
|
|
|
invoke-static {p1}, Lcom/moji/tool/ToastTool;->a(I)V
|
|
|
|
goto :goto_0
|
|
|
|
.line 136
|
|
:cond_0
|
|
iget-object p2, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->e:Lcom/moji/newliveview/camera/view/LableContainer;
|
|
|
|
invoke-virtual {p2, p1}, Lcom/moji/newliveview/camera/view/LableContainer;->a(Ljava/lang/String;)V
|
|
|
|
:cond_1
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public onClick(Landroid/view/View;)V
|
|
.locals 2
|
|
|
|
.line 112
|
|
invoke-static {}, Lcom/moji/tool/Utils;->b()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 115
|
|
:cond_0
|
|
invoke-virtual {p1}, Landroid/view/View;->getId()I
|
|
|
|
move-result p1
|
|
|
|
.line 116
|
|
sget v0, Lcom/moji/newliveview/R$id;->lable_layout:I
|
|
|
|
if-ne p1, v0, :cond_3
|
|
|
|
.line 117
|
|
iget-object p1, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->f:Lcom/moji/newliveview/camera/model/LiveViewItem;
|
|
|
|
iget p1, p1, Lcom/moji/newliveview/camera/model/LiveViewItem;->width:I
|
|
|
|
int-to-float p1, p1
|
|
|
|
const/high16 v0, 0x3f800000 # 1.0f
|
|
|
|
mul-float p1, p1, v0
|
|
|
|
iget-object v0, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->f:Lcom/moji/newliveview/camera/model/LiveViewItem;
|
|
|
|
iget v0, v0, Lcom/moji/newliveview/camera/model/LiveViewItem;->height:I
|
|
|
|
int-to-float v0, v0
|
|
|
|
div-float/2addr p1, v0
|
|
|
|
const/high16 v0, 0x3f000000 # 0.5f
|
|
|
|
cmpg-float v0, p1, v0
|
|
|
|
if-ltz v0, :cond_2
|
|
|
|
const/high16 v0, 0x40000000 # 2.0f
|
|
|
|
cmpl-float p1, p1, v0
|
|
|
|
if-lez p1, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
.line 122
|
|
:cond_1
|
|
new-instance p1, Landroid/content/Intent;
|
|
|
|
invoke-virtual {p0}, Lcom/moji/newliveview/camera/activity/EditLableFragment;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
const-class v1, Lcom/moji/newliveview/camera/activity/InputLableTextActivity;
|
|
|
|
invoke-direct {p1, v0, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
|
|
|
|
const/4 v0, 0x2
|
|
|
|
.line 123
|
|
invoke-virtual {p0, p1, v0}, Lcom/moji/newliveview/camera/activity/EditLableFragment;->startActivityForResult(Landroid/content/Intent;I)V
|
|
|
|
.line 124
|
|
invoke-static {}, Lcom/moji/statistics/EventManager;->a()Lcom/moji/statistics/EventManager;
|
|
|
|
move-result-object p1
|
|
|
|
sget-object v0, Lcom/moji/statistics/EVENT_TAG;->NEWLIVEVIEW_LABEL_CLICK:Lcom/moji/statistics/EVENT_TAG;
|
|
|
|
const-string v1, "3"
|
|
|
|
invoke-virtual {p1, v0, v1}, Lcom/moji/statistics/EventManager;->a(Lcom/moji/statistics/EVENT_TAG;Ljava/lang/String;)Lcom/moji/statistics/EventManager;
|
|
|
|
goto :goto_1
|
|
|
|
.line 119
|
|
:cond_2
|
|
:goto_0
|
|
sget p1, Lcom/moji/newliveview/R$string;->picture_too_large_cant_add_lable:I
|
|
|
|
invoke-static {p1}, Lcom/moji/tool/ToastTool;->a(I)V
|
|
|
|
return-void
|
|
|
|
:cond_3
|
|
:goto_1
|
|
return-void
|
|
.end method
|
|
|
|
.method public onCreateView(Landroid/view/LayoutInflater;Landroid/view/ViewGroup;Landroid/os/Bundle;)Landroid/view/View;
|
|
.locals 2
|
|
.param p2 # Landroid/view/ViewGroup;
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.param p3 # Landroid/os/Bundle;
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroid/support/annotation/Nullable;
|
|
.end annotation
|
|
|
|
.line 46
|
|
invoke-virtual {p0}, Lcom/moji/newliveview/camera/activity/EditLableFragment;->getArguments()Landroid/os/Bundle;
|
|
|
|
move-result-object p3
|
|
|
|
if-nez p3, :cond_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
return-object p1
|
|
|
|
.line 50
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->b:Landroid/view/View;
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
.line 51
|
|
sget v0, Lcom/moji/newliveview/R$layout;->fragment_edit_lable:I
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {p1, v0, p2, v1}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->b:Landroid/view/View;
|
|
|
|
.line 52
|
|
iget-object p1, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->b:Landroid/view/View;
|
|
|
|
invoke-direct {p0, p1}, Lcom/moji/newliveview/camera/activity/EditLableFragment;->a(Landroid/view/View;)V
|
|
|
|
.line 53
|
|
invoke-direct {p0}, Lcom/moji/newliveview/camera/activity/EditLableFragment;->d()V
|
|
|
|
.line 54
|
|
invoke-direct {p0, p3}, Lcom/moji/newliveview/camera/activity/EditLableFragment;->a(Landroid/os/Bundle;)V
|
|
|
|
.line 56
|
|
:cond_1
|
|
iget-object p1, p0, Lcom/moji/newliveview/camera/activity/EditLableFragment;->b:Landroid/view/View;
|
|
|
|
return-object p1
|
|
.end method
|