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

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

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

TextView.getCompoundPaddingBottom介绍

暂无

代码示例

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

public S hasCompoundPaddingBottom(int padding) {
 isNotNull();
 int actualPadding = actual.getCompoundPaddingBottom();
 assertThat(actualPadding) //
   .overridingErrorMessage("Expected compound drawable bottom padding <%s> but was <%s>.",
     padding, actualPadding) //
   .isEqualTo(padding);
 return myself;
}

代码示例来源:origin: Manabu-GT/ExpandableTextView

private static int getRealTextViewHeight(@NonNull TextView textView) {
  int textHeight = textView.getLayout().getLineTop(textView.getLineCount());
  int padding = textView.getCompoundPaddingTop() + textView.getCompoundPaddingBottom();
  return textHeight + padding;
}

代码示例来源:origin: jaydenxiao2016/AndroidFire

/**
 * 获取内容tv真实高度(含padding)
 * @param textView
 * @return
 */
private static int getRealTextViewHeight( TextView textView) {
  int textHeight = textView.getLayout().getLineTop(textView.getLineCount());
  int padding = textView.getCompoundPaddingTop() + textView.getCompoundPaddingBottom();
  return textHeight + padding;
}

代码示例来源:origin: willowtreeapps/Hyperion-Android

attributeTranslator.translatePx(view.getCompoundPaddingRight())));
attributes.add(new ViewAttribute<>("CompoundPaddingBottom",
    attributeTranslator.translatePx(view.getCompoundPaddingBottom())));

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

public S hasCompoundPaddingBottom(int padding) {
 isNotNull();
 int actualPadding = actual.getCompoundPaddingBottom();
 assertThat(actualPadding) //
   .overridingErrorMessage("Expected compound drawable bottom padding <%s> but was <%s>.",
     padding, actualPadding) //
   .isEqualTo(padding);
 return myself;
}

代码示例来源:origin: CNCoderX/ExpandableTextView

private int getLinesHeight(int lines) {
  int lineHeight = mTextView.getLineHeight() * lines;
  int padding = mTextView.getCompoundPaddingTop() + mTextView.getCompoundPaddingBottom();
  return lineHeight + padding;
}

代码示例来源:origin: MCMrARM/revolution-irc

private void updateTextPositions() {
  if (mChild == null)
    return;
  mTextX = mChild.getLeft() + mChild.getPaddingLeft();
  mTextPaint.setTextSize(mTextSizeCollapsed);
  mTextYCollapsed = getPaddingTop() - mTextPaint.ascent();
  mTextPaint.setTextSize(mTextSizeExpanded);
  int childTop = mChild.getTop() + (mChild instanceof TextView ? ((TextView) mChild).getCompoundPaddingTop() : mChild.getPaddingTop());
  int childBot = mChild.getBottom() - (mChild instanceof TextView ? ((TextView) mChild).getCompoundPaddingBottom() : mChild.getPaddingBottom());
  mTextYExpanded = mInputFrame.getTop() + (childTop + childBot) / 2;
  mTextYExpanded += (mTextPaint.descent() - mTextPaint.ascent()) / 2 - mTextPaint.descent();
}

代码示例来源:origin: whyalwaysmea/BigBoom

/**
 * 获取TextView真正的高度
 *
 * @param textView
 * @return
 */
private static int getRealTextViewHeight(@NonNull TextView textView) {
  int textHeight = textView.getLayout().getLineTop(textView.getLineCount());
  int padding = textView.getCompoundPaddingTop() + textView.getCompoundPaddingBottom();
  return textHeight + padding;
}

代码示例来源:origin: chaychan/PowerfulViewLibrary

/**
 * 获取内容tv真实高度(含padding)
 * @param textView
 * @return
 */
private static int getRealTextViewHeight( TextView textView) {
  int textHeight = textView.getLayout().getLineTop(textView.getLineCount());
  int padding = textView.getCompoundPaddingTop() + textView.getCompoundPaddingBottom();
  return textHeight + padding;
}

代码示例来源:origin: baidu/speech-samples

private void scrollLog(String message) {
  Spannable colorMessage = new SpannableString(message + "\n");
  colorMessage.setSpan(new ForegroundColorSpan(0xff0000ff), 0, message.length(),
      Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
  mShowText.append(colorMessage);
  Layout layout = mShowText.getLayout();
  if (layout != null) {
    int scrollAmount = layout.getLineTop(mShowText.getLineCount()) - mShowText.getHeight();
    if (scrollAmount > 0) {
      mShowText.scrollTo(0, scrollAmount + mShowText.getCompoundPaddingBottom());
    } else {
      mShowText.scrollTo(0, 0);
    }
  }
}

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

values.put("CompoundPaddingRight", tv.getCompoundPaddingRight());
values.put("CompoundPaddingTop", tv.getCompoundPaddingTop());
values.put("CompoundPaddingBottom", tv.getCompoundPaddingBottom());
Drawable[] compoundDrawables = tv.getCompoundDrawables();
if (compoundDrawables != null && compoundDrawables.length >= 4) {

代码示例来源:origin: MCMrARM/revolution-irc

textView.getCompoundPaddingBottom()) - textView.getCompoundPaddingTop();
float tViewX = Math.min(Math.max(viewX, 0), textView.getWidth() -
    textView.getCompoundPaddingRight()) - textView.getCompoundPaddingLeft();
    viewX <= textView.getWidth() - textView.getCompoundPaddingEnd() &&
    viewY >= textView.getCompoundPaddingTop() &&
    viewY <= textView.getHeight() - textView.getCompoundPaddingBottom() &&
    tViewX <= textView.getLayout().getLineWidth(line);
if (mSelectionLongPressMode) {

相关文章

TextView类方法