244 lines
5.8 KiB
Smali
244 lines
5.8 KiB
Smali
.class public Lcom/moji/titlebar/BlackTitleBarLayout;
|
|
.super Landroid/widget/RelativeLayout;
|
|
.source "BlackTitleBarLayout.java"
|
|
|
|
|
|
# instance fields
|
|
.field public a:Landroid/widget/ImageView;
|
|
|
|
.field private final b:Ljava/lang/String;
|
|
|
|
.field private c:Z
|
|
|
|
.field private d:I
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;)V
|
|
.locals 1
|
|
|
|
.line 25
|
|
invoke-direct {p0, p1}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;)V
|
|
|
|
const-string v0, "imageview_mask"
|
|
|
|
.line 20
|
|
iput-object v0, p0, Lcom/moji/titlebar/BlackTitleBarLayout;->b:Ljava/lang/String;
|
|
|
|
.line 26
|
|
invoke-direct {p0, p1}, Lcom/moji/titlebar/BlackTitleBarLayout;->a(Landroid/content/Context;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
.locals 0
|
|
|
|
.line 30
|
|
invoke-direct {p0, p1, p2}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
const-string p2, "imageview_mask"
|
|
|
|
.line 20
|
|
iput-object p2, p0, Lcom/moji/titlebar/BlackTitleBarLayout;->b:Ljava/lang/String;
|
|
|
|
.line 31
|
|
invoke-direct {p0, p1}, Lcom/moji/titlebar/BlackTitleBarLayout;->a(Landroid/content/Context;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
.locals 0
|
|
|
|
.line 35
|
|
invoke-direct {p0, p1, p2, p3}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
|
|
const-string p2, "imageview_mask"
|
|
|
|
.line 20
|
|
iput-object p2, p0, Lcom/moji/titlebar/BlackTitleBarLayout;->b:Ljava/lang/String;
|
|
|
|
.line 36
|
|
invoke-direct {p0, p1}, Lcom/moji/titlebar/BlackTitleBarLayout;->a(Landroid/content/Context;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private a(Landroid/content/Context;)V
|
|
.locals 3
|
|
.annotation build Landroid/annotation/TargetApi;
|
|
value = 0x10
|
|
.end annotation
|
|
|
|
.line 41
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v1, 0x13
|
|
|
|
if-lt v0, v1, :cond_0
|
|
|
|
.line 42
|
|
invoke-static {}, Lcom/moji/tool/DeviceTool;->e()I
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Lcom/moji/titlebar/BlackTitleBarLayout;->d:I
|
|
|
|
.line 44
|
|
:cond_0
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v2, 0x10
|
|
|
|
if-lt v0, v2, :cond_1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
iput-boolean v0, p0, Lcom/moji/titlebar/BlackTitleBarLayout;->c:Z
|
|
|
|
.line 45
|
|
new-instance v0, Landroid/widget/ImageView;
|
|
|
|
invoke-direct {v0, p1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V
|
|
|
|
iput-object v0, p0, Lcom/moji/titlebar/BlackTitleBarLayout;->a:Landroid/widget/ImageView;
|
|
|
|
.line 46
|
|
iget-object p1, p0, Lcom/moji/titlebar/BlackTitleBarLayout;->a:Landroid/widget/ImageView;
|
|
|
|
sget-object v0, Landroid/widget/ImageView$ScaleType;->FIT_XY:Landroid/widget/ImageView$ScaleType;
|
|
|
|
invoke-virtual {p1, v0}, Landroid/widget/ImageView;->setScaleType(Landroid/widget/ImageView$ScaleType;)V
|
|
|
|
.line 47
|
|
sget p1, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
if-lt p1, v1, :cond_2
|
|
|
|
.line 48
|
|
iget-object p1, p0, Lcom/moji/titlebar/BlackTitleBarLayout;->a:Landroid/widget/ImageView;
|
|
|
|
sget v0, Lcom/moji/widget/R$drawable;->titlebar_background:I
|
|
|
|
invoke-virtual {p1, v0}, Landroid/widget/ImageView;->setImageResource(I)V
|
|
|
|
.line 50
|
|
:cond_2
|
|
iget-boolean p1, p0, Lcom/moji/titlebar/BlackTitleBarLayout;->c:Z
|
|
|
|
const/16 v0, 0xff
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
.line 51
|
|
iget-object p1, p0, Lcom/moji/titlebar/BlackTitleBarLayout;->a:Landroid/widget/ImageView;
|
|
|
|
invoke-virtual {p1, v0}, Landroid/widget/ImageView;->setImageAlpha(I)V
|
|
|
|
goto :goto_1
|
|
|
|
.line 53
|
|
:cond_3
|
|
iget-object p1, p0, Lcom/moji/titlebar/BlackTitleBarLayout;->a:Landroid/widget/ImageView;
|
|
|
|
invoke-virtual {p1, v0}, Landroid/widget/ImageView;->setAlpha(I)V
|
|
|
|
.line 55
|
|
:goto_1
|
|
iget-object p1, p0, Lcom/moji/titlebar/BlackTitleBarLayout;->a:Landroid/widget/ImageView;
|
|
|
|
const-string v0, "imageview_mask"
|
|
|
|
invoke-virtual {p1, v0}, Landroid/widget/ImageView;->setTag(Ljava/lang/Object;)V
|
|
|
|
.line 56
|
|
iget-object p1, p0, Lcom/moji/titlebar/BlackTitleBarLayout;->a:Landroid/widget/ImageView;
|
|
|
|
invoke-virtual {p0, p1}, Lcom/moji/titlebar/BlackTitleBarLayout;->addView(Landroid/view/View;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method protected onLayout(ZIIII)V
|
|
.locals 5
|
|
|
|
.line 67
|
|
invoke-super/range {p0 .. p5}, Landroid/widget/RelativeLayout;->onLayout(ZIIII)V
|
|
|
|
.line 68
|
|
invoke-virtual {p0}, Lcom/moji/titlebar/BlackTitleBarLayout;->getChildCount()I
|
|
|
|
move-result p1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
if-ge v1, p1, :cond_1
|
|
|
|
.line 70
|
|
invoke-virtual {p0, v1}, Lcom/moji/titlebar/BlackTitleBarLayout;->getChildAt(I)Landroid/view/View;
|
|
|
|
move-result-object v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
.line 71
|
|
invoke-virtual {v2}, Landroid/view/View;->getTag()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
invoke-virtual {v2}, Landroid/view/View;->getTag()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
const-string v4, "imageview_mask"
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
sub-int v3, p4, p2
|
|
|
|
sub-int v4, p5, p3
|
|
|
|
.line 72
|
|
invoke-virtual {v2, v0, v0, v3, v4}, Landroid/view/View;->layout(IIII)V
|
|
|
|
:cond_0
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method protected onMeasure(II)V
|
|
.locals 1
|
|
|
|
.line 61
|
|
iget v0, p0, Lcom/moji/titlebar/BlackTitleBarLayout;->d:I
|
|
|
|
add-int/2addr p2, v0
|
|
|
|
.line 62
|
|
invoke-super {p0, p1, p2}, Landroid/widget/RelativeLayout;->onMeasure(II)V
|
|
|
|
return-void
|
|
.end method
|