Add CREATOR to parcelables

pull/384/head
Alex Baker 9 years ago
parent 8f67989ae0
commit f2448ae776

@ -1,5 +1,8 @@
package org.tasks.filters;
import android.os.Parcel;
import android.os.Parcelable;
import com.todoroo.astrid.api.FilterListItem;
public class NavigationDrawerSeparator extends FilterListItem {
@ -8,4 +11,25 @@ public class NavigationDrawerSeparator extends FilterListItem {
public Type getItemType() {
return Type.SEPARATOR;
}
public static final Parcelable.Creator<NavigationDrawerSeparator> CREATOR = new Parcelable.Creator<NavigationDrawerSeparator>() {
/**
* {@inheritDoc}
*/
@Override
public NavigationDrawerSeparator createFromParcel(Parcel source) {
NavigationDrawerSeparator navigationDrawerSeparator = new NavigationDrawerSeparator();
navigationDrawerSeparator.readFromParcel(source);
return navigationDrawerSeparator;
}
/**
* {@inheritDoc}
*/
@Override
public NavigationDrawerSeparator[] newArray(int size) {
return new NavigationDrawerSeparator[size];
}
};
}

@ -1,9 +1,16 @@
package org.tasks.filters;
import android.os.Parcel;
import android.os.Parcelable;
import com.todoroo.astrid.api.FilterListItem;
public class NavigationDrawerSubheader extends FilterListItem {
private NavigationDrawerSubheader() {
}
public NavigationDrawerSubheader(String listingTitle) {
this.listingTitle = listingTitle;
}
@ -12,4 +19,25 @@ public class NavigationDrawerSubheader extends FilterListItem {
public Type getItemType() {
return Type.SUBHEADER;
}
public static final Parcelable.Creator<NavigationDrawerSubheader> CREATOR = new Parcelable.Creator<NavigationDrawerSubheader>() {
/**
* {@inheritDoc}
*/
@Override
public NavigationDrawerSubheader createFromParcel(Parcel source) {
NavigationDrawerSubheader navigationDrawerSubheader = new NavigationDrawerSubheader();
navigationDrawerSubheader.readFromParcel(source);
return navigationDrawerSubheader;
}
/**
* {@inheritDoc}
*/
@Override
public NavigationDrawerSubheader[] newArray(int size) {
return new NavigationDrawerSubheader[size];
}
};
}

Loading…
Cancel
Save