当前位置: 首页>>代码示例>>Java>>正文


Java TextView.getCompoundPaddingTop方法代码示例

本文整理汇总了Java中android.widget.TextView.getCompoundPaddingTop方法的典型用法代码示例。如果您正苦于以下问题:Java TextView.getCompoundPaddingTop方法的具体用法?Java TextView.getCompoundPaddingTop怎么用?Java TextView.getCompoundPaddingTop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.TextView的用法示例。


在下文中一共展示了TextView.getCompoundPaddingTop方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CsDrawableTouchUtils

import android.widget.TextView; //导入方法依赖的package包/类
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();
}
 
开发者ID:matpag,项目名称:ClickDrawableTextView,代码行数:18,代码来源:CsDrawableTouchUtils.java

示例2: getRealTextViewHeight

import android.widget.TextView; //导入方法依赖的package包/类
/**
 * 获取内容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;
}
 
开发者ID:wp521,项目名称:MyFire,代码行数:11,代码来源:ExpandableTextView.java

示例3: getRealTextViewHeight

import android.widget.TextView; //导入方法依赖的package包/类
private static int getRealTextViewHeight(@NonNull TextView textView) {
    int textHeight = textView.getLayout().getLineTop(textView.getLineCount());
    int padding = textView.getCompoundPaddingTop() + textView.getCompoundPaddingBottom();
    return textHeight + padding;
}
 
开发者ID:yhyzgn,项目名称:Widgets,代码行数:6,代码来源:ExpandTextView.java

示例4: getRealTextViewHeight

import android.widget.TextView; //导入方法依赖的package包/类
/**
 * 获取内容tv真实高度(含padding)
 */
private static int getRealTextViewHeight(TextView textView) {
    int textHeight = textView.getLayout().getLineTop(textView.getLineCount());
    int padding = textView.getCompoundPaddingTop() + textView.getCompoundPaddingBottom();
    return textHeight + padding;
}
 
开发者ID:haihaio,项目名称:AmenEye,代码行数:9,代码来源:FoldableTextView.java

示例5: getRealTextViewHeight

import android.widget.TextView; //导入方法依赖的package包/类
private static int getRealTextViewHeight(TextView textView) {
    int textHeight = textView.getLayout().getLineTop(textView.getLineCount());
    int padding = textView.getCompoundPaddingTop() + textView.getCompoundPaddingBottom();
    return textHeight + padding;
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:6,代码来源:ExpandableTextView.java

示例6: getRealTextViewHeight

import android.widget.TextView; //导入方法依赖的package包/类
/**
 * 获取内容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;
}
 
开发者ID:mangestudio,项目名称:GCSApp,代码行数:12,代码来源:ExpandableTextView2.java


注:本文中的android.widget.TextView.getCompoundPaddingTop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。