HurriyetSDK$18.smali

.class final Ltr/com/hurriyet/androidsdk/HurriyetSDK$18;
.super Ljava/lang/Object;
.source "HurriyetSDK.java"

# interfaces
.implements Lretrofit2/Callback;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Ltr/com/hurriyet/androidsdk/HurriyetSDK;->getComments(Ljava/lang/String;IILtr/com/hurriyet/androidsdk/callback/GetCommentsCallback;)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/comment/CommentsContent;",
        ">;"
    }
.end annotation


# instance fields
.field final synthetic val$callback:Ltr/com/hurriyet/androidsdk/callback/GetCommentsCallback;


# direct methods
.method constructor <init>(Ltr/com/hurriyet/androidsdk/callback/GetCommentsCallback;)V
    .registers 2

    .line 720
    iput-object p1, p0, Ltr/com/hurriyet/androidsdk/HurriyetSDK$18;->val$callback:Ltr/com/hurriyet/androidsdk/callback/GetCommentsCallback;

    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/comment/CommentsContent;",
            ">;",
            "Ljava/lang/Throwable;",
            ")V"
        }
    .end annotation

    .line 746
    invoke-virtual {p2}, Ljava/lang/Throwable;->printStackTrace()V

    .line 747
    iget-object p1, p0, Ltr/com/hurriyet/androidsdk/HurriyetSDK$18;->val$callback:Ltr/com/hurriyet/androidsdk/callback/GetCommentsCallback;

    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/GetCommentsCallback;->onFailure(Ltr/com/hurriyet/androidsdk/model/ErrorResponse;)V

    return-void
.end method

