SubChapterActivity.smali

.class public Lcom/yctpublication/mastes/quiz/SubChapterActivity;
.super Landroidx/appcompat/app/AppCompatActivity;
.source "SubChapterActivity.java"


# instance fields
.field chapter_id:Ljava/lang/String;

.field intent:Landroid/content/Intent;

.field quizId:Ljava/lang/String;

.field quizSessionManager:Lcom/yctpublication/mastes/common/QuizSessionManager;

.field recyclerView:Landroidx/recyclerview/widget/RecyclerView;

.field refreshLayout:Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;

.field subChapterModelList:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Lcom/yctpublication/mastes/models/SubChapterModel;",
            ">;"
        }
    .end annotation
.end field

.field toolbar:Landroidx/appcompat/widget/Toolbar;


# direct methods
.method public constructor <init>()V
    .registers 1

    .line 38
    invoke-direct {p0}, Landroidx/appcompat/app/AppCompatActivity;-><init>()V

    return-void
.end method

.method static synthetic access$000(Lcom/yctpublication/mastes/quiz/SubChapterActivity;)V
    .registers 1

    .line 38
    invoke-direct {p0}, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->get_chapter_details()V

    return-void
.end method

.method private get_chapter_details()V
    .registers 9

    .line 90
    iget-object v0, p0, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->refreshLayout:Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;

    const/4 v1, 0x1

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

    .line 91
    iget-object v0, p0, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->subChapterModelList:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->clear()V

    .line 92
    invoke-static {p0}, Lcom/android/volley/toolbox/Volley;->newRequestQueue(Landroid/content/Context;)Lcom/android/volley/RequestQueue;

    move-result-object v0

    .line 93
    new-instance v7, Lcom/yctpublication/mastes/quiz/SubChapterActivity$5;

    new-instance v5, Lcom/yctpublication/mastes/quiz/SubChapterActivity$3;

    invoke-direct {v5, p0}, Lcom/yctpublication/mastes/quiz/SubChapterActivity$3;-><init>(Lcom/yctpublication/mastes/quiz/SubChapterActivity;)V

    new-instance v6, Lcom/yctpublication/mastes/quiz/SubChapterActivity$4;

    invoke-direct {v6, p0}, Lcom/yctpublication/mastes/quiz/SubChapterActivity$4;-><init>(Lcom/yctpublication/mastes/quiz/SubChapterActivity;)V

    const/4 v3, 0x1

    const-string v4, "https://quizes.yctpublication.com/selfapi/get_sub_chapters.php"

    move-object v1, v7

    move-object v2, p0

    invoke-direct/range {v1 .. v6}, Lcom/yctpublication/mastes/quiz/SubChapterActivity$5;-><init>(Lcom/yctpublication/mastes/quiz/SubChapterActivity;ILjava/lang/String;Lcom/android/volley/Response$Listener;Lcom/android/volley/Response$ErrorListener;)V

    .line 130
    invoke-virtual {v0, v7}, Lcom/android/volley/RequestQueue;->add(Lcom/android/volley/Request;)Lcom/android/volley/Request;

    return-void
.end method


