android-parcelable-intellij-plugin | IntelliJ Plugin for Android Parcelable | Plugin library
kandi X-RAY | android-parcelable-intellij-plugin Summary
kandi X-RAY | android-parcelable-intellij-plugin Summary
IntelliJ Plugin for Android Parcelable boilerplate code generation.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Perform a PPI action
- Find and remove method by name and arguments
- Generate the constructor for the Parcelable
- Returns true if the super constructor has a Parcelable super constructor
- Remove an existing Parcelable implementation
- Returns true if this class has the specified method with the specified name
- Generate writeToToParcel
- Gets the psi class from the context
- Generate a static constructor
- Generate the parcel
- Make the class implements Parcelable
- Checks if the given type is an implementation of the given type
- Read the parcel
- This method returns the parcel
- Returns the serializer for the given type
- Write the parcel
- Returns the component s bottom panel
- Write nullable primitive types
- Init primitives
- Read a long value
android-parcelable-intellij-plugin Key Features
android-parcelable-intellij-plugin Examples and Code Snippets
Community Discussions
Trending Discussions on android-parcelable-intellij-plugin
QUESTION
I used Jetbrains plugin for generating Android Parcelable class in Kotlin, and got these two exceptions (not warnings, unlike here, so the project doesn't build):
CREATOR_DEFINITION_IS_NOT_ALLOWED: 'CREATOR' definition is not allowed. Use 'Parceler' companion object instead.
OVERRIDING_WRITE_TO_PARCEL_IS_NOT_ALLOWED: Overriding 'writeToParcel' is not allowed. Use 'Parceler' companion object instead.
I have looked through similar questions, and didn't find any solutions for my case.
My Kotlin version: 1.1.51 (according to Gradle), but this feauture was added in 1.1.4: https://blog.jetbrains.com/kotlin/2017/08/kotlin-1-1-4-is-out/
The auto-generated code:
...ANSWER
Answered 2017-Oct-27 at 16:10You can either use @Parcelize
to tell the compiler to add the methods, or implement them explicitly (generated by IDEA plugin or not, it doesn't matter). It doesn't make sense to have both at once.
You can customize logic used by @Parcelize
, but it's still not done by overriding the methods, but as described in https://github.com/Kotlin/KEEP/blob/master/proposals/extensions/android-parcelable.md#custom-parcelables (that's what the "Use 'Parceler' companion object instead" part of the message means).
QUESTION
This is a followup to a question I asked earlier. I am using the Android Parcelable plugin from https://github.com/nekocode/android-parcelable-intellij-plugin-kotlin Following bennyl's suggestion, I changed the generated code for the constructors to
...ANSWER
Answered 2017-Aug-09 at 01:46context
needs to be supplied in order to call the this(context,...)
constructors. But, you cannot change your constructor(parcel: Parcel)
to constructor(context: Context, parcel: Parcel)
because Parcelable requires the `constructor(parcel: Parcel)
What's going on? Your class derives from TextView
which requires a Context
to instantiate. Your primary constructor
is doing that...
QUESTION
I'm using Android Parcelable plugin from https://github.com/nekocode/android-parcelable-intellij-plugin-kotlin
I tried it on a class with this definition
...ANSWER
Answered 2017-Aug-08 at 20:02- TextView is a class and therefore your primary constructor should invoke one of its constructors
- you should invoke your primary constructor from other constructors
Example:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install android-parcelable-intellij-plugin
Download ParcelableGenerator release
Open IntelliJ/Android Studio
Preferences -> Plugins -> Install plugin from disk....
Choose the downloaded jar file
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page