Comments (5)
Supporting just List
would be tricky - e.g. if you initialized it with a custom implementation then you would expect to have it there after deserialization.
I could try to add a mechanism for custom serialization&deserialization of objects.
from blade.
@aartikov v2.6.0-beta1
is out.
Now you can specify your own Bundler
implementation for any object field.
e.g. @Extra(MyListBundler.class) List<String> mList;
Same goes for @Arg
and @State
.
You can try it and give me feedback 😉
from blade.
Nice! It works.
This is my ListBundler:
public class ListBundler implements Bundler<List> {
private static final String KEY = "key";
@Override
@SuppressWarnings("unchecked")
public void save(@Nullable List value, @NonNull Bundle state) {
if(value == null || value instanceof Serializable) {
state.putSerializable(KEY, (Serializable) value);
} else {
state.putSerializable(KEY, new ArrayList(value));
}
}
@Nullable
@Override
public List restore(@NonNull Bundle state) {
return (List)state.getSerializable(KEY);
}
}
from blade.
Ok, I'll just change the package name to blade.Bundler
and if I don't find anything else I'll release it as 2.6.0
from blade.
version 2.6.0
released
from blade.
Related Issues (19)
- There is no I.startMyActivity() generated if there is no @Extra annotation in the class. HOT 1
- Support for Parceler HOT 1
- Possible improvement? HOT 6
- Multiple annotations HOT 7
- Kotlin support HOT 4
- Inject code for @State at the end of `onSaveInstanceState()` HOT 1
- Support also yaml config file HOT 1
- Butterknife 8.4.0 does not work with Blade. HOT 4
- Support for Kotlin projects HOT 1
- Generate assertions from standard Android annotations HOT 2
- NoClassDefFoundError: javax/inject/Inject HOT 3
- Support for com.android.tools.build:gradle:3.+ HOT 1
- Add method for Bundle creation to blade.F
- Combine modules arg and extra into one
- Support for MVVM
- Kotlin primitive is generated as private HOT 4
- Only Fragment subclass can contain @Arg with AndroidX HOT 5
- Error for gradle 4.x HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blade.