.class public Lcom/moji/dialog/control/MJDialogRadioTwoControl;
.super Lcom/moji/dialog/control/AbsDialogControl;
.source "MJDialogRadioTwoControl.java"

# interfaces
.implements Landroid/widget/RadioGroup$OnCheckedChangeListener;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/dialog/control/MJDialogRadioTwoControl$SingleRadioButtonCallback;,
        Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/moji/dialog/control/AbsDialogControl<",
        "Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;",
        ">;",
        "Landroid/widget/RadioGroup$OnCheckedChangeListener;"
    }
.end annotation


# instance fields
.field protected b:Landroid/widget/RadioButton;

.field protected c:Landroid/widget/RadioButton;

.field protected d:Landroid/widget/RadioGroup;


# direct methods
.method public constructor <init>(Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;)V
    .locals 0

    .line 31
    invoke-direct {p0, p1}, Lcom/moji/dialog/control/AbsDialogControl;-><init>(Lcom/moji/dialog/control/MJDialogDefaultControl$Builder;)V

    return-void
.end method

.method private a(Landroid/widget/RadioButton;I)V
    .locals 3
    .param p2    # I
        .annotation build Landroid/support/annotation/DrawableRes;
        .end annotation
    .end param

    .line 74
    invoke-virtual {p1}, Landroid/widget/RadioButton;->getContext()Landroid/content/Context;

    move-result-object v0

    .line 75
    invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    .line 76
    invoke-static {v0, p2}, Landroid/support/v4/content/ContextCompat;->getDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;

    move-result-object p2

    .line 77
    sget v0, Lcom/moji/widget/R$dimen;->mj_dialog_radio_size:I

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

    move-result v0

    float-to-int v0, v0

    sget v2, Lcom/moji/widget/R$dimen;->mj_dialog_radio_size:I

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

    move-result v1

    float-to-int v1, v1

    const/4 v2, 0x0

    invoke-virtual {p2, v2, v2, v0, v1}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V

    const/4 v0, 0x0

    .line 78
    invoke-virtual {p1, v0, p2, v0, v0}, Landroid/widget/RadioButton;->setCompoundDrawables(Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;)V

    return-void
.end method


# virtual methods
.method public a()I
    .locals 1

    .line 36
    sget v0, Lcom/moji/widget/R$layout;->mj_dialog_radio_two:I

    return v0
.end method

