Java Code Examples for android.widget.TextView.getCompoundPaddingTop()

The following are Jave code examples for showing how to use getCompoundPaddingTop() of the android.widget.TextView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: ClickDrawableTextView   File: CsDrawableTouchUtils.java   View Source Code Vote up 6 votes
CsDrawableTouchUtils(MotionEvent event, TextView view, boolean isLayoutRTL){
    this.event = event;
    this.view = view;
    this.isLayoutRTL = isLayoutRTL;
    vSpace = view.getHeight() - view.getCompoundPaddingBottom() - view.getCompoundPaddingTop();
    hSpace = view.getWidth() - view.getCompoundPaddingRight() - view.getCompoundPaddingLeft();
    //if the drawable is extremely large (pushing the edges of the drawable itself
    //or of the other drawables out of the current view bounds, will not be possible
    //to calculate the correct touch position
    if (hSpace < 0 || vSpace < 0){
        throw new IllegalArgumentException("The size of one of your drawable is exceeding the" +
                " calculated width or height of the view. In this case you should provide" +
                "a smaller drawable or provide a smaller dimension in XML or with the builder");
    }
    scrollX = view.getScrollX();
    scrollY = view.getScrollY();
}
 
Example 2
Project: MyFire   File: ExpandableTextView.java   View Source Code Vote up 4 votes
/**
 * 获取内容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;
}
 
Example 3
Project: Widgets   File: ExpandTextView.java   View Source Code Vote up 4 votes
private static int getRealTextViewHeight(@NonNull TextView textView) {
    int textHeight = textView.getLayout().getLineTop(textView.getLineCount());
    int padding = textView.getCompoundPaddingTop() + textView.getCompoundPaddingBottom();
    return textHeight + padding;
}
 
Example 4
Project: AmenEye   File: FoldableTextView.java   View Source Code Vote up 4 votes
/**
 * 获取内容tv真实高度(含padding)
 */
private static int getRealTextViewHeight(TextView textView) {
    int textHeight = textView.getLayout().getLineTop(textView.getLineCount());
    int padding = textView.getCompoundPaddingTop() + textView.getCompoundPaddingBottom();
    return textHeight + padding;
}
 
Example 5
Project: social-app-android   File: ExpandableTextView.java   View Source Code Vote up 4 votes
private static int getRealTextViewHeight(@NonNull TextView textView) {
    int textHeight = textView.getLayout().getLineTop(textView.getLineCount());
    int padding = textView.getCompoundPaddingTop() + textView.getCompoundPaddingBottom();
    return textHeight + padding;
}
 
Example 6
Project: RLibrary   File: ExpandableTextView.java   View Source Code Vote up 4 votes
private static int getRealTextViewHeight(TextView textView) {
    int textHeight = textView.getLayout().getLineTop(textView.getLineCount());
    int padding = textView.getCompoundPaddingTop() + textView.getCompoundPaddingBottom();
    return textHeight + padding;
}
 
Example 7
Project: GCSApp   File: ExpandableTextView2.java   View Source Code Vote up 2 votes
/**
 * 获取内容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;
}