.class public Lcom/moji/mjweather/thunderstorm/TsMapFragment;
.super Lcom/moji/base/MJFragment;
.source "TsMapFragment.java"

# interfaces
.implements Lcom/moji/mjweather/thunderstorm/TsMapCallBack;


# instance fields
.field private b:Lcom/amap/api/maps2d/MapView;

.field private c:Lcom/amap/api/maps2d/AMap;

.field private d:Lcom/moji/mjweather/thunderstorm/TsMapPresenter;

.field private e:Landroid/widget/TextView;


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

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

    return-void
.end method

.method private a(I)I
    .locals 1

    packed-switch p1, :pswitch_data_0

    const p1, 0x7f060207

    goto :goto_0

    :pswitch_0
    const p1, 0x7f060208

    goto :goto_0

    :pswitch_1
    const p1, 0x7f060206

    .line 148
    :goto_0
    invoke-virtual {p0}, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0, p1}, Landroid/support/v4/content/ContextCompat;->getColor(Landroid/content/Context;I)I

    move-result p1

    return p1

    nop

    :pswitch_data_0
    .packed-switch 0x2
        :pswitch_1
        :pswitch_1
        :pswitch_0
    .end packed-switch
.end method

.method private a(Lcom/moji/http/thunderstorm/TsMapResponse$GridPointList;)Lcom/amap/api/maps2d/model/PolygonOptions;
    .locals 7

    .line 115
    new-instance v0, Lcom/amap/api/maps2d/model/PolygonOptions;

    invoke-direct {v0}, Lcom/amap/api/maps2d/model/PolygonOptions;-><init>()V

    .line 116
    invoke-virtual {p0}, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->getContext()Landroid/content/Context;

    move-result-object v1

    const v2, 0x7f060235

    invoke-static {v1, v2}, Landroid/support/v4/content/ContextCompat;->getColor(Landroid/content/Context;I)I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/amap/api/maps2d/model/PolygonOptions;->strokeColor(I)Lcom/amap/api/maps2d/model/PolygonOptions;

    move-result-object v1

    const/high16 v2, 0x40a00000    # 5.0f

    .line 117
    invoke-virtual {v1, v2}, Lcom/amap/api/maps2d/model/PolygonOptions;->strokeWidth(F)Lcom/amap/api/maps2d/model/PolygonOptions;

    move-result-object v1

    iget v2, p1, Lcom/moji/http/thunderstorm/TsMapResponse$GridPointList;->level:I

    .line 118
    invoke-direct {p0, v2}, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->a(I)I

    move-result v2

    invoke-virtual {v1, v2}, Lcom/amap/api/maps2d/model/PolygonOptions;->fillColor(I)Lcom/amap/api/maps2d/model/PolygonOptions;

    .line 121
    iget-object v1, p1, Lcom/moji/http/thunderstorm/TsMapResponse$GridPointList;->coordinate_list:Ljava/util/List;

    if-eqz v1, :cond_0

    iget-object v1, p1, Lcom/moji/http/thunderstorm/TsMapResponse$GridPointList;->coordinate_list:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    if-lez v1, :cond_0

    .line 122
    iget-object p1, p1, Lcom/moji/http/thunderstorm/TsMapResponse$GridPointList;->coordinate_list:Ljava/util/List;

    invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object p1

    :goto_0
    invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/moji/http/thunderstorm/TsMapResponse$Coordinate;

    .line 123
    new-instance v2, Lcom/amap/api/maps2d/model/LatLng;

    iget-wide v3, v1, Lcom/moji/http/thunderstorm/TsMapResponse$Coordinate;->lat:D

    iget-wide v5, v1, Lcom/moji/http/thunderstorm/TsMapResponse$Coordinate;->lon:D

    invoke-direct {v2, v3, v4, v5, v6}, Lcom/amap/api/maps2d/model/LatLng;-><init>(DD)V

    invoke-virtual {v0, v2}, Lcom/amap/api/maps2d/model/PolygonOptions;->add(Lcom/amap/api/maps2d/model/LatLng;)Lcom/amap/api/maps2d/model/PolygonOptions;

    goto :goto_0

    :cond_0
    return-object v0
.end method

.method private c(Lcom/amap/api/maps2d/model/LatLng;)V
    .locals 2

    .line 158
    iget-object v0, p0, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->c:Lcom/amap/api/maps2d/AMap;

    new-instance v1, Lcom/amap/api/maps2d/model/MarkerOptions;

    invoke-direct {v1}, Lcom/amap/api/maps2d/model/MarkerOptions;-><init>()V

    .line 159
    invoke-virtual {v1, p1}, Lcom/amap/api/maps2d/model/MarkerOptions;->position(Lcom/amap/api/maps2d/model/LatLng;)Lcom/amap/api/maps2d/model/MarkerOptions;

    move-result-object p1

    const/high16 v1, 0x3f000000    # 0.5f

    .line 160
    invoke-virtual {p1, v1, v1}, Lcom/amap/api/maps2d/model/MarkerOptions;->anchor(FF)Lcom/amap/api/maps2d/model/MarkerOptions;

    move-result-object p1

    const v1, 0x7f080705

    .line 161
    invoke-static {v1}, Lcom/amap/api/maps2d/model/BitmapDescriptorFactory;->fromResource(I)Lcom/amap/api/maps2d/model/BitmapDescriptor;

    move-result-object v1

    invoke-virtual {p1, v1}, Lcom/amap/api/maps2d/model/MarkerOptions;->icon(Lcom/amap/api/maps2d/model/BitmapDescriptor;)Lcom/amap/api/maps2d/model/MarkerOptions;

    move-result-object p1

    .line 158
    invoke-virtual {v0, p1}, Lcom/amap/api/maps2d/AMap;->addMarker(Lcom/amap/api/maps2d/model/MarkerOptions;)Lcom/amap/api/maps2d/model/Marker;

    return-void
