.class public abstract Lcom/moji/imageview/AsyncImageView;
.super Landroid/widget/ImageView;
.source "AsyncImageView.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/imageview/AsyncImageView$IAsyncImageViewNotify;
    }
.end annotation


# instance fields
.field protected a:Ljava/lang/String;

.field protected b:I

.field protected c:I

.field protected d:Z

.field protected e:Z

.field protected f:I

.field protected g:I

.field private h:Lcom/moji/imageview/AsyncImageView$IAsyncImageViewNotify;

.field private i:Z

.field private j:Landroid/content/Context;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1

    .line 63
    invoke-direct {p0, p1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    const/4 v0, 0x0

    .line 30
    iput-boolean v0, p0, Lcom/moji/imageview/AsyncImageView;->e:Z

    .line 31
    iput-boolean v0, p0, Lcom/moji/imageview/AsyncImageView;->i:Z

    .line 64
    iput-object p1, p0, Lcom/moji/imageview/AsyncImageView;->j:Landroid/content/Context;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 0

    .line 68
    invoke-direct {p0, p1, p2}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    const/4 p2, 0x0

    .line 30
    iput-boolean p2, p0, Lcom/moji/imageview/AsyncImageView;->e:Z

    .line 31
    iput-boolean p2, p0, Lcom/moji/imageview/AsyncImageView;->i:Z

    .line 69
    iput-object p1, p0, Lcom/moji/imageview/AsyncImageView;->j:Landroid/content/Context;

    return-void
.end method


# virtual methods
.method public a()V
    .locals 4

    .line 96
    iget-object v0, p0, Lcom/moji/imageview/AsyncImageView;->a:Ljava/lang/String;

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_0

    const-string v0, "AsyncImageView"

    const-string v1, "url is null"

    .line 97
    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    return-void

    :cond_0
    const-string v0, "AsyncImageView"

    .line 100
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "url is "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v2, p0, Lcom/moji/imageview/AsyncImageView;->a:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    const-string v0, "SKIN_DEFAULT"

    .line 101
    iget-object v1, p0, Lcom/moji/imageview/AsyncImageView;->a:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    .line 102
    sget v0, Lcom/moji/widget/R$drawable;->default_preview:I

    invoke-virtual {p0, v0}, Lcom/moji/imageview/AsyncImageView;->setImageResource(I)V

    goto :goto_0

    :cond_1
    const-string v0, "SKIN_DEFAULT_WHITE"

    .line 103
    iget-object v1, p0, Lcom/moji/imageview/AsyncImageView;->a:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_2

    .line 104
    sget v0, Lcom/moji/widget/R$drawable;->default_preview_white:I

    invoke-virtual {p0, v0}, Lcom/moji/imageview/AsyncImageView;->setImageResource(I)V

    goto :goto_0

    :cond_2
    const-string v0, "SKIN_DEFAULT_BLCAK"

    .line 105
    iget-object v1, p0, Lcom/moji/imageview/AsyncImageView;->a:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_3

    .line 106
    sget v0, Lcom/moji/widget/R$drawable;->default_preview_black:I

    invoke-virtual {p0, v0}, Lcom/moji/imageview/AsyncImageView;->setImageResource(I)V

    goto :goto_0

    .line 107
    :cond_3
    iget-object v0, p0, Lcom/moji/imageview/AsyncImageView;->a:Ljava/lang/String;

    const-string v1, "files&&"

    invoke-virtual {v0, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_4

    .line 108
    new-instance v0, Ljava/io/File;

    iget-object v1, p0, Lcom/moji/imageview/AsyncImageView;->a:Ljava/lang/String;

    const-string v2, "files&&"

    const-string v3, ""

    invoke-virtual {v1, v2, v3}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 109
    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v1

    if-eqz v1, :cond_5

    .line 110
    iget-object v1, p0, Lcom/moji/imageview/AsyncImageView;->j:Landroid/content/Context;

    invoke-static {v1}, Lcom/squareup/picasso/Picasso;->a(Landroid/content/Context;)Lcom/squareup/picasso/Picasso;

    move-result-object v1

    invoke-virtual {v1, v0}, Lcom/squareup/picasso/Picasso;->a(Ljava/io/File;)Lcom/squareup/picasso/RequestCreator;

    move-result-object v0

    invoke-virtual {v0, p0}, Lcom/squareup/picasso/RequestCreator;->a(Landroid/widget/ImageView;)V

    goto :goto_0

    .line 113
    :cond_4
    iget-object v0, p0, Lcom/moji/imageview/AsyncImageView;->a:Ljava/lang/String;

    invoke-virtual {p0, v0}, Lcom/moji/imageview/AsyncImageView;->a(Ljava/lang/String;)V

    :cond_5
    :goto_0
    return-void
.end method

.method public a(Ljava/lang/String;)V
    .locals 1

    .line 83
    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_0

    return-void

    .line 86
    :cond_0
    iget-object v0, p0, Lcom/moji/imageview/AsyncImageView;->j:Landroid/content/Context;

    invoke-static {v0}, Lcom/squareup/picasso/Picasso;->a(Landroid/content/Context;)Lcom/squareup/picasso/Picasso;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/squareup/picasso/Picasso;->a(Ljava/lang/String;)Lcom/squareup/picasso/RequestCreator;

    move-result-object p1

    invoke-virtual {p1, p0}, Lcom/squareup/picasso/RequestCreator;->a(Landroid/widget/ImageView;)V

    return-void
.end method

.method public a(Ljava/lang/String;I)V
    .locals 1

    .line 77
    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_0

    return-void

    .line 80
    :cond_0
    iget-object v0, p0, Lcom/moji/imageview/AsyncImageView;->j:Landroid/content/Context;

    invoke-static {v0}, Lcom/squareup/picasso/Picasso;->a(Landroid/content/Context;)Lcom/squareup/picasso/Picasso;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/squareup/picasso/Picasso;->a(Ljava/lang/String;)Lcom/squareup/picasso/RequestCreator;

    move-result-object p1

    invoke-virtual {p1, p2}, Lcom/squareup/picasso/RequestCreator;->a(I)Lcom/squareup/picasso/RequestCreator;

    move-result-object p1

    invoke-virtual {p1, p0}, Lcom/squareup/picasso/RequestCreator;->a(Landroid/widget/ImageView;)V

    return-void
.end method

.method protected abstract b()V
.end method

.method public getUrl()Ljava/lang/String;
    .locals 1

    .line 58
    iget-object v0, p0, Lcom/moji/imageview/AsyncImageView;->a:Ljava/lang/String;

    return-object v0
.end method

.method protected onLayout(ZIIII)V
    .locals 0

    .line 119
    invoke-super/range {p0 .. p5}, Landroid/widget/ImageView;->onLayout(ZIIII)V

    .line 120
    iget p1, p0, Lcom/moji/imageview/AsyncImageView;->g:I

    invoke-virtual {p0}, Lcom/moji/imageview/AsyncImageView;->getWidth()I

    move-result p2

    if-ne p1, p2, :cond_0

    iget p1, p0, Lcom/moji/imageview/AsyncImageView;->f:I

    invoke-virtual {p0}, Lcom/moji/imageview/AsyncImageView;->getHeight()I

    move-result p2

    if-eq p1, p2, :cond_1

    .line 121
    :cond_0
    invoke-virtual {p0}, Lcom/moji/imageview/AsyncImageView;->getWidth()I

    move-result p1

    iput p1, p0, Lcom/moji/imageview/AsyncImageView;->g:I

    .line 122
    invoke-virtual {p0}, Lcom/moji/imageview/AsyncImageView;->getHeight()I

    move-result p1

    iput p1, p0, Lcom/moji/imageview/AsyncImageView;->f:I

    .line 123
    invoke-virtual {p0}, Lcom/moji/imageview/AsyncImageView;->b()V

    :cond_1
    return-void
.end method

.method public setImageHeight(I)V
    .locals 0

    .line 45
    iput p1, p0, Lcom/moji/imageview/AsyncImageView;->c:I

    return-void
.end method

.method public setImageWidth(I)V
    .locals 0

    .line 73
    iput p1, p0, Lcom/moji/imageview/AsyncImageView;->b:I

    return-void
.end method

.method public setIsloadAnnimation(Z)V
    .locals 0

    .line 50
    iput-boolean p1, p0, Lcom/moji/imageview/AsyncImageView;->e:Z

    return-void
.end method

.method public setLoadNotify(Lcom/moji/imageview/AsyncImageView$IAsyncImageViewNotify;)V
    .locals 0

    .line 130
    iput-object p1, p0, Lcom/moji/imageview/AsyncImageView;->h:Lcom/moji/imageview/AsyncImageView$IAsyncImageViewNotify;

    return-void
.end method

.method public setNeedCache(Z)V
    .locals 0

    .line 41
    iput-boolean p1, p0, Lcom/moji/imageview/AsyncImageView;->d:Z

    return-void
.end method

.method public setUrl(Ljava/lang/String;)V
    .locals 0

    .line 54
    iput-object p1, p0, Lcom/moji/imageview/AsyncImageView;->a:Ljava/lang/String;

    return-void
.end method