# virtual methods
.method protected onCreate(Landroid/os/Bundle;)V
    .registers 4
    .annotation system Ldalvik/annotation/MethodParameters;
        accessFlags = {
            0x0
        }
        names = {
            "savedInstanceState"
        }
    .end annotation

    .line 50
    invoke-super {p0, p1}, Landroidx/appcompat/app/AppCompatActivity;->onCreate(Landroid/os/Bundle;)V

    const p1, 0x7f0c0046

    .line 51
    invoke-virtual {p0, p1}, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->setContentView(I)V

    const p1, 0x7f090350

    .line 54
    invoke-virtual {p0, p1}, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->findViewById(I)Landroid/view/View;

    move-result-object p1

    check-cast p1, Landroidx/appcompat/widget/Toolbar;

    iput-object p1, p0, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->toolbar:Landroidx/appcompat/widget/Toolbar;

    const p1, 0x7f0900c5

    .line 55
    invoke-virtual {p0, p1}, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->findViewById(I)Landroid/view/View;

    move-result-object p1

    check-cast p1, Landroidx/recyclerview/widget/RecyclerView;

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

    .line 56
    new-instance p1, Lcom/yctpublication/mastes/common/QuizSessionManager;

    invoke-direct {p1, p0}, Lcom/yctpublication/mastes/common/QuizSessionManager;-><init>(Landroid/content/Context;)V

    iput-object p1, p0, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->quizSessionManager:Lcom/yctpublication/mastes/common/QuizSessionManager;

    const p1, 0x7f0902b5

    .line 57
    invoke-virtual {p0, p1}, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->findViewById(I)Landroid/view/View;

    move-result-object p1

    check-cast p1, Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;

    iput-object p1, p0, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->refreshLayout:Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;

    .line 58
    new-instance p1, Ljava/util/ArrayList;

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

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

    .line 61
    iget-object p1, p0, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->toolbar:Landroidx/appcompat/widget/Toolbar;

    invoke-virtual {p0, p1}, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->setSupportActionBar(Landroidx/appcompat/widget/Toolbar;)V

    .line 62
    invoke-virtual {p0}, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->getSupportActionBar()Landroidx/appcompat/app/ActionBar;

    move-result-object p1

    const/4 v0, 0x1

    invoke-virtual {p1, v0}, Landroidx/appcompat/app/ActionBar;->setDisplayHomeAsUpEnabled(Z)V

    .line 63
    iget-object p1, p0, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->toolbar:Landroidx/appcompat/widget/Toolbar;

    new-instance v1, Lcom/yctpublication/mastes/quiz/SubChapterActivity$1;

    invoke-direct {v1, p0}, Lcom/yctpublication/mastes/quiz/SubChapterActivity$1;-><init>(Lcom/yctpublication/mastes/quiz/SubChapterActivity;)V

    invoke-virtual {p1, v1}, Landroidx/appcompat/widget/Toolbar;->setNavigationOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 69
    invoke-virtual {p0}, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->getIntent()Landroid/content/Intent;

    move-result-object p1

    iput-object p1, p0, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->intent:Landroid/content/Intent;

    const-string v1, "chapter_id"

    .line 70
    invoke-virtual {p1, v1}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1

    iput-object p1, p0, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->chapter_id:Ljava/lang/String;

    .line 71
    iget-object p1, p0, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->intent:Landroid/content/Intent;

    const-string v1, "quizId"

    invoke-virtual {p1, v1}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1

    iput-object p1, p0, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->quizId:Ljava/lang/String;

    .line 74
    iget-object p1, p0, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->refreshLayout:Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;

    new-instance v1, Lcom/yctpublication/mastes/quiz/SubChapterActivity$2;

    invoke-direct {v1, p0}, Lcom/yctpublication/mastes/quiz/SubChapterActivity$2;-><init>(Lcom/yctpublication/mastes/quiz/SubChapterActivity;)V

    invoke-virtual {p1, v1}, Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;->setOnRefreshListener(Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout$OnRefreshListener;)V

    .line 83
    new-instance p1, Landroidx/recyclerview/widget/GridLayoutManager;

    invoke-direct {p1, p0, v0}, Landroidx/recyclerview/widget/GridLayoutManager;-><init>(Landroid/content/Context;I)V

    .line 84
    iget-object v0, p0, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->recyclerView:Landroidx/recyclerview/widget/RecyclerView;

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

    return-void
.end method

.method protected onStart()V
    .registers 3

    .line 135
    invoke-super {p0}, Landroidx/appcompat/app/AppCompatActivity;->onStart()V

    .line 136
    invoke-static {p0}, Lcom/yctpublication/mastes/common/LibraryFunctions;->isNetworkConnected(Landroid/content/Context;)Z

    move-result v0

    if-eqz v0, :cond_d

    .line 137
    invoke-direct {p0}, Lcom/yctpublication/mastes/quiz/SubChapterActivity;->get_chapter_details()V

    goto :goto_17

    :cond_d
    const/4 v0, 0x0

    const-string v1, "Connection error."

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

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    :goto_17
    return-void
.end method