mirror of https://github.com/tasks/tasks
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
1.8 KiB
Java
90 lines
1.8 KiB
Java
/**
|
|
* 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 <tim@todoroo.com>
|
|
*
|
|
*/
|
|
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 <code>0</code> 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<TaskDetail> CREATOR = new Parcelable.Creator<TaskDetail>() {
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
public TaskDetail createFromParcel(Parcel source) {
|
|
return new TaskDetail(source.readString(), source.readInt());
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
public TaskDetail[] newArray(int size) {
|
|
return new TaskDetail[size];
|
|
};
|
|
};
|
|
|
|
}
|