// Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/time/numberpad/Preconditions.java
// static <T> T checkNotNull(T t) {
//     if (t == null) {
//         throw new NullPointerException();
//     }
//     return t;
// }
// 
// Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/time/numberpad/DigitwiseTimeModel.java
// static final int MAX_DIGITS = 4;


import android.support.annotation.NonNull;
import static com.philliphsu.bottomsheetpickers.time.numberpad.Preconditions.checkNotNull;
import static com.philliphsu.bottomsheetpickers.time.numberpad.AmPmState.AM;
import static com.philliphsu.bottomsheetpickers.time.numberpad.AmPmState.HRS_24;
import static com.philliphsu.bottomsheetpickers.time.numberpad.AmPmState.PM;
import static com.philliphsu.bottomsheetpickers.time.numberpad.AmPmState.UNSPECIFIED;
import static com.philliphsu.bottomsheetpickers.time.numberpad.DigitwiseTimeModel.MAX_DIGITS;
package com.philliphsu.bottomsheetpickers.time.numberpad;



class NumberPadTimePickerPresenter implements
        INumberPadTimePicker.Presenter,
        DigitwiseTimeModel.OnInputChangeListener {
    private static final int MAX_CHARS = 5;  // 4 digits + time separator

    private final StringBuilder mFormattedInput = new StringBuilder(MAX_CHARS);
    private final String[] mAltTexts = new String[2];

    private final @NonNull LocaleModel mLocaleModel;
    private final ButtonTextModel mTextModel;
    private final String mTimeSeparator;
    private final boolean mIs24HourMode;

    private INumberPadTimePicker.View mView;

    private boolean mAltKeysDisabled;
    private boolean mAllNumberKeysDisabled;
    private boolean mHeaderDisplayFocused;

    final DigitwiseTimeModel mTimeModel = new DigitwiseTimeModel(this);

    @AmPmState
    int mAmPmState = UNSPECIFIED;

    NumberPadTimePickerPresenter(@NonNull INumberPadTimePicker.View view,
                                 @NonNull LocaleModel localeModel,
                                 boolean is24HourMode) {
// Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/time/numberpad/Preconditions.java
// static <T> T checkNotNull(T t) {
//     if (t == null) {
//         throw new NullPointerException();
//     }
//     return t;
// }
// 
// Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/time/numberpad/DigitwiseTimeModel.java
// static final int MAX_DIGITS = 4;


// Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/time/numberpad/NumberPadTimePickerPresenter.java
import android.support.annotation.NonNull;
import static com.philliphsu.bottomsheetpickers.time.numberpad.Preconditions.checkNotNull;
import static com.philliphsu.bottomsheetpickers.time.numberpad.AmPmState.AM;
import static com.philliphsu.bottomsheetpickers.time.numberpad.AmPmState.HRS_24;
import static com.philliphsu.bottomsheetpickers.time.numberpad.AmPmState.PM;
import static com.philliphsu.bottomsheetpickers.time.numberpad.AmPmState.UNSPECIFIED;
import static com.philliphsu.bottomsheetpickers.time.numberpad.DigitwiseTimeModel.MAX_DIGITS;

package com.philliphsu.bottomsheetpickers.time.numberpad;



class NumberPadTimePickerPresenter implements
        INumberPadTimePicker.Presenter,
        DigitwiseTimeModel.OnInputChangeListener {
    private static final int MAX_CHARS = 5;  // 4 digits + time separator

    private final StringBuilder mFormattedInput = new StringBuilder(MAX_CHARS);
    private final String[] mAltTexts = new String[2];

    private final @NonNull LocaleModel mLocaleModel;
    private final ButtonTextModel mTextModel;
    private final String mTimeSeparator;
    private final boolean mIs24HourMode;

    private INumberPadTimePicker.View mView;

    private boolean mAltKeysDisabled;
    private boolean mAllNumberKeysDisabled;
    private boolean mHeaderDisplayFocused;

    final DigitwiseTimeModel mTimeModel = new DigitwiseTimeModel(this);

    @AmPmState
    int mAmPmState = UNSPECIFIED;

    NumberPadTimePickerPresenter(@NonNull INumberPadTimePicker.View view,
                                 @NonNull LocaleModel localeModel,
                                 boolean is24HourMode) {
        mView = checkNotNull(view);