android-parcelable-intellij-plugin-kotlin | Plugin which generates Android Parcelable boilerplate code | Plugin library
kandi X-RAY | android-parcelable-intellij-plugin-kotlin Summary
kandi X-RAY | android-parcelable-intellij-plugin-kotlin Summary
Plugin which generates Android Parcelable boilerplate code for kotlin's class.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Display a Parcelable instance
- Generate the class
- Add the imports for the KtFile
- Creates a list of type serializers
- Generate read value
- Gets the value null type
- Get the projection type
- Updates the presence of an event
- Returns the ktClass of a PtElement
- Gets the PsiClass for an event
- Generate the read value string
- Returns true if this field is null
- Generate write value
- Gets the selected fields
- Generate the read value
- Generates the write value
- Generates the read value
android-parcelable-intellij-plugin-kotlin Key Features
android-parcelable-intellij-plugin-kotlin Examples and Code Snippets
Community Discussions
Trending Discussions on android-parcelable-intellij-plugin-kotlin
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-kotlin
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