CommentsFragment.smali

.class public Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;
.super Lhurriyet/mobil/android/hurriyet/fragments/BaseFragment;
.source "CommentsFragment.java"


# instance fields
.field private articleId:Ljava/lang/String;

.field private articleUrl:Ljava/lang/String;

.field private commentLst:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList<",
            "Ltr/com/hurriyet/androidsdk/response/comment/Comments;",
            ">;"
        }
    .end annotation
.end field

.field private commentsAdapter:Lhurriyet/mobil/android/hurriyet/adapters/CommentsAdapter;

.field private etWriteComment:Landroid/widget/EditText;

.field private isAllLoaded:Z

.field private isLoading:Z

.field private linearLayoutManager:Landroidx/recyclerview/widget/LinearLayoutManager;

.field private mClose:Landroid/view/View;

.field private mCommentsRecyclerView:Landroidx/recyclerview/widget/RecyclerView;

.field private final mOnClickListener:Landroid/view/View$OnClickListener;

.field private pageNo:I

.field private pageSize:I

.field private relLoginToComment:Landroid/widget/RelativeLayout;

.field private relLoginToCommentClickable:Landroid/view/View;

.field private txtFirstComment:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;


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

    .line 32
    invoke-direct {p0}, Lhurriyet/mobil/android/hurriyet/fragments/BaseFragment;-><init>()V

    const/16 v0, 0x14

    .line 33
    iput v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->pageSize:I

    const/4 v0, 0x1

    .line 34
    iput v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->pageNo:I

    .line 211
    new-instance v0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment$4;

    invoke-direct {v0, p0}, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment$4;-><init>(Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;)V

    iput-object v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->mOnClickListener:Landroid/view/View$OnClickListener;

    return-void
.end method

.method static synthetic access$000(Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;)Landroidx/recyclerview/widget/LinearLayoutManager;
    .registers 1

    .line 32
    iget-object p0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->linearLayoutManager:Landroidx/recyclerview/widget/LinearLayoutManager;

    return-object p0
.end method

.method static synthetic access$100(Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;)Z
    .registers 1

    .line 32
    iget-boolean p0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->isLoading:Z

    return p0
.end method

.method static synthetic access$1000(Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;)Landroid/view/View;
    .registers 1

    .line 32
    iget-object p0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->relLoginToCommentClickable:Landroid/view/View;

    return-object p0
.end method

.method static synthetic access$102(Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;Z)Z
    .registers 2

    .line 32
    iput-boolean p1, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->isLoading:Z

    return p1
.end method

.method static synthetic access$200(Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;)V
    .registers 1

    .line 32
    invoke-direct {p0}, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->loadNextColumns()V

    return-void
.end method

.method static synthetic access$300(Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;)Ljava/lang/String;
    .registers 1

    .line 32
    iget-object p0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->articleId:Ljava/lang/String;

    return-object p0
.end method

.method static synthetic access$400(Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;)Lhurriyet/mobil/android/hurriyet/adapters/CommentsAdapter;
    .registers 1

    .line 32
    iget-object p0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->commentsAdapter:Lhurriyet/mobil/android/hurriyet/adapters/CommentsAdapter;

    return-object p0
.end method

.method static synthetic access$500(Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;)Ljava/util/ArrayList;
    .registers 1

    .line 32
    iget-object p0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->commentLst:Ljava/util/ArrayList;

    return-object p0
.end method

.method static synthetic access$608(Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;)I
    .registers 3

    .line 32
    iget v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->pageNo:I

    add-int/lit8 v1, v0, 0x1

    iput v1, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->pageNo:I

    return v0
.end method

.method static synthetic access$702(Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;Z)Z
    .registers 2

    .line 32
    iput-boolean p1, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->isAllLoaded:Z

    return p1
.end method

.method static synthetic access$800(Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;)Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;
    .registers 1

    .line 32
    iget-object p0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->txtFirstComment:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    return-object p0
.end method

.method static synthetic access$900(Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;)Landroid/view/View;
    .registers 1

    .line 32
    iget-object p0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->mClose:Landroid/view/View;

    return-object p0
.end method

.method private editTextOperations()V
    .registers 3

    .line 130
    iget-object v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->etWriteComment:Landroid/widget/EditText;

    new-instance v1, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment$2;

    invoke-direct {v1, p0}, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment$2;-><init>(Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;)V

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->setOnFocusChangeListener(Landroid/view/View$OnFocusChangeListener;)V

    return-void
