diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-02-10 15:44:00 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-02-10 15:44:00 -0800 |
commit | d24b8183b93e781080b2c16c487e60d51c12da31 (patch) | |
tree | fbb89154858984eb8e41556da7e9433040d55cd4 /core/java/android/text/Annotation.java | |
parent | f1e484acb594a726fb57ad0ae4cfe902c7f35858 (diff) | |
download | frameworks_base-d24b8183b93e781080b2c16c487e60d51c12da31.zip frameworks_base-d24b8183b93e781080b2c16c487e60d51c12da31.tar.gz frameworks_base-d24b8183b93e781080b2c16c487e60d51c12da31.tar.bz2 |
auto import from //branches/cupcake/...@130745
Diffstat (limited to 'core/java/android/text/Annotation.java')
-rw-r--r-- | core/java/android/text/Annotation.java | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/core/java/android/text/Annotation.java b/core/java/android/text/Annotation.java index a3812a8..dbc290b 100644 --- a/core/java/android/text/Annotation.java +++ b/core/java/android/text/Annotation.java @@ -16,20 +16,40 @@ package android.text; +import android.os.Parcel; + /** * Annotations are simple key-value pairs that are preserved across * TextView save/restore cycles and can be used to keep application-specific * data that needs to be maintained for regions of text. */ -public class Annotation { - private String mKey; - private String mValue; +public class Annotation implements ParcelableSpan { + private final String mKey; + private final String mValue; public Annotation(String key, String value) { mKey = key; mValue = value; } + public Annotation(Parcel src) { + mKey = src.readString(); + mValue = src.readString(); + } + + public int getSpanTypeId() { + return TextUtils.ANNOTATION; + } + + public int describeContents() { + return 0; + } + + public void writeToParcel(Parcel dest, int flags) { + dest.writeString(mKey); + dest.writeString(mValue); + } + public String getKey() { return mKey; } |