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

Deprecate @View in favor of a new class that doesn't conflict with a common android class name #57

Open
ghost opened this issue Jan 24, 2014 · 8 comments
Milestone

Comments

@ghost
Copy link

ghost commented Jan 24, 2014

I am finding myself qualifying my usage of android.view.View all over the place... would you consider adding a new @tview or @ViewRef or something that doesn't conflict so frequently?

This actually might be an issue with a couple others as well.. I feel like we should avoid name conflicts with common core android components whenever possible.

@ghost
Copy link
Author

ghost commented Jan 24, 2014

Fragment is another good example.. especially when dealing with the support libraries, you can end up with some nasty qualified class names in your code.

@johncarl81
Copy link
Owner

I'll consider it, but I do like keeping the annotation names simple and readable... even if you do have to use them fully-qualified from time to time.

@ghost
Copy link
Author

ghost commented Jan 25, 2014

Yeah.. I guess it's a style choice.. we just have some pretty complex Fragments that now have quite a few fully qualified references to android.view.View and the support library version of Fragments.. it's a tad ugly... would it be a huge pain/hack to add in some "aliases" that work the same way but don't conflict and just have them all in there? It's too bad Java doesn't support Scala style import aliasing

@johncarl81
Copy link
Owner

Actually, aliasing could be accomplished... I'll have to think about it though.

@johncarl81 johncarl81 added this to the 0.3.0 Release milestone Aug 24, 2016
@johncarl81
Copy link
Owner

@dbachelder , this was you right? I'm leaning more in this direction now. I kindof like @TView... should we also change @Activity to @TActivity?

@dbachelder
Copy link
Contributor

Yes, please! Would be great to remove ambiguity with any annotation names that conflict with platform classes

@johncarl81
Copy link
Owner

what's your preference on naming convention? Prepend with a T (Ugh, I hate to copy Android Annotations here, they prepend with E: @EActivity)? Append a 'Ref'?

@dbachelder
Copy link
Contributor

hah.. prepending a letter is a tradition as old as Java :) Save everyone the typing and go with T prefix.. that's my opinion.

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