EbookBottamFragment.smali

.class public Lcom/yctpublication/mastes/home/EbookBottamFragment;
.super Landroidx/fragment/app/Fragment;
.source "EbookBottamFragment.java"

# interfaces
.implements Lcom/yctpublication/mastes/ebook/adapter/CategoryTypeListAdapter$AdapterCallbackEbookBottam;


# instance fields
.field private categoryTypeListAdapter:Lcom/yctpublication/mastes/ebook/adapter/CategoryTypeListAdapter;

.field ebookAdapter:Lcom/yctpublication/mastes/home/adapters/EbookAdapter;

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

.field filter_list:Lcom/google/android/material/tabs/TabLayout;

.field gridLayoutManager:Landroidx/recyclerview/widget/GridLayoutManager;

.field lAll:Landroid/widget/LinearLayout;

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

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

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

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

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

.field private tvSearchBook:Landroid/widget/EditText;

.field view:Landroid/view/View;


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

    .line 61
    invoke-direct {p0}, Landroidx/fragment/app/Fragment;-><init>()V

    return-void
.end method

.method static synthetic access$000(Lcom/yctpublication/mastes/home/EbookBottamFragment;)Landroid/widget/EditText;
    .registers 1

    .line 47
    iget-object p0, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->tvSearchBook:Landroid/widget/EditText;

    return-object p0
.end method

.method static synthetic access$100(Lcom/yctpublication/mastes/home/EbookBottamFragment;)Lcom/yctpublication/mastes/ebook/adapter/CategoryTypeListAdapter;
    .registers 1

    .line 47
    iget-object p0, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->categoryTypeListAdapter:Lcom/yctpublication/mastes/ebook/adapter/CategoryTypeListAdapter;

    return-object p0
.end method

.method static synthetic access$102(Lcom/yctpublication/mastes/home/EbookBottamFragment;Lcom/yctpublication/mastes/ebook/adapter/CategoryTypeListAdapter;)Lcom/yctpublication/mastes/ebook/adapter/CategoryTypeListAdapter;
    .registers 2

    .line 47
    iput-object p1, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->categoryTypeListAdapter:Lcom/yctpublication/mastes/ebook/adapter/CategoryTypeListAdapter;

    return-object p1
.end method

.method private getMasterCategory()V
    .registers 7

    .line 232
    invoke-virtual {p0}, Lcom/yctpublication/mastes/home/EbookBottamFragment;->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 233
    new-instance v1, Lcom/android/volley/toolbox/StringRequest;

    new-instance v2, Lcom/yctpublication/mastes/home/EbookBottamFragment$6;

    invoke-direct {v2, p0}, Lcom/yctpublication/mastes/home/EbookBottamFragment$6;-><init>(Lcom/yctpublication/mastes/home/EbookBottamFragment;)V

    new-instance v3, Lcom/yctpublication/mastes/home/EbookBottamFragment$7;

    invoke-direct {v3, p0}, Lcom/yctpublication/mastes/home/EbookBottamFragment$7;-><init>(Lcom/yctpublication/mastes/home/EbookBottamFragment;)V

    const/4 v4, 0x1

    const-string v5, "https://yctpublication.com/master/api/getcategory"

    invoke-direct {v1, v4, v5, v2, v3}, Lcom/android/volley/toolbox/StringRequest;-><init>(ILjava/lang/String;Lcom/android/volley/Response$Listener;Lcom/android/volley/Response$ErrorListener;)V

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

    return-void
.end method


