608 lines
14 KiB
Smali
608 lines
14 KiB
Smali
.class public Lcom/moji/newliveview/camera/view/Lable;
|
|
.super Landroid/widget/LinearLayout;
|
|
.source "Lable.java"
|
|
|
|
|
|
# instance fields
|
|
.field public a:F
|
|
|
|
.field public b:F
|
|
|
|
.field public c:Ljava/lang/String;
|
|
|
|
.field private d:Landroid/content/Context;
|
|
|
|
.field private e:Z
|
|
|
|
.field private f:I
|
|
|
|
.field private g:Landroid/widget/TextView;
|
|
|
|
.field private h:Landroid/widget/ImageView;
|
|
|
|
.field private i:I
|
|
|
|
.field private j:I
|
|
|
|
.field private k:F
|
|
|
|
.field private l:F
|
|
|
|
.field private m:F
|
|
|
|
.field private n:F
|
|
|
|
.field private o:J
|
|
|
|
.field private p:Landroid/view/View$OnClickListener;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;)V
|
|
.locals 0
|
|
|
|
.line 37
|
|
invoke-direct {p0, p1}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V
|
|
|
|
.line 38
|
|
invoke-direct {p0, p1}, Lcom/moji/newliveview/camera/view/Lable;->a(Landroid/content/Context;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
.locals 0
|
|
|
|
.line 42
|
|
invoke-direct {p0, p1, p2}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
.line 43
|
|
invoke-direct {p0, p1}, Lcom/moji/newliveview/camera/view/Lable;->a(Landroid/content/Context;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
.locals 0
|
|
|
|
.line 47
|
|
invoke-direct {p0, p1, p2, p3}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
|
|
.line 48
|
|
invoke-direct {p0, p1}, Lcom/moji/newliveview/camera/view/Lable;->a(Landroid/content/Context;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private a()V
|
|
.locals 3
|
|
|
|
const/high16 v0, 0x41a00000 # 20.0f
|
|
|
|
.line 69
|
|
invoke-static {v0}, Lcom/moji/tool/DeviceTool;->a(F)I
|
|
|
|
move-result v0
|
|
|
|
const/high16 v1, 0x41700000 # 15.0f
|
|
|
|
.line 70
|
|
invoke-static {v1}, Lcom/moji/tool/DeviceTool;->a(F)I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
.line 71
|
|
invoke-virtual {p0, v2, v1, v0, v0}, Lcom/moji/newliveview/camera/view/Lable;->setPadding(IIII)V
|
|
|
|
.line 72
|
|
new-instance v0, Landroid/widget/ImageView;
|
|
|
|
iget-object v1, p0, Lcom/moji/newliveview/camera/view/Lable;->d:Landroid/content/Context;
|
|
|
|
invoke-direct {v0, v1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V
|
|
|
|
iput-object v0, p0, Lcom/moji/newliveview/camera/view/Lable;->h:Landroid/widget/ImageView;
|
|
|
|
.line 73
|
|
new-instance v0, Landroid/widget/TextView;
|
|
|
|
iget-object v1, p0, Lcom/moji/newliveview/camera/view/Lable;->d:Landroid/content/Context;
|
|
|
|
invoke-direct {v0, v1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V
|
|
|
|
iput-object v0, p0, Lcom/moji/newliveview/camera/view/Lable;->g:Landroid/widget/TextView;
|
|
|
|
.line 74
|
|
sget v0, Lcom/moji/newliveview/R$drawable;->lable_piont_animation_drawable:I
|
|
|
|
invoke-static {v0}, Lcom/moji/tool/DeviceTool;->c(I)Landroid/graphics/drawable/Drawable;
|
|
|
|
move-result-object v0
|
|
|
|
.line 75
|
|
iget-object v1, p0, Lcom/moji/newliveview/camera/view/Lable;->h:Landroid/widget/ImageView;
|
|
|
|
invoke-virtual {v1, v0}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V
|
|
|
|
.line 76
|
|
check-cast v0, Landroid/graphics/drawable/AnimationDrawable;
|
|
|
|
invoke-virtual {v0}, Landroid/graphics/drawable/AnimationDrawable;->start()V
|
|
|
|
.line 77
|
|
iget-object v0, p0, Lcom/moji/newliveview/camera/view/Lable;->g:Landroid/widget/TextView;
|
|
|
|
sget v1, Lcom/moji/newliveview/R$drawable;->lable_background_selector:I
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setBackgroundResource(I)V
|
|
|
|
const/high16 v0, 0x41000000 # 8.0f
|
|
|
|
.line 78
|
|
invoke-static {v0}, Lcom/moji/tool/DeviceTool;->a(F)I
|
|
|
|
move-result v0
|
|
|
|
const/high16 v1, 0x40000000 # 2.0f
|
|
|
|
.line 79
|
|
invoke-static {v1}, Lcom/moji/tool/DeviceTool;->a(F)I
|
|
|
|
move-result v1
|
|
|
|
.line 80
|
|
iget-object v2, p0, Lcom/moji/newliveview/camera/view/Lable;->g:Landroid/widget/TextView;
|
|
|
|
invoke-virtual {v2, v0, v1, v0, v1}, Landroid/widget/TextView;->setPadding(IIII)V
|
|
|
|
.line 81
|
|
iget-object v0, p0, Lcom/moji/newliveview/camera/view/Lable;->g:Landroid/widget/TextView;
|
|
|
|
const/16 v1, 0x11
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setGravity(I)V
|
|
|
|
.line 82
|
|
iget-object v0, p0, Lcom/moji/newliveview/camera/view/Lable;->g:Landroid/widget/TextView;
|
|
|
|
const/high16 v1, 0x42e60000 # 115.0f
|
|
|
|
invoke-static {v1}, Lcom/moji/tool/DeviceTool;->a(F)I
|
|
|
|
move-result v1
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setMaxWidth(I)V
|
|
|
|
.line 83
|
|
iget-object v0, p0, Lcom/moji/newliveview/camera/view/Lable;->g:Landroid/widget/TextView;
|
|
|
|
invoke-virtual {v0}, Landroid/widget/TextView;->setSingleLine()V
|
|
|
|
.line 84
|
|
iget-object v0, p0, Lcom/moji/newliveview/camera/view/Lable;->g:Landroid/widget/TextView;
|
|
|
|
sget-object v1, Landroid/text/TextUtils$TruncateAt;->END:Landroid/text/TextUtils$TruncateAt;
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setEllipsize(Landroid/text/TextUtils$TruncateAt;)V
|
|
|
|
.line 85
|
|
iget-object v0, p0, Lcom/moji/newliveview/camera/view/Lable;->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 86
|
|
iget-object v0, p0, Lcom/moji/newliveview/camera/view/Lable;->g:Landroid/widget/TextView;
|
|
|
|
const/4 v1, -0x1
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setTextColor(I)V
|
|
|
|
.line 87
|
|
iget-object v0, p0, Lcom/moji/newliveview/camera/view/Lable;->g:Landroid/widget/TextView;
|
|
|
|
iget-object v1, p0, Lcom/moji/newliveview/camera/view/Lable;->c:Ljava/lang/String;
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
.line 88
|
|
new-instance v0, Landroid/widget/LinearLayout$LayoutParams;
|
|
|
|
const/4 v1, -0x2
|
|
|
|
invoke-direct {v0, v1, v1}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V
|
|
|
|
const/16 v1, 0x10
|
|
|
|
.line 89
|
|
iput v1, v0, Landroid/widget/LinearLayout$LayoutParams;->gravity:I
|
|
|
|
.line 90
|
|
iget-object v1, p0, Lcom/moji/newliveview/camera/view/Lable;->h:Landroid/widget/ImageView;
|
|
|
|
invoke-virtual {p0, v1, v0}, Lcom/moji/newliveview/camera/view/Lable;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V
|
|
|
|
.line 91
|
|
iget-object v1, p0, Lcom/moji/newliveview/camera/view/Lable;->g:Landroid/widget/TextView;
|
|
|
|
invoke-virtual {p0, v1, v0}, Lcom/moji/newliveview/camera/view/Lable;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private a(Landroid/content/Context;)V
|
|
.locals 0
|
|
|
|
.line 52
|
|
iput-object p1, p0, Lcom/moji/newliveview/camera/view/Lable;->d:Landroid/content/Context;
|
|
|
|
.line 53
|
|
invoke-virtual {p0}, Lcom/moji/newliveview/camera/view/Lable;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p1}, Landroid/view/ViewConfiguration;->get(Landroid/content/Context;)Landroid/view/ViewConfiguration;
|
|
|
|
move-result-object p1
|
|
|
|
.line 54
|
|
invoke-virtual {p1}, Landroid/view/ViewConfiguration;->getScaledTouchSlop()I
|
|
|
|
move-result p1
|
|
|
|
iput p1, p0, Lcom/moji/newliveview/camera/view/Lable;->f:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method protected onAttachedToWindow()V
|
|
.locals 2
|
|
|
|
.line 59
|
|
invoke-super {p0}, Landroid/widget/LinearLayout;->onAttachedToWindow()V
|
|
|
|
.line 60
|
|
iget-object v0, p0, Lcom/moji/newliveview/camera/view/Lable;->g:Landroid/widget/TextView;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 61
|
|
invoke-direct {p0}, Lcom/moji/newliveview/camera/view/Lable;->a()V
|
|
|
|
.line 63
|
|
:cond_0
|
|
invoke-virtual {p0}, Lcom/moji/newliveview/camera/view/Lable;->getParent()Landroid/view/ViewParent;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/view/ViewGroup;
|
|
|
|
.line 64
|
|
invoke-virtual {v0}, Landroid/view/ViewGroup;->getWidth()I
|
|
|
|
move-result v1
|
|
|
|
iput v1, p0, Lcom/moji/newliveview/camera/view/Lable;->i:I
|
|
|
|
.line 65
|
|
invoke-virtual {v0}, Landroid/view/ViewGroup;->getHeight()I
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Lcom/moji/newliveview/camera/view/Lable;->j:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
|
|
.locals 7
|
|
|
|
.line 99
|
|
iget-boolean v0, p0, Lcom/moji/newliveview/camera/view/Lable;->e:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 100
|
|
invoke-super {p0, p1}, Landroid/widget/LinearLayout;->onTouchEvent(Landroid/view/MotionEvent;)Z
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
|
|
.line 102
|
|
:cond_0
|
|
invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
.line 104
|
|
invoke-virtual {p0, v1}, Lcom/moji/newliveview/camera/view/Lable;->requestDisallowInterceptTouchEvent(Z)V
|
|
|
|
.line 105
|
|
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
|
|
|
|
move-result-wide v2
|
|
|
|
iput-wide v2, p0, Lcom/moji/newliveview/camera/view/Lable;->o:J
|
|
|
|
.line 106
|
|
invoke-virtual {p1}, Landroid/view/MotionEvent;->getRawX()F
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Lcom/moji/newliveview/camera/view/Lable;->m:F
|
|
|
|
.line 107
|
|
invoke-virtual {p1}, Landroid/view/MotionEvent;->getRawY()F
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Lcom/moji/newliveview/camera/view/Lable;->n:F
|
|
|
|
.line 108
|
|
invoke-virtual {p0}, Lcom/moji/newliveview/camera/view/Lable;->getX()F
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Lcom/moji/newliveview/camera/view/Lable;->k:F
|
|
|
|
.line 109
|
|
invoke-virtual {p0}, Lcom/moji/newliveview/camera/view/Lable;->getY()F
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Lcom/moji/newliveview/camera/view/Lable;->l:F
|
|
|
|
goto/16 :goto_2
|
|
|
|
:cond_1
|
|
const/4 v2, 0x2
|
|
|
|
if-ne v0, v2, :cond_6
|
|
|
|
.line 111
|
|
invoke-virtual {p1}, Landroid/view/MotionEvent;->getRawX()F
|
|
|
|
move-result v0
|
|
|
|
iget v2, p0, Lcom/moji/newliveview/camera/view/Lable;->m:F
|
|
|
|
sub-float/2addr v0, v2
|
|
|
|
iget v2, p0, Lcom/moji/newliveview/camera/view/Lable;->k:F
|
|
|
|
add-float/2addr v0, v2
|
|
|
|
.line 112
|
|
invoke-virtual {p1}, Landroid/view/MotionEvent;->getRawY()F
|
|
|
|
move-result v2
|
|
|
|
iget v3, p0, Lcom/moji/newliveview/camera/view/Lable;->n:F
|
|
|
|
sub-float/2addr v2, v3
|
|
|
|
iget v3, p0, Lcom/moji/newliveview/camera/view/Lable;->l:F
|
|
|
|
add-float/2addr v2, v3
|
|
|
|
.line 113
|
|
iget v3, p0, Lcom/moji/newliveview/camera/view/Lable;->i:I
|
|
|
|
invoke-virtual {p0}, Lcom/moji/newliveview/camera/view/Lable;->getWidth()I
|
|
|
|
move-result v4
|
|
|
|
sub-int/2addr v3, v4
|
|
|
|
.line 114
|
|
iget v4, p0, Lcom/moji/newliveview/camera/view/Lable;->j:I
|
|
|
|
invoke-virtual {p0}, Lcom/moji/newliveview/camera/view/Lable;->getHeight()I
|
|
|
|
move-result v5
|
|
|
|
sub-int/2addr v4, v5
|
|
|
|
const/4 v5, 0x0
|
|
|
|
cmpg-float v6, v0, v5
|
|
|
|
if-gez v6, :cond_2
|
|
|
|
const/4 v0, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
int-to-float v3, v3
|
|
|
|
cmpl-float v6, v0, v3
|
|
|
|
if-lez v6, :cond_3
|
|
|
|
move v0, v3
|
|
|
|
:cond_3
|
|
:goto_0
|
|
cmpg-float v3, v2, v5
|
|
|
|
if-gez v3, :cond_4
|
|
|
|
const/4 v2, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_4
|
|
int-to-float v3, v4
|
|
|
|
cmpl-float v4, v2, v3
|
|
|
|
if-lez v4, :cond_5
|
|
|
|
move v2, v3
|
|
|
|
.line 117
|
|
:cond_5
|
|
:goto_1
|
|
invoke-virtual {p0, v0}, Lcom/moji/newliveview/camera/view/Lable;->setX(F)V
|
|
|
|
.line 118
|
|
invoke-virtual {p0, v2}, Lcom/moji/newliveview/camera/view/Lable;->setY(F)V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_6
|
|
if-ne v0, v1, :cond_7
|
|
|
|
.line 120
|
|
invoke-virtual {p0}, Lcom/moji/newliveview/camera/view/Lable;->getX()F
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Lcom/moji/newliveview/camera/view/Lable;->a:F
|
|
|
|
.line 121
|
|
invoke-virtual {p0}, Lcom/moji/newliveview/camera/view/Lable;->getY()F
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Lcom/moji/newliveview/camera/view/Lable;->b:F
|
|
|
|
.line 122
|
|
invoke-virtual {p1}, Landroid/view/MotionEvent;->getRawX()F
|
|
|
|
move-result v0
|
|
|
|
iget v2, p0, Lcom/moji/newliveview/camera/view/Lable;->m:F
|
|
|
|
sub-float/2addr v0, v2
|
|
|
|
invoke-static {v0}, Ljava/lang/Math;->abs(F)F
|
|
|
|
move-result v0
|
|
|
|
.line 123
|
|
invoke-virtual {p1}, Landroid/view/MotionEvent;->getRawY()F
|
|
|
|
move-result v2
|
|
|
|
iget v3, p0, Lcom/moji/newliveview/camera/view/Lable;->n:F
|
|
|
|
sub-float/2addr v2, v3
|
|
|
|
invoke-static {v2}, Ljava/lang/Math;->abs(F)F
|
|
|
|
move-result v2
|
|
|
|
.line 124
|
|
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
|
|
|
|
move-result-wide v3
|
|
|
|
iget-wide v5, p0, Lcom/moji/newliveview/camera/view/Lable;->o:J
|
|
|
|
sub-long/2addr v3, v5
|
|
|
|
.line 125
|
|
iget v5, p0, Lcom/moji/newliveview/camera/view/Lable;->f:I
|
|
|
|
int-to-float v5, v5
|
|
|
|
cmpg-float v0, v0, v5
|
|
|
|
if-gez v0, :cond_7
|
|
|
|
iget v0, p0, Lcom/moji/newliveview/camera/view/Lable;->f:I
|
|
|
|
int-to-float v0, v0
|
|
|
|
cmpg-float v0, v2, v0
|
|
|
|
if-gez v0, :cond_7
|
|
|
|
const-wide/16 v5, 0x1f4
|
|
|
|
cmp-long v0, v3, v5
|
|
|
|
if-gez v0, :cond_7
|
|
|
|
iget-object v0, p0, Lcom/moji/newliveview/camera/view/Lable;->p:Landroid/view/View$OnClickListener;
|
|
|
|
if-eqz v0, :cond_7
|
|
|
|
.line 126
|
|
iget-object v0, p0, Lcom/moji/newliveview/camera/view/Lable;->p:Landroid/view/View$OnClickListener;
|
|
|
|
invoke-interface {v0, p0}, Landroid/view/View$OnClickListener;->onClick(Landroid/view/View;)V
|
|
|
|
.line 129
|
|
:cond_7
|
|
:goto_2
|
|
invoke-super {p0, p1}, Landroid/widget/LinearLayout;->onTouchEvent(Landroid/view/MotionEvent;)Z
|
|
|
|
return v1
|
|
.end method
|
|
|
|
.method public setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
.locals 0
|
|
|
|
.line 157
|
|
iput-object p1, p0, Lcom/moji/newliveview/camera/view/Lable;->p:Landroid/view/View$OnClickListener;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setPinned(Z)V
|
|
.locals 0
|
|
|
|
.line 150
|
|
iput-boolean p1, p0, Lcom/moji/newliveview/camera/view/Lable;->e:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setText(Ljava/lang/String;)V
|
|
.locals 0
|
|
|
|
.line 134
|
|
iput-object p1, p0, Lcom/moji/newliveview/camera/view/Lable;->c:Ljava/lang/String;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setX(F)V
|
|
.locals 0
|
|
|
|
.line 139
|
|
invoke-super {p0, p1}, Landroid/widget/LinearLayout;->setX(F)V
|
|
|
|
.line 140
|
|
iput p1, p0, Lcom/moji/newliveview/camera/view/Lable;->a:F
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setY(F)V
|
|
.locals 0
|
|
|
|
.line 145
|
|
invoke-super {p0, p1}, Landroid/widget/LinearLayout;->setY(F)V
|
|
|
|
.line 146
|
|
iput p1, p0, Lcom/moji/newliveview/camera/view/Lable;->b:F
|
|
|
|
return-void
|
|
.end method
|