Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

Annotation for AutocompleteTextView (feature request) #1791

Open
cutiko opened this issue Jun 7, 2016 · 2 comments
Open

Annotation for AutocompleteTextView (feature request) #1791

cutiko opened this issue Jun 7, 2016 · 2 comments

Comments

@cutiko
Copy link

cutiko commented Jun 7, 2016

Greetings

I would like to ask for an annotation for the AutocompleteTextView.

The purpose of the annotation is to make more straightforward the use of a AutocompleteTextview. Could be something like the current @Click annotation. Using the id of the view as name of the method, one parameter for the View and another for the position of the item clicked, and passing the String collection List<String> with the resource next to the annotation.

@AutoComplete(collection = myStringCollection, resource = R.layout.list_item_green_bg)
void asUsualTheId(View view, int position) {
    //Do something when the item is clicked, like setting it as text to the view
    view.setTextColor(ContextCompat.getColor(getApplicationContext, R.color.colorPrimary));
    if (myStringCollection.get(position).equals(MY_CONSTANT)) {
         //DO something with the position
    }
}

Above, the params pass next to the annotations are based in the @Receiver.

Thanks.

@WonderCsabo
Copy link
Member

I like the idea of an event annotation for AutocompleteTextView. Feel free to contribute it.

However i think it is not a good thing to define the adapter elements this way, especially on a method annotation.

@cutiko
Copy link
Author

cutiko commented Jun 9, 2016

I was very excited about doing it so. I start watching how the annotations was made an try to understand what AA does in the background to make or life easier. Sadly, Im not skilled enough yet to endeavour in such a task. Couldnt figure it out my way arround. Sorry I wont be able to contribute.

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

No branches or pull requests

2 participants