-
Notifications
You must be signed in to change notification settings - Fork 24
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
@Inject for findFragmentById? #35
Comments
I cant understand what you want to get. Can you please describe more in detail how it should work? You can post a complete class with your implementation and some comments in it to help us understand. |
Hi. If I'm not mistaken what you want is to be able to inject a fragment from XML: <fragment android:id="@+id/myFragment" class="..."> In the same way we do it for views. While I think this could be a good thing, I'm not sure it should be done in an annotation way, as it isn't a widely used feature. I thought about using a DSL method, but it doesn't make it less verbose: fragment = (MyFragment) activity.findFragment(R.id.myFragment) I don't know. What do you think, @eugene-kamenev? |
@Arasthel I think @dsvensson wants to define an additional parameter in annotation to use supportFragmentManager or fragmentManager am I wrong? :) just cant understand the goal |
Instead of what I wrote above |
It could be done using just an annotation, as the AST transform could check if the activity/fragment is normal or compat. What I'm not really sure about is if it's worth the trouble of making the new transformation... |
Not sure if it's possible, but it feels like something that would be nice to deal with an @InjectSomething tag. Perhaps with supportFragmentManager vs fragmentManager distinction.
Currently do this in my onCreate:
The text was updated successfully, but these errors were encountered: