.class public Lcom/moji/mjad/tab/network/AdBlockingTabIconLoadTask;
.super Lcom/moji/tool/thread/task/MJAsyncTask;
.source "AdBlockingTabIconLoadTask.java"


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/moji/tool/thread/task/MJAsyncTask<",
        "Ljava/lang/Void;",
        "Ljava/lang/Void;",
        "Landroid/graphics/drawable/StateListDrawable;",
        ">;"
    }
.end annotation


# instance fields
.field private final a:Lcom/moji/mjad/tab/data/AdBlocking;

.field private b:Landroid/content/Context;


# direct methods
.method public constructor <init>(Landroid/content/Context;Lcom/moji/mjad/tab/data/AdBlocking;)V
    .locals 1

    .line 27
    sget-object v0, Lcom/moji/tool/thread/ThreadPriority;->NORMAL:Lcom/moji/tool/thread/ThreadPriority;

    invoke-direct {p0, v0}, Lcom/moji/tool/thread/task/MJAsyncTask;-><init>(Lcom/moji/tool/thread/ThreadPriority;)V

    .line 28
    iput-object p1, p0, Lcom/moji/mjad/tab/network/AdBlockingTabIconLoadTask;->b:Landroid/content/Context;

    .line 29
    iput-object p2, p0, Lcom/moji/mjad/tab/network/AdBlockingTabIconLoadTask;->a:Lcom/moji/mjad/tab/data/AdBlocking;

    return-void
.end method

