Hello Peter,
It's a nice idea and project. I haven't tried AQuery yet, but I have a little
remark.
In your examples there is:
aq.id(R.id.icon).image(R.drawable.icon).visible().clicked(this, "someMethod");
I'm not a big fan of this clicked() function. The problem is that the java
compiler cannot check whether someMethod exists, and also it is not available to
Eclipse refactoring, when renaming a method, which is a pretty handy feature.
I think that a clicked(OnClickListener listener) method could be better.
Also, having different methods for each click event isn't so nice.
For instance, in my case, I have a file manager, with about 10 buttons (not all
visible at the same time), but I have only one method to handle all clicks:
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.button1:
...
case R.id.button10:
}
}
I'm using this in quite a few places and find it pretty efficient.
To register my class as listener for all these buttons I use a small loop.
But, with jQuery you have these selectors and such which allow you to register
as event listener for multiple elements at once. Maybe that you could consider
the idea, for example with a method which matches all instances of a certain
View class, within a given ViewGroup.
Just a couple of ideas :)
Olivier
On 05/27/2011 08:17 AM, Peter Liu wrote:
> [Reposting to correct group]
>
> Hi.
>
> I am an Android developer and just started an open source project at:
> http://code.google.com/p/android-query/
>
> It’s a light weight library that’s designed to make Android coding
> simpler and easier. If you are familiar with jQuery style of coding,
> you will like AQuery.
>
> Why AQuery?
>
> Less Code
> Chaining
> Binding
> Handle Fragmentation
> Multiple UI, One Piece of Code
> Extendable
> Light Weight
> Open Source
>
> Any comments, feedback, or contribution will be appreciated!
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en