HurriyetSDK$11.smali
.class final Ltr/com/hurriyet/androidsdk/HurriyetSDK$11;
.super Ljava/lang/Object;
.source "HurriyetSDK.java"
# interfaces
.implements Lretrofit2/Callback;
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Ltr/com/hurriyet/androidsdk/HurriyetSDK;->getWeatherForecast(ILtr/com/hurriyet/androidsdk/callback/WeatherCallback;)Lretrofit2/Call;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x8
name = null
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/lang/Object;",
"Lretrofit2/Callback<",
"Ltr/com/hurriyet/androidsdk/response/content/WeatherContent;",
">;"
}
.end annotation
# instance fields
.field final synthetic val$callback:Ltr/com/hurriyet/androidsdk/callback/WeatherCallback;
# direct methods
.method constructor <init>(Ltr/com/hurriyet/androidsdk/callback/WeatherCallback;)V
.registers 2
.line 528
iput-object p1, p0, Ltr/com/hurriyet/androidsdk/HurriyetSDK$11;->val$callback:Ltr/com/hurriyet/androidsdk/callback/WeatherCallback;
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public onFailure(Lretrofit2/Call;Ljava/lang/Throwable;)V
.registers 3
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lretrofit2/Call<",
"Ltr/com/hurriyet/androidsdk/response/content/WeatherContent;",
">;",
"Ljava/lang/Throwable;",
")V"
}
.end annotation
.line 550
invoke-virtual {p2}, Ljava/lang/Throwable;->printStackTrace()V
.line 551
iget-object p1, p0, Ltr/com/hurriyet/androidsdk/HurriyetSDK$11;->val$callback:Ltr/com/hurriyet/androidsdk/callback/WeatherCallback;
new-instance p2, Ltr/com/hurriyet/androidsdk/model/ErrorResponse;
invoke-direct {p2}, Ltr/com/hurriyet/androidsdk/model/ErrorResponse;-><init>()V
invoke-interface {p1, p2}, Ltr/com/hurriyet/androidsdk/callback/WeatherCallback;->onFailure(Ltr/com/hurriyet/androidsdk/model/ErrorResponse;)V
return-void
.end method
.method public onResponse(Lretrofit2/Call;Lretrofit2/Response;)V
.registers 4
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lretrofit2/Call<",
"Ltr/com/hurriyet/androidsdk/response/content/WeatherContent;",
">;",
"Lretrofit2/Response<",
"Ltr/com/hurriyet/androidsdk/response/content/WeatherContent;",
">;)V"
}
.end annotation
if-eqz p2, :cond_64
.line 531
invoke-virtual {p2}, Lretrofit2/Response;->body()Ljava/lang/Object;
move-result-object p1
if-eqz p1, :cond_64
invoke-virtual {p2}, Lretrofit2/Response;->body()Ljava/lang/Object;
move-result-object p1
check-cast p1, Ltr/com/hurriyet/androidsdk/response/content/WeatherContent;
invoke-virtual {p1}, Ltr/com/hurriyet/androidsdk/response/content/WeatherContent;->getMeta()Ltr/com/hurriyet/androidsdk/response/content/Meta;
move-result-object p1
if-eqz p1, :cond_64
.line 532
invoke-virtual {p2}, Lretrofit2/Response;->body()Ljava/lang/Object;
move-result-object p1
check-cast p1, Ltr/com/hurriyet/androidsdk/response/content/WeatherContent;
.line 534
invoke-virtual {p1}, Ltr/com/hurriyet/androidsdk/response/content/WeatherContent;->getMeta()Ltr/com/hurriyet/androidsdk/response/content/Meta;
move-result-object p2
invoke-virtual {p2}, Ltr/com/hurriyet/androidsdk/response/content/Meta;->getStatus()I
move-result p2
const/16 v0, 0xc8
if-ne p2, v0, :cond_3c
invoke-virtual {p1}, Ltr/com/hurriyet/androidsdk/response/content/WeatherContent;->getWeatherList()Ljava/util/ArrayList;
move-result-object p2
if-eqz p2, :cond_3c
invoke-virtual {p1}, Ltr/com/hurriyet/androidsdk/response/content/WeatherContent;->getWeatherList()Ljava/util/ArrayList;
move-result-object p2
invoke-virtual {p2}, Ljava/util/ArrayList;->size()I
move-result p2
if-lez p2, :cond_3c
.line 536
iget-object p2, p0, Ltr/com/hurriyet/androidsdk/HurriyetSDK$11;->val$callback:Ltr/com/hurriyet/androidsdk/callback/WeatherCallback;
invoke-interface {p2, p1}, Ltr/com/hurriyet/androidsdk/callback/WeatherCallback;->onSuccess(Ltr/com/hurriyet/androidsdk/response/content/WeatherContent;)V
goto :goto_6e
.line 538
:cond_3c
invoke-virtual {p1}, Ltr/com/hurriyet/androidsdk/response/content/WeatherContent;->getMeta()Ltr/com/hurriyet/androidsdk/response/content/Meta;
move-result-object p2
invoke-virtual {p2}, Ltr/com/hurriyet/androidsdk/response/content/Meta;->getErrorMessage()Ljava/lang/String;
move-result-object p2
if-eqz p2, :cond_59
.line 539
iget-object p2, p0, Ltr/com/hurriyet/androidsdk/HurriyetSDK$11;->val$callback:Ltr/com/hurriyet/androidsdk/callback/WeatherCallback;
new-instance v0, Ltr/com/hurriyet/androidsdk/model/ErrorResponse;
invoke-virtual {p1}, Ltr/com/hurriyet/androidsdk/response/content/WeatherContent;->getMeta()Ltr/com/hurriyet/androidsdk/response/content/Meta;
move-result-object p1
invoke-virtual {p1}, Ltr/com/hurriyet/androidsdk/response/content/Meta;->getErrorMessage()Ljava/lang/String;
move-result-object p1
invoke-direct {v0, p1}, Ltr/com/hurriyet/androidsdk/model/ErrorResponse;-><init>(Ljava/lang/String;)V
invoke-interface {p2, v0}, Ltr/com/hurriyet/androidsdk/callback/WeatherCallback;->onFailure(Ltr/com/hurriyet/androidsdk/model/ErrorResponse;)V
goto :goto_6e
.line 541
:cond_59
iget-object p1, p0, Ltr/com/hurriyet/androidsdk/HurriyetSDK$11;->val$callback:Ltr/com/hurriyet/androidsdk/callback/WeatherCallback;
new-instance p2, Ltr/com/hurriyet/androidsdk/model/ErrorResponse;
invoke-direct {p2}, Ltr/com/hurriyet/androidsdk/model/ErrorResponse;-><init>()V
invoke-interface {p1, p2}, Ltr/com/hurriyet/androidsdk/callback/WeatherCallback;->onFailure(Ltr/com/hurriyet/androidsdk/model/ErrorResponse;)V
goto :goto_6e
.line 544
:cond_64
iget-object p1, p0, Ltr/com/hurriyet/androidsdk/HurriyetSDK$11;->val$callback:Ltr/com/hurriyet/androidsdk/callback/WeatherCallback;
new-instance p2, Ltr/com/hurriyet/androidsdk/model/ErrorResponse;
invoke-direct {p2}, Ltr/com/hurriyet/androidsdk/model/ErrorResponse;-><init>()V
invoke-interface {p1, p2}, Ltr/com/hurriyet/androidsdk/callback/WeatherCallback;->onFailure(Ltr/com/hurriyet/androidsdk/model/ErrorResponse;)V
:goto_6e
return-void
.end method