TestSeriesBottamFragment$4.smali

.class Lcom/yctpublication/mastes/home/TestSeriesBottamFragment$4;
.super Ljava/lang/Object;
.source "TestSeriesBottamFragment.java"

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


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;->getTestSeries()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/home/TestSeriesBottamFragment;


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

    .line 167
    iput-object p1, p0, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment$4;->this$0:Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;

    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 167
    check-cast p1, Ljava/lang/String;

    invoke-virtual {p0, p1}, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment$4;->onResponse(Ljava/lang/String;)V

    return-void
.end method

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

    .line 170
    iget-object v0, p0, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment$4;->this$0:Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;

    iget-object v0, v0, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;->swipeRefreshLayout:Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;

    const/4 v1, 0x0

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

    const-string v0, "test"

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

    .line 174
    :try_start_d
    new-instance v0, Lorg/json/JSONObject;

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

    const-string p1, "message"

    .line 175
    invoke-virtual {v0, p1}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1

    const-string v2, "successfull"

    .line 176
    invoke-virtual {p1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p1

    if-eqz p1, :cond_8e

    const-string p1, "data"

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

    move-result-object p1

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

    move-result v0

    if-ge v1, v0, :cond_60

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

    move-result-object v0

    .line 180
    iget-object v2, p0, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment$4;->this$0:Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;

    iget-object v2, v2, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;->testSeriesModelList:Ljava/util/List;

    new-instance v10, Lcom/yctpublication/mastes/models/TestSeriesModel;

    const-string v3, "id"

    .line 181
    invoke-virtual {v0, v3}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    const-string v3, "name"

    .line 182
    invoke-virtual {v0, v3}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    const-string v3, "application_id"

    .line 183
    invoke-virtual {v0, v3}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    const-string v3, "master_cat_id"

    .line 184
    invoke-virtual {v0, v3}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    const-string v8, ""

    const-string v3, "master_cat_name"

    .line 186
    invoke-virtual {v0, v3}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    move-object v3, v10

    invoke-direct/range {v3 .. v9}, Lcom/yctpublication/mastes/models/TestSeriesModel;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 180
    invoke-interface {v2, v10}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    add-int/lit8 v1, v1, 0x1

    goto :goto_26

    .line 189
    :cond_60
    iget-object p1, p0, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment$4;->this$0:Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;

    new-instance v0, Lcom/yctpublication/mastes/home/adapters/TestSeriesAdapter;

    iget-object v1, p0, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment$4;->this$0:Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;

    invoke-virtual {v1}, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;->getContext()Landroid/content/Context;

    move-result-object v1

    iget-object v2, p0, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment$4;->this$0:Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;

    iget-object v2, v2, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;->testSeriesModelList:Ljava/util/List;

    iget-object v3, p0, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment$4;->this$0:Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;

    iget-object v3, v3, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;->testSeriesModelList:Ljava/util/List;

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

    move-result v3

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

    iput-object v0, p1, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;->testSeriesAdapter:Lcom/yctpublication/mastes/home/adapters/TestSeriesAdapter;

    .line 190
    iget-object p1, p0, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment$4;->this$0:Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;

    iget-object p1, p1, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;->test_series_list:Landroidx/recyclerview/widget/RecyclerView;

    iget-object v0, p0, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment$4;->this$0:Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;

    iget-object v0, v0, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;->testSeriesAdapter:Lcom/yctpublication/mastes/home/adapters/TestSeriesAdapter;

    invoke-virtual {p1, v0}, Landroidx/recyclerview/widget/RecyclerView;->setAdapter(Landroidx/recyclerview/widget/RecyclerView$Adapter;)V

    .line 191
    iget-object p1, p0, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment$4;->this$0:Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;

    iget-object p1, p1, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;->testSeriesModelList:Ljava/util/List;

    invoke-static {p1}, Ljava/util/Collections;->reverse(Ljava/util/List;)V

    goto :goto_a2

    .line 194
    :cond_8e
    iget-object p1, p0, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment$4;->this$0:Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;

    invoke-virtual {p1}, Lcom/yctpublication/mastes/home/TestSeriesBottamFragment;->getContext()Landroid/content/Context;

    move-result-object p1

    const-string v0, "Error"

    invoke-static {p1, v0, v1}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object p1

    invoke-virtual {p1}, Landroid/widget/Toast;->show()V
    :try_end_9d
    .catch Lorg/json/JSONException; {:try_start_d .. :try_end_9d} :catch_9e

    goto :goto_a2

    :catch_9e
    move-exception p1

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

    :goto_a2
    return-void
.end method