.class public Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;
.super Lcom/moji/base/MJPresenter;
.source "SnowPoiKeywordSearchPresenter.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter$SnowPKSearchCallback;,
        Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter$PoiSearchListener;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/moji/base/MJPresenter<",
        "Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter$SnowPKSearchCallback;",
        ">;"
    }
.end annotation


# instance fields
.field private final b:Lcom/moji/location/MJLocationManager;

.field private final c:Lcom/moji/location/MJOnGeoCodeSearchListener;

.field private d:Lcom/amap/api/services/poisearch/PoiSearch$Query;

.field private e:Lcom/amap/api/services/poisearch/PoiSearch;

.field private f:Landroid/content/Context;

.field private g:Ljava/lang/String;


# direct methods
.method public constructor <init>(Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter$SnowPKSearchCallback;)V
    .locals 0

    .line 43
    invoke-direct {p0, p1}, Lcom/moji/base/MJPresenter;-><init>(Lcom/moji/base/MJPresenter$ICallback;)V

    const-string p1, "SnowPoiKeywordSearchPresenter"

    .line 41
    iput-object p1, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->g:Ljava/lang/String;

    .line 44
    invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;

    move-result-object p1

    iput-object p1, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->f:Landroid/content/Context;

    .line 45
    new-instance p1, Lcom/moji/location/MJLocationManager;

    invoke-direct {p1}, Lcom/moji/location/MJLocationManager;-><init>()V

    iput-object p1, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->b:Lcom/moji/location/MJLocationManager;

    .line 46
    new-instance p1, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter$1;

    invoke-direct {p1, p0}, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter$1;-><init>(Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;)V

    iput-object p1, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->c:Lcom/moji/location/MJOnGeoCodeSearchListener;

    return-void
.end method

.method static synthetic a(Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;)Lcom/moji/base/MJPresenter$ICallback;
    .locals 0

    .line 34
    iget-object p0, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->a:Lcom/moji/base/MJPresenter$ICallback;

    return-object p0
.end method

.method static synthetic a(Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;Ljava/util/ArrayList;)Ljava/util/List;
    .locals 0

    .line 34
    invoke-direct {p0, p1}, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->a(Ljava/util/ArrayList;)Ljava/util/List;

    move-result-object p0

    return-object p0
.end method

