SubChapterAdapter.smali
.class public Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;
.super Landroidx/recyclerview/widget/RecyclerView$Adapter;
.source "SubChapterAdapter.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter$SubChapterAdapterVH;
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroidx/recyclerview/widget/RecyclerView$Adapter<",
"Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter$SubChapterAdapterVH;",
">;"
}
.end annotation
# instance fields
.field chapter_id:Ljava/lang/String;
.field context:Landroid/content/Context;
.field count:I
.field dbQuiz:Lcom/yctpublication/mastes/common/storevalue/databasebook/DatabaseHandlerofQuiz;
.field saveQuiz:Ljava/lang/String;
.field subChapterModelList:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List<",
"Lcom/yctpublication/mastes/models/SubChapterModel;",
">;"
}
.end annotation
.end field
# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/util/List;Ljava/lang/String;)V
.registers 4
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x0,
0x0,
0x0
}
names = {
"context",
"subChapterModelList",
"chapter_id"
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/content/Context;",
"Ljava/util/List<",
"Lcom/yctpublication/mastes/models/SubChapterModel;",
">;",
"Ljava/lang/String;",
")V"
}
.end annotation
.line 34
invoke-direct {p0}, Landroidx/recyclerview/widget/RecyclerView$Adapter;-><init>()V
.line 35
iput-object p1, p0, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;->context:Landroid/content/Context;
.line 36
iput-object p2, p0, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;->subChapterModelList:Ljava/util/List;
.line 37
iput-object p3, p0, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;->chapter_id:Ljava/lang/String;
return-void
.end method
# virtual methods
.method public getItemCount()I
.registers 2
.line 111
iget-object v0, p0, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;->subChapterModelList:Ljava/util/List;
invoke-interface {v0}, Ljava/util/List;->size()I
move-result v0
return v0
.end method
.method public bridge synthetic onBindViewHolder(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;I)V
.registers 3
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x1000,
0x1000
}
names = {
"holder",
"position"
}
.end annotation
.line 25
check-cast p1, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter$SubChapterAdapterVH;
invoke-virtual {p0, p1, p2}, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;->onBindViewHolder(Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter$SubChapterAdapterVH;I)V
return-void
.end method
.method public onBindViewHolder(Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter$SubChapterAdapterVH;I)V
.registers 8
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x0,
0x0
}
names = {
"holder",
"position"
}
.end annotation
add-int/lit8 v0, p2, 0x1
.line 50
iput v0, p0, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;->count:I
.line 51
iget-object v0, p1, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter$SubChapterAdapterVH;->num:Landroid/widget/TextView;
const/4 v1, 0x1
new-array v1, v1, [Ljava/lang/Object;
iget v2, p0, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;->count:I
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
const/4 v3, 0x0
aput-object v2, v1, v3
const-string v2, "Chapter: %d"
invoke-static {v2, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
.line 52
iget-object v0, p0, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;->subChapterModelList:Ljava/util/List;
invoke-interface {v0, p2}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/yctpublication/mastes/models/SubChapterModel;
invoke-virtual {v0}, Lcom/yctpublication/mastes/models/SubChapterModel;->getTitle()Ljava/lang/String;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/String;->isEmpty()Z
move-result v0
if-nez v0, :cond_3f
.line 53
iget-object v0, p1, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter$SubChapterAdapterVH;->title:Landroid/widget/TextView;
iget-object v1, p0, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;->subChapterModelList:Ljava/util/List;
invoke-interface {v1, p2}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v1
check-cast v1, Lcom/yctpublication/mastes/models/SubChapterModel;
invoke-virtual {v1}, Lcom/yctpublication/mastes/models/SubChapterModel;->getTitle()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
goto :goto_50
.line 55
:cond_3f
iget-object v0, p1, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter$SubChapterAdapterVH;->title:Landroid/widget/TextView;
iget-object v1, p0, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;->subChapterModelList:Ljava/util/List;
invoke-interface {v1, p2}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v1
check-cast v1, Lcom/yctpublication/mastes/models/SubChapterModel;
invoke-virtual {v1}, Lcom/yctpublication/mastes/models/SubChapterModel;->getTitle_hi()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
.line 58
:goto_50
iget-object v0, p0, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;->context:Landroid/content/Context;
check-cast v0, Landroid/app/Activity;
invoke-virtual {v0}, Landroid/app/Activity;->getIntent()Landroid/content/Intent;
move-result-object v0
const-string v1, "quizId"
invoke-virtual {v0, v1}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
.line 64
new-instance v1, Lcom/yctpublication/mastes/common/storevalue/databasebook/DatabaseHandlerofQuiz;
iget-object v2, p0, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;->context:Landroid/content/Context;
invoke-direct {v1, v2}, Lcom/yctpublication/mastes/common/storevalue/databasebook/DatabaseHandlerofQuiz;-><init>(Landroid/content/Context;)V
iput-object v1, p0, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;->dbQuiz:Lcom/yctpublication/mastes/common/storevalue/databasebook/DatabaseHandlerofQuiz;
.line 65
invoke-virtual {v1, v0}, Lcom/yctpublication/mastes/common/storevalue/databasebook/DatabaseHandlerofQuiz;->getLastSubChapter(Ljava/lang/String;)Ljava/lang/String;
move-result-object v1
const/16 v2, 0x8
if-eqz v1, :cond_9d
.line 66
iget-object v1, p0, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;->subChapterModelList:Ljava/util/List;
invoke-interface {v1, p2}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v1
check-cast v1, Lcom/yctpublication/mastes/models/SubChapterModel;
invoke-virtual {v1}, Lcom/yctpublication/mastes/models/SubChapterModel;->getId()Ljava/lang/String;
move-result-object v1
iget-object v4, p0, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;->dbQuiz:Lcom/yctpublication/mastes/common/storevalue/databasebook/DatabaseHandlerofQuiz;
invoke-virtual {v4, v0}, Lcom/yctpublication/mastes/common/storevalue/databasebook/DatabaseHandlerofQuiz;->getLastSubChapter(Ljava/lang/String;)Ljava/lang/String;
move-result-object v4
invoke-virtual {v1, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_92
.line 68
iget-object v1, p1, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter$SubChapterAdapterVH;->ivBookMark:Landroid/widget/ImageView;
invoke-virtual {v1, v3}, Landroid/widget/ImageView;->setVisibility(I)V
.line 69
iget-object v1, p1, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter$SubChapterAdapterVH;->rbk:Landroid/widget/RelativeLayout;
invoke-virtual {v1, v3}, Landroid/widget/RelativeLayout;->setVisibility(I)V
goto :goto_ab
.line 74
:cond_92
iget-object v1, p1, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter$SubChapterAdapterVH;->ivBookMark:Landroid/widget/ImageView;
invoke-virtual {v1, v2}, Landroid/widget/ImageView;->setVisibility(I)V
.line 75
iget-object v1, p1, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter$SubChapterAdapterVH;->rbk:Landroid/widget/RelativeLayout;
invoke-virtual {v1, v2}, Landroid/widget/RelativeLayout;->setVisibility(I)V
goto :goto_ab
.line 84
:cond_9d
iget-object v1, p1, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter$SubChapterAdapterVH;->ivBookMark:Landroid/widget/ImageView;
invoke-virtual {v1, v2}, Landroid/widget/ImageView;->setVisibility(I)V
.line 85
iget-object v1, p1, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter$SubChapterAdapterVH;->rbk:Landroid/widget/RelativeLayout;
invoke-virtual {v1, v2}, Landroid/widget/RelativeLayout;->setVisibility(I)V
const-string v1, "0"
.line 86
iput-object v1, p0, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;->saveQuiz:Ljava/lang/String;
.line 88
:goto_ab
iget-object p1, p1, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter$SubChapterAdapterVH;->linearLayout:Landroid/widget/LinearLayout;
new-instance v1, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter$1;
invoke-direct {v1, p0, p2, v0}, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter$1;-><init>(Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;ILjava/lang/String;)V
invoke-virtual {p1, v1}, Landroid/widget/LinearLayout;->setOnClickListener(Landroid/view/View$OnClickListener;)V
return-void
.end method
.method public bridge synthetic onCreateViewHolder(Landroid/view/ViewGroup;I)Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
.registers 3
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x1000,
0x1000
}
names = {
"parent",
"viewType"
}
.end annotation
.line 25
invoke-virtual {p0, p1, p2}, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;->onCreateViewHolder(Landroid/view/ViewGroup;I)Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter$SubChapterAdapterVH;
move-result-object p1
return-object p1
.end method
.method public onCreateViewHolder(Landroid/view/ViewGroup;I)Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter$SubChapterAdapterVH;
.registers 4
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x0,
0x0
}
names = {
"parent",
"viewType"
}
.end annotation
.line 43
iget-object p1, p0, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;->context:Landroid/content/Context;
invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;
move-result-object p1
const p2, 0x7f0c0052
const/4 v0, 0x0
invoke-virtual {p1, p2, v0}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object p1
.line 44
new-instance p2, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter$SubChapterAdapterVH;
invoke-direct {p2, p0, p1}, Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter$SubChapterAdapterVH;-><init>(Lcom/yctpublication/mastes/quiz/adapters/SubChapterAdapter;Landroid/view/View;)V
return-object p2
.end method