744 lines
26 KiB
Smali
744 lines
26 KiB
Smali
.class Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;
|
|
.super Ljava/lang/Object;
|
|
.source "TimePickerTextInputPresenter.java"
|
|
|
|
# interfaces
|
|
.implements Lcom/google/android/material/timepicker/TimePickerView$OnSelectionChange;
|
|
.implements Lcom/google/android/material/timepicker/TimePickerPresenter;
|
|
|
|
|
|
# instance fields
|
|
.field private final controller:Lcom/google/android/material/timepicker/TimePickerTextInputKeyController;
|
|
|
|
.field private final hourEditText:Landroid/widget/EditText;
|
|
|
|
.field private final hourTextInput:Lcom/google/android/material/timepicker/ChipTextInputComboView;
|
|
|
|
.field private final hourTextWatcher:Landroid/text/TextWatcher;
|
|
|
|
.field private final minuteEditText:Landroid/widget/EditText;
|
|
|
|
.field private final minuteTextInput:Lcom/google/android/material/timepicker/ChipTextInputComboView;
|
|
|
|
.field private final minuteTextWatcher:Landroid/text/TextWatcher;
|
|
|
|
.field private final time:Lcom/google/android/material/timepicker/TimeModel;
|
|
|
|
.field private final timePickerView:Landroid/widget/LinearLayout;
|
|
|
|
.field private toggle:Lcom/google/android/material/button/MaterialButtonToggleGroup;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/widget/LinearLayout;Lcom/google/android/material/timepicker/TimeModel;)V
|
|
.locals 6
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
.line 2
|
|
new-instance v0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter$1;
|
|
|
|
invoke-direct {v0, p0}, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter$1;-><init>(Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;)V
|
|
|
|
iput-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->minuteTextWatcher:Landroid/text/TextWatcher;
|
|
|
|
.line 3
|
|
new-instance v0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter$2;
|
|
|
|
invoke-direct {v0, p0}, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter$2;-><init>(Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;)V
|
|
|
|
iput-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->hourTextWatcher:Landroid/text/TextWatcher;
|
|
|
|
.line 4
|
|
iput-object p1, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->timePickerView:Landroid/widget/LinearLayout;
|
|
|
|
.line 5
|
|
iput-object p2, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->time:Lcom/google/android/material/timepicker/TimeModel;
|
|
|
|
.line 6
|
|
invoke-virtual {p1}, Landroid/widget/LinearLayout;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v0
|
|
|
|
.line 7
|
|
sget v1, Lcom/google/android/material/R$id;->material_minute_text_input:I
|
|
|
|
invoke-virtual {p1, v1}, Landroid/widget/LinearLayout;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lcom/google/android/material/timepicker/ChipTextInputComboView;
|
|
|
|
iput-object v1, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->minuteTextInput:Lcom/google/android/material/timepicker/ChipTextInputComboView;
|
|
|
|
.line 8
|
|
sget v2, Lcom/google/android/material/R$id;->material_hour_text_input:I
|
|
|
|
invoke-virtual {p1, v2}, Landroid/widget/LinearLayout;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lcom/google/android/material/timepicker/ChipTextInputComboView;
|
|
|
|
iput-object v2, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->hourTextInput:Lcom/google/android/material/timepicker/ChipTextInputComboView;
|
|
|
|
.line 9
|
|
sget v3, Lcom/google/android/material/R$id;->material_label:I
|
|
|
|
invoke-virtual {v1, v3}, Landroid/widget/FrameLayout;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object v4
|
|
|
|
check-cast v4, Landroid/widget/TextView;
|
|
|
|
.line 10
|
|
invoke-virtual {v2, v3}, Landroid/widget/FrameLayout;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Landroid/widget/TextView;
|
|
|
|
.line 11
|
|
sget v5, Lcom/google/android/material/R$string;->material_timepicker_minute:I
|
|
|
|
invoke-virtual {v0, v5}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {v4, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
.line 12
|
|
sget v4, Lcom/google/android/material/R$string;->material_timepicker_hour:I
|
|
|
|
invoke-virtual {v0, v4}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v3, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
.line 13
|
|
sget v0, Lcom/google/android/material/R$id;->selection_type:I
|
|
|
|
const/16 v3, 0xc
|
|
|
|
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v1, v0, v3}, Lcom/google/android/material/timepicker/ChipTextInputComboView;->setTag(ILjava/lang/Object;)V
|
|
|
|
const/16 v3, 0xa
|
|
|
|
.line 14
|
|
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v2, v0, v3}, Lcom/google/android/material/timepicker/ChipTextInputComboView;->setTag(ILjava/lang/Object;)V
|
|
|
|
.line 15
|
|
iget v0, p2, Lcom/google/android/material/timepicker/TimeModel;->format:I
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 16
|
|
invoke-direct {p0}, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->setupPeriodToggle()V
|
|
|
|
.line 17
|
|
:cond_0
|
|
new-instance v0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter$3;
|
|
|
|
invoke-direct {v0, p0}, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter$3;-><init>(Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;)V
|
|
|
|
.line 18
|
|
invoke-virtual {v2, v0}, Lcom/google/android/material/timepicker/ChipTextInputComboView;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
.line 19
|
|
invoke-virtual {v1, v0}, Lcom/google/android/material/timepicker/ChipTextInputComboView;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
.line 20
|
|
invoke-virtual {p2}, Lcom/google/android/material/timepicker/TimeModel;->getHourInputValidator()Lcom/google/android/material/timepicker/MaxInputValidator;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v2, v0}, Lcom/google/android/material/timepicker/ChipTextInputComboView;->addInputFilter(Landroid/text/InputFilter;)V
|
|
|
|
.line 21
|
|
invoke-virtual {p2}, Lcom/google/android/material/timepicker/TimeModel;->getMinuteInputValidator()Lcom/google/android/material/timepicker/MaxInputValidator;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v1, v0}, Lcom/google/android/material/timepicker/ChipTextInputComboView;->addInputFilter(Landroid/text/InputFilter;)V
|
|
|
|
.line 22
|
|
invoke-virtual {v2}, Lcom/google/android/material/timepicker/ChipTextInputComboView;->getTextInput()Lcom/google/android/material/textfield/TextInputLayout;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/google/android/material/textfield/TextInputLayout;->getEditText()Landroid/widget/EditText;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->hourEditText:Landroid/widget/EditText;
|
|
|
|
.line 23
|
|
invoke-virtual {v1}, Lcom/google/android/material/timepicker/ChipTextInputComboView;->getTextInput()Lcom/google/android/material/textfield/TextInputLayout;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/google/android/material/textfield/TextInputLayout;->getEditText()Landroid/widget/EditText;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->minuteEditText:Landroid/widget/EditText;
|
|
|
|
.line 24
|
|
new-instance v0, Lcom/google/android/material/timepicker/TimePickerTextInputKeyController;
|
|
|
|
invoke-direct {v0, v2, v1, p2}, Lcom/google/android/material/timepicker/TimePickerTextInputKeyController;-><init>(Lcom/google/android/material/timepicker/ChipTextInputComboView;Lcom/google/android/material/timepicker/ChipTextInputComboView;Lcom/google/android/material/timepicker/TimeModel;)V
|
|
|
|
iput-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->controller:Lcom/google/android/material/timepicker/TimePickerTextInputKeyController;
|
|
|
|
.line 25
|
|
new-instance p2, Lcom/google/android/material/timepicker/ClickActionDelegate;
|
|
|
|
.line 26
|
|
invoke-virtual {p1}, Landroid/widget/LinearLayout;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
sget v3, Lcom/google/android/material/R$string;->material_hour_selection:I
|
|
|
|
invoke-direct {p2, v0, v3}, Lcom/google/android/material/timepicker/ClickActionDelegate;-><init>(Landroid/content/Context;I)V
|
|
|
|
.line 27
|
|
invoke-virtual {v2, p2}, Lcom/google/android/material/timepicker/ChipTextInputComboView;->setChipDelegate(Landroidx/core/view/a;)V
|
|
|
|
.line 28
|
|
new-instance p2, Lcom/google/android/material/timepicker/ClickActionDelegate;
|
|
|
|
.line 29
|
|
invoke-virtual {p1}, Landroid/widget/LinearLayout;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object p1
|
|
|
|
sget v0, Lcom/google/android/material/R$string;->material_minute_selection:I
|
|
|
|
invoke-direct {p2, p1, v0}, Lcom/google/android/material/timepicker/ClickActionDelegate;-><init>(Landroid/content/Context;I)V
|
|
|
|
.line 30
|
|
invoke-virtual {v1, p2}, Lcom/google/android/material/timepicker/ChipTextInputComboView;->setChipDelegate(Landroidx/core/view/a;)V
|
|
|
|
.line 31
|
|
invoke-virtual {p0}, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->initialize()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static synthetic access$000(Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;)Lcom/google/android/material/timepicker/TimeModel;
|
|
.locals 0
|
|
|
|
.line 1
|
|
iget-object p0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->time:Lcom/google/android/material/timepicker/TimeModel;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private addTextWatchers()V
|
|
.locals 2
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->hourEditText:Landroid/widget/EditText;
|
|
|
|
iget-object v1, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->hourTextWatcher:Landroid/text/TextWatcher;
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/EditText;->addTextChangedListener(Landroid/text/TextWatcher;)V
|
|
|
|
.line 2
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->minuteEditText:Landroid/widget/EditText;
|
|
|
|
iget-object v1, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->minuteTextWatcher:Landroid/text/TextWatcher;
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/EditText;->addTextChangedListener(Landroid/text/TextWatcher;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private removeTextWatchers()V
|
|
.locals 2
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->hourEditText:Landroid/widget/EditText;
|
|
|
|
iget-object v1, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->hourTextWatcher:Landroid/text/TextWatcher;
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/EditText;->removeTextChangedListener(Landroid/text/TextWatcher;)V
|
|
|
|
.line 2
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->minuteEditText:Landroid/widget/EditText;
|
|
|
|
iget-object v1, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->minuteTextWatcher:Landroid/text/TextWatcher;
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/EditText;->removeTextChangedListener(Landroid/text/TextWatcher;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private static setCursorDrawableColor(Landroid/widget/EditText;I)V
|
|
.locals 5
|
|
.param p1 # I
|
|
.annotation build Landroidx/annotation/ColorInt;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 1
|
|
:try_start_0
|
|
invoke-virtual {p0}, Landroid/widget/EditText;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
.line 2
|
|
const-class v1, Landroid/widget/TextView;
|
|
|
|
const-string v2, "mCursorDrawableRes"
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
|
|
|
|
move-result-object v1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
.line 3
|
|
invoke-virtual {v1, v2}, Ljava/lang/reflect/Field;->setAccessible(Z)V
|
|
|
|
.line 4
|
|
invoke-virtual {v1, p0}, Ljava/lang/reflect/Field;->getInt(Ljava/lang/Object;)I
|
|
|
|
move-result v1
|
|
|
|
.line 5
|
|
const-class v3, Landroid/widget/TextView;
|
|
|
|
const-string v4, "mEditor"
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
|
|
|
|
move-result-object v3
|
|
|
|
.line 6
|
|
invoke-virtual {v3, v2}, Ljava/lang/reflect/Field;->setAccessible(Z)V
|
|
|
|
.line 7
|
|
invoke-virtual {v3, p0}, Ljava/lang/reflect/Field;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
.line 8
|
|
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v3
|
|
|
|
const-string v4, "mCursorDrawable"
|
|
|
|
.line 9
|
|
invoke-virtual {v3, v4}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
|
|
|
|
move-result-object v3
|
|
|
|
.line 10
|
|
invoke-virtual {v3, v2}, Ljava/lang/reflect/Field;->setAccessible(Z)V
|
|
|
|
.line 11
|
|
invoke-static {v0, v1}, Lg/a;->d(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;
|
|
|
|
move-result-object v0
|
|
|
|
.line 12
|
|
sget-object v1, Landroid/graphics/PorterDuff$Mode;->SRC_IN:Landroid/graphics/PorterDuff$Mode;
|
|
|
|
invoke-virtual {v0, p1, v1}, Landroid/graphics/drawable/Drawable;->setColorFilter(ILandroid/graphics/PorterDuff$Mode;)V
|
|
|
|
const/4 p1, 0x2
|
|
|
|
new-array p1, p1, [Landroid/graphics/drawable/Drawable;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
aput-object v0, p1, v1
|
|
|
|
aput-object v0, p1, v2
|
|
|
|
.line 13
|
|
invoke-virtual {v3, p0, p1}, Ljava/lang/reflect/Field;->set(Ljava/lang/Object;Ljava/lang/Object;)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:catchall_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private setTime(Lcom/google/android/material/timepicker/TimeModel;)V
|
|
.locals 5
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->removeTextWatchers()V
|
|
|
|
.line 2
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->timePickerView:Landroid/widget/LinearLayout;
|
|
|
|
invoke-virtual {v0}, Landroid/widget/LinearLayout;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v0, v0, Landroid/content/res/Configuration;->locale:Ljava/util/Locale;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
new-array v2, v1, [Ljava/lang/Object;
|
|
|
|
.line 3
|
|
iget v3, p1, Lcom/google/android/material/timepicker/TimeModel;->minute:I
|
|
|
|
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v3
|
|
|
|
const/4 v4, 0x0
|
|
|
|
aput-object v3, v2, v4
|
|
|
|
const-string v3, "%02d"
|
|
|
|
invoke-static {v0, v3, v2}, Ljava/lang/String;->format(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
new-array v1, v1, [Ljava/lang/Object;
|
|
|
|
.line 4
|
|
invoke-virtual {p1}, Lcom/google/android/material/timepicker/TimeModel;->getHourForDisplay()I
|
|
|
|
move-result p1
|
|
|
|
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object p1
|
|
|
|
aput-object p1, v1, v4
|
|
|
|
invoke-static {v0, v3, v1}, Ljava/lang/String;->format(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
.line 5
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->minuteTextInput:Lcom/google/android/material/timepicker/ChipTextInputComboView;
|
|
|
|
invoke-virtual {v0, v2}, Lcom/google/android/material/timepicker/ChipTextInputComboView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
.line 6
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->hourTextInput:Lcom/google/android/material/timepicker/ChipTextInputComboView;
|
|
|
|
invoke-virtual {v0, p1}, Lcom/google/android/material/timepicker/ChipTextInputComboView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
.line 7
|
|
invoke-direct {p0}, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->addTextWatchers()V
|
|
|
|
.line 8
|
|
invoke-direct {p0}, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->updateSelection()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private setupPeriodToggle()V
|
|
.locals 2
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->timePickerView:Landroid/widget/LinearLayout;
|
|
|
|
sget v1, Lcom/google/android/material/R$id;->material_clock_period_toggle:I
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/google/android/material/button/MaterialButtonToggleGroup;
|
|
|
|
iput-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->toggle:Lcom/google/android/material/button/MaterialButtonToggleGroup;
|
|
|
|
.line 2
|
|
new-instance v1, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter$4;
|
|
|
|
invoke-direct {v1, p0}, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter$4;-><init>(Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;)V
|
|
|
|
invoke-virtual {v0, v1}, Lcom/google/android/material/button/MaterialButtonToggleGroup;->addOnButtonCheckedListener(Lcom/google/android/material/button/MaterialButtonToggleGroup$OnButtonCheckedListener;)V
|
|
|
|
.line 3
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->toggle:Lcom/google/android/material/button/MaterialButtonToggleGroup;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->setVisibility(I)V
|
|
|
|
.line 4
|
|
invoke-direct {p0}, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->updateSelection()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private updateSelection()V
|
|
.locals 2
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->toggle:Lcom/google/android/material/button/MaterialButtonToggleGroup;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 2
|
|
:cond_0
|
|
iget-object v1, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->time:Lcom/google/android/material/timepicker/TimeModel;
|
|
|
|
iget v1, v1, Lcom/google/android/material/timepicker/TimeModel;->period:I
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
sget v1, Lcom/google/android/material/R$id;->material_clock_period_am_button:I
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
sget v1, Lcom/google/android/material/R$id;->material_clock_period_pm_button:I
|
|
|
|
:goto_0
|
|
invoke-virtual {v0, v1}, Lcom/google/android/material/button/MaterialButtonToggleGroup;->check(I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public clearCheck()V
|
|
.locals 2
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->minuteTextInput:Lcom/google/android/material/timepicker/ChipTextInputComboView;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {v0, v1}, Lcom/google/android/material/timepicker/ChipTextInputComboView;->setChecked(Z)V
|
|
|
|
.line 2
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->hourTextInput:Lcom/google/android/material/timepicker/ChipTextInputComboView;
|
|
|
|
invoke-virtual {v0, v1}, Lcom/google/android/material/timepicker/ChipTextInputComboView;->setChecked(Z)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public hide()V
|
|
.locals 4
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->timePickerView:Landroid/widget/LinearLayout;
|
|
|
|
invoke-virtual {v0}, Landroid/widget/LinearLayout;->getFocusedChild()Landroid/view/View;
|
|
|
|
move-result-object v0
|
|
|
|
const/16 v1, 0x8
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 2
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->timePickerView:Landroid/widget/LinearLayout;
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->setVisibility(I)V
|
|
|
|
return-void
|
|
|
|
.line 3
|
|
:cond_0
|
|
iget-object v2, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->timePickerView:Landroid/widget/LinearLayout;
|
|
|
|
invoke-virtual {v2}, Landroid/widget/LinearLayout;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v2
|
|
|
|
.line 4
|
|
const-class v3, Landroid/view/inputmethod/InputMethodManager;
|
|
|
|
invoke-static {v2, v3}, Landroidx/core/content/d;->o(Landroid/content/Context;Ljava/lang/Class;)Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Landroid/view/inputmethod/InputMethodManager;
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
.line 5
|
|
invoke-virtual {v0}, Landroid/view/View;->getWindowToken()Landroid/os/IBinder;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
invoke-virtual {v2, v0, v3}, Landroid/view/inputmethod/InputMethodManager;->hideSoftInputFromWindow(Landroid/os/IBinder;I)Z
|
|
|
|
.line 6
|
|
:cond_1
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->timePickerView:Landroid/widget/LinearLayout;
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->setVisibility(I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public initialize()V
|
|
.locals 1
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->addTextWatchers()V
|
|
|
|
.line 2
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->time:Lcom/google/android/material/timepicker/TimeModel;
|
|
|
|
invoke-direct {p0, v0}, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->setTime(Lcom/google/android/material/timepicker/TimeModel;)V
|
|
|
|
.line 3
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->controller:Lcom/google/android/material/timepicker/TimePickerTextInputKeyController;
|
|
|
|
invoke-virtual {v0}, Lcom/google/android/material/timepicker/TimePickerTextInputKeyController;->bind()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public invalidate()V
|
|
.locals 1
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->time:Lcom/google/android/material/timepicker/TimeModel;
|
|
|
|
invoke-direct {p0, v0}, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->setTime(Lcom/google/android/material/timepicker/TimeModel;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onSelectionChanged(I)V
|
|
.locals 4
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->time:Lcom/google/android/material/timepicker/TimeModel;
|
|
|
|
iput p1, v0, Lcom/google/android/material/timepicker/TimeModel;->selection:I
|
|
|
|
.line 2
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->minuteTextInput:Lcom/google/android/material/timepicker/ChipTextInputComboView;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/16 v3, 0xc
|
|
|
|
if-ne p1, v3, :cond_0
|
|
|
|
move v3, v1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move v3, v2
|
|
|
|
:goto_0
|
|
invoke-virtual {v0, v3}, Lcom/google/android/material/timepicker/ChipTextInputComboView;->setChecked(Z)V
|
|
|
|
.line 3
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->hourTextInput:Lcom/google/android/material/timepicker/ChipTextInputComboView;
|
|
|
|
const/16 v3, 0xa
|
|
|
|
if-ne p1, v3, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
move v1, v2
|
|
|
|
:goto_1
|
|
invoke-virtual {v0, v1}, Lcom/google/android/material/timepicker/ChipTextInputComboView;->setChecked(Z)V
|
|
|
|
.line 4
|
|
invoke-direct {p0}, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->updateSelection()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public resetChecked()V
|
|
.locals 5
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->minuteTextInput:Lcom/google/android/material/timepicker/ChipTextInputComboView;
|
|
|
|
iget-object v1, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->time:Lcom/google/android/material/timepicker/TimeModel;
|
|
|
|
iget v1, v1, Lcom/google/android/material/timepicker/TimeModel;->selection:I
|
|
|
|
const/4 v2, 0x1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/16 v4, 0xc
|
|
|
|
if-ne v1, v4, :cond_0
|
|
|
|
move v1, v2
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move v1, v3
|
|
|
|
:goto_0
|
|
invoke-virtual {v0, v1}, Lcom/google/android/material/timepicker/ChipTextInputComboView;->setChecked(Z)V
|
|
|
|
.line 2
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->hourTextInput:Lcom/google/android/material/timepicker/ChipTextInputComboView;
|
|
|
|
iget-object v1, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->time:Lcom/google/android/material/timepicker/TimeModel;
|
|
|
|
iget v1, v1, Lcom/google/android/material/timepicker/TimeModel;->selection:I
|
|
|
|
const/16 v4, 0xa
|
|
|
|
if-ne v1, v4, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
move v2, v3
|
|
|
|
:goto_1
|
|
invoke-virtual {v0, v2}, Lcom/google/android/material/timepicker/ChipTextInputComboView;->setChecked(Z)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public show()V
|
|
.locals 2
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/google/android/material/timepicker/TimePickerTextInputPresenter;->timePickerView:Landroid/widget/LinearLayout;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->setVisibility(I)V
|
|
|
|
return-void
|
|
.end method
|