.class public Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Lcom/android/systemui/miui/volume/MiuiVolumeTimerSeekBar$TimerSeekBarMotions;


# static fields
.field public static final SEGMENT_TIME_FG_THRESHOLD:I = 0x1

.field public static final TAG:Ljava/lang/String; = "VolumeTimerDrawables"


# instance fields
.field public mBackground:Landroid/graphics/drawable/Drawable;

.field public mContext:Landroid/content/Context;

.field public mCountDownStates:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Ljava/lang/Object;",
            ">;"
        }
    .end annotation
.end field

.field public mCurrentSegment:I

.field public mDeterminedSegment:I

.field public mDragging:Z

.field public mDrawable:Landroid/graphics/drawable/Drawable;

.field public mProgress:Landroid/graphics/drawable/Drawable;

.field public mProgressDraggingIcon:Landroid/graphics/drawable/Drawable;

.field public mProgressDraggingRect:Landroid/graphics/drawable/Drawable;

.field public mProgressDraggingRectIdle:Landroid/graphics/drawable/Drawable;

.field public mProgressNormalRect:Landroid/graphics/drawable/Drawable;

.field public mTicking:Z

.field public mTickingTimes:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Ljava/lang/Object;",
            ">;"
        }
    .end annotation
.end field

.field public mTimeDrawableBg:Lcom/android/systemui/miui/widget/CenterTextDrawable;

.field public mTimeDrawableFg:Lcom/android/systemui/miui/widget/CenterTextDrawable;

.field public mTimeDrawableHint:Ljava/lang/String;

.field public mTimeRemain:I

