Loading core/java/android/view/accessibility/AccessibilityEvent.java +6 −4 Original line number Diff line number Diff line Loading @@ -240,10 +240,12 @@ import java.util.List; * <li>{@link #getMovementGranularity()} - Sets the granularity at which a view's text * was traversed.</li> * <li>{@link #getText()} - The text of the source's sub-tree.</li> * <li>{@link #getFromIndex()} - The start of the next/previous text at the specified granularity * - inclusive.</li> * <li>{@link #getToIndex()} - The end of the next/previous text at the specified granularity * - exclusive.</li> * <li>{@link #getFromIndex()} - The start the text that was skipped over in this movement. * This is the starting point when moving forward through the text, but not when moving * back.</li> * <li>{@link #getToIndex()} - The end of the text that was skipped over in this movement. * This is the ending point when moving forward through the text, but not when moving * back.</li> * <li>{@link #isPassword()} - Whether the source is password.</li> * <li>{@link #isEnabled()} - Whether the source is enabled.</li> * <li>{@link #getContentDescription()} - The content description of the source.</li> Loading core/java/android/widget/AccessibilityIterators.java +11 −6 Original line number Diff line number Diff line Loading @@ -134,8 +134,8 @@ final class AccessibilityIterators { @Override public int[] following(int offset) { final int textLegth = mText.length(); if (textLegth <= 0) { final int textLength = mText.length(); if (textLength <= 0) { return null; } if (offset >= mText.length()) { Loading Loading @@ -163,8 +163,8 @@ final class AccessibilityIterators { @Override public int[] preceding(int offset) { final int textLegth = mText.length(); if (textLegth <= 0) { final int textLength = mText.length(); if (textLength <= 0) { return null; } if (offset <= 0) { Loading @@ -181,8 +181,13 @@ final class AccessibilityIterators { final int pageHeight = mTempRect.height() - mView.getTotalPaddingTop() - mView.getTotalPaddingBottom(); final int previousPageEndY = currentLineTop - pageHeight; final int currentPageStartLine = (previousPageEndY > 0) ? mLayout.getLineForVertical(previousPageEndY) + 1 : 0; int currentPageStartLine = (previousPageEndY > 0) ? mLayout.getLineForVertical(previousPageEndY) : 0; // If we're at the end of text, we're at the end of the current line rather than the // start of the next line, so we should move up one fewer lines than we would otherwise. if (end == mText.length() && (currentPageStartLine < currentLine)) { currentPageStartLine += 1; } final int start = getLineEdgeIndex(currentPageStartLine, DIRECTION_START); Loading Loading
core/java/android/view/accessibility/AccessibilityEvent.java +6 −4 Original line number Diff line number Diff line Loading @@ -240,10 +240,12 @@ import java.util.List; * <li>{@link #getMovementGranularity()} - Sets the granularity at which a view's text * was traversed.</li> * <li>{@link #getText()} - The text of the source's sub-tree.</li> * <li>{@link #getFromIndex()} - The start of the next/previous text at the specified granularity * - inclusive.</li> * <li>{@link #getToIndex()} - The end of the next/previous text at the specified granularity * - exclusive.</li> * <li>{@link #getFromIndex()} - The start the text that was skipped over in this movement. * This is the starting point when moving forward through the text, but not when moving * back.</li> * <li>{@link #getToIndex()} - The end of the text that was skipped over in this movement. * This is the ending point when moving forward through the text, but not when moving * back.</li> * <li>{@link #isPassword()} - Whether the source is password.</li> * <li>{@link #isEnabled()} - Whether the source is enabled.</li> * <li>{@link #getContentDescription()} - The content description of the source.</li> Loading
core/java/android/widget/AccessibilityIterators.java +11 −6 Original line number Diff line number Diff line Loading @@ -134,8 +134,8 @@ final class AccessibilityIterators { @Override public int[] following(int offset) { final int textLegth = mText.length(); if (textLegth <= 0) { final int textLength = mText.length(); if (textLength <= 0) { return null; } if (offset >= mText.length()) { Loading Loading @@ -163,8 +163,8 @@ final class AccessibilityIterators { @Override public int[] preceding(int offset) { final int textLegth = mText.length(); if (textLegth <= 0) { final int textLength = mText.length(); if (textLength <= 0) { return null; } if (offset <= 0) { Loading @@ -181,8 +181,13 @@ final class AccessibilityIterators { final int pageHeight = mTempRect.height() - mView.getTotalPaddingTop() - mView.getTotalPaddingBottom(); final int previousPageEndY = currentLineTop - pageHeight; final int currentPageStartLine = (previousPageEndY > 0) ? mLayout.getLineForVertical(previousPageEndY) + 1 : 0; int currentPageStartLine = (previousPageEndY > 0) ? mLayout.getLineForVertical(previousPageEndY) : 0; // If we're at the end of text, we're at the end of the current line rather than the // start of the next line, so we should move up one fewer lines than we would otherwise. if (end == mText.length() && (currentPageStartLine < currentLine)) { currentPageStartLine += 1; } final int start = getLineEdgeIndex(currentPageStartLine, DIRECTION_START); Loading