Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile helper #14

Closed
danielgomezrico opened this issue Mar 22, 2015 · 6 comments
Closed

Compile helper #14

danielgomezrico opened this issue Mar 22, 2015 · 6 comments

Comments

@danielgomezrico
Copy link

I need to add the cast to Parselable everytime that I will use it... is there any way to avoid this?

example:
intent.putExtra(DrawerActivity.BUNDLE_ORDER, (Parselable) actualOrder);

@eugene-kamenev
Copy link
Collaborator

Sure you can, take a look at AndroidBundleDSL class

@danielgomezrico
Copy link
Author

the link is broken

@eugene-kamenev
Copy link
Collaborator

Sorry but I was from mobile, you can find it by path
24 марта 2015 г. 21:15 пользователь "Daniel" notifications@github.com
написал:

the link is broken


Reply to this email directly or view it on GitHub
#14 (comment).

@eugene-kamenev
Copy link
Collaborator

@danielgomezrico I fixed the link, do you understand how to use these methods?

@danielgomezrico
Copy link
Author

Thanks 👍 ! but I don't, can you some me a little example?

@eugene-kamenev
Copy link
Collaborator

@danielgomezrico take a look:

def map = [someKey: 'someValue', someKey2: 'someValue2'];
Bundle bundle = map.asBundle();
Bundle bundle1 = anyObject.fromMap([someKey: 'someValue', someKey2: 'someValue2']);
Bundle bundle2 = new Bundle();
bundle2.putFromMap([someKey: 'someValue', someKey2: 'someValue2']);

but it will work only for groovy classes. For Java you should explicitly use it like this:

Map bundleMap = new HashMap();
Bundle bundle1 = new Bundle();
AndroidBundleDSL.putFromMap(bundle1, bundleMap);

and so on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants