SaddamButo / android-query

Automatically exported from code.google.com/p/android-query
0 stars 0 forks source link

Custom method for aq.progress() #27

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I usually like add a progress item to my ListAdapter when loading data, then 
remove it during the success callback, but aQuery only supports passing a 
drawable to the .progress() method. Can you add support for passing a custom 
method name to aq.progress()?

It would go something like this:

...

/* using GreenDroid, e.g. */
private void showProgress() {
    ProgressItem indicator = new ProgressItem("Loading...", true);
    items.add(indicator);
}

aq.progress("showProgress").ajax(url, JSONObject.class, this, "jsonCb");

...

The jsonCb method would be responsible for removing the ProgressItem and 
filling in the new data.

Thanks!

Adam K

Original issue reported on code.google.com by krebsa...@gmail.com on 5 Mar 2012 at 12:50

GoogleCodeExporter commented 8 years ago

Original comment by tinyeeliu@gmail.com on 21 Aug 2012 at 3:02