appyx
appyx copied to clipboard
[#310] Ensure NavTarget and State are parcelable
Description
Fixes #310
Check list
- [x] I have updated
CHANGELOG.md
if required. - [x] I have updated documentation if required.
This is definitely a breaking change. We can likely fix the problems (samples that do not use Parcelable) in a different PR, but I think it's worthwhile adding this to avoid issues in the future
If we don't want to go down this path (I don't see why we shouldn't, other than the fact that we have to make the enums parcelable), we MAY be able to solve this with a detekt
rule (though that would mean that the library may not work as advertised if developers don't use detekt
)
The original intention was to allow different types like primitives and serialisables.
We can potentially introduce runtime checks class.java.isPrimitive || class.java.implementsParcelableOrSerializable
as an alternative which we can perform in the constructor of NavElement
.
Not against your approach.
@CherryPerry that could be a good alternative as well. Let's discuss tomorrow!