.end method

.method private initViews(Landroid/view/View;)V
    .registers 3

    .line 83
    new-instance v0, Ljava/util/ArrayList;

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

    iput-object v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->commentLst:Ljava/util/ArrayList;

    const v0, 0x7f0900c8

    .line 85
    invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->mClose:Landroid/view/View;

    const v0, 0x7f090401

    .line 86
    invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    iput-object v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->txtFirstComment:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    const v0, 0x7f09014f

    .line 87
    invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/EditText;

    iput-object v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->etWriteComment:Landroid/widget/EditText;

    const v0, 0x7f090305

    .line 88
    invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/RelativeLayout;

    iput-object v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->relLoginToComment:Landroid/widget/RelativeLayout;

    const v0, 0x7f0900c9

    .line 89
    invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->relLoginToCommentClickable:Landroid/view/View;

    const v0, 0x7f0902f3

    .line 90
    invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p1

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

    iput-object p1, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->mCommentsRecyclerView:Landroidx/recyclerview/widget/RecyclerView;

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

    invoke-static {}, Lcom/appcore/CoreApp;->getAppContext()Landroid/content/Context;

    move-result-object v0

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

    iput-object p1, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->linearLayoutManager:Landroidx/recyclerview/widget/LinearLayoutManager;

    .line 92
    iget-object v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->mCommentsRecyclerView:Landroidx/recyclerview/widget/RecyclerView;

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

    .line 93
    new-instance p1, Lhurriyet/mobil/android/hurriyet/adapters/CommentsAdapter;

    iget-object v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->commentLst:Ljava/util/ArrayList;

    invoke-direct {p1, v0}, Lhurriyet/mobil/android/hurriyet/adapters/CommentsAdapter;-><init>(Ljava/util/ArrayList;)V

    iput-object p1, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->commentsAdapter:Lhurriyet/mobil/android/hurriyet/adapters/CommentsAdapter;

    .line 94
    iget-object v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->mCommentsRecyclerView:Landroidx/recyclerview/widget/RecyclerView;

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

    .line 96
    iget-object p1, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->mCommentsRecyclerView:Landroidx/recyclerview/widget/RecyclerView;

    new-instance v0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment$1;

    invoke-direct {v0, p0}, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment$1;-><init>(Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;)V

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

    .line 115
    iget-object p1, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->mClose:Landroid/view/View;

    iget-object v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->mOnClickListener:Landroid/view/View$OnClickListener;

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

    .line 116
    iget-object p1, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->relLoginToCommentClickable:Landroid/view/View;

    iget-object v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->mOnClickListener:Landroid/view/View$OnClickListener;

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

    .line 118
    invoke-direct {p0}, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->setLoginBarVisibility()V

    .line 119
    invoke-direct {p0}, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->editTextOperations()V

    return-void
.end method

.method private loadNextColumns()V
    .registers 5

    .line 150
    iget-boolean v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->isAllLoaded:Z

    if-nez v0, :cond_15

    const/4 v0, 0x1

    .line 152
    iput-boolean v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->isLoading:Z

    .line 154
    iget-object v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->articleId:Ljava/lang/String;

    iget v1, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->pageNo:I

    iget v2, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->pageSize:I

    new-instance v3, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment$3;

    invoke-direct {v3, p0}, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment$3;-><init>(Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;)V

    invoke-static {v0, v1, v2, v3}, Ltr/com/hurriyet/androidsdk/HurriyetSDK;->getComments(Ljava/lang/String;IILtr/com/hurriyet/androidsdk/callback/GetCommentsCallback;)Lretrofit2/Call;

    :cond_15
    return-void
.end method

.method public static newInstance()Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;
    .registers 1

    .line 53
    new-instance v0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;

    invoke-direct {v0}, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;-><init>()V

    return-object v0
.end method

