.class public Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;
.super Lcom/moji/base/MJActivity;
.source "SnowCreateSubscribeActivity.java"

# interfaces
.implements Landroid/view/View$OnClickListener;
.implements Lcom/moji/mjsnowmodule/presenter/SnowCreateSubscribePresenter$CreateSubscribeCallback;


# instance fields
.field private a:Landroid/widget/TextView;

.field private b:I

.field private c:Landroid/content/Intent;

.field private i:Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

.field private j:Lcom/moji/mjsnowmodule/presenter/SnowCreateSubscribePresenter;

.field private k:Lcom/moji/preferences/ProcessPrefer;


# direct methods
.method public constructor <init>()V
    .locals 1

    .line 36
    invoke-direct {p0}, Lcom/moji/base/MJActivity;-><init>()V

    const/16 v0, 0xa

    .line 39
    iput v0, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->b:I

    return-void
.end method

.method private a()V
    .locals 4

    .line 54
    sget v0, Lcom/moji/mjsnowmodule/R$id;->create_subscribe_title:I

    invoke-virtual {p0, v0}, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/moji/titlebar/MJTitleBar;

    .line 55
    sget v1, Lcom/moji/mjsnowmodule/R$string;->open_push_remind:I

    invoke-virtual {v0, v1}, Lcom/moji/titlebar/MJTitleBar;->setTitleText(I)V

    .line 56
    sget v0, Lcom/moji/mjsnowmodule/R$id;->rl_set_push_location:I

    invoke-virtual {p0, v0}, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/RelativeLayout;

    .line 57
    invoke-virtual {v0, p0}, Landroid/widget/RelativeLayout;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 58
    sget v0, Lcom/moji/mjsnowmodule/R$id;->tv_set_push_location:I

    invoke-virtual {p0, v0}, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->a:Landroid/widget/TextView;

    .line 59
    sget v0, Lcom/moji/mjsnowmodule/R$id;->tv_open_push:I

    invoke-virtual {p0, v0}, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    .line 60
    new-instance v1, Lcom/moji/tool/drawable/MJStateDrawable;

    sget v2, Lcom/moji/mjsnowmodule/R$color;->color_gold:I

    const/4 v3, 0x1

    invoke-direct {v1, v2, v3}, Lcom/moji/tool/drawable/MJStateDrawable;-><init>(II)V

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 61
    invoke-virtual {v0, p0}, Landroid/widget/TextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    return-void
.end method

