[Galaxy S II Android Development] remuntada78:
sure look at this

.class public Lcom/android/keyguard/NumPadKey;
.super Landroid/view/ViewGroup;
.source "NumPadKey.java"

# static fields
.field static sKlondike:[Ljava/lang/String;

# instance fields
.field private mDigit:I

.field private mDigitText:Landroid/widget/TextView;

.field private mEnableHaptics:Z

.field private mKlondikeText:Landroid/widget/TextView;

.field private mListener:Landroid/view/View$OnClickListener;

.field private mPM:Landroid/os/PowerManager;

.field private mTextView:Lcom/android/keyguard/PasswordTextView;

.field private mTextViewResId:I

# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 1
.param p1, "context" # Landroid/content/Context;

.prologue
.line 71
const/4 v0, 0x0

invoke-direct {p0, p1, v0}, Lcom/android/keyguard/NumPadKey;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

.line 72
return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.locals 1
.param p1, "context" # Landroid/content/Context;
.param p2, "attrs" # Landroid/util/AttributeSet;

.prologue
.line 75
const/4 v0, 0x0

invoke-direct {p0, p1, p2, v0}, Lcom/android/keyguard/NumPadKey;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

.line 76
return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
.locals 12
.param p1, "context" # Landroid/content/Context;
.param p2, "attrs" # Landroid/util/AttributeSet;
.param p3, "defStyle" # I

.prologue
const/4 v7, 0x1

.line 79
invoke-direct {p0, p1, p2, p3}, Landroid/view/ViewGroup;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

.line 41
const/4 v5, -0x1

iput v5, p0, Lcom/android/keyguard/NumPadKey;->mDigit:I

.line 49
new-instance v5, Lcom/android/keyguard/NumPadKey$1;

invoke-direct {v5, p0}, Lcom/android/keyguard/NumPadKey$1;-><init>(Lcom/android/keyguard/NumPadKey;)V

iput-object v5, p0, Lcom/android/keyguard/NumPadKey;->mListener:Landroid/view/View$OnClickListener;

.line 80
invoke-virtual {p0, v7}, Lcom/android/keyguard/NumPadKey;->setFocusable(Z)V

.line 82
sget-object v5, Lcom/android/keyguard/R$styleable;->NumPadKey:[I

invoke-virtual {p1, p2, v5}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;

move-result-object v0

.line 85
.local v0, "a":Landroid/content/res/TypedArray;
:try_start_0
sget v5, Lcom/android/keyguard/R$styleable;->NumPadKey_digit:I

iget v6, p0, Lcom/android/keyguard/NumPadKey;->mDigit:I

invoke-virtual {v0, v5, v6}, Landroid/content/res/TypedArray;->getInt(II)I

move-result v5

iput v5, p0, Lcom/android/keyguard/NumPadKey;->mDigit:I

.line 86
sget v5, Lcom/android/keyguard/R$styleable;->NumPadKey_textView:I

const/4 v6, 0x0

invoke-virtual {v0, v5, v6}, Landroid/content/res/TypedArray;->getResourceId(II)I

move-result v5

iput v5, p0, Lcom/android/keyguard/NumPadKey;->mTextViewResId:I
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0

.line 88
invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V

.line 91
iget-object v5, p0, Lcom/android/keyguard/NumPadKey;->mListener:Landroid/view/View$OnClickListener;

invoke-virtual {p0, v5}, Lcom/android/keyguard/NumPadKey;->setOnClickListener(Landroid/view/View$OnClickListener;)V

.line 92
new-instance v5, Lcom/android/keyguard/LiftToActivateListener;

invoke-direct {v5, p1}, Lcom/android/keyguard/LiftToActivateListener;-><init>(Landroid/content/Context;)V

invoke-virtual {p0, v5}, Lcom/android/keyguard/NumPadKey;->setOnHoverListener(Landroid/view/View$OnHoverListener;)V

.line 93
new-instance v5, Lcom/android/keyguard/ObscureSpeechDelegate;

invoke-direct {v5, p1}, Lcom/android/keyguard/ObscureSpeechDelegate;-><init>(Landroid/content/Context;)V

invoke-virtual {p0, v5}, Lcom/android/keyguard/NumPadKey;->setAccessibilityDelegate(Landroid/view/View$AccessibilityDelegate;)V

.line 95
new-instance v5, Lcom/android/internal/widget/LockPatternUtils;

invoke-direct {v5, p1}, Lcom/android/internal/widget/LockPatternUtils;-><init>(Landroid/content/Context;)V

invoke-virtual {v5}, Lcom/android/internal/widget/LockPatternUtils;->isTactileFeedbackEnabled()Z

move-result v5

iput-boolean v5, p0, Lcom/android/keyguard/NumPadKey;->mEnableHaptics:Z

.line 97
iget-object v5, p0, Lcom/android/keyguard/NumPadKey;->mContext:Landroid/content/Context;

const-string v6, "power"

invoke-virtual {v5, v6}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

move-result-object v5

check-cast v5, Landroid/os/PowerManager;

iput-object v5, p0, Lcom/android/keyguard/NumPadKey;->mPM:Landroid/os/PowerManager;

.line 98
invoke-virtual {p0}, Lcom/android/keyguard/NumPadKey;->getContext()Landroid/content/Context;

move-result-object v5

const-string v6, "layout_inflater"

invoke-virtual {v5, v6}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

move-result-object v1

check-cast v1, Landroid/view/LayoutInflater;

.line 100
.local v1, "inflater":Landroid/view/LayoutInflater;
sget v5, Lcom/android/keyguard/R$layout;->keyguard_num_pad_key:I

invoke-virtual {v1, v5, p0, v7}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

.line 102
sget v5, Lcom/android/keyguard/R$id;->digit_text:I

invoke-virtual {p0, v5}, Lcom/android/keyguard/NumPadKey;->findViewById(I)Landroid/view/View;

move-result-object v5

check-cast v5, Landroid/widget/TextView;

iput-object v5, p0, Lcom/android/keyguard/NumPadKey;->mDigitText:Landroid/widget/TextView;

.line 103
iget-object v5, p0, Lcom/android/keyguard/NumPadKey;->mDigitText:Landroid/widget/TextView;

iget v6, p0, Lcom/android/keyguard/NumPadKey;->mDigit:I

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

move-result-object v6

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

invoke-virtual {p0}, Lcom/android/keyguard/NumPadKey;->getContext()Landroid/content/Context;

move-result-object v8

invoke-virtual {v8}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v8

const-string v9, "number_key_color"

const/4 v10, -0x1

invoke-static {v8, v9, v10}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v8

invoke-virtual {v5, v8}, Landroid/widget/TextView;->setTextColor(I)V

.line 104
const-string v5, "/system/fonts/SamsungSans-Num4Tv.ttf"

invoke-static {v5}, Landroid/graphics/Typeface;->createFromFile(Ljava/lang/String;)Landroid/graphics/Typeface;

move-result-object v4

.line 105
.local v4, "tf":Landroid/graphics/Typeface;
iget-object v5, p0, Lcom/android/keyguard/NumPadKey;->mDigitText:Landroid/widget/TextView;

invoke-virtual {v5, v4}, Landroid/widget/TextView;->setTypeface(Landroid/graphics/Typeface;)V

.line 107
sget v5, Lcom/android/keyguard/R$id;->klondike_text:I

invoke-virtual {p0, v5}, Lcom/android/keyguard/NumPadKey;->findViewById(I)Landroid/view/View;

move-result-object v5

check-cast v5, Landroid/widget/TextView;

iput-object v5, p0, Lcom/android/keyguard/NumPadKey;->mKlondikeText:Landroid/widget/TextView;

.line 108
const-string v5, "/system/fonts/Roboto-Regular.ttf"

invoke-static {v5}, Landroid/graphics/Typeface;->createFromFile(Ljava/lang/String;)Landroid/graphics/Typeface;

move-result-object v4

.line 109
iget-object v5, p0, Lcom/android/keyguard/NumPadKey;->mKlondikeText:Landroid/widget/TextView;

invoke-virtual {v5, v4}, Landroid/widget/TextView;->setTypeface(Landroid/graphics/Typeface;)V

invoke-virtual {p0}, Lcom/android/keyguard/NumPadKey;->getContext()Landroid/content/Context;

move-result-object v8

invoke-virtual {v8}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v8

const-string v9, "letters_key_color"

const/4 v10, -0x1

invoke-static {v8, v9, v10}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v8

invoke-virtual {v5, v8}, Landroid/widget/TextView;->setTextColor(I)V

.line 111
iget v5, p0, Lcom/android/keyguard/NumPadKey;->mDigit:I

if-ltz v5, :cond_1

.line 112
sget-object v5, Lcom/android/keyguard/NumPadKey;->sKlondike:[Ljava/lang/String;

if-nez v5, :cond_0

.line 113
invoke-virtual {p0}, Lcom/android/keyguard/NumPadKey;->getResources()Landroid/content/res/Resources;

move-result-object v5

sget v6, Lcom/android/keyguard/R$array;->lockscreen_num_pad_klondike:I

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

move-result-object v5

sput-object v5, Lcom/android/keyguard/NumPadKey;->sKlondike:[Ljava/lang/String;

.line 115
:cond_0
sget-object v5, Lcom/android/keyguard/NumPadKey;->sKlondike:[Ljava/lang/String;

if-eqz v5, :cond_1

sget-object v5, Lcom/android/keyguard/NumPadKey;->sKlondike:[Ljava/lang/String;

array-length v5, v5

iget v6, p0, Lcom/android/keyguard/NumPadKey;->mDigit:I

if-le v5, v6, :cond_1

.line 116
sget-object v5, Lcom/android/keyguard/NumPadKey;->sKlondike:[Ljava/lang/String;

iget v6, p0, Lcom/android/keyguard/NumPadKey;->mDigit:I

aget-object v2, v5, v6

.line 117
.local v2, "klondike":Ljava/lang/String;
invoke-virtual {v2}, Ljava/lang/String;->length()I

move-result v3

.line 118
.local v3, "len":I
if-lez v3, :cond_2

.line 119
iget-object v5, p0, Lcom/android/keyguard/NumPadKey;->mKlondikeText:Landroid/widget/TextView;

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

.line 126
.end local v2 # "klondike":Ljava/lang/String;
.end local v3 # "len":I
:cond_1
:goto_0[COLOR="Red"]
iget-object v5, p0, Lcom/android/keyguard/NumPadKey;->mContext:Landroid/content/Context;

sget v6, Lcom/android/keyguard/R$drawable;->ripple_drawable:I

invoke-virtual {v5, v6}, Landroid/content/Context;->getDrawable(I)Landroid/graphics/drawable/Drawable;

move-result-object v5

invoke-virtual {p0, v5}, Lcom/android/keyguard/NumPadKey;->setBackground(Landroid/graphics/drawable/Drawable;)V
[/COLOR]
.line 127
iget-object v5, p0, Lcom/android/keyguard/NumPadKey;->mDigitText:Landroid/widget/TextView;

invoke-virtual {v5}, Landroid/widget/TextView;->getText()Ljava/lang/CharSequence;

move-result-object v5

invoke-virtual {p0, v5}, Lcom/android/keyguard/NumPadKey;->setContentDescription(Ljava/lang/CharSequence;)V

.line 128
return-void

.line 88
.end local v1 # "inflater":Landroid/view/LayoutInflater;
.end local v4 # "tf":Landroid/graphics/Typeface;
:catchall_0
move-exception v5

invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V

throw v5

.line 121
.restart local v1 # "inflater":Landroid/view/LayoutInflater;
.restart local v2 # "klondike":Ljava/lang/String;
.restart local v3 # "len":I
.restart local v4 # "tf":Landroid/graphics/Typeface;
:cond_2
iget-object v5, p0, Lcom/android/keyguard/NumPadKey;->mKlondikeText:Landroid/widget/TextView;

const/4 v6, 0x4

invoke-virtual {v5, v6}, Landroid/widget/TextView;->setVisibility(I)V

goto :goto_0
.end method

.method static synthetic access$000(Lcom/android/keyguard/NumPadKey;)Lcom/android/keyguard/PasswordTextView;
.locals 1
.param p0, "x0" # Lcom/android/keyguard/NumPadKey;

.prologue
.line 37
iget-object v0, p0, Lcom/android/keyguard/NumPadKey;->mTextView:Lcom/android/keyguard/PasswordTextView;

return-object v0
.end method

.method static synthetic access$002(Lcom/android/keyguard/NumPadKey;Lcom/android/keyguard/PasswordTextView;)Lcom/android/keyguard/PasswordTextView;
.locals 0
.param p0, "x0" # Lcom/android/keyguard/NumPadKey;
.param p1, "x1" # Lcom/android/keyguard/PasswordTextView;

.prologue
.line 37
iput-object p1, p0, Lcom/android/keyguard/NumPadKey;->mTextView:Lcom/android/keyguard/PasswordTextView;

return-object p1
.end method

.method static synthetic access$100(Lcom/android/keyguard/NumPadKey;)I
.locals 1
.param p0, "x0" # Lcom/android/keyguard/NumPadKey;

.prologue
.line 37
iget v0, p0, Lcom/android/keyguard/NumPadKey;->mTextViewResId:I

return v0
.end method

.method static synthetic access$200(Lcom/android/keyguard/NumPadKey;)I
.locals 1
.param p0, "x0" # Lcom/android/keyguard/NumPadKey;

.prologue
.line 37
iget v0, p0, Lcom/android/keyguard/NumPadKey;->mDigit:I

return v0
.end method

# virtual methods
.method public doHapticKeyClick()V
.locals 2

.prologue
.line 172
iget-boolean v0, p0, Lcom/android/keyguard/NumPadKey;->mEnableHaptics:Z

if-eqz v0, :cond_0

.line 173
const/4 v0, 0x1

const/4 v1, 0x3

invoke-virtual {p0, v0, v1}, Lcom/android/keyguard/NumPadKey;->performHapticFeedback(II)Z

.line 177
:cond_0
return-void
.end method

.method public hasOverlappingRendering()Z
.locals 1

.prologue
.line 167
const/4 v0, 0x0

return v0
.end method

.method public onDetachedFromWindow()V
.locals 1

.prologue
.line 132
invoke-super {p0}, Landroid/view/ViewGroup;->onDetachedFromWindow()V

.line 135
const/4 v0, 0x0

sput-boolean v0, Lcom/android/keyguard/ObscureSpeechDelegate;->sAnnouncedHeadset:Z

.line 136
return-void
.end method

.method protected onLayout(ZIIII)V
.locals 18
.param p1, "changed" # Z
.param p2, "l" # I
.param p3, "t" # I
.param p4, "r" # I
.param p5, "b" # I

.prologue
.line 146
move-object/from16 v0, p0

iget-object v11, v0, Lcom/android/keyguard/NumPadKey;->mDigitText:Landroid/widget/TextView;

invoke-virtual {v11}, Landroid/widget/TextView;->getMeasuredHeight()I

move-result v4

.line 147
.local v4, "digitHeight":I
move-object/from16 v0, p0

iget-object v11, v0, Lcom/android/keyguard/NumPadKey;->mDigitText:Landroid/widget/TextView;

invoke-virtual {v11}, Landroid/widget/TextView;->getMeasuredWidth()I

move-result v5

.line 148
.local v5, "digitWidth":I
move-object/from16 v0, p0

iget-object v11, v0, Lcom/android/keyguard/NumPadKey;->mKlondikeText:Landroid/widget/TextView;

invoke-virtual {v11}, Landroid/widget/TextView;->getMeasuredHeight()I

move-result v6

.line 149
.local v6, "klondikeHeight":I
move-object/from16 v0, p0

iget-object v11, v0, Lcom/android/keyguard/NumPadKey;->mKlondikeText:Landroid/widget/TextView;

invoke-virtual {v11}, Landroid/widget/TextView;->getMeasuredWidth()I

move-result v7

.line 151
.local v7, "klondikeWidth":I
invoke-virtual/range {p0 .. p0}, Lcom/android/keyguard/NumPadKey;->getHeight()I

move-result v11

div-int/lit8 v11, v11, 0x2

div-int/lit8 v12, v4, 0x2

sub-int v10, v11, v12

.line 152
.local v10, "top":I
invoke-virtual/range {p0 .. p0}, Lcom/android/keyguard/NumPadKey;->getWidth()I

move-result v11

div-int/lit8 v3, v11, 0x2

.line 153
.local v3, "centerX":I
mul-int/lit8 v11, v5, 0x2

sub-int v11, v3, v11

div-int/lit8 v12, v5, 0x2

add-int v8, v11, v12

.line 154
.local v8, "left":I
add-int v9, v8, v5

.line 155
.local v9, "right":I
add-int v2, v10, v4

.line 156
.local v2, "bottom":I
move-object/from16 v0, p0

iget-object v11, v0, Lcom/android/keyguard/NumPadKey;->mDigitText:Landroid/widget/TextView;

invoke-virtual {v11, v8, v10, v9, v2}, Landroid/widget/TextView;->layout(IIII)V

.line 158
int-to-double v12, v2

int-to-double v14, v6

const-wide v16, 0x3ff6666666666666L # 1.4

mul-double v14, v14, v16

sub-double/2addr v12, v14

double-to-int v10, v12

.line 159
add-int v2, v10, v6

.line 160
div-int/lit8 v11, v5, 0x2

add-int v8, v9, v11

.line 161
add-int v9, v8, v7

.line 162
move-object/from16 v0, p0

iget-object v11, v0, Lcom/android/keyguard/NumPadKey;->mKlondikeText:Landroid/widget/TextView;

invoke-virtual {v11, v8, v10, v9, v2}, Landroid/widget/TextView;->layout(IIII)V

.line 163
return-void
.end method

.method protected onMeasure(II)V
.locals 0
.param p1, "widthMeasureSpec" # I
.param p2, "heightMeasureSpec" # I

.prologue
.line 140
invoke-super {p0, p1, p2}, Landroid/view/ViewGroup;->onMeasure(II)V

.line 141
invoke-virtual {p0, p1, p2}, Lcom/android/keyguard/NumPadKey;->measureChildren(II)V

.line 142
return-void
.end method

.method public userActivity()V
.locals 4

.prologue
.line 67
iget-object v0, p0, Lcom/android/keyguard/NumPadKey;->mPM:Landroid/os/PowerManager;

invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J

move-result-wide v2

const/4 v1, 0x0

invoke-virtual {v0, v2, v3, v1}, Landroid/os/PowerManager;->userActivity(JZ)V

.line 68
return-void
.end method