android.widget.TextView.getLineSpacingMultiplier()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(155)

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

TextView.getLineSpacingMultiplier介绍

暂无

代码示例

代码示例来源:origin: square/assertj-android

@TargetApi(JELLY_BEAN)
public S hasLineSpacingMultiplier(float multiplier) {
 isNotNull();
 float actualMultiplier = actual.getLineSpacingMultiplier();
 assertThat(actualMultiplier) //
   .overridingErrorMessage("Expected line spacing multiplier <%s> but was <%s>.", multiplier,
     actualMultiplier) //
   .isEqualTo(multiplier);
 return myself;
}

代码示例来源:origin: stackoverflow.com

mTextView.getHeight(),
mTextView.getPaint(),
mTextView.getLineSpacingMultiplier(),
mTextView.getLineSpacingExtra(),
mTextView.getIncludeFontPadding());

代码示例来源:origin: com.squareup.assertj/assertj-android

@TargetApi(JELLY_BEAN)
public S hasLineSpacingMultiplier(float multiplier) {
 isNotNull();
 float actualMultiplier = actual.getLineSpacingMultiplier();
 assertThat(actualMultiplier) //
   .overridingErrorMessage("Expected line spacing multiplier <%s> but was <%s>.", multiplier,
     actualMultiplier) //
   .isEqualTo(multiplier);
 return myself;
}

代码示例来源:origin: bignerdranch/Typesetter

private void applyLineSpacing() {
  String lineSpacing = binding.lineSpacingEditText.getText().toString();
  try {
    float lineSpacingSp = Float.parseFloat(lineSpacing);
    float lineSpacingPx = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, lineSpacingSp, getResources().getDisplayMetrics());
    float multiplier = binding.fillerTextView.getLineSpacingMultiplier();
    binding.fillerTextView.setLineSpacing(lineSpacingPx, multiplier);
    binding.lineSpacingTextInputLayout.setErrorEnabled(false);
  } catch (NumberFormatException e) {
    Log.e(TAG, "Unable to format line spacing");
    binding.lineSpacingTextInputLayout.setErrorEnabled(true);
    binding.lineSpacingTextInputLayout.setError(getString(R.string.nah));
  }
}

代码示例来源:origin: jbruchanov/AnUitor

values.put("LineSpacingMultiplier", tv.getLineSpacingMultiplier());
values.put("MaxLines", tv.getMaxLines());
values.put("ShadowColor", getStringColor(tv.getShadowColor()));

代码示例来源:origin: shazam/reflow-animator

private static Layout createUnrestrictedLayout(@Nonnull TextView view) {
  CharSequence text = view.getText();
  Layout layout = view.getLayout();
  TextPaint paint = layout.getPaint();
  if (SDK_INT >= M) {
    return StaticLayout.Builder
        .obtain(text, 0, text.length(), layout.getPaint(), layout.getWidth())
        .setAlignment(layout.getAlignment())
        .setLineSpacing(view.getLineSpacingExtra(), view.getLineSpacingMultiplier())
        .setIncludePad(view.getIncludeFontPadding())
        .setBreakStrategy(view.getBreakStrategy())
        .setHyphenationFrequency(view.getHyphenationFrequency())
        .build();
  } else {
    return new StaticLayout(
        text,
        paint,
        text.length(),
        layout.getAlignment(),
        view.getLineSpacingMultiplier(),
        view.getLineSpacingExtra(),
        view.getIncludeFontPadding());
  }
}

代码示例来源:origin: bzsome/VirtualApp-x326

} else {
  layout = new StaticLayout(text, paint, getTextWidth(textView),
      getLayoutAlignment(textView), textView.getLineSpacingMultiplier(),
      textView.getLineSpacingExtra(), textView.getIncludeFontPadding());

代码示例来源:origin: darkskygit/VirtualApp

} else {
  layout = new StaticLayout(text, paint, getTextWidth(textView),
      getLayoutAlignment(textView), textView.getLineSpacingMultiplier(),
      textView.getLineSpacingExtra(), textView.getIncludeFontPadding());

相关文章

TextView类方法