pakerfeldt / android-viewflow

A horizontal view scroller library for Android
1.78k stars 694 forks source link

How to invalidate loaded view ? #32

Closed Voldemar123 closed 13 years ago

Voldemar123 commented 13 years ago

In my Adapter in getView() method I call the AsyncTask for load data for current view it takes time so on view shows the progress bar

Could you bring any suggestions how invalidate the already stored data in mLoadedViews and redraw the current selected view after execute my async task ?

pakerfeldt commented 13 years ago

You could keep a reference to the view you are (synchronously) returning in getView(), do whatever lazy loading you need and then call invalidate() on that view when needed. This is actually how I personally do it in another project using ViewFlow where we load images asynchronously. Does that make sense?

Voldemar123 commented 13 years ago

It's all right intended after reading the documentation I did so

I have a working example of asynchronous data loading into ViewFlow Can I add it ViewFlowExample and commit into this project?

I think my experience will be useful to others

pakerfeldt commented 13 years ago

Absolutely. As long as the data loaded is somewhat persistent. I would prefer if you could load resources found in this project, like reading these URLs for instance:

https://github.com/pakerfeldt/android-viewflow/raw/master/viewflow-example/res/drawable/cupcake.jpg https://github.com/pakerfeldt/android-viewflow/raw/master/viewflow-example/res/drawable/donut.jpg https://github.com/pakerfeldt/android-viewflow/raw/master/viewflow-example/res/drawable/eclair.png https://github.com/pakerfeldt/android-viewflow/raw/master/viewflow-example/res/drawable/froyo.png https://github.com/pakerfeldt/android-viewflow/raw/master/viewflow-example/res/drawable/gingerbread.png https://github.com/pakerfeldt/android-viewflow/raw/master/viewflow-example/res/drawable/honeycomb.png https://github.com/pakerfeldt/android-viewflow/raw/master/viewflow-example/res/drawable/icecream.png

Voldemar123 commented 13 years ago

Ok, I try to commit my changes it is my first github experience - could advise me how to start work with project ?

pakerfeldt commented 13 years ago

I'm on the go right now. Can give more details later. But you mainly want to fork my repository first. Pull down your fork. Do your changes, commit and push to your fork. Then issue a pull request on github. On Aug 16, 2011 4:37 PM, "Voldemar123" < reply@reply.github.com> wrote:

Ok, I try to commit my changes it is my first github experience - could advise me how to start work with project ?

Reply to this email directly or view it on GitHub:

https://github.com/pakerfeldt/android-viewflow/issues/32#issuecomment-1816795

pakerfeldt commented 13 years ago

Here are some links. Forking on Github: http://help.github.com/fork-a-repo/ Sending pull requests: http://help.github.com/send-pull-requests/