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

configurable naming strategy #68

Open
ghost opened this issue Jan 28, 2014 · 6 comments
Open

configurable naming strategy #68

ghost opened this issue Jan 28, 2014 · 6 comments

Comments

@ghost
Copy link

ghost commented Jan 28, 2014

I'd like to be able to name my Activities *Activity without having to reference *ActivityActivity in code... it would be cool if transfuse could use a configurable naming strategy... So ultimately I could end up with MyActivity -> MyTransfuseActivity and MyFragment -> MyTransfuseFragment ... or something like that, without spelling out said strategy on every single component.

@johncarl81
Copy link
Owner

Great idea and this may go hand in hand with different manifest generation strategies... ie: you having to manually add the activity to the manifest. Also, this would be a nice extension to add in the plugin environment I've been envisioning.

Have you tried using the Components utility? This gives you a mapping of all generated components in the system in the hope that you wouldn't have to reference a class that doen't exist before compile time:

Components.get(MyTransfuseActivity.class) -> MyTransfuseActivityActivity.class

Looks like this is missing from the docs.

@ghost
Copy link
Author

ghost commented Jan 29, 2014

Ah, I had not played with that yet...

It doesn't help too much when I need to inject the concrete version of a component.. and it doesn't look like it helps me get the strategy for an activity component.

@johncarl81
Copy link
Owner

Right, referencing the Intent Strategies is one of the few times when you need to use the generated classes directly.

How are you injecting the concrete version of a component?

@ghost
Copy link
Author

ghost commented Jan 29, 2014

When I want to inject some number of fragments into an activity so they can be swapped in and out based on my navigation widgets I am doing it by the concrete component name... is there a better way?

@johncarl81
Copy link
Owner

Fragments do need to be referenced directly as well currently... but I wonder if we could make a Fragments utility to instantiate the related generated code instead of having you do it, ie:

Fragments.create(MyTransfuseFragment.class) -> new instance of MyTransfuseFragmentFragment

thoughts?

@ghost
Copy link
Author

ghost commented Jan 29, 2014

I think that would be helpful in most cases... aside from the injection I am treating them as their base class (or at least I could be... )

@johncarl81 johncarl81 added this to the 0.3.0 Release milestone Aug 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant