Check Mobile App
Read now
Start a Project

Adding Swipe-to-Refresh To Your App

Save

This blog will give you a basic overview about the SwipeRefreshLayout.

SwipeRefreshLayout as the name suggest refreshes the content of a view (mostly View’s that this Layout hold) via vertical swipe gesture.

 

Let us Add the SwipeRefreshLayout Widget for our layout

Yes, That’s simple. Just wrap your view by SwipeRefreshLayout.

 

interface OnRefreshListener (SwipeRefreshLayout.OnRefreshListener)

Classes that wish to be notified when the swipe gesture correctly triggers a refresh should implement this interface.

The activity/fragment that instantiates this view should add an OnRefreshListener to be notified whenever the swipe to refresh gesture is completed. The SwipeRefreshLayout will notify the listener (OnRefreshListener) each and every time the gesture is completed again; the listener is responsible for correctly determining when to actually initiate a refresh of its content.

call setRefreshing(false) to cancel any visual indication of a refresh.

To disable the gesture and progress animation, call setEnabled(false) on the view.

 

Respond to the Refresh Gesture

 

Here is a sample of our SwipeRefreshLayout used in our Mobikul Application.

swipe_refresh_layout

 

That’s all folks. #Stay_hungry_stay_foolish

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

css.php

The support is fast and do everything in their power to make it perfect. If you need customization it's also done right away. I had massive research to select Mobikul and now I'm sure it was the right one.

Igor Souza

Igor Souza

Talk to Sales

Global

Live Chat
Start a Project

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home