summaryrefslogtreecommitdiff
path: root/core/java/android/text/Layout.java
diff options
context:
space:
mode:
authorGilles Debunne <debunne@google.com>2012-04-25 18:48:42 -0700
committerGilles Debunne <debunne@google.com>2012-04-25 18:48:42 -0700
commiteca5b7385a641ae5d8c4aa2b7823a4e573737376 (patch)
tree3b2c8116751b86b716ff2e8c11c14f9e1c1f1b57 /core/java/android/text/Layout.java
parent7725180c646d1976a2a2097735862a75ec47c544 (diff)
Basic renaming refactoring in Layout
Change-Id: I79f5444a097f1e2b2a81ececf1f0a14b6d7d5179
Diffstat (limited to 'core/java/android/text/Layout.java')
-rw-r--r--core/java/android/text/Layout.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/core/java/android/text/Layout.java b/core/java/android/text/Layout.java
index 2dcea80c5b21..c453a5db42c7 100644
--- a/core/java/android/text/Layout.java
+++ b/core/java/android/text/Layout.java
@@ -45,8 +45,7 @@ public abstract class Layout {
private static final ParagraphStyle[] NO_PARA_SPANS =
ArrayUtils.emptyArray(ParagraphStyle.class);
- /* package */ static final EmojiFactory EMOJI_FACTORY =
- EmojiFactory.newAvailableInstance();
+ /* package */ static final EmojiFactory EMOJI_FACTORY = EmojiFactory.newAvailableInstance();
/* package */ static final int MIN_EMOJI, MAX_EMOJI;
static {
@@ -363,15 +362,15 @@ public abstract class Layout {
// direction of the layout or line. XXX: Should they?
// They are evaluated at each line.
if (mSpannedText) {
- if (lineBackgroundSpans == null) {
- lineBackgroundSpans = new SpanSet<LineBackgroundSpan>(LineBackgroundSpan.class);
+ if (mLineBackgroundSpans == null) {
+ mLineBackgroundSpans = new SpanSet<LineBackgroundSpan>(LineBackgroundSpan.class);
}
Spanned buffer = (Spanned) mText;
int textLength = buffer.length();
- lineBackgroundSpans.init(buffer, 0, textLength);
+ mLineBackgroundSpans.init(buffer, 0, textLength);
- if (lineBackgroundSpans.numberOfSpans > 0) {
+ if (mLineBackgroundSpans.numberOfSpans > 0) {
int previousLineBottom = getLineTop(firstLine);
int previousLineEnd = getLineStart(firstLine);
ParagraphStyle[] spans = NO_PARA_SPANS;
@@ -392,17 +391,18 @@ public abstract class Layout {
if (start >= spanEnd) {
// These should be infrequent, so we'll use this so that
// we don't have to check as often.
- spanEnd = lineBackgroundSpans.getNextTransition(start, textLength);
+ spanEnd = mLineBackgroundSpans.getNextTransition(start, textLength);
// All LineBackgroundSpans on a line contribute to its background.
spansLength = 0;
// Duplication of the logic of getParagraphSpans
if (start != end || start == 0) {
// Equivalent to a getSpans(start, end), but filling the 'spans' local
// array instead to reduce memory allocation
- for (int j = 0; j < lineBackgroundSpans.numberOfSpans; j++) {
- // equal test is valid since both intervals are not empty by construction
- if (lineBackgroundSpans.spanStarts[j] >= end ||
- lineBackgroundSpans.spanEnds[j] <= start) continue;
+ for (int j = 0; j < mLineBackgroundSpans.numberOfSpans; j++) {
+ // equal test is valid since both intervals are not empty by
+ // construction
+ if (mLineBackgroundSpans.spanStarts[j] >= end ||
+ mLineBackgroundSpans.spanEnds[j] <= start) continue;
if (spansLength == spans.length) {
// The spans array needs to be expanded
int newSize = ArrayUtils.idealObjectArraySize(2 * spansLength);
@@ -410,7 +410,7 @@ public abstract class Layout {
System.arraycopy(spans, 0, newSpans, 0, spansLength);
spans = newSpans;
}
- spans[spansLength++] = lineBackgroundSpans.spans[j];
+ spans[spansLength++] = mLineBackgroundSpans.spans[j];
}
}
}
@@ -423,7 +423,7 @@ public abstract class Layout {
}
}
}
- lineBackgroundSpans.recycle();
+ mLineBackgroundSpans.recycle();
}
// There can be a highlight even without spans if we are drawing
@@ -1687,7 +1687,7 @@ public abstract class Layout {
* styles that are already applied to the buffer will apply to text that
* is inserted into it.
*/
- /* package */ static <T> T[] getParagraphSpans(Spanned text, int start, int end, Class<T> type) {
+ /* package */static <T> T[] getParagraphSpans(Spanned text, int start, int end, Class<T> type) {
if (start == end && start > 0) {
return ArrayUtils.emptyArray(type);
}
@@ -1857,7 +1857,7 @@ public abstract class Layout {
private static final Rect sTempRect = new Rect();
private boolean mSpannedText;
private TextDirectionHeuristic mTextDir;
- private SpanSet<LineBackgroundSpan> lineBackgroundSpans;
+ private SpanSet<LineBackgroundSpan> mLineBackgroundSpans;
public static final int DIR_LEFT_TO_RIGHT = 1;
public static final int DIR_RIGHT_TO_LEFT = -1;