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

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

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

TextView.getTotalPaddingRight介绍

暂无

代码示例

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

public S hasTotalPaddingRight(int padding) {
 isNotNull();
 int actualPadding = actual.getTotalPaddingRight();
 assertThat(actualPadding) //
   .overridingErrorMessage("Expected total right padding <%s> but was <%s>.", padding,
     actualPadding) //
   .isEqualTo(padding);
 return myself;
}

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

public S hasTotalPaddingRight(int padding) {
 isNotNull();
 int actualPadding = actual.getTotalPaddingRight();
 assertThat(actualPadding) //
   .overridingErrorMessage("Expected total right padding <%s> but was <%s>.", padding,
     actualPadding) //
   .isEqualTo(padding);
 return myself;
}

代码示例来源:origin: mtotschnig/MyExpenses

private static float convertToLocalHorizontalCoordinate(TextView view, float x) {
  x -= view.getTotalPaddingLeft();
  // Clamp the position to inside of the view.
  x = Math.max(0.0f, x);
  x = Math.min(view.getWidth() - view.getTotalPaddingRight() - 1, x);
  x += view.getScrollX();
  return x;
}

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

data.put("TotalPaddingBottom", tv.getTotalPaddingBottom());
  data.put("TotalPaddingLeft", tv.getTotalPaddingLeft());
  data.put("TotalPaddingRight", tv.getTotalPaddingRight());
  data.put("TotalPaddingTop", tv.getTotalPaddingTop());
} catch (Throwable e) {

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

private int getOffset(int x, int y, TextView widget){
 // Converts the absolute X,Y coordinates to the character offset for the
 // character whose position is closest to the specified
 // horizontal position.
 x -= widget.getTotalPaddingLeft();
 y -= widget.getTotalPaddingTop();

 // Clamp the position to inside of the view.
 if (x < 0) {
   x = 0;
 } else if (x >= (widget.getWidth()-widget.getTotalPaddingRight())) {
   x = widget.getWidth()-widget.getTotalPaddingRight() - 1;
 }
 if (y < 0) {
   y = 0;
 } else if (y >= (widget.getHeight()-widget.getTotalPaddingBottom())) {
   y = widget.getHeight()-widget.getTotalPaddingBottom() - 1;
 }

 x += widget.getScrollX();
 y += widget.getScrollY();

 Layout layout = widget.getLayout();
 int line = layout.getLineForVertical(y);

 int offset = layout.getOffsetForHorizontal(line, x);
 return offset;
}

相关文章

TextView类方法