com.coder.zzq.smartshow.core.Utils.getColorFromRes()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中com.coder.zzq.smartshow.core.Utils.getColorFromRes()方法的一些代码示例,展示了Utils.getColorFromRes()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.getColorFromRes()方法的具体详情如下:
包路径:com.coder.zzq.smartshow.core.Utils
类名称:Utils
方法名:getColorFromRes

Utils.getColorFromRes介绍

暂无

代码示例

代码示例来源:origin: the-pig-of-jungle/smart-show

public BarSettingImpl() {
  mBgColor = IBarSetting.SNACK_BAR_COLOR;
  mMsgColor = Color.WHITE;
  mMsgTextSizeSp = 14;
  mActionColor = Utils.getColorFromRes(R.color.colorAccent);
  mActionSizeSp = 14;
  mDefaultActionTextForIndefinite = "确定";
}

代码示例来源:origin: the-pig-of-jungle/SmartShow

public InputTextDialogCreator() {
  super();
  mTitle = "输入";
  mAtMostInputNum = 20;
  mInputNumMarkColor = Utils.getColorFromRes(R.color.colorPrimary);
}

代码示例来源:origin: the-pig-of-jungle/SmartShow

public BarSettingImpl() {
  mBgColor = IBarSetting.SNACK_BAR_COLOR;
  mMsgColor = Color.WHITE;
  mMsgTextSizeSp = 14;
  mActionColor = Utils.getColorFromRes(R.color.colorAccent);
  mActionSizeSp = 14;
  mDefaultActionTextForIndefinite = "确定";
}

代码示例来源:origin: the-pig-of-jungle/smart-show

public InputTextDialogCreator() {
  super();
  mTitle = "输入";
  mAtMostInputNum = 20;
  mInputNumMarkColor = Utils.getColorFromRes(R.color.colorPrimary);
}

代码示例来源:origin: the-pig-of-jungle/smart-show

@Override
public void afterTextChanged(Editable s) {
  mStringBuilder.delete(0, mStringBuilder.length());
  if (s.length() > mAtMostInputNum) {
    inputNumView.setTextColor(Color.RED);
    mStringBuilder.append("-")
        .append(s.length() - mAtMostInputNum);
    inputNumView.setText(mStringBuilder);
  } else {
    inputNumView.setTextColor(Utils.getColorFromRes(R.color.colorPrimary));
    mStringBuilder.append(mAtMostInputNum - s.length());
    inputNumView.setText(mStringBuilder);
  }
}

代码示例来源:origin: the-pig-of-jungle/SmartShow

@Override
public void afterTextChanged(Editable s) {
  mStringBuilder.delete(0, mStringBuilder.length());
  if (s.length() > mAtMostInputNum) {
    inputNumView.setTextColor(Color.RED);
    mStringBuilder.append("-")
        .append(s.length() - mAtMostInputNum);
    inputNumView.setText(mStringBuilder);
  } else {
    inputNumView.setTextColor(Utils.getColorFromRes(R.color.colorPrimary));
    mStringBuilder.append(mAtMostInputNum - s.length());
    inputNumView.setText(mStringBuilder);
  }
}

代码示例来源:origin: the-pig-of-jungle/smart-show

@Override
public BarSetting actionColorRes(int colorRes) {
  return actionColor(Utils.getColorFromRes(colorRes));
}

代码示例来源:origin: the-pig-of-jungle/SmartShow

@Override
public BarSetting msgTextColorRes(int colorRes) {
  return msgTextColor(Utils.getColorFromRes(colorRes));
}

代码示例来源:origin: the-pig-of-jungle/smart-show

@Override
public BarSetting backgroundColorRes(int colorRes) {
  return backgroundColor(Utils.getColorFromRes(colorRes));
}

代码示例来源:origin: the-pig-of-jungle/SmartShow

@Override
public BarSetting backgroundColorRes(int colorRes) {
  return backgroundColor(Utils.getColorFromRes(colorRes));
}

代码示例来源:origin: the-pig-of-jungle/smart-show

@Override
public BarSetting msgTextColorRes(int colorRes) {
  return msgTextColor(Utils.getColorFromRes(colorRes));
}

代码示例来源:origin: the-pig-of-jungle/SmartShow

@Override
public BarSetting actionColorRes(int colorRes) {
  return actionColor(Utils.getColorFromRes(colorRes));
}

代码示例来源:origin: the-pig-of-jungle/smart-show

public void onInputClick(View view) {
  if (mInputSuggestionDialog == null) {
    mInputSuggestionDialog = new SmartDialog()
        .dialogCreator(
            DialogCreatorFactory
                .input()
                .inputAtMost(60)
                .hint("输入建议")
                .confirmBtn("提交", new DialogBtnClickListener() {
                  @Override
                  public void onBtnClick(Dialog dialog, int which, Object data) {
                    if (data.toString().length() > 60) {
                      SmartToast.showInCenter("最多只能输入70个字符");
                      return;
                    } else {
                      dialog.dismiss();
                      SmartToast.showInCenter(data.toString());
                    }
                  }
                })
                .inputCountMarkColor(Utils.getColorFromRes(R.color.colorPrimary))
        )
        .reuse(true);
  }
  mInputSuggestionDialog.show(this);
}

代码示例来源:origin: the-pig-of-jungle/SmartShow

public void onInputClick(View view) {
  if (mInputSuggestionDialog == null) {
    mInputSuggestionDialog = new SmartDialog()
        .dialogCreator(
            DialogCreatorFactory
                .input()
                .inputAtMost(60)
                .hint("输入建议")
                .confirmBtn("提交", new DialogBtnClickListener() {
                  @Override
                  public void onBtnClick(Dialog dialog, int which, Object data) {
                    if (data.toString().length() > 60) {
                      SmartToast.showInCenter("最多只能输入70个字符");
                      return;
                    } else {
                      dialog.dismiss();
                      SmartToast.showInCenter(data.toString());
                    }
                  }
                })
                .inputCountMarkColor(Utils.getColorFromRes(R.color.colorPrimary))
        )
        .reuse(true);
  }
  mInputSuggestionDialog.show(this);
}

相关文章