SubChapterActivity$3.smali

.class Lcom/yctpublication/mastes/quiz/SubChapterActivity$3;
.super Ljava/lang/Object;
.source "SubChapterActivity.java"

# interfaces
.implements Lcom/android/volley/Response$Listener;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/yctpublication/mastes/quiz/SubChapterActivity;->get_chapter_details()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Lcom/android/volley/Response$Listener<",
        "Ljava/lang/String;",
        ">;"
    }
.end annotation


# instance fields
.field final synthetic this$0:Lcom/yctpublication/mastes/quiz/SubChapterActivity;


# direct methods
.method constructor <init>(Lcom/yctpublication/mastes/quiz/SubChapterActivity;)V
    .registers 2
    .annotation system Ldalvik/annotation/MethodParameters;
        accessFlags = {
            0x8010
        }
        names = {
            "this$0"
        }
    .end annotation

    .line 93
    iput-object p1, p0, Lcom/yctpublication/mastes/quiz/SubChapterActivity$3;->this$0:Lcom/yctpublication/mastes/quiz/SubChapterActivity;

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

    return-void
.end method


# virtual methods
.method public bridge synthetic onResponse(Ljava/lang/Object;)V
    .registers 2
    .annotation system Ldalvik/annotation/MethodParameters;
        accessFlags = {
            0x1000
        }
        names = {
            "response"
        }
    .end annotation

    .line 93
    check-cast p1, Ljava/lang/String;

    invoke-virtual {p0, p1}, Lcom/yctpublication/mastes/quiz/SubChapterActivity$3;->onResponse(Ljava/lang/String;)V

    return-void
.end method

.method public onResponse(Ljava/lang/String;)V
    .registers 10
    .annotation system Ldalvik/annotation/MethodParameters;
        accessFlags = {
            0x0
        }
        names = {
            "response"
        }
    .end annotation

    const-string v0, "data"

    .line 96
    iget-object v1, p0, Lcom/yctpublication/mastes/quiz/SubChapterActivity$3;->this$0:Lcom/yctpublication/mastes/quiz/SubChapterActivity;

    iget-object v1, v1, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->refreshLayout:Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;->setRefreshing(Z)V

    .line 98
    :try_start_a
    new-instance v1, Lorg/json/JSONObject;

    invoke-direct {v1, p1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 99
    invoke-virtual {v1, v0}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object p1

    .line 100
    :goto_13
    invoke-virtual {p1}, Lorg/json/JSONArray;->length()I

    move-result v1

    if-ge v2, v1, :cond_3e

    .line 101
    invoke-virtual {p1, v2}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v1

    .line 102
    iget-object v3, p0, Lcom/yctpublication/mastes/quiz/SubChapterActivity$3;->this$0:Lcom/yctpublication/mastes/quiz/SubChapterActivity;

    iget-object v3, v3, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->subChapterModelList:Ljava/util/List;

    new-instance v4, Lcom/yctpublication/mastes/models/SubChapterModel;

    const-string v5, "id"

    .line 103
    invoke-virtual {v1, v5}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    const-string v6, "subchapter_english"

    .line 104
    invoke-virtual {v1, v6}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    const-string v7, "subchapter_hindi"

    .line 105
    invoke-virtual {v1, v7}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v4, v5, v6, v1}, Lcom/yctpublication/mastes/models/SubChapterModel;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 102
    invoke-interface {v3, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    add-int/lit8 v2, v2, 0x1

    goto :goto_13

    .line 108
    :cond_3e
    iget-object p1, p0, Lcom/yctpublication/mastes/quiz/SubChapterActivity$3;->this$0:Lcom/yctpublication/mastes/quiz/SubChapterActivity;

    iget-object p1, p1, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->subChapterModelList:Ljava/util/List;

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

    move-result-object p1

    invoke-static {v0, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 109
    iget-object p1, p0, Lcom/yctpublication/mastes/quiz/SubChapterActivity$3;->this$0:Lcom/yctpublication/mastes/quiz/SubChapterActivity;

    iget-object p1, p1, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->recyclerView:Landroidx/recyclerview/widget/RecyclerView;

    new-instance v0, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;

    iget-object v1, p0, Lcom/yctpublication/mastes/quiz/SubChapterActivity$3;->this$0:Lcom/yctpublication/mastes/quiz/SubChapterActivity;

    iget-object v2, v1, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->subChapterModelList:Ljava/util/List;

    iget-object v3, p0, Lcom/yctpublication/mastes/quiz/SubChapterActivity$3;->this$0:Lcom/yctpublication/mastes/quiz/SubChapterActivity;

    iget-object v3, v3, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->chapter_id:Ljava/lang/String;

    invoke-direct {v0, v1, v2, v3}, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;-><init>(Landroid/content/Context;Ljava/util/List;Ljava/lang/String;)V

    invoke-virtual {p1, v0}, Landroidx/recyclerview/widget/RecyclerView;->setAdapter(Landroidx/recyclerview/widget/RecyclerView$Adapter;)V
    :try_end_5d
    .catch Lorg/json/JSONException; {:try_start_a .. :try_end_5d} :catch_5e

    goto :goto_62

    :catch_5e
    move-exception p1

    .line 113
    invoke-virtual {p1}, Lorg/json/JSONException;->printStackTrace()V

    :goto_62
    return-void
.end method