本文整理了Java中android.widget.TextView.getCompoundPaddingTop()
方法的一些代码示例,展示了TextView.getCompoundPaddingTop()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.getCompoundPaddingTop()
方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:getCompoundPaddingTop
暂无
代码示例来源:origin: square/assertj-android
public S hasCompoundPaddingTop(int padding) {
isNotNull();
int actualPadding = actual.getCompoundPaddingTop();
assertThat(actualPadding) //
.overridingErrorMessage("Expected compound drawable top 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.getCompoundPaddingLeft())));
attributes.add(new ViewAttribute<>("CompoundPaddingTop",
attributeTranslator.translatePx(view.getCompoundPaddingTop())));
attributes.add(new ViewAttribute<>("CompoundPaddingRight",
attributeTranslator.translatePx(view.getCompoundPaddingRight())));
代码示例来源:origin: com.squareup.assertj/assertj-android
public S hasCompoundPaddingTop(int padding) {
isNotNull();
int actualPadding = actual.getCompoundPaddingTop();
assertThat(actualPadding) //
.overridingErrorMessage("Expected compound drawable top 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: jbruchanov/AnUitor
values.put("CompoundPaddingLeft", tv.getCompoundPaddingLeft());
values.put("CompoundPaddingRight", tv.getCompoundPaddingRight());
values.put("CompoundPaddingTop", tv.getCompoundPaddingTop());
values.put("CompoundPaddingBottom", tv.getCompoundPaddingBottom());
Drawable[] compoundDrawables = tv.getCompoundDrawables();
代码示例来源:origin: stackoverflow.com
parentTextView.getCompoundPaddingTop()
);
代码示例来源:origin: MCMrARM/revolution-irc
textView.getCompoundPaddingBottom()) - textView.getCompoundPaddingTop();
float tViewX = Math.min(Math.max(viewX, 0), textView.getWidth() -
textView.getCompoundPaddingRight()) - textView.getCompoundPaddingLeft();
mLastTouchInText = viewX >= textView.getCompoundPaddingLeft() &&
viewX <= textView.getWidth() - textView.getCompoundPaddingEnd() &&
viewY >= textView.getCompoundPaddingTop() &&
viewY <= textView.getHeight() - textView.getCompoundPaddingBottom() &&
tViewX <= textView.getLayout().getLineWidth(line);
代码示例来源:origin: shazam/reflow-animator
currentStartRunLeft + getSectionWidth(startLayout, lastCharPosition, charPosition),
startRunBottom);
startBound.offset(sourceView.getCompoundPaddingLeft() + startOffsetLeft, sourceView.getCompoundPaddingTop());
Rect endBound = new Rect(
currentEndRunLeft,
currentEndRunLeft + getSectionWidth(endLayout, lastCharPosition, charPosition),
endRunBottom);
endBound.offset(targetView.getCompoundPaddingLeft() + endOffsetLeft, targetView.getCompoundPaddingTop());
boolean isStartVisible = startRunBottom <= sourceView.getMeasuredHeight();
boolean isEndVisible = endRunBottom <= targetView.getMeasuredHeight();
代码示例来源:origin: stackoverflow.com
parentTextViewLocation[1] -
textView.getScrollY() +
textView.getCompoundPaddingTop()
);
parentTextViewRect.top += parentTextViewTopAndBottomOffset;
内容来源于网络,如有侵权,请联系作者删除!