DetailDescriptionViewHolder.smali

.class public Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;
.super Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
.source "DetailDescriptionViewHolder.java"


# instance fields
.field mBigChar:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

.field mBottomText:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

.field private mBottomTextStartIndex:I

.field mSideText:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;


# direct methods
.method public constructor <init>(Landroid/view/View;)V
    .registers 3

    .line 29
    invoke-direct {p0, p1}, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;-><init>(Landroid/view/View;)V

    const/4 v0, -0x1

    .line 26
    iput v0, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mBottomTextStartIndex:I

    const v0, 0x7f0901f8

    .line 30
    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/adapters/viewholders/DetailDescriptionViewHolder;->mBigChar:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    const v0, 0x7f0901f9

    .line 31
    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/adapters/viewholders/DetailDescriptionViewHolder;->mSideText:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    const v0, 0x7f0901fa

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

    move-result-object p1

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

    iput-object p1, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mBottomText:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    return-void
.end method

.method static synthetic access$000(Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;Ljava/lang/String;)V
    .registers 2

    .line 21
    invoke-direct {p0, p1}, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->setSideText(Ljava/lang/String;)V

    return-void
.end method

.method static synthetic access$100(Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;)I
    .registers 1

    .line 21
    iget p0, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mBottomTextStartIndex:I

    return p0
.end method

.method static synthetic access$200(Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;ILjava/lang/String;)V
    .registers 3

    .line 21
    invoke-direct {p0, p1, p2}, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->setBottomText(ILjava/lang/String;)V

    return-void
.end method

.method private setBottomText(ILjava/lang/String;)V
    .registers 5

    .line 99
    invoke-virtual {p2}, Ljava/lang/String;->length()I

    move-result v0

    add-int/lit8 v0, v0, -0x1

    if-ge p1, v0, :cond_20

    .line 100
    iget-object v0, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mBottomText:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setVisibility(I)V

    .line 101
    invoke-virtual {p2}, Ljava/lang/String;->length()I

    move-result v0

    invoke-virtual {p2, p1, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object p1

    .line 102
    iget-object p2, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mBottomText:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

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

    move-result-object p1

    invoke-virtual {p2, p1}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setText(Ljava/lang/CharSequence;)V

    goto :goto_27

    .line 104
    :cond_20
    iget-object p1, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mBottomText:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    const/16 p2, 0x8

    invoke-virtual {p1, p2}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setVisibility(I)V

    :goto_27
    return-void
.end method

.method private setSideText(Ljava/lang/String;)V
    .registers 4

    .line 93
    iget-object v0, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mSideText:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    const/4 v1, 0x1

    invoke-virtual {p1, v1}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object p1

    invoke-virtual {v0, p1}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setText(Ljava/lang/CharSequence;)V

    .line 94
    iget-object p1, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mSideText:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    invoke-virtual {p1}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->requestLayout()V

    return-void
.end method


# virtual methods
.method public setData(Ltr/com/hurriyet/androidsdk/model/content/Content;)V
    .registers 7

    if-nez p1, :cond_3

    return-void

    .line 39
    :cond_3
    iget-object v0, p1, Ltr/com/hurriyet/androidsdk/model/content/Content;->description:Ljava/lang/String;

    .line 40
    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    const/16 v2, 0x8

    if-eqz v1, :cond_1d

    .line 41
    iget-object p1, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mBigChar:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    invoke-virtual {p1, v2}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setVisibility(I)V

    .line 42
    iget-object p1, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mSideText:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    invoke-virtual {p1, v2}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setVisibility(I)V

    .line 43
    iget-object p1, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mBottomText:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    invoke-virtual {p1, v2}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setVisibility(I)V

    return-void

    .line 47
    :cond_1d
    sget-boolean v1, Lhurriyet/mobil/android/hurriyet/HConstants;->IS_DROP_CAP_DESCRIPTION_ENABLED:Z

    if-nez v1, :cond_3b

    .line 48
    invoke-static {}, Lhurriyet/mobil/android/hurriyet/utils/SharedPreferencesHelper;->getNewsTextSize()I

    move-result p1

    .line 49
    iget-object v1, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mBottomText:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    int-to-float p1, p1

    invoke-virtual {v1, p1}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setTextSize(F)V

    .line 50
    iget-object p1, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mBottomText:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    invoke-virtual {p1, v0}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setText(Ljava/lang/CharSequence;)V

    .line 52
    iget-object p1, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mBigChar:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    invoke-virtual {p1, v2}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setVisibility(I)V

    .line 53
    iget-object p1, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mSideText:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    invoke-virtual {p1, v2}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setVisibility(I)V

    return-void

    .line 56
    :cond_3b
    iget-object v1, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mBigChar:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setVisibility(I)V

    .line 57
    iget-object v1, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mSideText:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    invoke-virtual {v1, v2}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setVisibility(I)V

    .line 58
    invoke-static {}, Lhurriyet/mobil/android/hurriyet/utils/SharedPreferencesHelper;->getNewsTextSize()I

    move-result v1

    .line 59
    iget-object v3, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mBigChar:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    int-to-float v1, v1

    const/high16 v4, 0x40000000    # 2.0f

    mul-float v4, v4, v1

    invoke-virtual {v3, v4}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setTextSize(F)V

    .line 60
    iget-object v3, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mSideText:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    invoke-virtual {v3, v1}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setTextSize(F)V

    .line 61
    iget-object v3, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mBottomText:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    invoke-virtual {v3, v1}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setTextSize(F)V

    .line 63
    iget v1, p1, Ltr/com/hurriyet/androidsdk/model/content/Content;->specialTextStartIndex:I

    if-gez v1, :cond_7a

    .line 64
    iget-object v1, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mBigChar:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    invoke-virtual {v0, v2}, Ljava/lang/String;->charAt(I)C

    move-result v2

    invoke-static {v2}, Ljava/lang/String;->valueOf(C)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setText(Ljava/lang/CharSequence;)V

    .line 65
    iget-object v1, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mBigChar:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    new-instance v2, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder$1;

    invoke-direct {v2, p0, v0, p1}, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder$1;-><init>(Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;Ljava/lang/String;Ltr/com/hurriyet/androidsdk/model/content/Content;)V

    invoke-static {v1, v2}, Lcom/appcore/utils/helpers/UiHelpers;->notifyWhenLayoutIsReady(Landroid/view/View;Ljava/lang/Runnable;)V

    goto :goto_8f

    .line 86
    :cond_7a
    iget-object v1, p0, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->mBigChar:Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;

    invoke-virtual {v0, v2}, Ljava/lang/String;->charAt(I)C

    move-result v2

    invoke-static {v2}, Ljava/lang/String;->valueOf(C)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lhurriyet/mobil/android/hurriyet/views/HurriyetTextView;->setText(Ljava/lang/CharSequence;)V

    .line 87
    invoke-direct {p0, v0}, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->setSideText(Ljava/lang/String;)V

    .line 88
    iget p1, p1, Ltr/com/hurriyet/androidsdk/model/content/Content;->specialTextStartIndex:I

    invoke-direct {p0, p1, v0}, Lhurriyet/mobil/android/hurriyet/adapters/viewholders/DetailDescriptionViewHolder;->setBottomText(ILjava/lang/String;)V

    :goto_8f
    return-void
.end method