.end method


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

    return-void
.end method

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

    const v0, 0x4139999a    # 11.6f

    .line 95
    invoke-static {p1, v0}, Lcom/amap/api/maps2d/CameraUpdateFactory;->newLatLngZoom(Lcom/amap/api/maps2d/model/LatLng;F)Lcom/amap/api/maps2d/CameraUpdate;

    move-result-object v0

    .line 96
    iget-object v1, p0, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->c:Lcom/amap/api/maps2d/AMap;

    invoke-virtual {v1, v0}, Lcom/amap/api/maps2d/AMap;->moveCamera(Lcom/amap/api/maps2d/CameraUpdate;)V

    .line 97
    invoke-direct {p0, p1}, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->c(Lcom/amap/api/maps2d/model/LatLng;)V

    .line 98
    invoke-virtual {p0, p1}, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->b(Lcom/amap/api/maps2d/model/LatLng;)V

    return-void
.end method

.method public a(Lcom/moji/http/thunderstorm/TsMapResponse;)V
    .locals 2

    .line 105
    iget-object v0, p0, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->e:Landroid/widget/TextView;

    iget-object v1, p1, Lcom/moji/http/thunderstorm/TsMapResponse;->shower_desc:Ljava/lang/String;

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

    .line 106
    iget-object p1, p1, Lcom/moji/http/thunderstorm/TsMapResponse;->grid_point_list:Ljava/util/List;

    invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object p1

    :goto_0
    invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/moji/http/thunderstorm/TsMapResponse$GridPointList;

    .line 108
    invoke-direct {p0, v0}, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->a(Lcom/moji/http/thunderstorm/TsMapResponse$GridPointList;)Lcom/amap/api/maps2d/model/PolygonOptions;

    move-result-object v0

    .line 109
    iget-object v1, p0, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->c:Lcom/amap/api/maps2d/AMap;

    invoke-virtual {v1, v0}, Lcom/amap/api/maps2d/AMap;->addPolygon(Lcom/amap/api/maps2d/model/PolygonOptions;)Lcom/amap/api/maps2d/model/Polygon;

    goto :goto_0

    :cond_0
    return-void
.end method

.method public b(Lcom/amap/api/maps2d/model/LatLng;)V
    .locals 4

    .line 167
    invoke-virtual {p0}, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f080701

    invoke-static {v0, v1}, Landroid/graphics/BitmapFactory;->decodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 168
    iget-object v1, p0, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->c:Lcom/amap/api/maps2d/AMap;

    new-instance v2, Lcom/amap/api/maps2d/model/MarkerOptions;

    invoke-direct {v2}, Lcom/amap/api/maps2d/model/MarkerOptions;-><init>()V

    .line 169
    invoke-virtual {v2, p1}, Lcom/amap/api/maps2d/model/MarkerOptions;->position(Lcom/amap/api/maps2d/model/LatLng;)Lcom/amap/api/maps2d/model/MarkerOptions;

    move-result-object p1

    const/high16 v2, 0x3f000000    # 0.5f

    const/high16 v3, 0x3f800000    # 1.0f

    .line 170
    invoke-virtual {p1, v2, v3}, Lcom/amap/api/maps2d/model/MarkerOptions;->anchor(FF)Lcom/amap/api/maps2d/model/MarkerOptions;

    move-result-object p1

    .line 171
    invoke-static {v0}, Lcom/amap/api/maps2d/model/BitmapDescriptorFactory;->fromBitmap(Landroid/graphics/Bitmap;)Lcom/amap/api/maps2d/model/BitmapDescriptor;

    move-result-object v0

    invoke-virtual {p1, v0}, Lcom/amap/api/maps2d/model/MarkerOptions;->icon(Lcom/amap/api/maps2d/model/BitmapDescriptor;)Lcom/amap/api/maps2d/model/MarkerOptions;

    move-result-object p1

    .line 168
    invoke-virtual {v1, p1}, Lcom/amap/api/maps2d/AMap;->addMarker(Lcom/amap/api/maps2d/model/MarkerOptions;)Lcom/amap/api/maps2d/model/Marker;

    return-void
.end method

