@Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        final int touchableSize = getContext().getResources().getDimensionPixelSize(R.dimen.touchable);
        final int dummyMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);

        // set spacing between units
        hoursView.measure(dummyMeasureSpec, dummyMeasureSpec);
        final TextView unitLabelView = unitLabelViews[2];
        unitLabelView.measure(dummyMeasureSpec, dummyMeasureSpec);
        final int unitSpacing = Math.max(hoursView.getMeasuredWidth() / 3, (int) (1.2f * unitLabelView.getMeasuredWidth()));
        applyLeftMargin(unitSpacing, minutesView, secondsView);

        // calculate size for display row
        durationView.measure(dummyMeasureSpec, dummyMeasureSpec);
        final int minDisplayWidth = durationView.getMeasuredWidth() + 2 * touchableSize;
        final int minDisplayHeight = Math.max(durationView.getMeasuredHeight(), touchableSize);

        // calculate size for num pad
        numPadMeasureButton.measure(dummyMeasureSpec, dummyMeasureSpec);
        final int minNumPadButtonSize = Math.max(Math.max(numPadMeasureButton.getMeasuredHeight(), numPadMeasureButton.getMeasuredWidth()), touchableSize);
        final int minNumPadWidth = 3 * minNumPadButtonSize;
        final int minNumPadHeight = 4 * minNumPadButtonSize;

        // calculate overall size
        final int minWidth = Math.max(minDisplayWidth, minNumPadWidth);
        final int minHeight = minDisplayHeight + minNumPadHeight;

        // respect measure spec
        final int availableWidth = MeasureSpec.getSize(widthMeasureSpec);
        final int availableHeight = MeasureSpec.getSize(heightMeasureSpec);
        final int widthMode = MeasureSpec.getMode(widthMeasureSpec);
        final int heightMode = MeasureSpec.getMode(heightMeasureSpec);

        final int preferredWidth = widthMode == MeasureSpec.EXACTLY ? availableWidth : minWidth;
        final int preferredHeight = heightMode == MeasureSpec.EXACTLY ? availableHeight : minHeight;

        // measure the display
        final int displayRowWidth = Math.max(minDisplayWidth, preferredWidth);
        final int displayRowHeight = minDisplayHeight;
        displayRow.measure(MeasureSpec.makeMeasureSpec(displayRowWidth, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(displayRowHeight, MeasureSpec.EXACTLY));

        // measure the numPad
        // if we have more space available, we can try to grow the num pad
        final int numPadWidth = Math.max(minNumPadHeight, displayRowWidth);
        final int numPadHeight = Math.max(minNumPadHeight, preferredHeight - displayRowHeight);
        numPad.measure(MeasureSpec.makeMeasureSpec(numPadWidth, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(numPadHeight, MeasureSpec.EXACTLY));

        // forward calculated size to super implementation
        final int width = Math.max(displayRowWidth, numPadWidth);
        final int height = displayRowHeight + numPadHeight;
        setMeasuredDimension(width, height);
    }
Sets the padding to be used for the number pad buttons.

@param padding padding in pixels
android/third_party/time-duration-picker/src/main/java/mobi/upod/timedurationpicker/TimeDurationPicker.java