.method public onResponse(Lretrofit2/Call;Lretrofit2/Response;)V
    .registers 7
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lretrofit2/Call<",
            "Ltr/com/hurriyet/androidsdk/response/comment/CommentsContent;",
            ">;",
            "Lretrofit2/Response<",
            "Ltr/com/hurriyet/androidsdk/response/comment/CommentsContent;",
            ">;)V"
        }
    .end annotation

    if-eqz p2, :cond_84

    .line 723
    invoke-virtual {p2}, Lretrofit2/Response;->body()Ljava/lang/Object;

    move-result-object p1

    if-eqz p1, :cond_84

    invoke-virtual {p2}, Lretrofit2/Response;->body()Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Ltr/com/hurriyet/androidsdk/response/comment/CommentsContent;

    invoke-virtual {p1}, Ltr/com/hurriyet/androidsdk/response/comment/CommentsContent;->getMeta()Ltr/com/hurriyet/androidsdk/response/comment/Meta;

    move-result-object p1

    if-eqz p1, :cond_84

    .line 725
    invoke-virtual {p2}, Lretrofit2/Response;->body()Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Ltr/com/hurriyet/androidsdk/response/comment/CommentsContent;

    if-eqz p1, :cond_79

    .line 727
    invoke-virtual {p1}, Ltr/com/hurriyet/androidsdk/response/comment/CommentsContent;->getMeta()Ltr/com/hurriyet/androidsdk/response/comment/Meta;

    move-result-object p2

    if-eqz p2, :cond_79

    invoke-virtual {p1}, Ltr/com/hurriyet/androidsdk/response/comment/CommentsContent;->getMeta()Ltr/com/hurriyet/androidsdk/response/comment/Meta;

    move-result-object p2

    invoke-virtual {p2}, Ltr/com/hurriyet/androidsdk/response/comment/Meta;->getStatus()D

    move-result-wide v0

    const-wide/high16 v2, 0x4069000000000000L    # 200.0

    cmpl-double p2, v0, v2

    if-nez p2, :cond_79

    .line 729
    invoke-virtual {p1}, Ltr/com/hurriyet/androidsdk/response/comment/CommentsContent;->getSocialComment()Ltr/com/hurriyet/androidsdk/response/comment/SocialComment;

    move-result-object p2

    if-eqz p2, :cond_6d

    invoke-virtual {p1}, Ltr/com/hurriyet/androidsdk/response/comment/CommentsContent;->getSocialComment()Ltr/com/hurriyet/androidsdk/response/comment/SocialComment;

    move-result-object p2

    invoke-virtual {p2}, Ltr/com/hurriyet/androidsdk/response/comment/SocialComment;->getData()Ltr/com/hurriyet/androidsdk/response/comment/Data;

    move-result-object p2

    if-eqz p2, :cond_6d

    .line 730
    invoke-virtual {p1}, Ltr/com/hurriyet/androidsdk/response/comment/CommentsContent;->getSocialComment()Ltr/com/hurriyet/androidsdk/response/comment/SocialComment;

    move-result-object p2

    invoke-virtual {p2}, Ltr/com/hurriyet/androidsdk/response/comment/SocialComment;->getData()Ltr/com/hurriyet/androidsdk/response/comment/Data;

    move-result-object p2

    invoke-virtual {p2}, Ltr/com/hurriyet/androidsdk/response/comment/Data;->getComments()Ljava/util/ArrayList;

    move-result-object p2

    if-eqz p2, :cond_6d

    .line 731
    iget-object p2, p0, Ltr/com/hurriyet/androidsdk/HurriyetSDK$18;->val$callback:Ltr/com/hurriyet/androidsdk/callback/GetCommentsCallback;

    invoke-virtual {p1}, Ltr/com/hurriyet/androidsdk/response/comment/CommentsContent;->getSocialComment()Ltr/com/hurriyet/androidsdk/response/comment/SocialComment;

    move-result-object v0

    invoke-virtual {v0}, Ltr/com/hurriyet/androidsdk/response/comment/SocialComment;->getData()Ltr/com/hurriyet/androidsdk/response/comment/Data;

    move-result-object v0

    invoke-virtual {v0}, Ltr/com/hurriyet/androidsdk/response/comment/Data;->getComments()Ljava/util/ArrayList;

    move-result-object v0

    invoke-virtual {p1}, Ltr/com/hurriyet/androidsdk/response/comment/CommentsContent;->getSocialComment()Ltr/com/hurriyet/androidsdk/response/comment/SocialComment;

    move-result-object p1

    invoke-virtual {p1}, Ltr/com/hurriyet/androidsdk/response/comment/SocialComment;->getData()Ltr/com/hurriyet/androidsdk/response/comment/Data;

    move-result-object p1

    invoke-virtual {p1}, Ltr/com/hurriyet/androidsdk/response/comment/Data;->getTotalRows()D

    move-result-wide v1

    double-to-int p1, v1

    invoke-interface {p2, v0, p1}, Ltr/com/hurriyet/androidsdk/callback/GetCommentsCallback;->onSuccess(Ljava/util/ArrayList;I)V

    goto :goto_8e

    .line 733
    :cond_6d
    iget-object p1, p0, Ltr/com/hurriyet/androidsdk/HurriyetSDK$18;->val$callback:Ltr/com/hurriyet/androidsdk/callback/GetCommentsCallback;

    new-instance p2, Ljava/util/ArrayList;

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

    const/4 v0, 0x0

    invoke-interface {p1, p2, v0}, Ltr/com/hurriyet/androidsdk/callback/GetCommentsCallback;->onSuccess(Ljava/util/ArrayList;I)V

    goto :goto_8e

    .line 736
    :cond_79
    iget-object p1, p0, Ltr/com/hurriyet/androidsdk/HurriyetSDK$18;->val$callback:Ltr/com/hurriyet/androidsdk/callback/GetCommentsCallback;

    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/GetCommentsCallback;->onFailure(Ltr/com/hurriyet/androidsdk/model/ErrorResponse;)V

    goto :goto_8e

    .line 740
    :cond_84
    iget-object p1, p0, Ltr/com/hurriyet/androidsdk/HurriyetSDK$18;->val$callback:Ltr/com/hurriyet/androidsdk/callback/GetCommentsCallback;

    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/GetCommentsCallback;->onFailure(Ltr/com/hurriyet/androidsdk/model/ErrorResponse;)V

    :goto_8e
    return-void
.end method