This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Repository navigation
Integrated Parceler into Extras #977
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Integrated Parceler into Extras
- Loading branch information
commit 4edfe690cd7dd5eacb379a9faa3e2e6a3bd934d0
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
31 changes: 31 additions & 0 deletions
31
...unctional-test-1-5/src/main/java/org/androidannotations/test15/parceler/ParcelerBean.java
This file contains hidden or 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,31 @@ | ||
| package org.androidannotations.test15.parceler; | ||
|
|
||
| import org.parceler.Parcel; | ||
| import org.parceler.ParcelConstructor; | ||
|
|
||
| /** | ||
| * @author John Ericksen | ||
| */ | ||
| @Parcel | ||
| public class ParcelerBean { | ||
|
|
||
| String name; | ||
| int age; | ||
|
|
||
| public ParcelerBean() { | ||
| } | ||
|
|
||
| @ParcelConstructor | ||
| public ParcelerBean(String name, int age) { | ||
| this.name = name; | ||
| this.age = age; | ||
| } | ||
|
|
||
| public String getName() { | ||
| return name; | ||
| } | ||
|
|
||
| public int getAge() { | ||
| return age; | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not okay. Not just
@Parcelannotated types should usegetParcelablebut types what are implementing theParcelableinterface, too. This change breaks compilation ofSaveInstanceStateActivityandFragmentArgumentsclasses in the test app.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this breaks Parcelable interfaces? This method is called from the second else/if after it checks if the object is a Parcelable. Really all this call will do is set the
boolean parcelerBean = truealong withmethodNameToSave = "put" + "Parcelable";andmethodNameToRestore = "get" + "Parcelable";. I am, of course, open to different ways of integrating this stuff. This technique just seemed to fit with AA's existing architecture.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just check out this code:
So if there is no
@Parcelannotation, always theserializablemethod will be used. You are missing anelsei guess.This is indeed breaks
Parcelables in extras, i compiled the test project that's why i noticed the issue.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake. Fixed.