public S hasTotalPaddingBottom(int padding) { isNotNull(); int actualPadding = actual.getTotalPaddingBottom(); assertThat(actualPadding) // .overridingErrorMessage("Expected total bottom padding <%s> but was <%s>.", padding, actualPadding) // .isEqualTo(padding); return myself; }
widget.getTotalPaddingBottom(); int areatop = widget.getScrollY(); int areabot = areatop + widget.getHeight() - padding;
public S hasTotalPaddingBottom(int padding) { isNotNull(); int actualPadding = actual.getTotalPaddingBottom(); assertThat(actualPadding) // .overridingErrorMessage("Expected total bottom padding <%s> but was <%s>.", padding, actualPadding) // .isEqualTo(padding); return myself; }
private static int getLineAtCoordinate(TextView view, float y) { y -= view.getTotalPaddingTop(); // Clamp the position to inside of the view. y = Math.max(0.0f, y); y = Math.min(view.getHeight() - view.getTotalPaddingBottom() - 1, y); y += view.getScrollY(); return view.getLayout().getLineForVertical((int) y); }
data.put("TextColors", String.valueOf(tv.getTextColors())); try { data.put("TotalPaddingBottom", tv.getTotalPaddingBottom()); data.put("TotalPaddingLeft", tv.getTotalPaddingLeft()); data.put("TotalPaddingRight", tv.getTotalPaddingRight());
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; }
private boolean action(int what, TextView widget, Spannable buffer) { Layout layout = widget.getLayout(); int padding = widget.getTotalPaddingTop() + widget.getTotalPaddingBottom(); int areatop = widget.getScrollY(); int areabot = areatop + widget.getHeight() - padding;
widget.getTotalPaddingBottom(); int areatop = widget.getScrollY(); int areabot = areatop + widget.getHeight() - padding;