# virtual methods
.method public getEbooks()V
    .registers 7

    .line 171
    iget-object v0, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->swipeRefreshLayout:Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;

    const/4 v1, 0x1

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

    .line 172
    invoke-virtual {p0}, Lcom/yctpublication/mastes/home/EbookBottamFragment;->getContext()Landroid/content/Context;

    move-result-object v0

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

    move-result v0

    if-eqz v0, :cond_37

    .line 173
    iget-object v0, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->swipeRefreshLayout:Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;

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

    .line 174
    iget-object v0, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->ebookModelList:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    .line 175
    invoke-virtual {p0}, Lcom/yctpublication/mastes/home/EbookBottamFragment;->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 176
    new-instance v2, Lcom/android/volley/toolbox/StringRequest;

    new-instance v3, Lcom/yctpublication/mastes/home/EbookBottamFragment$4;

    invoke-direct {v3, p0}, Lcom/yctpublication/mastes/home/EbookBottamFragment$4;-><init>(Lcom/yctpublication/mastes/home/EbookBottamFragment;)V

    new-instance v4, Lcom/yctpublication/mastes/home/EbookBottamFragment$5;

    invoke-direct {v4, p0}, Lcom/yctpublication/mastes/home/EbookBottamFragment$5;-><init>(Lcom/yctpublication/mastes/home/EbookBottamFragment;)V

    const-string v5, "https://yctpublication.com/master/api/MasterController/booklist"

    invoke-direct {v2, v1, v5, v3, v4}, Lcom/android/volley/toolbox/StringRequest;-><init>(ILjava/lang/String;Lcom/android/volley/Response$Listener;Lcom/android/volley/Response$ErrorListener;)V

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

    goto :goto_4a

    .line 227
    :cond_37
    invoke-virtual {p0}, Lcom/yctpublication/mastes/home/EbookBottamFragment;->getContext()Landroid/content/Context;

    move-result-object v0

    const v1, 0x7f12007b

    invoke-virtual {p0, v1}, Lcom/yctpublication/mastes/home/EbookBottamFragment;->getString(I)Ljava/lang/String;

    move-result-object v1

    const/4 v2, 0x0

    invoke-static {v0, v1, v2}, 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_4a
    return-void
.end method

