ShowRecentTextView.smali
.class public Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;
.super Ljava/lang/Object;
.source "ShowRecentTextView.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThreadHandler;,
Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThread;
}
.end annotation
# static fields
.field private static final HANDLER_UPDATE_SHOW_INFO:I = 0x0
.field private static final MAX_RECENT_CACHE_INFO_ITEM_NUM:I = 0x200
.field private static final SHOW_INFO_TIME_MILLISECONDS:J = 0x64L
# instance fields
.field private mLastShowIndexInLoop:I
.field private mLastTextInfo:Ljava/lang/CharSequence;
.field private mStartIndex:I
.field private mTextInfoList:Ljava/util/ArrayList;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/ArrayList",
"<",
"Ljava/lang/String;",
">;"
}
.end annotation
.end field
.field private mTextView:Landroid/widget/TextView;
.field private showInfoThread:Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThread;
.field private showInfoThreadHandler:Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThreadHandler;
# direct methods
.method public constructor <init>(Landroid/widget/TextView;)V
.registers 4
.prologue
const/4 v1, 0x0
const/4 v0, 0x0
.line 29
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 18
iput-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextView:Landroid/widget/TextView;
.line 19
iput-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mLastTextInfo:Ljava/lang/CharSequence;
.line 20
iput-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextInfoList:Ljava/util/ArrayList;
.line 21
iput v1, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mStartIndex:I
.line 22
iput v1, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mLastShowIndexInLoop:I
.line 23
iput-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->showInfoThread:Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThread;
.line 24
iput-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->showInfoThreadHandler:Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThreadHandler;
.line 30
iput-object p1, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextView:Landroid/widget/TextView;
.line 31
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextView:Landroid/widget/TextView;
sget-object v1, Landroid/text/TextUtils$TruncateAt;->MIDDLE:Landroid/text/TextUtils$TruncateAt;
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setEllipsize(Landroid/text/TextUtils$TruncateAt;)V
.line 32
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
iput-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextInfoList:Ljava/util/ArrayList;
.line 33
new-instance v0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThreadHandler;
invoke-direct {v0, p0}, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThreadHandler;-><init>(Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;)V
iput-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->showInfoThreadHandler:Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThreadHandler;
.line 34
return-void
.end method
.method static synthetic access$100(Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;)Landroid/widget/TextView;
.registers 2
.prologue
.line 13
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextView:Landroid/widget/TextView;
return-object v0
.end method
.method static synthetic access$200(Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;)Ljava/util/ArrayList;
.registers 2
.prologue
.line 13
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextInfoList:Ljava/util/ArrayList;
return-object v0
.end method
.method static synthetic access$300(Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;)I
.registers 2
.prologue
.line 13
invoke-direct {p0}, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->getNextShowIndex()I
move-result v0
return v0
.end method
.method static synthetic access$400(Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;Ljava/lang/CharSequence;)V
.registers 2
.prologue
.line 13
invoke-direct {p0, p1}, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->showInfo(Ljava/lang/CharSequence;)V
return-void
.end method
.method private change2NextShowIndex(I)V
.registers 6
.prologue
.line 87
if-ltz p1, :cond_a
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextInfoList:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
move-result v0
if-lt p1, v0, :cond_b
.line 101
:cond_a
:goto_a
return-void
.line 90
:cond_b
iget v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mLastShowIndexInLoop:I
add-int/lit8 v0, v0, 0x1
.line 91
iget-object v1, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextInfoList:Ljava/util/ArrayList;
invoke-virtual {v1}, Ljava/util/ArrayList;->size()I
move-result v1
if-lt v0, v1, :cond_34
.line 92
const/4 v0, 0x0
move v1, v0
.line 94
:goto_19
if-eq p1, v1, :cond_a
.line 97
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextInfoList:Ljava/util/ArrayList;
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/String;
.line 99
iget-object v2, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextInfoList:Ljava/util/ArrayList;
iget-object v3, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextInfoList:Ljava/util/ArrayList;
invoke-virtual {v3, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v3
invoke-virtual {v2, v1, v3}, Ljava/util/ArrayList;->set(ILjava/lang/Object;)Ljava/lang/Object;
.line 100
iget-object v1, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextInfoList:Ljava/util/ArrayList;
invoke-virtual {v1, p1, v0}, Ljava/util/ArrayList;->set(ILjava/lang/Object;)Ljava/lang/Object;
goto :goto_a
:cond_34
move v1, v0
goto :goto_19
.end method
.method private getNextShowIndex()I
.registers 4
.prologue
.line 147
iget-object v1, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextInfoList:Ljava/util/ArrayList;
monitor-enter v1
.line 148
:try_start_3
iget v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mLastShowIndexInLoop:I
add-int/lit8 v0, v0, 0x1
iput v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mLastShowIndexInLoop:I
iget-object v2, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextInfoList:Ljava/util/ArrayList;
invoke-virtual {v2}, Ljava/util/ArrayList;->size()I
move-result v2
if-lt v0, v2, :cond_14
.line 149
const/4 v0, 0x0
iput v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mLastShowIndexInLoop:I
.line 151
:cond_14
monitor-exit v1
:try_end_15
.catchall {:try_start_3 .. :try_end_15} :catchall_18
.line 152
iget v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mLastShowIndexInLoop:I
return v0
.line 151
:catchall_18
move-exception v0
:try_start_19
monitor-exit v1
:try_end_1a
.catchall {:try_start_19 .. :try_end_1a} :catchall_18
throw v0
.end method
.method private initThread()V
.registers 3
.prologue
.line 37
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->showInfoThread:Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThread;
if-nez v0, :cond_c
.line 38
new-instance v0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThread;
const/4 v1, 0x0
invoke-direct {v0, p0, v1}, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThread;-><init>(Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$1;)V
iput-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->showInfoThread:Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThread;
.line 40
:cond_c
return-void
.end method
.method private showInfo(Ljava/lang/CharSequence;)V
.registers 5
.prologue
.line 166
if-nez p1, :cond_3
.line 176
:goto_2
return-void
.line 170
:cond_3
invoke-static {}, Landroid/os/Message;->obtain()Landroid/os/Message;
move-result-object v0
.line 171
const/4 v1, 0x0
iput v1, v0, Landroid/os/Message;->what:I
.line 172
new-instance v1, Landroid/os/Bundle;
invoke-direct {v1}, Landroid/os/Bundle;-><init>()V
.line 173
const-string v2, "info"
invoke-virtual {v1, v2, p1}, Landroid/os/Bundle;->putCharSequence(Ljava/lang/String;Ljava/lang/CharSequence;)V
.line 174
invoke-virtual {v0, v1}, Landroid/os/Message;->setData(Landroid/os/Bundle;)V
.line 175
iget-object v1, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->showInfoThreadHandler:Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThreadHandler;
invoke-virtual {v1, v0}, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThreadHandler;->sendMessage(Landroid/os/Message;)Z
goto :goto_2
.end method
# virtual methods
.method public setFinalText(Ljava/lang/CharSequence;)V
.registers 5
.prologue
const/4 v0, 0x1
.line 117
.line 119
invoke-direct {p0}, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->initThread()V
.line 121
:try_start_4
sget-object v1, Ljava/lang/Thread$State;->NEW:Ljava/lang/Thread$State;
iget-object v2, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->showInfoThread:Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThread;
invoke-virtual {v2}, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThread;->getState()Ljava/lang/Thread$State;
:try_end_b
.catch Ljava/lang/Exception; {:try_start_4 .. :try_end_b} :catch_29
move-result-object v2
if-eq v1, v2, :cond_27
.line 126
:goto_e
if-eqz v0, :cond_23
.line 127
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->showInfoThread:Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThread;
invoke-virtual {v0}, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThread;->notifyStop()V
.line 128
iget-object v1, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextInfoList:Ljava/util/ArrayList;
monitor-enter v1
.line 129
:try_start_18
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextInfoList:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/lang/Object;->notifyAll()V
.line 130
monitor-exit v1
:try_end_1e
.catchall {:try_start_18 .. :try_end_1e} :catchall_2e
.line 133
:try_start_1e
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->showInfoThread:Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThread;
invoke-virtual {v0}, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThread;->join()V
:try_end_23
.catch Ljava/lang/InterruptedException; {:try_start_1e .. :try_end_23} :catch_31
.line 138
:cond_23
:goto_23
invoke-direct {p0, p1}, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->showInfo(Ljava/lang/CharSequence;)V
.line 139
return-void
.line 121
:cond_27
const/4 v0, 0x0
goto :goto_e
.line 122
:catch_29
move-exception v1
.line 123
invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V
goto :goto_e
.line 130
:catchall_2e
move-exception v0
:try_start_2f
monitor-exit v1
:try_end_30
.catchall {:try_start_2f .. :try_end_30} :catchall_2e
throw v0
.line 134
:catch_31
move-exception v0
goto :goto_23
.end method
.method public setText(Ljava/lang/String;)V
.registers 7
.prologue
.line 46
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mLastTextInfo:Ljava/lang/CharSequence;
if-eqz v0, :cond_d
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mLastTextInfo:Ljava/lang/CharSequence;
invoke-virtual {v0, p1}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_d
.line 74
:cond_c
:goto_c
return-void
.line 49
:cond_d
iget-object v1, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextInfoList:Ljava/util/ArrayList;
monitor-enter v1
.line 50
:try_start_10
iput-object p1, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mLastTextInfo:Ljava/lang/CharSequence;
.line 52
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextInfoList:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
move-result v0
const/16 v2, 0x200
if-lt v0, v2, :cond_52
.line 53
iget v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mStartIndex:I
iget-object v2, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextInfoList:Ljava/util/ArrayList;
invoke-virtual {v2}, Ljava/util/ArrayList;->size()I
move-result v2
if-lt v0, v2, :cond_29
.line 54
const/4 v0, 0x0
iput v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mStartIndex:I
.line 56
:cond_29
iget v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mStartIndex:I
.line 58
iget-object v2, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextInfoList:Ljava/util/ArrayList;
iget v3, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mStartIndex:I
add-int/lit8 v4, v3, 0x1
iput v4, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mStartIndex:I
invoke-virtual {v2, v3, p1}, Ljava/util/ArrayList;->set(ILjava/lang/Object;)Ljava/lang/Object;
.line 64
:goto_36
invoke-direct {p0, v0}, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->change2NextShowIndex(I)V
.line 65
invoke-direct {p0}, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->initThread()V
.line 66
monitor-exit v1
:try_end_3d
.catchall {:try_start_10 .. :try_end_3d} :catchall_60
.line 68
:try_start_3d
sget-object v0, Ljava/lang/Thread$State;->NEW:Ljava/lang/Thread$State;
iget-object v1, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->showInfoThread:Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThread;
invoke-virtual {v1}, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThread;->getState()Ljava/lang/Thread$State;
move-result-object v1
if-ne v0, v1, :cond_c
.line 69
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->showInfoThread:Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThread;
invoke-virtual {v0}, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThread;->start()V
:try_end_4c
.catch Ljava/lang/Exception; {:try_start_3d .. :try_end_4c} :catch_4d
goto :goto_c
.line 71
:catch_4d
move-exception v0
.line 72
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
goto :goto_c
.line 60
:cond_52
:try_start_52
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextInfoList:Ljava/util/ArrayList;
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 61
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextInfoList:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
move-result v0
add-int/lit8 v0, v0, -0x1
goto :goto_36
.line 66
:catchall_60
move-exception v0
monitor-exit v1
:try_end_62
.catchall {:try_start_52 .. :try_end_62} :catchall_60
throw v0
.end method
.method public setTextBackgroud(I)V
.registers 3
.prologue
.line 77
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextView:Landroid/widget/TextView;
if-eqz v0, :cond_9
.line 78
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextView:Landroid/widget/TextView;
invoke-virtual {v0, p1}, Landroid/widget/TextView;->setBackgroundResource(I)V
.line 80
:cond_9
return-void
.end method
.method public stop()V
.registers 3
.prologue
.line 104
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->showInfoThread:Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThread;
if-eqz v0, :cond_12
.line 105
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->showInfoThread:Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThread;
invoke-virtual {v0}, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView$ShowRecentTextInfoThread;->notifyStop()V
.line 106
iget-object v1, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextInfoList:Ljava/util/ArrayList;
monitor-enter v1
.line 107
:try_start_c
iget-object v0, p0, Lcom/cleanmaster/hpsharelib/base/util/ui/ShowRecentTextView;->mTextInfoList:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/lang/Object;->notifyAll()V
.line 108
monitor-exit v1
.line 110
:cond_12
return-void
.line 108
:catchall_13
move-exception v0
monitor-exit v1
:try_end_15
.catchall {:try_start_c .. :try_end_15} :catchall_13
throw v0
.end method