summaryrefslogtreecommitdiffstats
path: root/core/java/android/text/Spanned.java
diff options
context:
space:
mode:
authorGilles Debunne <debunne@google.com>2012-04-26 18:46:19 -0700
committerGilles Debunne <debunne@google.com>2012-04-26 19:04:03 -0700
commit26b62d432101084c832f5587798cfd24a4ed9c59 (patch)
treea5c2601eca3d4bd195543b138eef14271d6f8b56 /core/java/android/text/Spanned.java
parent7725180c646d1976a2a2097735862a75ec47c544 (diff)
downloadframeworks_base-26b62d432101084c832f5587798cfd24a4ed9c59.zip
frameworks_base-26b62d432101084c832f5587798cfd24a4ed9c59.tar.gz
frameworks_base-26b62d432101084c832f5587798cfd24a4ed9c59.tar.bz2
SpannableStringBuilder correctly manages MARK and POINTS
Bug 6343982 Finally deeply understood the meaning of the POINT and MARK flags. Updated the Spanned documentation to reflect this. Updated tests to come. Change-Id: I400d56b7b4929bc1e7eb4f0497d8e081ee23682e
Diffstat (limited to 'core/java/android/text/Spanned.java')
-rw-r--r--core/java/android/text/Spanned.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/java/android/text/Spanned.java b/core/java/android/text/Spanned.java
index d14fcbc..2b73763 100644
--- a/core/java/android/text/Spanned.java
+++ b/core/java/android/text/Spanned.java
@@ -28,13 +28,17 @@ extends CharSequence
/**
* Bitmask of bits that are relevent for controlling point/mark behavior
* of spans.
+ *
+ * MARK and POINT are conceptually located <i>between</i> two adjacent characters.
+ * A MARK is "attached" to the character on the left hand side, while a POINT
+ * tends to stick to the character on the right hand side.
*/
public static final int SPAN_POINT_MARK_MASK = 0x33;
/**
* 0-length spans with type SPAN_MARK_MARK behave like text marks:
* they remain at their original offset when text is inserted
- * at that offset.
+ * at that offset. Conceptually, the text is added after the mark.
*/
public static final int SPAN_MARK_MARK = 0x11;
/**
@@ -50,6 +54,7 @@ extends CharSequence
* 0-length spans with type SPAN_POINT_POINT behave like cursors:
* they are pushed forward by the length of the insertion when text
* is inserted at their offset.
+ * The text is conceptually inserted before the point.
*/
public static final int SPAN_POINT_POINT = 0x22;