.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, 0x7f0c0070

    const/4 v0, 0x0

    .line 67
    invoke-virtual {p1, p3, p2, v0}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object p1

    iput-object p1, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->view:Landroid/view/View;

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

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

    iput-object p1, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->ebookModelList:Ljava/util/ArrayList;

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

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

    iput-object p1, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->masterCategoryModelList:Ljava/util/ArrayList;

    .line 73
    iget-object p1, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->view:Landroid/view/View;

    const p2, 0x7f090381

    invoke-virtual {p1, p2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p1

    check-cast p1, Landroid/widget/EditText;

    iput-object p1, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->tvSearchBook:Landroid/widget/EditText;

    .line 74
    iget-object p1, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->view:Landroid/view/View;

    const p2, 0x7f0901a3

    invoke-virtual {p1, p2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p1

    check-cast p1, Landroid/widget/LinearLayout;

    iput-object p1, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->lAll:Landroid/widget/LinearLayout;

    .line 77
    iget-object p1, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->view:Landroid/view/View;

    const p2, 0x7f090350

    invoke-virtual {p1, p2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p1

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

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

    .line 81
    iget-object p1, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->view:Landroid/view/View;

    const p2, 0x7f090318

    invoke-virtual {p1, p2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p1

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

    iput-object p1, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->swipeRefreshLayout:Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;

    .line 82
    iget-object p1, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->view:Landroid/view/View;

    const p2, 0x7f09011c

    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/home/EbookBottamFragment;->recyclerView:Landroidx/recyclerview/widget/RecyclerView;

    .line 83
    iget-object p1, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->view:Landroid/view/View;

    const p2, 0x7f0902aa

    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/home/EbookBottamFragment;->recyclerViewCat:Landroidx/recyclerview/widget/RecyclerView;

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

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

    move-result-object p2

    const/4 p3, 0x3

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

    iput-object p1, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->gridLayoutManager:Landroidx/recyclerview/widget/GridLayoutManager;

    .line 87
    iget-object p2, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->recyclerView:Landroidx/recyclerview/widget/RecyclerView;

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

    .line 90
    iget-object p1, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->swipeRefreshLayout:Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;

    new-instance p2, Lcom/yctpublication/mastes/home/EbookBottamFragment$1;

    invoke-direct {p2, p0}, Lcom/yctpublication/mastes/home/EbookBottamFragment$1;-><init>(Lcom/yctpublication/mastes/home/EbookBottamFragment;)V

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

    .line 101
    invoke-virtual {p0}, Lcom/yctpublication/mastes/home/EbookBottamFragment;->getEbooks()V

    .line 102
    iget-object p1, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->lAll:Landroid/widget/LinearLayout;

    new-instance p2, Lcom/yctpublication/mastes/home/EbookBottamFragment$2;

    invoke-direct {p2, p0}, Lcom/yctpublication/mastes/home/EbookBottamFragment$2;-><init>(Lcom/yctpublication/mastes/home/EbookBottamFragment;)V

    invoke-virtual {p1, p2}, Landroid/widget/LinearLayout;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 113
    new-instance p1, Landroidx/recyclerview/widget/LinearLayoutManager;

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

    move-result-object p2

    invoke-direct {p1, p2}, Landroidx/recyclerview/widget/LinearLayoutManager;-><init>(Landroid/content/Context;)V

    .line 116
    invoke-virtual {p1, v0}, Landroidx/recyclerview/widget/LinearLayoutManager;->setOrientation(I)V

    .line 117
    iget-object p2, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->recyclerViewCat:Landroidx/recyclerview/widget/RecyclerView;

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

    .line 121
    invoke-direct {p0}, Lcom/yctpublication/mastes/home/EbookBottamFragment;->getMasterCategory()V

    .line 122
    iget-object p1, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->tvSearchBook:Landroid/widget/EditText;

    invoke-virtual {p1, v0}, Landroid/widget/EditText;->setEnabled(Z)V

    .line 123
    iget-object p1, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->tvSearchBook:Landroid/widget/EditText;

    new-instance p2, Lcom/yctpublication/mastes/home/EbookBottamFragment$3;

    invoke-direct {p2, p0}, Lcom/yctpublication/mastes/home/EbookBottamFragment$3;-><init>(Lcom/yctpublication/mastes/home/EbookBottamFragment;)V

    invoke-virtual {p1, p2}, Landroid/widget/EditText;->addTextChangedListener(Landroid/text/TextWatcher;)V

    .line 167
    iget-object p1, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->view:Landroid/view/View;

    return-object p1
.end method

.method public onMethodCallbackEbookBottam(I)V
    .registers 7
    .annotation system Ldalvik/annotation/MethodParameters;
        accessFlags = {
            0x0
        }
        names = {
            "position"
        }
    .end annotation

    .line 279
    iget-object v0, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->masterCategoryModelList:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lcom/yctpublication/mastes/models/MasterCategoryModel;

    .line 280
    iget-object v0, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->ebookModelList:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    .line 283
    iget-object v0, p0, Lcom/yctpublication/mastes/home/EbookBottamFragment;->ebookAdapter:Lcom/yctpublication/mastes/home/adapters/EbookAdapter;

    if-eqz v0, :cond_43

    .line 284
    invoke-virtual {p0}, Lcom/yctpublication/mastes/home/EbookBottamFragment;->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 285
    new-instance v1, Lcom/android/volley/toolbox/StringRequest;

    const/4 v2, 0x1

    new-instance v3, Ljava/lang/StringBuilder;

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

    const-string v4, "https://yctpublication.com/master/api/MasterController/getebook?catid="

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {p1}, Lcom/yctpublication/mastes/models/MasterCategoryModel;->getId()Ljava/lang/String;

    move-result-object p1

    invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object p1

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

    move-result-object p1

    new-instance v3, Lcom/yctpublication/mastes/home/EbookBottamFragment$8;

    invoke-direct {v3, p0}, Lcom/yctpublication/mastes/home/EbookBottamFragment$8;-><init>(Lcom/yctpublication/mastes/home/EbookBottamFragment;)V

    new-instance v4, Lcom/yctpublication/mastes/home/EbookBottamFragment$9;

    invoke-direct {v4, p0}, Lcom/yctpublication/mastes/home/EbookBottamFragment$9;-><init>(Lcom/yctpublication/mastes/home/EbookBottamFragment;)V

    invoke-direct {v1, v2, p1, v3, v4}, Lcom/android/volley/toolbox/StringRequest;-><init>(ILjava/lang/String;Lcom/android/volley/Response$Listener;Lcom/android/volley/Response$ErrorListener;)V

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

    :cond_43
    return-void
.end method