
So, now that you are contextualized about "Pull Down Refresh", I would like to inform that this famous gesture has just arrived to Java ME/LWUIT world.
Pull Down to Refresh for LWUIT was an old idea of mine, but just this week I sat down and decided to code a component that implemented this gesture. I was not sure whether it was going to work, but for my surprise it worked, and you will see how easy it is to get it integrated into your apps.
... Form form = new Form("PullDownRefresh") {}; form.setLayout(new BorderLayout()); // List list = new List(new String[] {...}); list.setRenderer(new DefaultListCellRenderer()); // final PullDownRefresh refresher = new PullDownRefresh(); refresher.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { new Thread() { public void run() { // Perform some process // refresher.endRefreshing(); } }.start(); } }); // form.addComponent(BorderLayout.NORTH, refresher); form.addComponent(BorderLayout.CENTER, list); // form.show(); ...
As you can see in the code snippet above, all you have to do is to create an instance of PullDownRefresh class and add it at first position of a Form object and register an ActionListener object to be notified when a refresh operation is triggered. With this notification, you can start a process to perform any operation, e.g., refresh the Form's data. Once the operation is concluded, just call the endRefreshing() method, so the component can return to its default state. Easy, huh?
Watch the video below and see PullDownRefresh component in action:
Cool, huh? :)
PullDownRefresh component is totally customizable. For instance, you can change the style, images and labels. Check out the Javadoc and you will know how.
You can download the component right away by clicking here. Besides the source code, there is also sample MIDlet.
By the way, PullDownRefresh is under MIT license.
I hope everybody finds this new component useful and let me know your comments.
See you in the next post...
Update (Feb 17th, 2014):
There is a new version of this component. For further details, check this post.
16 comments:
Hi Ernandes, is there a recent J2ME app for blogger? The old ones like Blogplanet and Kablog no longer work because google changed the blogger interface. If you could make one, It'd be very useful to a lot of people. Thanks
Sorry, I know none.
I will think about it. :)
Hi. I'm trying to use PullDownRefresh in my app. Everything works except that when the form loads the bar is already visible. It doesn't hide until pulled. Any ideas?
Is it the first component in your form?
Are you calling beginRefreshing() method during the form load? If so, remove it.
Great and Useful Article.
Online Java Course
Java Online Training
Java Course Online
Best Recommended books for Spring framework
Java Interview Questions
Java Training Institutes in Chennai
Java Training in Chennai
J2EE Training in Chennai
java j2ee training institutes in chennai
Java Course in Chennai
thank you for sharing such a nice and interesting blog with us. hope it might be much useful for us. keep on updating...
ROI Services in Chennai
The knowledge of technology you have been sharing thorough this post is very much helpful to develop new idea. here by i also want to share this.
Data Science Training in Chennai
Data science training in bangalore
Data science online training
Data science training in pune
Data science training in kalyan nagar
Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and I got more information from your blog.
Devops training in Chennai
Devops training in Bangalore
Devops Online training
Devops training in Pune
It is better to engaged ourselves in activities we like. I liked the post. Thanks for sharing.
java training in chennai | java training in bangalore
java online training | java training in pune
selenium training in chennai
selenium training in bangalore
I would like to thank you for your nicely written post, its informative and your writing style encouraged me to read it till end. Thanks
angularjs-Training in annanagar
angularjs Training in chennai
angularjs Training in chennai
angularjs Training in bangalore
Impressive. Your story always bring hope and new energy. Keep up the good work.
python online training
python training in OMR
python training course in chennai
Thank you for an additional great post. Exactly where else could anybody get that kind of facts in this kind of a ideal way of writing? I have a presentation next week, and I’m around the appear for this kind of data.
angularjs Training in marathahalli
angularjs interview questions and answers
angularjs Training in bangalore
angularjs Training in bangalore
angularjs Training in chennai
automation anywhere online Training
I would like to say that this blog really convinced me to update my knowledge about the technology you talk about. Thanks, very good post
Selenium Training in Chennai
Selenium Course in Chennai
iOS Course in Chennai
French Classes in Chennai
Big Data Training in Chennai
SEO Course in Chennai
SEO Training Institute in Chennai
Great article. Thanks for sharing.
opencu
Guest posting sites
iphone service center chennai
iphone service center
ipad service center chennai
ipad service center
imac service center chennai
imac service center
Really awesome blog. Your blog is really useful for me
Regards,
Best Devops Training in Chennai | Best Devops Training Institute in Chennai
Post a Comment