summaryrefslogtreecommitdiffstats
path: root/core/java/android/text/Spanned.java
diff options
context:
space:
mode:
authorGilles Debunne <debunne@google.com>2012-06-26 15:00:00 -0700
committerGilles Debunne <debunne@google.com>2012-06-26 15:18:49 -0700
commitdd0c25c9219d707d3d88bd54b5a1268d9b4d0780 (patch)
tree9d5a4d891d2612a8d02be0ed9a0dad712b95c955 /core/java/android/text/Spanned.java
parentd80f095efb1cb1751fa72e9344b8b5e276b6db6f (diff)
downloadframeworks_base-dd0c25c9219d707d3d88bd54b5a1268d9b4d0780.zip
frameworks_base-dd0c25c9219d707d3d88bd54b5a1268d9b4d0780.tar.gz
frameworks_base-dd0c25c9219d707d3d88bd54b5a1268d9b4d0780.tar.bz2
Added comments describing the span limit attributes
Patch: replaced left/right by before/after and added a comment on RTL. Change-Id: Iccd70adfbba4cb5f76d2729eeb81fed9b50403ae
Diffstat (limited to 'core/java/android/text/Spanned.java')
-rw-r--r--core/java/android/text/Spanned.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/core/java/android/text/Spanned.java b/core/java/android/text/Spanned.java
index 2b73763..b4622e0 100644
--- a/core/java/android/text/Spanned.java
+++ b/core/java/android/text/Spanned.java
@@ -30,8 +30,19 @@ extends CharSequence
* 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.
+ * A MARK is "attached" to the character before, while a POINT will stick to the character
+ * after. The insertion cursor is conceptually located between the MARK and the POINT.
+ *
+ * As a result, inserting a new character between a MARK and a POINT will leave the MARK
+ * unchanged, while the POINT will be shifted, now located after the inserted character and
+ * still glued to the same character after it.
+ *
+ * Depending on whether the insertion happens at the beginning or the end of a span, the span
+ * will hence be expanded to <i>include</i> the new character (when the span is using a MARK at
+ * its beginning or a POINT at its end) or it will be <i>excluded</i>.
+ *
+ * Note that <i>before</i> and <i>after</i> here refer to offsets in the String, which are
+ * independent from the visual representation of the text (left-to-right or right-to-left).
*/
public static final int SPAN_POINT_MARK_MASK = 0x33;