.method private b()V
    .locals 4

    .line 65
    new-instance v0, Lcom/moji/mjsnowmodule/presenter/SnowCreateSubscribePresenter;

    invoke-direct {v0, p0}, Lcom/moji/mjsnowmodule/presenter/SnowCreateSubscribePresenter;-><init>(Lcom/moji/mjsnowmodule/presenter/SnowCreateSubscribePresenter$CreateSubscribeCallback;)V

    iput-object v0, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->j:Lcom/moji/mjsnowmodule/presenter/SnowCreateSubscribePresenter;

    .line 66
    new-instance v0, Lcom/moji/preferences/ProcessPrefer;

    invoke-direct {v0}, Lcom/moji/preferences/ProcessPrefer;-><init>()V

    iput-object v0, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->k:Lcom/moji/preferences/ProcessPrefer;

    .line 67
    sget-object v0, Lcom/moji/location/MJLocationSource;->AMAP_LOCATION:Lcom/moji/location/MJLocationSource;

    invoke-static {p0, v0}, Lcom/moji/location/provider/HistoryLocationHelper;->b(Landroid/content/Context;Lcom/moji/location/MJLocationSource;)Lcom/moji/location/entity/MJLocation;

    move-result-object v0

    .line 69
    invoke-virtual {p0}, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->getIntent()Landroid/content/Intent;

    move-result-object v1

    invoke-virtual {v1}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v1

    if-eqz v1, :cond_0

    const-string v0, "push_site"

    .line 72
    invoke-virtual {v1, v0}, Landroid/os/Bundle;->getSerializable(Ljava/lang/String;)Ljava/io/Serializable;

    move-result-object v0

    check-cast v0, Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

    iput-object v0, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->i:Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

    .line 73
    iget-object v0, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->i:Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

    if-eqz v0, :cond_3

    iget-object v0, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->i:Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

    iget-object v0, v0, Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;->address:Ljava/lang/String;

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

    move-result v0

    if-nez v0, :cond_3

    .line 74
    iget-object v0, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->a:Landroid/widget/TextView;

    iget-object v1, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->i:Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

    iget-object v1, v1, Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;->address:Ljava/lang/String;

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    goto :goto_0

    .line 78
    :cond_0
    iget-object v1, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->i:Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

    if-nez v1, :cond_1

    .line 79
    new-instance v1, Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

    invoke-direct {v1}, Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;-><init>()V

    iput-object v1, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->i:Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

    .line 81
    :cond_1
    invoke-virtual {v0}, Lcom/moji/location/entity/MJLocation;->getAddress()Ljava/lang/String;

    move-result-object v1

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

    move-result v2

    if-nez v2, :cond_2

    .line 83
    iget-object v2, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->a:Landroid/widget/TextView;

    invoke-virtual {v2, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 84
    iget-object v2, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->i:Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

    iput-object v1, v2, Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;->address:Ljava/lang/String;

    .line 85
    iget-object v1, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->i:Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

    invoke-virtual {v0}, Lcom/moji/location/entity/MJLocation;->getLatitude()D

    move-result-wide v2

    iput-wide v2, v1, Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;->lat:D

    .line 86
    iget-object v1, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->i:Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

    invoke-virtual {v0}, Lcom/moji/location/entity/MJLocation;->getLongitude()D

    move-result-wide v2

    iput-wide v2, v1, Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;->lon:D

    goto :goto_0

    .line 88
    :cond_2
    iget-object v0, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->a:Landroid/widget/TextView;

    sget v1, Lcom/moji/mjsnowmodule/R$string;->please_choose_location:I

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(I)V

    .line 89
    iget-object v0, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->a:Landroid/widget/TextView;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setEnabled(Z)V

    .line 90
    iget-object v0, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->a:Landroid/widget/TextView;

    const v1, 0x3ecccccd    # 0.4f

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setAlpha(F)V

    :cond_3
    :goto_0
    return-void
.end method


# virtual methods
.method protected onActivityResult(IILandroid/content/Intent;)V
    .locals 1

    .line 123
    iget v0, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->b:I

    if-ne p1, v0, :cond_0

    sget p1, Lcom/moji/mjsnowmodule/SnowPoiKeywordSearchActivity;->poiSearchResult:I

    if-ne p2, p1, :cond_0

    .line 125
    invoke-virtual {p3}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object p1

    if-eqz p1, :cond_0

    const-string p2, "push_site"

    .line 127
    invoke-virtual {p1, p2}, Landroid/os/Bundle;->getSerializable(Ljava/lang/String;)Ljava/io/Serializable;

    move-result-object p1

    check-cast p1, Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

    iput-object p1, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->i:Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

    .line 128
    iget-object p1, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->i:Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

    if-eqz p1, :cond_0

    .line 129
    iget-object p1, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->a:Landroid/widget/TextView;

    iget-object p2, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->i:Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

    iget-object p2, p2, Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;->address:Ljava/lang/String;

    invoke-virtual {p1, p2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 130
    iget-object p1, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->a:Landroid/widget/TextView;

    const/4 p2, 0x1

    invoke-virtual {p1, p2}, Landroid/widget/TextView;->setEnabled(Z)V

    .line 131
    iget-object p1, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->a:Landroid/widget/TextView;

    const/high16 p2, 0x3f800000    # 1.0f

    invoke-virtual {p1, p2}, Landroid/widget/TextView;->setAlpha(F)V

    :cond_0
    return-void
.end method

.method public onClick(Landroid/view/View;)V
    .locals 8

    .line 97
    invoke-virtual {p1}, Landroid/view/View;->getId()I

    move-result p1

    .line 98
    sget v0, Lcom/moji/mjsnowmodule/R$id;->rl_set_push_location:I

    if-ne p1, v0, :cond_0

    .line 99
    invoke-static {}, Lcom/moji/statistics/EventManager;->a()Lcom/moji/statistics/EventManager;

    move-result-object p1

    sget-object v0, Lcom/moji/statistics/EVENT_TAG;->SNOW_PUSH_EDITADDERESS:Lcom/moji/statistics/EVENT_TAG;

    invoke-virtual {p1, v0}, Lcom/moji/statistics/EventManager;->a(Lcom/moji/statistics/EVENT_TAG;)Lcom/moji/statistics/EventManager;

    .line 100
    new-instance p1, Landroid/content/Intent;

    const-class v0, Lcom/moji/mjsnowmodule/SnowPoiKeywordSearchActivity;

    invoke-direct {p1, p0, v0}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    iput-object p1, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->c:Landroid/content/Intent;

    .line 101
    iget-object p1, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->c:Landroid/content/Intent;

    iget v0, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->b:I

    invoke-virtual {p0, p1, v0}, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->startActivityForResult(Landroid/content/Intent;I)V

    goto :goto_0

    .line 102
    :cond_0
    sget v0, Lcom/moji/mjsnowmodule/R$id;->tv_open_push:I

    if-ne p1, v0, :cond_4

    .line 103
    invoke-static {}, Lcom/moji/tool/DeviceTool;->m()Z

    move-result p1

    if-eqz p1, :cond_3

    .line 104
    iget-object p1, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->i:Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

    if-eqz p1, :cond_2

    .line 105
    iget-object p1, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->i:Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

    iget-object p1, p1, Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;->address:Ljava/lang/String;

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

    move-result p1

    if-eqz p1, :cond_1

    .line 106
    sget p1, Lcom/moji/mjsnowmodule/R$string;->choose_location_warn:I

    invoke-static {p1}, Lcom/moji/tool/ToastTool;->a(I)V

    goto :goto_0

    .line 109
    :cond_1
    iget-object v0, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->j:Lcom/moji/mjsnowmodule/presenter/SnowCreateSubscribePresenter;

    const/4 v1, 0x0

    iget-object p1, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->i:Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

    iget-wide v2, p1, Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;->lat:D

    iget-object p1, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->i:Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

    iget-wide v4, p1, Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;->lon:D

    iget-object p1, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->i:Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

    iget-object v6, p1, Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;->address:Ljava/lang/String;

    iget-object p1, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->k:Lcom/moji/preferences/ProcessPrefer;

    .line 110
    invoke-virtual {p1}, Lcom/moji/preferences/ProcessPrefer;->f()Ljava/lang/String;

    move-result-object v7

    .line 109
    invoke-virtual/range {v0 .. v7}, Lcom/moji/mjsnowmodule/presenter/SnowCreateSubscribePresenter;->a(IDDLjava/lang/String;Ljava/lang/String;)V

    goto :goto_0

    .line 113
    :cond_2
    sget p1, Lcom/moji/mjsnowmodule/R$string;->add_location_warn:I

    invoke-static {p1}, Lcom/moji/tool/ToastTool;->a(I)V

    goto :goto_0

    .line 116
    :cond_3
    sget p1, Lcom/moji/mjsnowmodule/R$string;->network_unaviable:I

    invoke-static {p1}, Lcom/moji/tool/ToastTool;->a(I)V

    :cond_4
    :goto_0
    return-void
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 0

    .line 47
    invoke-super {p0, p1}, Lcom/moji/base/MJActivity;->onCreate(Landroid/os/Bundle;)V

    .line 48
    sget p1, Lcom/moji/mjsnowmodule/R$layout;->activity_create_push_location:I

    invoke-virtual {p0, p1}, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->setContentView(I)V

    .line 49
    invoke-direct {p0}, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->a()V

    .line 50
    invoke-direct {p0}, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->b()V

    return-void
.end method

.method public openFailed(Lcom/moji/requestcore/MJException;)V
    .locals 3

    const-string v0, "SnowCreateSubscribeActivity"

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

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

    sget v2, Lcom/moji/mjsnowmodule/R$string;->open_fail:I

    invoke-virtual {p0, v2}, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->getString(I)Ljava/lang/String;

    move-result-object v2

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

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

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

    move-result-object p1

    invoke-static {v0, p1}, Lcom/moji/tool/log/MJLogger;->e(Ljava/lang/String;Ljava/lang/String;)V

    .line 154
    sget p1, Lcom/moji/mjsnowmodule/R$string;->open_fail:I

    invoke-static {p1}, Lcom/moji/tool/ToastTool;->a(I)V

    return-void
.end method

.method public openSuccess(Lcom/moji/requestcore/entity/MJBaseRespRc;)V
    .locals 2

    .line 139
    sget p1, Lcom/moji/mjsnowmodule/R$string;->open_success:I

    invoke-static {p1}, Lcom/moji/tool/ToastTool;->a(I)V

    .line 140
    invoke-static {}, Lcom/moji/statistics/EventManager;->a()Lcom/moji/statistics/EventManager;

    move-result-object p1

    sget-object v0, Lcom/moji/statistics/EVENT_TAG;->SNOW_PUSH_SAVE:Lcom/moji/statistics/EVENT_TAG;

    invoke-virtual {p1, v0}, Lcom/moji/statistics/EventManager;->a(Lcom/moji/statistics/EVENT_TAG;)Lcom/moji/statistics/EventManager;

    .line 141
    new-instance p1, Landroid/content/Intent;

    const-class v0, Lcom/moji/mjsnowmodule/SnowEditSubscribeActivity;

    invoke-direct {p1, p0, v0}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    iput-object p1, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->c:Landroid/content/Intent;

    .line 143
    new-instance p1, Landroid/os/Bundle;

    invoke-direct {p1}, Landroid/os/Bundle;-><init>()V

    const-string v0, "push_site"

    .line 145
    iget-object v1, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->i:Lcom/moji/http/snow/bean/SnowPushDetail$SubPush;

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putSerializable(Ljava/lang/String;Ljava/io/Serializable;)V

    .line 146
    iget-object v0, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->c:Landroid/content/Intent;

    invoke-virtual {v0, p1}, Landroid/content/Intent;->putExtras(Landroid/os/Bundle;)Landroid/content/Intent;

    .line 147
    iget-object p1, p0, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->c:Landroid/content/Intent;

    invoke-virtual {p0, p1}, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->startActivity(Landroid/content/Intent;)V

    .line 148
    invoke-virtual {p0}, Lcom/moji/mjsnowmodule/SnowCreateSubscribeActivity;->finish()V

    return-void
.end method
