From f2448ae77649007a2ebe398b369e206cebe7c186 Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Tue, 8 Dec 2015 11:21:34 -0600 Subject: [PATCH] Add CREATOR to parcelables --- .../filters/NavigationDrawerSeparator.java | 24 ++++++++++++++++ .../filters/NavigationDrawerSubheader.java | 28 +++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/src/main/java/org/tasks/filters/NavigationDrawerSeparator.java b/src/main/java/org/tasks/filters/NavigationDrawerSeparator.java index 93fd1ee30..cb8615e07 100644 --- a/src/main/java/org/tasks/filters/NavigationDrawerSeparator.java +++ b/src/main/java/org/tasks/filters/NavigationDrawerSeparator.java @@ -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 CREATOR = new Parcelable.Creator() { + + /** + * {@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]; + } + }; } diff --git a/src/main/java/org/tasks/filters/NavigationDrawerSubheader.java b/src/main/java/org/tasks/filters/NavigationDrawerSubheader.java index 88804bb7a..74774d93c 100644 --- a/src/main/java/org/tasks/filters/NavigationDrawerSubheader.java +++ b/src/main/java/org/tasks/filters/NavigationDrawerSubheader.java @@ -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 CREATOR = new Parcelable.Creator() { + + /** + * {@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]; + } + }; }