Wednesday, February 15, 2017

Re: Animating images in GWT

I tried with a timer but the transition is a little slow the first time as the images download. Is there some way to cache or download them into memory before iterating them?
// Create a new timer that iterates the images
               
Timer t = new Timer() {
                 
int counter = 0;

                 
@Override
                 
public void run() {
                     
if (counter < imageUrls.size()) {
                        iconPreviewHTML
.setHTML("<img src=\"" + imageUrls.get(counter) + "\"/>");
                     
}
                     counter
++;
                 
}
               
};
               
// Schedule the timer to run once in x seconds.
               t
.scheduleRepeating(500);



--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment