.class public Lcom/scaleasw/powercalc/CalcDisplay;
.super Landroid/widget/EditText;
.source "CalcDisplay.java"


# instance fields
.field private editor:Lcom/scaleasw/powercalc/Editor;

.field public lockCursor:Z

.field public lockSoftKey:Z


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

    .prologue
    const/4 v1, 0x1

    .line 57
    invoke-direct {p0, p1}, Landroid/widget/EditText;-><init>(Landroid/content/Context;)V

    .line 58
    invoke-direct {p0}, Lcom/scaleasw/powercalc/CalcDisplay;->eventHandlers()V

    .line 61
    invoke-virtual {p0, v1}, Lcom/scaleasw/powercalc/CalcDisplay;->setSingleLine(Z)V

    .line 62
    invoke-virtual {p0, v1}, Lcom/scaleasw/powercalc/CalcDisplay;->setMaxLines(I)V

    .line 63
    invoke-virtual {p0, v1}, Lcom/scaleasw/powercalc/CalcDisplay;->setLines(I)V

    .line 71
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/scaleasw/powercalc/CalcDisplay;->lockCursor:Z

    .line 72
    iput-boolean v1, p0, Lcom/scaleasw/powercalc/CalcDisplay;->lockSoftKey:Z

    .line 73
    return-void
.end method

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

    .prologue
    const/4 v1, 0x1

    .line 38
    invoke-direct {p0, p1, p2}, Landroid/widget/EditText;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 39
    invoke-direct {p0}, Lcom/scaleasw/powercalc/CalcDisplay;->eventHandlers()V

    .line 42
    invoke-virtual {p0, v1}, Lcom/scaleasw/powercalc/CalcDisplay;->setSingleLine(Z)V

    .line 43
    invoke-virtual {p0, v1}, Lcom/scaleasw/powercalc/CalcDisplay;->setMaxLines(I)V

    .line 44
    invoke-virtual {p0, v1}, Lcom/scaleasw/powercalc/CalcDisplay;->setLines(I)V

    .line 52
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/scaleasw/powercalc/CalcDisplay;->lockCursor:Z

    .line 53
    iput-boolean v1, p0, Lcom/scaleasw/powercalc/CalcDisplay;->lockSoftKey:Z

    .line 54
    return-void
.end method

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

    .prologue
    const/4 v1, 0x1

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

    .line 20
    invoke-direct {p0}, Lcom/scaleasw/powercalc/CalcDisplay;->eventHandlers()V

    .line 23
    invoke-virtual {p0, v1}, Lcom/scaleasw/powercalc/CalcDisplay;->setSingleLine(Z)V

    .line 24
    invoke-virtual {p0, v1}, Lcom/scaleasw/powercalc/CalcDisplay;->setMaxLines(I)V

    .line 25
    invoke-virtual {p0, v1}, Lcom/scaleasw/powercalc/CalcDisplay;->setLines(I)V

    .line 33
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/scaleasw/powercalc/CalcDisplay;->lockCursor:Z

    .line 34
    iput-boolean v1, p0, Lcom/scaleasw/powercalc/CalcDisplay;->lockSoftKey:Z

    .line 35
    return-void
.end method

.method private eventHandlers()V
    .locals 2

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

    invoke-virtual {p0, v0}, Lcom/scaleasw/powercalc/CalcDisplay;->setInputType(I)V

    .line 90
    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v1, 0xb

    if-lt v0, v1, :cond_0

    .line 94
    const v0, -0x8001

    invoke-virtual {p0, v0}, Lcom/scaleasw/powercalc/CalcDisplay;->setRawInputType(I)V

    .line 97
    :cond_0
    new-instance v0, Lcom/scaleasw/powercalc/CalcDisplay$1;

    invoke-direct {v0, p0}, Lcom/scaleasw/powercalc/CalcDisplay$1;-><init>(Lcom/scaleasw/powercalc/CalcDisplay;)V

    invoke-virtual {p0, v0}, Lcom/scaleasw/powercalc/CalcDisplay;->setOnLongClickListener(Landroid/view/View$OnLongClickListener;)V

    .line 104
    new-instance v0, Lcom/scaleasw/powercalc/CalcDisplay$2;

    invoke-direct {v0, p0}, Lcom/scaleasw/powercalc/CalcDisplay$2;-><init>(Lcom/scaleasw/powercalc/CalcDisplay;)V

    invoke-virtual {p0, v0}, Lcom/scaleasw/powercalc/CalcDisplay;->setOnKeyListener(Landroid/view/View$OnKeyListener;)V

    .line 113
    new-instance v0, Lcom/scaleasw/powercalc/CalcDisplay$3;

    invoke-direct {v0, p0}, Lcom/scaleasw/powercalc/CalcDisplay$3;-><init>(Lcom/scaleasw/powercalc/CalcDisplay;)V

    invoke-virtual {p0, v0}, Lcom/scaleasw/powercalc/CalcDisplay;->setOnTouchListener(Landroid/view/View$OnTouchListener;)V

    .line 121
    return-void
.end method


# virtual methods
.method protected onSelectionChanged(II)V
    .locals 1
    .param p1, "selStart"    # I
    .param p2, "selEnd"    # I

    .prologue
    .line 77
    if-eq p1, p2, :cond_0

    invoke-virtual {p0, p1, p1}, Lcom/scaleasw/powercalc/CalcDisplay;->setSelection(II)V

    .line 78
    :cond_0
    iget-object v0, p0, Lcom/scaleasw/powercalc/CalcDisplay;->editor:Lcom/scaleasw/powercalc/Editor;

    if-eqz v0, :cond_1

    iget-boolean v0, p0, Lcom/scaleasw/powercalc/CalcDisplay;->lockCursor:Z

    if-nez v0, :cond_1

    iget-object v0, p0, Lcom/scaleasw/powercalc/CalcDisplay;->editor:Lcom/scaleasw/powercalc/Editor;

    invoke-virtual {v0, p2}, Lcom/scaleasw/powercalc/Editor;->setCursor(I)V

    .line 79
    :cond_1
    return-void
.end method

.method public onTouchEvent(Landroid/view/MotionEvent;)Z
    .locals 3
    .param p1, "event"    # Landroid/view/MotionEvent;

    .prologue
    const/4 v2, 0x1

    .line 126
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I

    move-result v1

    if-eq v1, v2, :cond_0

    iput-boolean v2, p0, Lcom/scaleasw/powercalc/CalcDisplay;->lockCursor:Z

    .line 127
    :cond_0
    invoke-super {p0, p1}, Landroid/widget/EditText;->onTouchEvent(Landroid/view/MotionEvent;)Z

    move-result v1

    invoke-static {v1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v0

    .line 128
    .local v0, "mOnTouchEvent":Ljava/lang/Boolean;
    const/4 v1, 0x0

    iput-boolean v1, p0, Lcom/scaleasw/powercalc/CalcDisplay;->lockCursor:Z

    .line 129
    invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v1

    return v1
.end method

.method public setEditor(Lcom/scaleasw/powercalc/Editor;)V
    .locals 0
    .param p1, "editor"    # Lcom/scaleasw/powercalc/Editor;

    .prologue
    .line 134
    iput-object p1, p0, Lcom/scaleasw/powercalc/CalcDisplay;->editor:Lcom/scaleasw/powercalc/Editor;

    .line 135
    return-void
.end method
