// 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;
        updateAltKeysStates();
        updateBackspaceState();
        // TOneverDO: Call before both updateAltKeysStates() and updateNumberKeysStates().
        updateHeaderDisplayFocus();
    }

    private void updateHeaderDisplayFocus() {
        final boolean showHeaderDisplayFocused = !(mAllNumberKeysDisabled && mAltKeysDisabled);
        if (mHeaderDisplayFocused != showHeaderDisplayFocused) {
            mView.setHeaderDisplayFocused(showHeaderDisplayFocused);
            mHeaderDisplayFocused = showHeaderDisplayFocused;
        }
    }

    private void updateBackspaceState() { 
        mView.setBackspaceEnabled(count() > 0);
    }

    private void updateAltKeysStates() {
        boolean enabled = false;
        if (count() == 0) {
            // No input, no access!
            enabled = false;
        } else if (count() == 1) {
            // Any of 0-9 inputted, always have access in either clock.
            enabled = true;
        } else if (count() == 2) {
            // Any 2 digits that make a valid hour for either clock are eligible for access
            final int time = getDigitsAsInteger();
            enabled = is24HourFormat() ? time <= 23 : time >= 10 && time <= 12;
// 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;

        updateAltKeysStates();
        updateBackspaceState();
        // TOneverDO: Call before both updateAltKeysStates() and updateNumberKeysStates().
        updateHeaderDisplayFocus();
    }

    private void updateHeaderDisplayFocus() {
        final boolean showHeaderDisplayFocused = !(mAllNumberKeysDisabled && mAltKeysDisabled);
        if (mHeaderDisplayFocused != showHeaderDisplayFocused) {
            mView.setHeaderDisplayFocused(showHeaderDisplayFocused);
            mHeaderDisplayFocused = showHeaderDisplayFocused;
        }
    }

    private void updateBackspaceState() { 
        mView.setBackspaceEnabled(count() > 0);
    }

    private void updateAltKeysStates() {
        boolean enabled = false;
        if (count() == 0) {
            // No input, no access!
            enabled = false;
        } else if (count() == 1) {
            // Any of 0-9 inputted, always have access in either clock.
            enabled = true;
        } else if (count() == 2) {
            // Any 2 digits that make a valid hour for either clock are eligible for access
            final int time = getDigitsAsInteger();
            enabled = is24HourFormat() ? time <= 23 : time >= 10 && time <= 12;
        } else if (count() == 3 || count() == MAX_DIGITS) {