You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
In a recent project I have to deal with lots CheckBoxes.
There is some special logic (e.g. disallow multi select etc) and it should be possible to add this into AA.
I'd follow to the idea of @Click - if no-one else is working on it already.
I think we should extend the usage of this annotation to CompoundButton and all its subclasses.
Also I would prefer a name like @CheckedStateChange or @CheckedChange. Until now we use listeners interfaces names to determine the annotation name :
OnClickListener => @Click
OnTouchListener => @Touch
OnItemClickListener => @ItemClick
OnCheckedChangeListener should be @CheckedChange
Finally I think it would be nice to let users determine which parameters they really need. In this manner, the view and the checked parameters will be optional (like the @TextChange or @SeekBarProgressChange)
packagecom.myapp;
// ...@CheckedChange({R.id.chkType1, R.id.chkType2})
voidcheckBoxChecked(CompoundButtonbuttonView, booleanisChecked) {
// Both parameters for convenience.
}
@CheckedChange(R.id.chkType3)
voidtype3Checked(CompoundButtonbuttonView) {
// Just the button.
}
@CheckedChange(R.id.chkType4)
voidtype4Checked(booleanisChecked) {
// Just the state.
}
Are you interested in contributing to AndroidAnnotations ? The implementation of that feature could be a good way to take a tour on AndroidAnnotations plumbing.
Activity
pyricau commentedon Nov 8, 2012
Interesting. Could you write a small code sample on what the generated code would look like ?
mathieuboniface commentedon Nov 8, 2012
It seems a really great idea to me !
I think we should extend the usage of this annotation to CompoundButton and all its subclasses.
Also I would prefer a name like
@CheckedStateChangeor@CheckedChange. Until now we use listeners interfaces names to determine the annotation name :OnClickListener=>@ClickOnTouchListener=>@TouchOnItemClickListener=>@ItemClickOnCheckedChangeListenershould be@CheckedChangeFinally I think it would be nice to let users determine which parameters they really need. In this manner, the
viewand thecheckedparameters will be optional (like the @TextChange or @SeekBarProgressChange)By browsing youtube I found the Compound sound : http://www.youtube.com/watch?v=RoX9ojwca8M :)
ened commentedon Nov 9, 2012
Ah, I understand the naming scheme and of course makes sense like that.
Code sample:
XML Layout:
Activity Code:
Generated code:
Merci ;-)
mathieuboniface commentedon Nov 9, 2012
Hi Sebastian :)
The generated code seems good.
Are you interested in contributing to AndroidAnnotations ? The implementation of that feature could be a good way to take a tour on AndroidAnnotations plumbing.
ened commentedon Nov 9, 2012
Yes, I'd love to work on that.
Will do once time allows. Hope within a week or 2.
mathieuboniface commentedon Nov 9, 2012
Great !
luxtau commentedon Jan 10, 2013
What state of this feature?
mathieuboniface commentedon Jan 12, 2013
Hi @luxtau,
This feature is planned for 3.0. It seems that nobody has started working on that issue.
Feel free to implement it :)
naixx commentedon Jan 12, 2013
Probably, it will be easier to implement this feature after #434. So, I'm woriking
Add @CheckedChange androidannotations#389
yDelouis commentedon Jun 19, 2013
This should be documented and closed.
DayS commentedon Jun 20, 2013
Wiki updated