-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from FazziCLAY/special_widget
Special widget
- Loading branch information
Showing
12 changed files
with
204 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
app/src/main/java/com/fazziclay/opentoday/app/items/item/MissingNoItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.fazziclay.opentoday.app.items.item; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
|
||
import com.fazziclay.opentoday.app.data.Cherry; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class MissingNoItem extends Item { | ||
public static final MissingNoItemCodec CODEC = new MissingNoItemCodec(); | ||
private static class MissingNoItemCodec extends AbstractItemCodec { | ||
|
||
@NonNull | ||
@Override | ||
public Cherry exportItem(@NonNull Item item) { | ||
MissingNoItem missingNoItem = (MissingNoItem) item; | ||
return missingNoItem.cherry; | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public Item importItem(@NonNull Cherry cherry, @Nullable Item item) { | ||
return new MissingNoItem(cherry); | ||
} | ||
} | ||
|
||
private final Cherry cherry; | ||
private final List<Exception> exceptionList = new ArrayList<>(); | ||
|
||
public MissingNoItem(Cherry cherry) { | ||
this.cherry = cherry; | ||
} | ||
|
||
public MissingNoItem putException(Exception e) { | ||
exceptionList.add(e); | ||
return this; | ||
} | ||
|
||
public Exception[] getExceptionList() { | ||
return exceptionList.toArray(new Exception[0]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.