PausedTestFragment.smali
.class public Lcom/yctpublication/mastes/mytests/PausedTestFragment;
.super Landroidx/fragment/app/Fragment;
.source "PausedTestFragment.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/yctpublication/mastes/mytests/PausedTestFragment$AssessmentAdapter;
}
.end annotation
# instance fields
.field adapter:Landroidx/recyclerview/widget/RecyclerView$Adapter;
.field assessmentList:Ljava/util/ArrayList;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/ArrayList<",
"Lcom/yctpublication/mastes/models/AssessmentModel;",
">;"
}
.end annotation
.end field
.field layoutManager:Landroidx/recyclerview/widget/RecyclerView$LayoutManager;
.field progressBar:Landroid/widget/ProgressBar;
.field recyclerView:Landroidx/recyclerview/widget/RecyclerView;
.field sharedPref:Landroid/content/SharedPreferences;
.field testList:Ljava/util/ArrayList;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/ArrayList<",
"Lcom/yctpublication/mastes/models/PausedTestModel;",
">;"
}
.end annotation
.end field
.field userID:Ljava/lang/String;
# direct methods
.method public constructor <init>()V
.registers 1
.line 60
invoke-direct {p0}, Landroidx/fragment/app/Fragment;-><init>()V
return-void
.end method
.method private getFinishedAssessments()V
.registers 11
.line 97
invoke-virtual {p0}, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->getContext()Landroid/content/Context;
move-result-object v0
invoke-static {v0}, Lcom/yctpublication/mastes/common/LibraryFunctions;->isNetworkConnected(Landroid/content/Context;)Z
move-result v0
const/4 v1, 0x0
if-eqz v0, :cond_40
.line 99
iget-object v0, p0, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->progressBar:Landroid/widget/ProgressBar;
invoke-virtual {v0, v1}, Landroid/widget/ProgressBar;->setVisibility(I)V
.line 101
invoke-virtual {p0}, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->getContext()Landroid/content/Context;
move-result-object v0
invoke-static {v0}, Lcom/android/volley/toolbox/Volley;->newRequestQueue(Landroid/content/Context;)Lcom/android/volley/RequestQueue;
move-result-object v0
.line 104
new-instance v1, Ljava/util/HashMap;
invoke-direct {v1}, Ljava/util/HashMap;-><init>()V
.line 105
iget-object v2, p0, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->userID:Ljava/lang/String;
const-string v3, "user_id"
invoke-interface {v1, v3, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 106
new-instance v7, Lorg/json/JSONObject;
invoke-direct {v7, v1}, Lorg/json/JSONObject;-><init>(Ljava/util/Map;)V
.line 108
new-instance v1, Lcom/android/volley/toolbox/JsonObjectRequest;
const/4 v5, 0x1
new-instance v8, Lcom/yctpublication/mastes/mytests/PausedTestFragment$1;
invoke-direct {v8, p0}, Lcom/yctpublication/mastes/mytests/PausedTestFragment$1;-><init>(Lcom/yctpublication/mastes/mytests/PausedTestFragment;)V
new-instance v9, Lcom/yctpublication/mastes/mytests/PausedTestFragment$2;
invoke-direct {v9, p0}, Lcom/yctpublication/mastes/mytests/PausedTestFragment$2;-><init>(Lcom/yctpublication/mastes/mytests/PausedTestFragment;)V
const-string v6, "https://yctpublication.com/api/get-paused-tests.php"
move-object v4, v1
invoke-direct/range {v4 .. v9}, Lcom/android/volley/toolbox/JsonObjectRequest;-><init>(ILjava/lang/String;Lorg/json/JSONObject;Lcom/android/volley/Response$Listener;Lcom/android/volley/Response$ErrorListener;)V
.line 142
invoke-virtual {v0, v1}, Lcom/android/volley/RequestQueue;->add(Lcom/android/volley/Request;)Lcom/android/volley/Request;
return-void
.line 145
:cond_40
invoke-virtual {p0}, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->getContext()Landroid/content/Context;
move-result-object v0
const v2, 0x7f12007b
invoke-virtual {p0, v2}, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->getString(I)Ljava/lang/String;
move-result-object v2
invoke-static {v0, v2, v1}, 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
return-void
.end method
# virtual methods
.method public onCreateView(Landroid/view/LayoutInflater;Landroid/view/ViewGroup;Landroid/os/Bundle;)Landroid/view/View;
.registers 5
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x0,
0x0,
0x0
}
names = {
"inflater",
"container",
"savedInstanceState"
}
.end annotation
const p3, 0x7f0c0079
const/4 v0, 0x0
.line 68
invoke-virtual {p1, p3, p2, v0}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
move-result-object p1
return-object p1
.end method
.method public onViewCreated(Landroid/view/View;Landroid/os/Bundle;)V
.registers 6
.annotation system Ldalvik/annotation/MethodParameters;
accessFlags = {
0x0,
0x0
}
names = {
"view",
"savedInstanceState"
}
.end annotation
.line 74
invoke-virtual {p0}, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->getContext()Landroid/content/Context;
move-result-object p2
invoke-virtual {p0}, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->getContext()Landroid/content/Context;
move-result-object v0
const v1, 0x7f1200f8
invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v0
const/4 v1, 0x0
invoke-virtual {p2, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
move-result-object p2
iput-object p2, p0, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->sharedPref:Landroid/content/SharedPreferences;
.line 76
new-instance p2, Lcom/google/gson/Gson;
invoke-direct {p2}, Lcom/google/gson/Gson;-><init>()V
.line 77
iget-object v0, p0, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->sharedPref:Landroid/content/SharedPreferences;
invoke-virtual {p0}, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->getContext()Landroid/content/Context;
move-result-object v1
const v2, 0x7f120117
invoke-virtual {v1, v2}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v1
const/4 v2, 0x0
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
const-class v1, Lcom/yctpublication/mastes/models/UserModel;
invoke-virtual {p2, v0, v1}, Lcom/google/gson/Gson;->fromJson(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;
move-result-object p2
check-cast p2, Lcom/yctpublication/mastes/models/UserModel;
.line 78
invoke-virtual {p2}, Lcom/yctpublication/mastes/models/UserModel;->getId()Ljava/lang/String;
move-result-object p2
iput-object p2, p0, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->userID:Ljava/lang/String;
.line 80
new-instance p2, Ljava/util/ArrayList;
invoke-direct {p2}, Ljava/util/ArrayList;-><init>()V
iput-object p2, p0, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->assessmentList:Ljava/util/ArrayList;
.line 81
new-instance p2, Ljava/util/ArrayList;
invoke-direct {p2}, Ljava/util/ArrayList;-><init>()V
iput-object p2, p0, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->testList:Ljava/util/ArrayList;
const p2, 0x7f09027e
.line 83
invoke-virtual {p1, p2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object p2
check-cast p2, Landroid/widget/ProgressBar;
iput-object p2, p0, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->progressBar:Landroid/widget/ProgressBar;
.line 84
invoke-direct {p0}, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->getFinishedAssessments()V
const p2, 0x7f0902b2
.line 86
invoke-virtual {p1, p2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object p1
check-cast p1, Landroidx/recyclerview/widget/RecyclerView;
iput-object p1, p0, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->recyclerView:Landroidx/recyclerview/widget/RecyclerView;
.line 87
new-instance p1, Landroidx/recyclerview/widget/LinearLayoutManager;
invoke-virtual {p0}, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->getContext()Landroid/content/Context;
move-result-object p2
invoke-direct {p1, p2}, Landroidx/recyclerview/widget/LinearLayoutManager;-><init>(Landroid/content/Context;)V
iput-object p1, p0, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->layoutManager:Landroidx/recyclerview/widget/RecyclerView$LayoutManager;
.line 88
iget-object p2, p0, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->recyclerView:Landroidx/recyclerview/widget/RecyclerView;
invoke-virtual {p2, p1}, Landroidx/recyclerview/widget/RecyclerView;->setLayoutManager(Landroidx/recyclerview/widget/RecyclerView$LayoutManager;)V
.line 89
new-instance p1, Lcom/yctpublication/mastes/mytests/PausedTestFragment$AssessmentAdapter;
invoke-direct {p1, p0, v2}, Lcom/yctpublication/mastes/mytests/PausedTestFragment$AssessmentAdapter;-><init>(Lcom/yctpublication/mastes/mytests/PausedTestFragment;Lcom/yctpublication/mastes/mytests/PausedTestFragment$1;)V
iput-object p1, p0, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->adapter:Landroidx/recyclerview/widget/RecyclerView$Adapter;
.line 90
iget-object p2, p0, Lcom/yctpublication/mastes/mytests/PausedTestFragment;->recyclerView:Landroidx/recyclerview/widget/RecyclerView;
invoke-virtual {p2, p1}, Landroidx/recyclerview/widget/RecyclerView;->setAdapter(Landroidx/recyclerview/widget/RecyclerView$Adapter;)V
return-void
.end method