.method private setLoginBarVisibility()V
    .registers 3

    .line 123
    invoke-static {}, Lhurriyet/mobil/android/hurriyet/utils/SharedPreferencesHelper;->getUserToken()Ljava/lang/String;

    move-result-object v0

    if-eqz v0, :cond_e

    .line 124
    iget-object v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->relLoginToComment:Landroid/widget/RelativeLayout;

    const/16 v1, 0x8

    invoke-virtual {v0, v1}, Landroid/widget/RelativeLayout;->setVisibility(I)V

    goto :goto_14

    .line 126
    :cond_e
    iget-object v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->relLoginToComment:Landroid/widget/RelativeLayout;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/widget/RelativeLayout;->setVisibility(I)V

    :goto_14
    return-void
.end method


# virtual methods
.method protected getConfigurationsForFragment(Lcom/appcore/configuration/ConfigurationsForFragment;)V
    .registers 3

    .line 67
    invoke-super {p0, p1}, Lhurriyet/mobil/android/hurriyet/fragments/BaseFragment;->getConfigurationsForFragment(Lcom/appcore/configuration/ConfigurationsForFragment;)V

    const v0, 0x7f0c0058

    .line 68
    iput v0, p1, Lcom/appcore/configuration/ConfigurationsForFragment;->layoutID:I

    return-void
.end method

.method public isTabVisible()Z
    .registers 2

    const/4 v0, 0x0

    return v0
.end method

.method protected onDataReceived(Lcom/appcore/utils/helpers/DataTransferObject;Z)V
    .registers 3

    .line 58
    check-cast p1, Lhurriyet/mobil/android/hurriyet/datatransferobjects/CommentsFragmentData;

    if-eqz p1, :cond_c

    .line 60
    iget-object p2, p1, Lhurriyet/mobil/android/hurriyet/datatransferobjects/CommentsFragmentData;->id:Ljava/lang/String;

    iput-object p2, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->articleId:Ljava/lang/String;

    .line 61
    iget-object p1, p1, Lhurriyet/mobil/android/hurriyet/datatransferobjects/CommentsFragmentData;->url:Ljava/lang/String;

    iput-object p1, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->articleUrl:Ljava/lang/String;

    :cond_c
    return-void
.end method

.method public onResume()V
    .registers 4

    .line 196
    invoke-super {p0}, Lhurriyet/mobil/android/hurriyet/fragments/BaseFragment;->onResume()V

    .line 198
    iget-object v0, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->commentsAdapter:Lhurriyet/mobil/android/hurriyet/adapters/CommentsAdapter;

    if-eqz v0, :cond_a

    .line 199
    invoke-virtual {v0}, Lhurriyet/mobil/android/hurriyet/adapters/CommentsAdapter;->notifyDataSetChanged()V

    .line 201
    :cond_a
    new-instance v0, Ltr/com/hurriyet/androidsdk/response/content/DataLayer;

    invoke-direct {v0}, Ltr/com/hurriyet/androidsdk/response/content/DataLayer;-><init>()V

    .line 202
    new-instance v1, Ljava/lang/StringBuilder;

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

    iget-object v2, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->articleUrl:Ljava/lang/String;

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

    const v2, 0x7f10010c

    invoke-static {v2}, Lhurriyet/mobil/android/hurriyet/HApp;->getStrWithID(I)Ljava/lang/String;

    move-result-object v2

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

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

    move-result-object v1

    iput-object v1, v0, Ltr/com/hurriyet/androidsdk/response/content/DataLayer;->trackingUrl:Ljava/lang/String;

    .line 203
    invoke-static {v0}, Lhurriyet/mobil/android/hurriyet/utils/HurriyetAnalytics;->logScreen(Ltr/com/hurriyet/androidsdk/response/content/DataLayer;)V

    return-void
.end method

.method public onViewCreated(Landroid/view/View;Landroid/os/Bundle;)V
    .registers 3

    .line 73
    invoke-super {p0, p1, p2}, Lhurriyet/mobil/android/hurriyet/fragments/BaseFragment;->onViewCreated(Landroid/view/View;Landroid/os/Bundle;)V

    const/4 p2, 0x0

    .line 74
    iput-boolean p2, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->isAllLoaded:Z

    .line 75
    iput-boolean p2, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->isLoading:Z

    const/4 p2, 0x1

    .line 76
    iput p2, p0, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->pageNo:I

    .line 78
    invoke-direct {p0, p1}, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->initViews(Landroid/view/View;)V

    .line 79
    invoke-direct {p0}, Lhurriyet/mobil/android/hurriyet/fragments/CommentsFragment;->loadNextColumns()V

    return-void
.end method