.field public mTimeSegmentTitle:[Ljava/lang/String;


# direct methods
.method public constructor <init>(Landroid/widget/SeekBar;Z)V
    .locals 2

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

    new-instance v0, Ljava/util/ArrayList;

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

    iput-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTickingTimes:Ljava/util/List;

    new-instance v0, Ljava/util/ArrayList;

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

    iput-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mCountDownStates:Ljava/util/List;

    invoke-virtual {p1}, Landroid/widget/SeekBar;->getContext()Landroid/content/Context;

    move-result-object v0

    iput-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mContext:Landroid/content/Context;

    invoke-virtual {p1}, Landroid/widget/SeekBar;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    sget v1, Lcom/android/systemui/miui/volume/R$string;->miui_dnd_count_down:I

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeDrawableHint:Ljava/lang/String;

    invoke-direct {p0}, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->initTimerString()V

    invoke-virtual {p1}, Landroid/widget/SeekBar;->getProgressDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object v0

    iput-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mDrawable:Landroid/graphics/drawable/Drawable;

    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mDrawable:Landroid/graphics/drawable/Drawable;

    if-eqz v0, :cond_0

    invoke-virtual {p1}, Landroid/widget/SeekBar;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-direct {p0, v0, p2}, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->setupDrawables(Landroid/content/Context;Z)V

    iget-object p2, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mDrawable:Landroid/graphics/drawable/Drawable;

    invoke-virtual {p1, p2}, Landroid/widget/SeekBar;->setProgressDrawable(Landroid/graphics/drawable/Drawable;)V

    invoke-direct {p0}, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->updateDrawables()V

    :cond_0
    return-void
.end method

.method public static synthetic access$000(Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;)Z
    .locals 0

    iget-boolean p0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTicking:Z

    return p0
.end method

.method public static synthetic access$100(Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;)Z
    .locals 0

    iget-boolean p0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mDragging:Z

    return p0
.end method

.method public static synthetic access$200(Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;)Landroid/graphics/drawable/Drawable;
    .locals 0

    iget-object p0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgressNormalRect:Landroid/graphics/drawable/Drawable;

    return-object p0
.end method

.method public static synthetic access$300(Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;)Landroid/graphics/drawable/Drawable;
    .locals 0

    iget-object p0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgressDraggingRect:Landroid/graphics/drawable/Drawable;

    return-object p0
.end method

.method private addTextDrawables(Landroid/content/Context;)V
    .locals 10

    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mDrawable:Landroid/graphics/drawable/Drawable;

    instance-of v1, v0, Landroid/graphics/drawable/LayerDrawable;

    if-nez v1, :cond_0

    const-string p0, "VolumeTimerDrawables"

    const-string p1, "progress drawable is not a LayerDrawable"

    invoke-static {p0, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    return-void

    :cond_0
    check-cast v0, Landroid/graphics/drawable/LayerDrawable;

    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    sget v2, Lcom/android/systemui/miui/volume/R$dimen;->miui_volume_timer_time_text_size:I

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDimension(I)F

    move-result v1

    const/4 v2, 0x0

    const-string v3, "mipro-medium"

    invoke-static {v3, v2}, Landroid/graphics/Typeface;->create(Ljava/lang/String;I)Landroid/graphics/Typeface;

    move-result-object v3

    new-instance v4, Lcom/android/systemui/miui/widget/CenterTextDrawable;

    invoke-direct {v4}, Lcom/android/systemui/miui/widget/CenterTextDrawable;-><init>()V

    iput-object v4, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeDrawableBg:Lcom/android/systemui/miui/widget/CenterTextDrawable;

    iget-object v4, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeDrawableBg:Lcom/android/systemui/miui/widget/CenterTextDrawable;

    invoke-virtual {v4, v1}, Lcom/android/systemui/miui/widget/CenterTextDrawable;->setTextSize(F)V

    iget-object v4, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeDrawableBg:Lcom/android/systemui/miui/widget/CenterTextDrawable;

    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v5

    sget v6, Lcom/android/systemui/miui/volume/R$color;->miui_volume_tint_light:I

    invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getColor(I)I

    move-result v5

    invoke-virtual {v4, v5}, Lcom/android/systemui/miui/widget/CenterTextDrawable;->setTextColor(I)V

    iget-object v4, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeDrawableBg:Lcom/android/systemui/miui/widget/CenterTextDrawable;

    invoke-virtual {v4, v3}, Lcom/android/systemui/miui/widget/CenterTextDrawable;->setTypeface(Landroid/graphics/Typeface;)V

    const/high16 v4, 0x1020000

    new-instance v5, Landroid/graphics/drawable/LayerDrawable;

    const/4 v6, 0x2

    new-array v7, v6, [Landroid/graphics/drawable/Drawable;

    iget-object v8, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mBackground:Landroid/graphics/drawable/Drawable;

    aput-object v8, v7, v2

    iget-object v8, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeDrawableBg:Lcom/android/systemui/miui/widget/CenterTextDrawable;

    const/4 v9, 0x1

    aput-object v8, v7, v9

    invoke-direct {v5, v7}, Landroid/graphics/drawable/LayerDrawable;-><init>([Landroid/graphics/drawable/Drawable;)V

    invoke-virtual {v0, v4, v5}, Landroid/graphics/drawable/LayerDrawable;->setDrawableByLayerId(ILandroid/graphics/drawable/Drawable;)Z

    new-instance v4, Lcom/android/systemui/miui/widget/CenterTextDrawable;

    invoke-direct {v4}, Lcom/android/systemui/miui/widget/CenterTextDrawable;-><init>()V

    iput-object v4, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeDrawableFg:Lcom/android/systemui/miui/widget/CenterTextDrawable;

    iget-object v4, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeDrawableFg:Lcom/android/systemui/miui/widget/CenterTextDrawable;

    invoke-virtual {v4, v1}, Lcom/android/systemui/miui/widget/CenterTextDrawable;->setTextSize(F)V

    iget-object v1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeDrawableFg:Lcom/android/systemui/miui/widget/CenterTextDrawable;

    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    sget v4, Lcom/android/systemui/miui/volume/R$color;->miui_volume_color_btn_seleted:I

    invoke-virtual {p1, v4}, Landroid/content/res/Resources;->getColor(I)I

    move-result p1

    invoke-virtual {v1, p1}, Lcom/android/systemui/miui/widget/CenterTextDrawable;->setTextColor(I)V

    iget-object p1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeDrawableFg:Lcom/android/systemui/miui/widget/CenterTextDrawable;

    invoke-virtual {p1, v3}, Lcom/android/systemui/miui/widget/CenterTextDrawable;->setTypeface(Landroid/graphics/Typeface;)V

    const p1, 0x102000d

    new-instance v1, Landroid/graphics/drawable/LayerDrawable;

    new-array v3, v6, [Landroid/graphics/drawable/Drawable;

    iget-object v4, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgress:Landroid/graphics/drawable/Drawable;

    aput-object v4, v3, v2

    new-instance v2, Landroid/graphics/drawable/ScaleDrawable;

    iget-object v4, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeDrawableFg:Lcom/android/systemui/miui/widget/CenterTextDrawable;

    const v5, 0x800003

    const/high16 v6, 0x3f800000    # 1.0f

    const/4 v7, 0x0

    invoke-direct {v2, v4, v5, v6, v7}, Landroid/graphics/drawable/ScaleDrawable;-><init>(Landroid/graphics/drawable/Drawable;IFF)V

    aput-object v2, v3, v9

    invoke-direct {v1, v3}, Landroid/graphics/drawable/LayerDrawable;-><init>([Landroid/graphics/drawable/Drawable;)V

    invoke-virtual {v0, p1, v1}, Landroid/graphics/drawable/LayerDrawable;->setDrawableByLayerId(ILandroid/graphics/drawable/Drawable;)Z

    iget-object p1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTickingTimes:Ljava/util/List;

    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeDrawableFg:Lcom/android/systemui/miui/widget/CenterTextDrawable;

    invoke-interface {p1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    iget-object p1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTickingTimes:Ljava/util/List;

    iget-object p0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeDrawableBg:Lcom/android/systemui/miui/widget/CenterTextDrawable;

    invoke-interface {p1, p0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    return-void
.end method

.method private formatRemainTime(I)Ljava/lang/String;
    .locals 4

    div-int/lit8 p0, p1, 0x3c

    div-int/lit8 v0, p0, 0x3c

    rem-int/lit8 p0, p0, 0x3c

    rem-int/lit8 p1, p1, 0x3c

    invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;

    move-result-object v1

    const/4 v2, 0x3

    new-array v2, v2, [Ljava/lang/Object;

    invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    const/4 v3, 0x0

    aput-object v0, v2, v3

    invoke-static {p0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object p0

    const/4 v0, 0x1

    aput-object p0, v2, v0

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object p0

    const/4 p1, 0x2

    aput-object p0, v2, p1

    const-string p0, "%d:%02d:%02d"

    invoke-static {v1, p0, v2}, Ljava/lang/String;->format(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object p0

    return-object p0
.end method

.method private initTimerString()V
    .locals 7

    const/4 v0, 0x5

    new-array v0, v0, [Ljava/lang/String;

    iput-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeSegmentTitle:[Ljava/lang/String;

    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeSegmentTitle:[Ljava/lang/String;

    iget-object v1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mContext:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    sget v2, Lcom/android/systemui/miui/volume/R$string;->timer_off:I

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    const/4 v2, 0x0

    aput-object v1, v0, v2

    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeSegmentTitle:[Ljava/lang/String;

    iget-object v1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mContext:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    sget v3, Lcom/android/systemui/miui/volume/R$string;->timer_30_minutes:I

    const/4 v4, 0x1

    new-array v5, v4, [Ljava/lang/Object;

    const/16 v6, 0x1e

    invoke-static {v6}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v6

    aput-object v6, v5, v2

    invoke-virtual {v1, v3, v5}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    aput-object v1, v0, v4

    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeSegmentTitle:[Ljava/lang/String;

    iget-object v1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mContext:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    sget v3, Lcom/android/systemui/miui/volume/R$string;->timer_1_hour:I

    new-array v5, v4, [Ljava/lang/Object;

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v6

    aput-object v6, v5, v2

    invoke-virtual {v1, v3, v5}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    const/4 v3, 0x2

    aput-object v1, v0, v3

    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeSegmentTitle:[Ljava/lang/String;

    iget-object v1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mContext:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    sget v5, Lcom/android/systemui/miui/volume/R$string;->timer_2_hours:I

    new-array v6, v4, [Ljava/lang/Object;

    invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    aput-object v3, v6, v2

    invoke-virtual {v1, v5, v6}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    const/4 v3, 0x3

    aput-object v1, v0, v3

    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeSegmentTitle:[Ljava/lang/String;

    iget-object p0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mContext:Landroid/content/Context;

    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p0

    sget v1, Lcom/android/systemui/miui/volume/R$string;->timer_8_hours:I

    new-array v3, v4, [Ljava/lang/Object;

    const/16 v4, 0x8

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    aput-object v4, v3, v2

    invoke-virtual {p0, v1, v3}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object p0

    const/4 v1, 0x4

    aput-object p0, v0, v1

    return-void
.end method

.method private setOutlineProvider(Landroid/view/View;)V
    .locals 1

    new-instance v0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper$1;

    invoke-direct {v0, p0}, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper$1;-><init>(Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;)V

    invoke-virtual {p1, v0}, Landroid/view/View;->setOutlineProvider(Landroid/view/ViewOutlineProvider;)V

    const/4 p0, 0x1

    invoke-virtual {p1, p0}, Landroid/view/View;->setClipToOutline(Z)V

    return-void
.end method

.method private setupDrawables(Landroid/content/Context;Z)V
    .locals 2

    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mDrawable:Landroid/graphics/drawable/Drawable;

    const/high16 v1, 0x1020000

    invoke-static {v0, v1}, Lcom/android/systemui/miui/DrawableUtils;->findDrawableById(Landroid/graphics/drawable/Drawable;I)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    iput-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mBackground:Landroid/graphics/drawable/Drawable;

    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mDrawable:Landroid/graphics/drawable/Drawable;

    const v1, 0x102000d

    invoke-static {v0, v1}, Lcom/android/systemui/miui/DrawableUtils;->findDrawableById(Landroid/graphics/drawable/Drawable;I)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    iput-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgress:Landroid/graphics/drawable/Drawable;

    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgress:Landroid/graphics/drawable/Drawable;

    sget v1, Lcom/android/systemui/miui/volume/R$id;->miui_volume_timer_progress_normal:I

    invoke-static {v0, v1}, Lcom/android/systemui/miui/DrawableUtils;->findDrawableById(Landroid/graphics/drawable/Drawable;I)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    iput-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgressNormalRect:Landroid/graphics/drawable/Drawable;

    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgress:Landroid/graphics/drawable/Drawable;

    sget v1, Lcom/android/systemui/miui/volume/R$id;->miui_volume_timer_progress_dragging_rect:I

    invoke-static {v0, v1}, Lcom/android/systemui/miui/DrawableUtils;->findDrawableById(Landroid/graphics/drawable/Drawable;I)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    iput-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgressDraggingRect:Landroid/graphics/drawable/Drawable;

    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgress:Landroid/graphics/drawable/Drawable;

    sget v1, Lcom/android/systemui/miui/volume/R$id;->miui_volume_timer_progress_dragging_rect_idle:I

    invoke-static {v0, v1}, Lcom/android/systemui/miui/DrawableUtils;->findDrawableById(Landroid/graphics/drawable/Drawable;I)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    iput-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgressDraggingRectIdle:Landroid/graphics/drawable/Drawable;

    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgress:Landroid/graphics/drawable/Drawable;

    sget v1, Lcom/android/systemui/miui/volume/R$id;->miui_volume_timer_progress_dragging_icon:I

    invoke-static {v0, v1}, Lcom/android/systemui/miui/DrawableUtils;->findDrawableById(Landroid/graphics/drawable/Drawable;I)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    iput-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgressDraggingIcon:Landroid/graphics/drawable/Drawable;

    if-eqz p2, :cond_0

    invoke-direct {p0, p1}, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->addTextDrawables(Landroid/content/Context;)V

    :cond_0
    return-void
.end method

.method private updateCountDownStateText()V
    .locals 12

    iget-boolean v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mDragging:Z

    const/4 v1, 0x0

    if-eqz v0, :cond_0

    iget v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mDeterminedSegment:I

    const/4 v2, 0x1

    sub-int/2addr v0, v2

    iget-object v3, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeSegmentTitle:[Ljava/lang/String;

    array-length v3, v3

    sub-int/2addr v3, v2

    invoke-static {v0, v1, v3}, Lcom/android/systemui/miui/volume/Util;->constrain(III)I

    move-result v0

    iget-object v3, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeSegmentTitle:[Ljava/lang/String;

    aget-object v0, v3, v0

    iget-object v3, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mContext:Landroid/content/Context;

    invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    sget v4, Lcom/android/systemui/miui/volume/R$string;->miui_dnd_count_down_time:I

    new-array v2, v2, [Ljava/lang/Object;

    aput-object v0, v2, v1

    invoke-virtual {v3, v4, v2}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    goto :goto_0

    :cond_0
    const-string v0, ""

    :goto_0
    iget-object v2, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mCountDownStates:Ljava/util/List;

    invoke-interface {v2}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :cond_1
    :goto_1
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_5

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    instance-of v4, v3, Lcom/android/systemui/miui/widget/CenterTextDrawable;

    if-eqz v4, :cond_2

    check-cast v3, Lcom/android/systemui/miui/widget/CenterTextDrawable;

    invoke-virtual {v3, v0}, Lcom/android/systemui/miui/widget/CenterTextDrawable;->setText(Ljava/lang/String;)V

    goto :goto_1

    :cond_2
    instance-of v4, v3, Landroid/widget/TextView;

    if-eqz v4, :cond_1

    invoke-static {v0}, Landroid/text/SpannableString;->valueOf(Ljava/lang/CharSequence;)Landroid/text/SpannableString;

    move-result-object v4

    iget-object v5, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mContext:Landroid/content/Context;

    invoke-virtual {v5}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v5

    sget v6, Lcom/android/systemui/miui/volume/R$dimen;->miui_volume_dialog_dnd_text_span_size:I

    invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getDimension(I)F

    move-result v5

    float-to-int v5, v5

    invoke-virtual {v0}, Ljava/lang/String;->toCharArray()[C

    move-result-object v6

    array-length v7, v6

    move v8, v1

    move v9, v8

    :goto_2
    if-ge v8, v7, :cond_4

    aget-char v10, v6, v8

    add-int/lit8 v9, v9, 0x1

    const/16 v11, 0xa

    if-ne v10, v11, :cond_3

    goto :goto_3

    :cond_3
    add-int/lit8 v8, v8, 0x1

    goto :goto_2

    :cond_4
    :goto_3
    new-instance v6, Landroid/text/style/AbsoluteSizeSpan;

    invoke-direct {v6, v5}, Landroid/text/style/AbsoluteSizeSpan;-><init>(I)V

    const/16 v5, 0x21

    invoke-virtual {v4, v6, v1, v9, v5}, Landroid/text/SpannableString;->setSpan(Ljava/lang/Object;III)V

    new-instance v6, Landroid/text/style/ForegroundColorSpan;

    iget-object v7, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mContext:Landroid/content/Context;

    invoke-virtual {v7}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v7

    sget v8, Lcom/android/systemui/miui/volume/R$color;->miui_volume_dnd_text_color:I

    invoke-virtual {v7, v8}, Landroid/content/res/Resources;->getColor(I)I

    move-result v7

    invoke-direct {v6, v7}, Landroid/text/style/ForegroundColorSpan;-><init>(I)V

    check-cast v3, Landroid/widget/TextView;

    invoke-virtual {v3, v4}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    goto :goto_1

    :cond_5
    return-void
.end method

.method private updateDrawables()V
    .locals 6

    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgressDraggingIcon:Landroid/graphics/drawable/Drawable;

    iget-boolean v1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mDragging:Z

    const/4 v2, 0x0

    const/4 v3, 0x1

    if-nez v1, :cond_1

    iget-boolean v1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTicking:Z

    if-nez v1, :cond_0

    goto :goto_0

    :cond_0
    move v1, v2

    goto :goto_1

    :cond_1
    :goto_0
    move v1, v3

    :goto_1
    invoke-static {v0, v1}, Lcom/android/systemui/miui/DrawableAnimators;->fade(Landroid/graphics/drawable/Drawable;Z)Landroid/animation/Animator;

    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgressDraggingRectIdle:Landroid/graphics/drawable/Drawable;

    iget-boolean v1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mDragging:Z

    if-nez v1, :cond_2

    iget-boolean v1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTicking:Z

    if-nez v1, :cond_2

    move v1, v3

    goto :goto_2

    :cond_2
    move v1, v2

    :goto_2
    invoke-static {v0, v1}, Lcom/android/systemui/miui/DrawableAnimators;->fade(Landroid/graphics/drawable/Drawable;Z)Landroid/animation/Animator;

    iget-boolean v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTicking:Z

    if-eqz v0, :cond_3

    iget-boolean v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mDragging:Z

    if-nez v0, :cond_3

    move v0, v3

    goto :goto_3

    :cond_3
    move v0, v2

    :goto_3
    iget-boolean v1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTicking:Z

    if-nez v1, :cond_4

    iget-boolean v1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mDragging:Z

    if-nez v1, :cond_4

    move v1, v3

    goto :goto_4

    :cond_4
    move v1, v2

    :goto_4
    iget-object v4, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeDrawableFg:Lcom/android/systemui/miui/widget/CenterTextDrawable;

    if-eqz v4, :cond_6

    if-eqz v0, :cond_5

    iget v5, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mCurrentSegment:I

    if-le v5, v3, :cond_5

    move v5, v3

    goto :goto_5

    :cond_5
    move v5, v2

    :goto_5
    invoke-static {v4, v5}, Lcom/android/systemui/miui/DrawableAnimators;->fade(Landroid/graphics/drawable/Drawable;Z)Landroid/animation/Animator;

    :cond_6
    iget-object v4, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeDrawableBg:Lcom/android/systemui/miui/widget/CenterTextDrawable;

    if-eqz v4, :cond_a

    if-eqz v0, :cond_7

    iget v5, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mCurrentSegment:I

    if-le v5, v3, :cond_8

    :cond_7
    if-eqz v1, :cond_9

    :cond_8
    move v5, v3

    goto :goto_6

    :cond_9
    move v5, v2

    :goto_6
    invoke-static {v4, v5}, Lcom/android/systemui/miui/DrawableAnimators;->fade(Landroid/graphics/drawable/Drawable;Z)Landroid/animation/Animator;

    :cond_a
    if-eqz v1, :cond_b

    invoke-direct {p0, v2}, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->updateTickingTimeText(I)V

    :cond_b
    if-nez v0, :cond_e

    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgressNormalRect:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getAlpha()I

    move-result v0

    const/16 v1, 0xff

    if-ne v0, v1, :cond_c

    goto :goto_7

    :cond_c
    move v3, v2

    :goto_7
    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgressNormalRect:Landroid/graphics/drawable/Drawable;

    invoke-static {v0, v2}, Lcom/android/systemui/miui/volume/Util;->setVisOrInvis(Landroid/graphics/drawable/Drawable;Z)V

    if-eqz v3, :cond_d

    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgressDraggingRect:Landroid/graphics/drawable/Drawable;

    iget-boolean v1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mDragging:Z

    invoke-static {v0, v1}, Lcom/android/systemui/miui/volume/Util;->setVisOrInvis(Landroid/graphics/drawable/Drawable;Z)V

    goto :goto_8

    :cond_d
    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgressDraggingRect:Landroid/graphics/drawable/Drawable;

    iget-boolean v1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mDragging:Z

    invoke-static {v0, v1}, Lcom/android/systemui/miui/DrawableAnimators;->fade(Landroid/graphics/drawable/Drawable;Z)Landroid/animation/Animator;

    :goto_8
    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mContext:Landroid/content/Context;

    iget-object v1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgressDraggingRect:Landroid/graphics/drawable/Drawable;

    sget v2, Lcom/android/systemui/miui/volume/R$array;->miui_volume_progress_dragging_corners:I

    invoke-static {v0, v1, v2}, Lcom/android/systemui/miui/DrawableAnimators;->updateCornerRadii(Landroid/content/Context;Landroid/graphics/drawable/Drawable;I)Landroid/animation/Animator;

    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mContext:Landroid/content/Context;

    iget-object p0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgressDraggingRectIdle:Landroid/graphics/drawable/Drawable;

    sget v1, Lcom/android/systemui/miui/volume/R$array;->miui_volume_progress_dragging_corners:I

    invoke-static {v0, p0, v1}, Lcom/android/systemui/miui/DrawableAnimators;->updateCornerRadii(Landroid/content/Context;Landroid/graphics/drawable/Drawable;I)Landroid/animation/Animator;

    goto :goto_9

    :cond_e
    iget v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeRemain:I

    div-int/lit8 v0, v0, 0x3c

    div-int/lit8 v0, v0, 0x3c

    const/4 v1, 0x2

    if-le v0, v1, :cond_f

    return-void

    :cond_f
    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mContext:Landroid/content/Context;

    iget-object v1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgressDraggingRectIdle:Landroid/graphics/drawable/Drawable;

    sget v2, Lcom/android/systemui/miui/volume/R$array;->miui_volume_progress_released_corners:I

    invoke-static {v0, v1, v2}, Lcom/android/systemui/miui/DrawableAnimators;->updateCornerRadii(Landroid/content/Context;Landroid/graphics/drawable/Drawable;I)Landroid/animation/Animator;

    iget-object v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mContext:Landroid/content/Context;

    iget-object v1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mProgressDraggingRect:Landroid/graphics/drawable/Drawable;

    sget v2, Lcom/android/systemui/miui/volume/R$array;->miui_volume_progress_released_corners:I

    invoke-static {v0, v1, v2}, Lcom/android/systemui/miui/DrawableAnimators;->updateCornerRadii(Landroid/content/Context;Landroid/graphics/drawable/Drawable;I)Landroid/animation/Animator;

    move-result-object v0

    new-instance v1, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper$2;

    invoke-direct {v1, p0}, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper$2;-><init>(Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;)V

    invoke-virtual {v0, v1}, Landroid/animation/Animator;->addListener(Landroid/animation/Animator$AnimatorListener;)V

    :goto_9
    return-void
.end method

.method private updateTickingTimeText(I)V
    .locals 2

    iget-boolean v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTicking:Z

    if-nez v0, :cond_0

    iget-boolean v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mDragging:Z

    if-nez v0, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    :goto_0
    if-eqz v0, :cond_1

    iget-object p1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeDrawableHint:Ljava/lang/String;

    goto :goto_1

    :cond_1
    invoke-direct {p0, p1}, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->formatRemainTime(I)Ljava/lang/String;

    move-result-object p1

    :goto_1
    iget-object p0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTickingTimes:Ljava/util/List;

    invoke-interface {p0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object p0

    :cond_2
    :goto_2
    invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_4

    invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    instance-of v1, v0, Lcom/android/systemui/miui/widget/CenterTextDrawable;

    if-eqz v1, :cond_3

    check-cast v0, Lcom/android/systemui/miui/widget/CenterTextDrawable;

    invoke-virtual {v0, p1}, Lcom/android/systemui/miui/widget/CenterTextDrawable;->setText(Ljava/lang/String;)V

    goto :goto_2

    :cond_3
    instance-of v1, v0, Landroid/widget/TextView;

    if-eqz v1, :cond_2

    check-cast v0, Landroid/widget/TextView;

    invoke-virtual {v0, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    goto :goto_2

    :cond_4
    return-void
.end method


# virtual methods
.method public addCountDownStateReceiver(Landroid/widget/TextView;)V
    .locals 0

    iget-object p0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mCountDownStates:Ljava/util/List;

    invoke-interface {p0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    return-void
.end method

.method public addTickingTimeReceiver(Landroid/widget/TextView;)V
    .locals 0

    iget-object p0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTickingTimes:Ljava/util/List;

    invoke-interface {p0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    return-void
.end method

.method public onSegmentChange(II)V
    .locals 1

    iget v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mCurrentSegment:I

    if-ne v0, p1, :cond_0

    iget v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mDeterminedSegment:I

    if-eq v0, p2, :cond_1

    :cond_0
    iput p1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mCurrentSegment:I

    iput p2, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mDeterminedSegment:I

    invoke-direct {p0}, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->updateDrawables()V

    :cond_1
    iget-boolean p1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mDragging:Z

    if-eqz p1, :cond_2

    invoke-direct {p0}, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->updateCountDownStateText()V

    :cond_2
    return-void
.end method

.method public onTimeUpdate(I)V
    .locals 1

    iput p1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeRemain:I

    invoke-direct {p0, p1}, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->updateTickingTimeText(I)V

    if-lez p1, :cond_0

    const/4 p1, 0x1

    goto :goto_0

    :cond_0
    const/4 p1, 0x0

    :goto_0
    iget-boolean v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTicking:Z

    if-eq v0, p1, :cond_1

    iput-boolean p1, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTicking:Z

    invoke-direct {p0}, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->updateDrawables()V

    :cond_1
    return-void
.end method

.method public onTouchDown()V
    .locals 1

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mDragging:Z

    invoke-direct {p0}, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->updateDrawables()V

    invoke-direct {p0}, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->updateCountDownStateText()V

    return-void
.end method

.method public onTouchRelease()V
    .locals 1

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mDragging:Z

    invoke-direct {p0}, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->updateDrawables()V

    iget v0, p0, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->mTimeRemain:I

    invoke-direct {p0, v0}, Lcom/android/systemui/miui/volume/MiuiVolumeTimerDrawableHelper;->updateTickingTimeText(I)V

    return-void
.end method