.method public onCreateView(Landroid/view/LayoutInflater;Landroid/view/ViewGroup;Landroid/os/Bundle;)Landroid/view/View;
    .locals 1
    .param p2    # Landroid/view/ViewGroup;
        .annotation build Landroid/support/annotation/Nullable;
        .end annotation
    .end param
    .param p3    # Landroid/os/Bundle;
        .annotation build Landroid/support/annotation/Nullable;
        .end annotation
    .end param
    .annotation build Landroid/support/annotation/Nullable;
    .end annotation

    const p3, 0x7f0b013e

    const/4 v0, 0x0

    .line 41
    invoke-virtual {p1, p3, p2, v0}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object p1

    return-object p1
.end method

.method public onDestroy()V
    .locals 1

    .line 83
    invoke-super {p0}, Lcom/moji/base/MJFragment;->onDestroy()V

    .line 84
    iget-object v0, p0, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->b:Lcom/amap/api/maps2d/MapView;

    invoke-virtual {v0}, Lcom/amap/api/maps2d/MapView;->onDestroy()V

    return-void
.end method

.method public onPause()V
    .locals 1

    .line 76
    invoke-super {p0}, Lcom/moji/base/MJFragment;->onPause()V

    .line 77
    iget-object v0, p0, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->b:Lcom/amap/api/maps2d/MapView;

    invoke-virtual {v0}, Lcom/amap/api/maps2d/MapView;->onPause()V

    return-void
.end method

.method public onResume()V
    .locals 1

    .line 66
    invoke-super {p0}, Lcom/moji/base/MJFragment;->onResume()V

    .line 67
    iget-object v0, p0, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->b:Lcom/amap/api/maps2d/MapView;

    invoke-virtual {v0}, Lcom/amap/api/maps2d/MapView;->onResume()V

    .line 69
    iget-object v0, p0, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->d:Lcom/moji/mjweather/thunderstorm/TsMapPresenter;

    invoke-virtual {v0}, Lcom/moji/mjweather/thunderstorm/TsMapPresenter;->a()V

    return-void
.end method

.method public onSaveInstanceState(Landroid/os/Bundle;)V
    .locals 1

    .line 89
    invoke-super {p0, p1}, Lcom/moji/base/MJFragment;->onSaveInstanceState(Landroid/os/Bundle;)V

    .line 90
    iget-object v0, p0, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->b:Lcom/amap/api/maps2d/MapView;

    invoke-virtual {v0, p1}, Lcom/amap/api/maps2d/MapView;->onSaveInstanceState(Landroid/os/Bundle;)V

    return-void
.end method

.method public onViewCreated(Landroid/view/View;Landroid/os/Bundle;)V
    .locals 1
    .param p2    # Landroid/os/Bundle;
        .annotation build Landroid/support/annotation/Nullable;
        .end annotation
    .end param

    .line 47
    invoke-super {p0, p1, p2}, Lcom/moji/base/MJFragment;->onViewCreated(Landroid/view/View;Landroid/os/Bundle;)V

    const v0, 0x7f090992

    .line 49
    invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/amap/api/maps2d/MapView;

    iput-object v0, p0, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->b:Lcom/amap/api/maps2d/MapView;

    .line 50
    iget-object v0, p0, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->b:Lcom/amap/api/maps2d/MapView;

    invoke-virtual {v0, p2}, Lcom/amap/api/maps2d/MapView;->onCreate(Landroid/os/Bundle;)V

    .line 52
    iget-object p2, p0, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->b:Lcom/amap/api/maps2d/MapView;

    invoke-virtual {p2}, Lcom/amap/api/maps2d/MapView;->getMap()Lcom/amap/api/maps2d/AMap;

    move-result-object p2

    iput-object p2, p0, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->c:Lcom/amap/api/maps2d/AMap;

    .line 54
    iget-object p2, p0, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->c:Lcom/amap/api/maps2d/AMap;

    invoke-virtual {p2}, Lcom/amap/api/maps2d/AMap;->getUiSettings()Lcom/amap/api/maps2d/UiSettings;

    move-result-object p2

    const/4 v0, 0x0

    .line 55
    invoke-virtual {p2, v0}, Lcom/amap/api/maps2d/UiSettings;->setZoomControlsEnabled(Z)V

    .line 56
    invoke-virtual {p2, v0}, Lcom/amap/api/maps2d/UiSettings;->setAllGesturesEnabled(Z)V

    const p2, 0x7f0909a0

    .line 58
    invoke-virtual {p1, p2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p1

    check-cast p1, Landroid/widget/TextView;

    iput-object p1, p0, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->e:Landroid/widget/TextView;

    .line 59
    new-instance p1, Lcom/moji/mjweather/thunderstorm/TsMapPresenter;

    invoke-direct {p1, p0}, Lcom/moji/mjweather/thunderstorm/TsMapPresenter;-><init>(Lcom/moji/mjweather/thunderstorm/TsMapCallBack;)V

    iput-object p1, p0, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->d:Lcom/moji/mjweather/thunderstorm/TsMapPresenter;

    .line 60
    iget-object p1, p0, Lcom/moji/mjweather/thunderstorm/TsMapFragment;->d:Lcom/moji/mjweather/thunderstorm/TsMapPresenter;

    invoke-virtual {p1}, Lcom/moji/mjweather/thunderstorm/TsMapPresenter;->b()V

    return-void
.end method
