MaterialDialog.java 文件源码

java
阅读 50 收藏 0 点赞 0 评论 0

项目:GitHub 作者:
protected void invalidateInputMinMaxIndicator(int currentLength, boolean emptyDisabled) {
    if (inputMinMax != null) {
        if (builder.inputMaxLength > 0) {
            inputMinMax.setText(String.format(Locale.getDefault(), "%d/%d", currentLength, builder.inputMaxLength));
            inputMinMax.setVisibility(View.VISIBLE);
        } else inputMinMax.setVisibility(View.GONE);
        final boolean isDisabled = (emptyDisabled && currentLength == 0) ||
                (builder.inputMaxLength > 0 && currentLength > builder.inputMaxLength) ||
                currentLength < builder.inputMinLength;
        final int colorText = isDisabled ? builder.inputRangeErrorColor : builder.contentColor;
        final int colorWidget = isDisabled ? builder.inputRangeErrorColor : builder.widgetColor;
        if (builder.inputMaxLength > 0)
            inputMinMax.setTextColor(colorText);
        MDTintHelper.setTint(input, colorWidget);
        final View positiveAb = getActionButton(DialogAction.POSITIVE);
        positiveAb.setEnabled(!isDisabled);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号