.method protected a(Lcom/moji/dialog/MJDialog;Landroid/view/View;)V
    .locals 2

    .line 41
    sget p1, Lcom/moji/widget/R$id;->rg_select:I

    invoke-virtual {p2, p1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p1

    check-cast p1, Landroid/widget/RadioGroup;

    iput-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->d:Landroid/widget/RadioGroup;

    .line 42
    sget p1, Lcom/moji/widget/R$id;->rb_select_one:I

    invoke-virtual {p2, p1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p1

    check-cast p1, Landroid/widget/RadioButton;

    iput-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->b:Landroid/widget/RadioButton;

    .line 43
    sget p1, Lcom/moji/widget/R$id;->rb_select_two:I

    invoke-virtual {p2, p1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p1

    check-cast p1, Landroid/widget/RadioButton;

    iput-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->c:Landroid/widget/RadioButton;

    .line 45
    iget-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->d:Landroid/widget/RadioGroup;

    if-nez p1, :cond_0

    return-void

    .line 47
    :cond_0
    iget-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->a:Lcom/moji/dialog/control/MJDialogDefaultControl$Builder;

    check-cast p1, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;

    iget-object p1, p1, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;->u:[Ljava/lang/CharSequence;

    if-eqz p1, :cond_2

    iget-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->a:Lcom/moji/dialog/control/MJDialogDefaultControl$Builder;

    check-cast p1, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;

    iget-object p1, p1, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;->a:[I

    if-eqz p1, :cond_2

    .line 51
    iget-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->a:Lcom/moji/dialog/control/MJDialogDefaultControl$Builder;

    check-cast p1, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;

    iget-object p1, p1, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;->u:[Ljava/lang/CharSequence;

    array-length p1, p1

    const/4 p2, 0x2

    if-ne p1, p2, :cond_1

    iget-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->a:Lcom/moji/dialog/control/MJDialogDefaultControl$Builder;

    check-cast p1, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;

    iget-object p1, p1, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;->a:[I

    array-length p1, p1

    if-ne p1, p2, :cond_1

    iget-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->a:Lcom/moji/dialog/control/MJDialogDefaultControl$Builder;

    check-cast p1, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;

    iget-object p1, p1, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;->t:[I

    array-length p1, p1

    if-ne p1, p2, :cond_1

    .line 55
    iget-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->b:Landroid/widget/RadioButton;

    iget-object p2, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->a:Lcom/moji/dialog/control/MJDialogDefaultControl$Builder;

    check-cast p2, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;

    iget-object p2, p2, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;->u:[Ljava/lang/CharSequence;

    const/4 v0, 0x0

    aget-object p2, p2, v0

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

    .line 56
    iget-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->c:Landroid/widget/RadioButton;

    iget-object p2, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->a:Lcom/moji/dialog/control/MJDialogDefaultControl$Builder;

    check-cast p2, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;

    iget-object p2, p2, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;->u:[Ljava/lang/CharSequence;

    const/4 v1, 0x1

    aget-object p2, p2, v1

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

    .line 58
    iget-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->b:Landroid/widget/RadioButton;

    iget-object p2, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->a:Lcom/moji/dialog/control/MJDialogDefaultControl$Builder;

    check-cast p2, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;

    iget-object p2, p2, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;->t:[I

    aget p2, p2, v0

    invoke-static {p2}, Lcom/moji/tool/Utils;->b(I)I

    move-result p2

    invoke-virtual {p1, p2}, Landroid/widget/RadioButton;->setTextColor(I)V

    .line 59
    iget-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->c:Landroid/widget/RadioButton;

    iget-object p2, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->a:Lcom/moji/dialog/control/MJDialogDefaultControl$Builder;

    check-cast p2, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;

    iget-object p2, p2, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;->t:[I

    aget p2, p2, v1

    invoke-static {p2}, Lcom/moji/tool/Utils;->b(I)I

    move-result p2

    invoke-virtual {p1, p2}, Landroid/widget/RadioButton;->setTextColor(I)V

    .line 61
    iget-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->b:Landroid/widget/RadioButton;

    sget-object p2, Lcom/moji/dialog/type/ETypeRadio;->RADIO_ONE:Lcom/moji/dialog/type/ETypeRadio;

    invoke-virtual {p1, p2}, Landroid/widget/RadioButton;->setTag(Ljava/lang/Object;)V

    .line 62
    iget-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->c:Landroid/widget/RadioButton;

    sget-object p2, Lcom/moji/dialog/type/ETypeRadio;->RADIO_TWO:Lcom/moji/dialog/type/ETypeRadio;

    invoke-virtual {p1, p2}, Landroid/widget/RadioButton;->setTag(Ljava/lang/Object;)V

    .line 64
    iget-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->b:Landroid/widget/RadioButton;

    iget-object p2, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->a:Lcom/moji/dialog/control/MJDialogDefaultControl$Builder;

    check-cast p2, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;

    iget-object p2, p2, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;->a:[I

    aget p2, p2, v0

    invoke-direct {p0, p1, p2}, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->a(Landroid/widget/RadioButton;I)V

    .line 65
    iget-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->c:Landroid/widget/RadioButton;

    iget-object p2, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->a:Lcom/moji/dialog/control/MJDialogDefaultControl$Builder;

    check-cast p2, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;

    iget-object p2, p2, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;->a:[I

    aget p2, p2, v1

    invoke-direct {p0, p1, p2}, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->a(Landroid/widget/RadioButton;I)V

    .line 67
    iget-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->b:Landroid/widget/RadioButton;

    invoke-static {p1}, Lcom/moji/tool/Utils;->a(Landroid/view/View;)V

    .line 68
    iget-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->c:Landroid/widget/RadioButton;

    invoke-static {p1}, Lcom/moji/tool/Utils;->a(Landroid/view/View;)V

    .line 70
    iget-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->d:Landroid/widget/RadioGroup;

    invoke-virtual {p1, p0}, Landroid/widget/RadioGroup;->setOnCheckedChangeListener(Landroid/widget/RadioGroup$OnCheckedChangeListener;)V

    return-void

    .line 52
    :cond_1
    new-instance p1, Ljava/lang/IllegalStateException;

    const-string p2, "so far,only support two radio button!"

    invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw p1

    .line 48
    :cond_2
    new-instance p1, Ljava/lang/IllegalStateException;

    const-string p2, "radioTextResources and radioBackgroundResources can not null, please use radioTextResources() and radioBackgroundResources() method"

    invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw p1
.end method

.method public onCheckedChanged(Landroid/widget/RadioGroup;I)V
    .locals 1

    .line 83
    invoke-virtual {p1, p2}, Landroid/widget/RadioGroup;->findViewById(I)Landroid/view/View;

    move-result-object p1

    check-cast p1, Landroid/widget/RadioButton;

    .line 84
    invoke-virtual {p1}, Landroid/widget/RadioButton;->getTag()Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lcom/moji/dialog/type/ETypeRadio;

    .line 85
    sget-object p2, Lcom/moji/dialog/control/MJDialogRadioTwoControl$1;->a:[I

    invoke-virtual {p1}, Lcom/moji/dialog/type/ETypeRadio;->ordinal()I

    move-result v0

    aget p2, p2, v0

    packed-switch p2, :pswitch_data_0

    goto :goto_0

    .line 92
    :pswitch_0
    iget-object p2, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->a:Lcom/moji/dialog/control/MJDialogDefaultControl$Builder;

    check-cast p2, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;

    iget-object p2, p2, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;->x:Lcom/moji/dialog/control/MJDialogRadioTwoControl$SingleRadioButtonCallback;

    if-eqz p2, :cond_0

    .line 93
    iget-object p2, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->a:Lcom/moji/dialog/control/MJDialogDefaultControl$Builder;

    check-cast p2, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;

    iget-object p2, p2, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;->x:Lcom/moji/dialog/control/MJDialogRadioTwoControl$SingleRadioButtonCallback;

    invoke-virtual {p0}, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->e()Lcom/moji/dialog/MJDialog;

    move-result-object v0

    invoke-interface {p2, v0, p1}, Lcom/moji/dialog/control/MJDialogRadioTwoControl$SingleRadioButtonCallback;->a(Lcom/moji/dialog/MJDialog;Lcom/moji/dialog/type/ETypeRadio;)V

    .line 94
    :cond_0
    iget-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->a:Lcom/moji/dialog/control/MJDialogDefaultControl$Builder;

    check-cast p1, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;

    iget-boolean p1, p1, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;->i:Z

    if-eqz p1, :cond_2

    invoke-virtual {p0}, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->e()Lcom/moji/dialog/MJDialog;

    move-result-object p1

    invoke-virtual {p1}, Lcom/moji/dialog/MJDialog;->dismiss()V

    goto :goto_0

    .line 87
    :pswitch_1
    iget-object p2, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->a:Lcom/moji/dialog/control/MJDialogDefaultControl$Builder;

    check-cast p2, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;

    iget-object p2, p2, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;->w:Lcom/moji/dialog/control/MJDialogRadioTwoControl$SingleRadioButtonCallback;

    if-eqz p2, :cond_1

    .line 88
    iget-object p2, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->a:Lcom/moji/dialog/control/MJDialogDefaultControl$Builder;

    check-cast p2, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;

    iget-object p2, p2, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;->w:Lcom/moji/dialog/control/MJDialogRadioTwoControl$SingleRadioButtonCallback;

    invoke-virtual {p0}, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->e()Lcom/moji/dialog/MJDialog;

    move-result-object v0

    invoke-interface {p2, v0, p1}, Lcom/moji/dialog/control/MJDialogRadioTwoControl$SingleRadioButtonCallback;->a(Lcom/moji/dialog/MJDialog;Lcom/moji/dialog/type/ETypeRadio;)V

    .line 89
    :cond_1
    iget-object p1, p0, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->a:Lcom/moji/dialog/control/MJDialogDefaultControl$Builder;

    check-cast p1, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;

    iget-boolean p1, p1, Lcom/moji/dialog/control/MJDialogRadioTwoControl$Builder;->i:Z

    if-eqz p1, :cond_2

    invoke-virtual {p0}, Lcom/moji/dialog/control/MJDialogRadioTwoControl;->e()Lcom/moji/dialog/MJDialog;

    move-result-object p1

    invoke-virtual {p1}, Lcom/moji/dialog/MJDialog;->dismiss()V

    :cond_2
    :goto_0
    return-void

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_1
        :pswitch_0
    .end packed-switch
.end method
