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);
}
}
MaterialDialog.java 文件源码
java
阅读 50
收藏 0
点赞 0
评论 0
项目:GitHub
作者:
评论列表
文章目录