/** * See the file "LICENSE" for the full license governing this code. */ package com.todoroo.astrid.api; import android.os.Parcel; import android.os.Parcelable; /** * Represents a line of text displayed in the Task List * * @author Tim Su * */ public class TaskDetail implements Parcelable { /** * Text of detail */ public String text = null; /** * Color to use for text. 0 is default */ public int color = 0; /** * Creates a TaskDetail object * * @param text * text to display * @param color * color to use for text. Use 0 for default color */ public TaskDetail(String text, int color) { super(); this.text = text; this.color = color; } /** * Convenience constructor to make a TaskDetail with default color * * @param text * text to display */ public TaskDetail(String text) { this(text, 0); } // --- parcelable helpers /** * {@inheritDoc} */ public int describeContents() { return 0; } /** * {@inheritDoc} */ public void writeToParcel(Parcel dest, int flags) { dest.writeString(text); dest.writeInt(color); } /** * Parcelable creator */ public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { /** * {@inheritDoc} */ public TaskDetail createFromParcel(Parcel source) { return new TaskDetail(source.readString(), source.readInt()); } /** * {@inheritDoc} */ public TaskDetail[] newArray(int size) { return new TaskDetail[size]; }; }; }