.method private a(Ljava/util/ArrayList;)Ljava/util/List;
    .locals 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/ArrayList<",
            "Lcom/amap/api/services/core/PoiItem;",
            ">;)",
            "Ljava/util/List<",
            "Lcom/moji/mjsnowmodule/bean/PoiSearchResultBean;",
            ">;"
        }
    .end annotation

    .line 134
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    const/4 v1, 0x0

    .line 136
    :goto_0
    invoke-virtual {p1}, Ljava/util/ArrayList;->size()I

    move-result v2

    if-ge v1, v2, :cond_1

    .line 137
    new-instance v2, Lcom/moji/mjsnowmodule/bean/PoiSearchResultBean;

    invoke-direct {v2}, Lcom/moji/mjsnowmodule/bean/PoiSearchResultBean;-><init>()V

    .line 138
    invoke-virtual {p1, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/amap/api/services/core/PoiItem;

    iput-object v3, v2, Lcom/moji/mjsnowmodule/bean/PoiSearchResultBean;->b:Lcom/amap/api/services/core/PoiItem;

    if-nez v1, :cond_0

    const/4 v3, 0x1

    .line 141
    iput-boolean v3, v2, Lcom/moji/mjsnowmodule/bean/PoiSearchResultBean;->a:Z

    .line 143
    :cond_0
    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    :cond_1
    return-object v0
.end method

.method static synthetic b(Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;)Lcom/moji/base/MJPresenter$ICallback;
    .locals 0

    .line 34
    iget-object p0, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->a:Lcom/moji/base/MJPresenter$ICallback;

    return-object p0
.end method

.method static synthetic c(Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;)Lcom/amap/api/services/poisearch/PoiSearch$Query;
    .locals 0

    .line 34
    iget-object p0, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->d:Lcom/amap/api/services/poisearch/PoiSearch$Query;

    return-object p0
.end method

.method static synthetic d(Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;)Lcom/moji/base/MJPresenter$ICallback;
    .locals 0

    .line 34
    iget-object p0, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->a:Lcom/moji/base/MJPresenter$ICallback;

    return-object p0
.end method

.method static synthetic e(Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;)Ljava/lang/String;
    .locals 0

    .line 34
    iget-object p0, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->g:Ljava/lang/String;

    return-object p0
.end method

.method static synthetic f(Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;)Lcom/moji/base/MJPresenter$ICallback;
    .locals 0

    .line 34
    iget-object p0, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->a:Lcom/moji/base/MJPresenter$ICallback;

    return-object p0
.end method


# virtual methods
.method public a()Lcom/moji/location/entity/MJLocation;
    .locals 2

    .line 59
    iget-object v0, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->f:Landroid/content/Context;

    sget-object v1, Lcom/moji/location/MJLocationSource;->AMAP_LOCATION:Lcom/moji/location/MJLocationSource;

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

    move-result-object v0

    return-object v0
.end method

.method public a(Landroid/widget/EditText;)Ljava/lang/String;
    .locals 2

    if-eqz p1, :cond_0

    .line 152
    invoke-virtual {p1}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 153
    invoke-virtual {p1}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v0

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

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v0

    const-string v1, ""

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

    move-result v0

    if-nez v0, :cond_0

    .line 154
    invoke-virtual {p1}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object p1

    invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object p1

    invoke-virtual {p1}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object p1

    return-object p1

    :cond_0
    const-string p1, ""

    return-object p1
.end method

.method public a(Lcom/amap/api/maps2d/model/LatLng;)V
    .locals 5

    .line 64
    new-instance v0, Lcom/moji/location/geo/MJLatLonPoint;

    iget-wide v1, p1, Lcom/amap/api/maps2d/model/LatLng;->latitude:D

    iget-wide v3, p1, Lcom/amap/api/maps2d/model/LatLng;->longitude:D

    invoke-direct {v0, v1, v2, v3, v4}, Lcom/moji/location/geo/MJLatLonPoint;-><init>(DD)V

    .line 65
    new-instance p1, Lcom/moji/location/geo/MJReGeoCodeQuery;

    const/4 v1, 0x0

    invoke-direct {p1, v0, v1}, Lcom/moji/location/geo/MJReGeoCodeQuery;-><init>(Lcom/moji/location/geo/MJLatLonPoint;F)V

    .line 66
    iget-object v0, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->b:Lcom/moji/location/MJLocationManager;

    invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;

    move-result-object v1

    iget-object v2, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->c:Lcom/moji/location/MJOnGeoCodeSearchListener;

    invoke-virtual {v0, v1, p1, v2}, Lcom/moji/location/MJLocationManager;->a(Landroid/content/Context;Lcom/moji/location/geo/MJReGeoCodeQuery;Lcom/moji/location/MJOnGeoCodeSearchListener;)V

    return-void
.end method

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

    .line 72
    new-instance v0, Lcom/amap/api/services/poisearch/PoiSearch$Query;

    const-string v1, ""

    invoke-direct {v0, p1, v1, p2}, Lcom/amap/api/services/poisearch/PoiSearch$Query;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    iput-object v0, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->d:Lcom/amap/api/services/poisearch/PoiSearch$Query;

    .line 73
    iget-object p1, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->d:Lcom/amap/api/services/poisearch/PoiSearch$Query;

    const/16 p2, 0x14

    invoke-virtual {p1, p2}, Lcom/amap/api/services/poisearch/PoiSearch$Query;->setPageSize(I)V

    .line 75
    new-instance p1, Lcom/amap/api/services/poisearch/PoiSearch;

    iget-object p2, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->f:Landroid/content/Context;

    iget-object v0, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->d:Lcom/amap/api/services/poisearch/PoiSearch$Query;

    invoke-direct {p1, p2, v0}, Lcom/amap/api/services/poisearch/PoiSearch;-><init>(Landroid/content/Context;Lcom/amap/api/services/poisearch/PoiSearch$Query;)V

    iput-object p1, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->e:Lcom/amap/api/services/poisearch/PoiSearch;

    .line 76
    iget-object p1, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->e:Lcom/amap/api/services/poisearch/PoiSearch;

    new-instance p2, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter$PoiSearchListener;

    const/4 v0, 0x0

    invoke-direct {p2, p0, v0}, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter$PoiSearchListener;-><init>(Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter$1;)V

    invoke-virtual {p1, p2}, Lcom/amap/api/services/poisearch/PoiSearch;->setOnPoiSearchListener(Lcom/amap/api/services/poisearch/PoiSearch$OnPoiSearchListener;)V

    .line 77
    iget-object p1, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->e:Lcom/amap/api/services/poisearch/PoiSearch;

    invoke-virtual {p1}, Lcom/amap/api/services/poisearch/PoiSearch;->searchPOIAsyn()V

    return-void
.end method

.method public a(Ljava/lang/String;Ljava/lang/String;Lcom/amap/api/services/core/LatLonPoint;)V
    .locals 2

    .line 84
    new-instance v0, Lcom/amap/api/services/poisearch/PoiSearch$Query;

    const-string v1, ""

    invoke-direct {v0, p1, v1, p2}, Lcom/amap/api/services/poisearch/PoiSearch$Query;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    iput-object v0, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->d:Lcom/amap/api/services/poisearch/PoiSearch$Query;

    .line 85
    iget-object p1, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->d:Lcom/amap/api/services/poisearch/PoiSearch$Query;

    const/16 p2, 0x14

    invoke-virtual {p1, p2}, Lcom/amap/api/services/poisearch/PoiSearch$Query;->setPageSize(I)V

    .line 86
    iget-object p1, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->d:Lcom/amap/api/services/poisearch/PoiSearch$Query;

    const/4 p2, 0x1

    invoke-virtual {p1, p2}, Lcom/amap/api/services/poisearch/PoiSearch$Query;->setPageNum(I)V

    if-eqz p3, :cond_0

    .line 89
    new-instance p1, Lcom/amap/api/services/poisearch/PoiSearch;

    iget-object v0, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->f:Landroid/content/Context;

    iget-object v1, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->d:Lcom/amap/api/services/poisearch/PoiSearch$Query;

    invoke-direct {p1, v0, v1}, Lcom/amap/api/services/poisearch/PoiSearch;-><init>(Landroid/content/Context;Lcom/amap/api/services/poisearch/PoiSearch$Query;)V

    iput-object p1, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->e:Lcom/amap/api/services/poisearch/PoiSearch;

    .line 90
    iget-object p1, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->e:Lcom/amap/api/services/poisearch/PoiSearch;

    new-instance v0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter$PoiSearchListener;

    const/4 v1, 0x0

    invoke-direct {v0, p0, v1}, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter$PoiSearchListener;-><init>(Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter$1;)V

    invoke-virtual {p1, v0}, Lcom/amap/api/services/poisearch/PoiSearch;->setOnPoiSearchListener(Lcom/amap/api/services/poisearch/PoiSearch$OnPoiSearchListener;)V

    .line 91
    iget-object p1, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->e:Lcom/amap/api/services/poisearch/PoiSearch;

    new-instance v0, Lcom/amap/api/services/poisearch/PoiSearch$SearchBound;

    const/16 v1, 0x1388

    invoke-direct {v0, p3, v1, p2}, Lcom/amap/api/services/poisearch/PoiSearch$SearchBound;-><init>(Lcom/amap/api/services/core/LatLonPoint;IZ)V

    invoke-virtual {p1, v0}, Lcom/amap/api/services/poisearch/PoiSearch;->setBound(Lcom/amap/api/services/poisearch/PoiSearch$SearchBound;)V

    .line 93
    iget-object p1, p0, Lcom/moji/mjsnowmodule/presenter/SnowPoiKeywordSearchPresenter;->e:Lcom/amap/api/services/poisearch/PoiSearch;

    invoke-virtual {p1}, Lcom/amap/api/services/poisearch/PoiSearch;->searchPOIAsyn()V

    :cond_0
    return-void
.end method
