public void pushDigit(final char digit) {
            if (!Character.isDigit(digit))
                throw new IllegalArgumentException("Only numbers are allowed");

            removeLeadingZeros();
            if (input.length() < maxDigits && (input.length() > 0 || digit != '0')) {
                input.append(digit);
            }
            padWithZeros();
        }
Encapsulates the digit input logic and text to duration conversion logic.
android/third_party/time-duration-picker/src/main/java/mobi/upod/timedurationpicker/TimeDurationPicker.java