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


import android.support.annotation.NonNull;
import static com.philliphsu.numberpadtimepicker.AmPmState.AM;
import static com.philliphsu.numberpadtimepicker.AmPmState.HRS_24;
import static com.philliphsu.numberpadtimepicker.AmPmState.PM;
import static com.philliphsu.numberpadtimepicker.AmPmState.UNSPECIFIED;
import static com.philliphsu.numberpadtimepicker.DigitwiseTimeModel.MAX_DIGITS;
import static com.philliphsu.numberpadtimepicker.Preconditions.checkNotNull;
        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) {
            // For the 24-hour clock, no access at all because
            // two more digits (00 or 30) cannot be added without
            // exceeding MAX_DIGITS.
            // For the 12-hour clock, any 3-digit or 4-digit times have
            // complete need of the alt buttons, if AM/PM not already entered.
            enabled = !is24HourFormat() && mAmPmState == UNSPECIFIED;
        }
        mView.setLeftAltKeyEnabled(enabled);
        mView.setRightAltKeyEnabled(enabled);
    }
    
    private void updateNumberKeysStates() {
        int cap = 10; // number of buttons
        boolean is24hours = is24HourFormat();

        if (count() == 0) {
            enable(is24hours ? 0 : 1, cap);
            return;
// Path: library/src/main/java/com/philliphsu/numberpadtimepicker/DigitwiseTimeModel.java
// static final int MAX_DIGITS = 4;
// 
// Path: library/src/main/java/com/philliphsu/numberpadtimepicker/Preconditions.java
// static <T> T checkNotNull(T t) {
//     if (t == null) {
//         throw new NullPointerException();
//     }
//     return t;
// }


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

        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) {
            // For the 24-hour clock, no access at all because
            // two more digits (00 or 30) cannot be added without
            // exceeding MAX_DIGITS.
            // For the 12-hour clock, any 3-digit or 4-digit times have
            // complete need of the alt buttons, if AM/PM not already entered.
            enabled = !is24HourFormat() && mAmPmState == UNSPECIFIED;
        }
        mView.setLeftAltKeyEnabled(enabled);
        mView.setRightAltKeyEnabled(enabled);
    }
    
    private void updateNumberKeysStates() {
        int cap = 10; // number of buttons
        boolean is24hours = is24HourFormat();

        if (count() == 0) {
            enable(is24hours ? 0 : 1, cap);
            return;
        } else if (count() == MAX_DIGITS) {