This repository has been archived by the owner on Feb 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
ParcelerIntegration
Csaba Kozák edited this page Feb 16, 2019
·
4 revisions
Since AndroidAnnotations 4.0.0
Parceler is an annotation processor which generates implementation of the Parcelable
interface, thus removes tons of boilerplate code.
AndroidAnnotations can detect if Parceler is on the classpath, and automatically call it during various Bundle
operations. You just have to annotate your POJO with Parceler annotations as usual, and pass the simple object around: AndroidAnnotations will call Parcels.wrap/unwrap
when needed.
Usage example:
@Parcel
public class Person {
String name;
int age;
public Person() {
}
@ParcelConstructor
public Person(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
}
@EActivity
public class ExtraInjectedActivity extends Activity {
@Extra("personExtra")
Person person;
@AfterInject
void afterInject() {
Log.w("AAParceler", person.getName());
}
}
Person john = new Person("John Doe", 25);
ExtraInjectedActivity_.intent(context).personExtra(john).start();
19/11/2020 The 4.8.0 release is out !
- Get started!
- Cookbook, full of recipes
- Customize annotation processing
- List of all available annotations
- Release Notes
- Examples
- Read the FAQ
- Join the Mailing list
- Create an issue
- Tag on Stack Overflow
- Ask on Gitter