.method private a(Ljava/lang/String;II)Landroid/graphics/drawable/Drawable;
    .locals 2

    const/4 v0, 0x0

    .line 50
    :try_start_0
    iget-object v1, p0, Lcom/moji/mjad/tab/network/AdBlockingTabIconLoadTask;->b: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, p1}, Lcom/squareup/picasso/Picasso;->a(Ljava/lang/String;)Lcom/squareup/picasso/RequestCreator;

    move-result-object p1

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

    move-result-object p1

    invoke-virtual {p1}, Lcom/squareup/picasso/RequestCreator;->i()Landroid/graphics/Bitmap;

    move-result-object p1

    if-eqz p1, :cond_0

    .line 53
    new-instance p2, Landroid/graphics/drawable/BitmapDrawable;

    iget-object p3, p0, Lcom/moji/mjad/tab/network/AdBlockingTabIconLoadTask;->b:Landroid/content/Context;

    invoke-virtual {p3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p3

    invoke-direct {p2, p3, p1}, Landroid/graphics/drawable/BitmapDrawable;-><init>(Landroid/content/res/Resources;Landroid/graphics/Bitmap;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    return-object p2

    :cond_0
    return-object v0

    :catch_0
    move-exception p1

    const-string p2, "AdBlockingTabIconLoadTa"

    .line 58
    invoke-static {p2, p1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V

    return-object v0
.end method


# virtual methods
.method protected varargs a([Ljava/lang/Void;)Landroid/graphics/drawable/StateListDrawable;
    .locals 5

    .line 35
    iget-object p1, p0, Lcom/moji/mjad/tab/network/AdBlockingTabIconLoadTask;->a:Lcom/moji/mjad/tab/data/AdBlocking;

    iget-object p1, p1, Lcom/moji/mjad/tab/data/AdBlocking;->unselectImageInfo:Lcom/moji/mjad/base/data/AdImageInfo;

    iget-object p1, p1, Lcom/moji/mjad/base/data/AdImageInfo;->imageUrl:Ljava/lang/String;

    iget-object v0, p0, Lcom/moji/mjad/tab/network/AdBlockingTabIconLoadTask;->a:Lcom/moji/mjad/tab/data/AdBlocking;

    iget-object v0, v0, Lcom/moji/mjad/tab/data/AdBlocking;->unselectImageInfo:Lcom/moji/mjad/base/data/AdImageInfo;

    iget v0, v0, Lcom/moji/mjad/base/data/AdImageInfo;->width:I

    int-to-float v0, v0

    const/high16 v1, 0x40000000    # 2.0f

    div-float/2addr v0, v1

    invoke-static {v0}, Lcom/moji/tool/DeviceTool;->a(F)I

    move-result v0

    iget-object v2, p0, Lcom/moji/mjad/tab/network/AdBlockingTabIconLoadTask;->a:Lcom/moji/mjad/tab/data/AdBlocking;

    iget-object v2, v2, Lcom/moji/mjad/tab/data/AdBlocking;->unselectImageInfo:Lcom/moji/mjad/base/data/AdImageInfo;

    iget v2, v2, Lcom/moji/mjad/base/data/AdImageInfo;->height:I

    int-to-float v2, v2

    div-float/2addr v2, v1

    invoke-static {v2}, Lcom/moji/tool/DeviceTool;->a(F)I

    move-result v2

    invoke-direct {p0, p1, v0, v2}, Lcom/moji/mjad/tab/network/AdBlockingTabIconLoadTask;->a(Ljava/lang/String;II)Landroid/graphics/drawable/Drawable;

    move-result-object p1

    .line 36
    iget-object v0, p0, Lcom/moji/mjad/tab/network/AdBlockingTabIconLoadTask;->a:Lcom/moji/mjad/tab/data/AdBlocking;

    iget-object v0, v0, Lcom/moji/mjad/tab/data/AdBlocking;->selectImageInfo:Lcom/moji/mjad/base/data/AdImageInfo;

    iget-object v0, v0, Lcom/moji/mjad/base/data/AdImageInfo;->imageUrl:Ljava/lang/String;

    iget-object v2, p0, Lcom/moji/mjad/tab/network/AdBlockingTabIconLoadTask;->a:Lcom/moji/mjad/tab/data/AdBlocking;

    iget-object v2, v2, Lcom/moji/mjad/tab/data/AdBlocking;->selectImageInfo:Lcom/moji/mjad/base/data/AdImageInfo;

    iget v2, v2, Lcom/moji/mjad/base/data/AdImageInfo;->width:I

    int-to-float v2, v2

    div-float/2addr v2, v1

    invoke-static {v2}, Lcom/moji/tool/DeviceTool;->a(F)I

    move-result v2

    iget-object v3, p0, Lcom/moji/mjad/tab/network/AdBlockingTabIconLoadTask;->a:Lcom/moji/mjad/tab/data/AdBlocking;

    iget-object v3, v3, Lcom/moji/mjad/tab/data/AdBlocking;->selectImageInfo:Lcom/moji/mjad/base/data/AdImageInfo;

    iget v3, v3, Lcom/moji/mjad/base/data/AdImageInfo;->height:I

    int-to-float v3, v3

    div-float/2addr v3, v1

    invoke-static {v3}, Lcom/moji/tool/DeviceTool;->a(F)I

    move-result v1

    invoke-direct {p0, v0, v2, v1}, Lcom/moji/mjad/tab/network/AdBlockingTabIconLoadTask;->a(Ljava/lang/String;II)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    if-eqz p1, :cond_0

    if-eqz v0, :cond_0

    .line 38
    new-instance v1, Landroid/graphics/drawable/StateListDrawable;

    invoke-direct {v1}, Landroid/graphics/drawable/StateListDrawable;-><init>()V

    const/4 v2, 0x1

    .line 39
    new-array v2, v2, [I

    const/4 v3, 0x0

    const v4, 0x10100a1

    aput v4, v2, v3

    invoke-virtual {v1, v2, v0}, Landroid/graphics/drawable/StateListDrawable;->addState([ILandroid/graphics/drawable/Drawable;)V

    const/4 v0, 0x3

    .line 41
    new-array v0, v0, [I

    fill-array-data v0, :array_0

    invoke-virtual {v1, v0, p1}, Landroid/graphics/drawable/StateListDrawable;->addState([ILandroid/graphics/drawable/Drawable;)V

    return-object v1

    :cond_0
    const/4 p1, 0x0

    return-object p1

    nop

    :array_0
    .array-data 4
        -0x101009c
        -0x10100a1
        -0x10100a7
    .end array-data
.end method

.method protected bridge synthetic a([Ljava/lang/Object;)Ljava/lang/Object;
    .locals 0

    .line 21
    check-cast p1, [Ljava/lang/Void;

    invoke-virtual {p0, p1}, Lcom/moji/mjad/tab/network/AdBlockingTabIconLoadTask;->a([Ljava/lang/Void;)Landroid/graphics/drawable/StateListDrawable;

    move-result-object p1

    return-object p1
.end method
