When users swipe downwards the shroud or action at that topographic point volition seem a round off loader/progress at the locomote yesteryear of the activity/screen. The loader color is changed inwards each fourth dimension which is nether textile design. Swipe to refresh or refresh functionality is mainly used inwards intelligence application, social app, forums app etc.
Android Example: How to Implement Swipe to Refresh inwards Android
To implement swipe to refresh inwards android app showtime of all opened upward your app XML layout file together with add together SwipeRefreshLayout every 2nd GroupView using v4 blueprint back upward library. Inside SwipeRefreshLayout widget add together a LinearLayout within ScvtollView. Your app content goes within LinearLayout. If you lot desire to work refresh functionality inwards your app amongst ListView or GridView you lot tin add together conduct within SwipeRefreshLayout widget. Following is the consummate content of XML layout file.
Now, opened upward your coffee action file together with implement setOnRefreshListener together with setColorSchemeResources to SwipeRefreshLayout. In setColorSchemeResources add together dissimilar colors which are displayed inwards round off telephone of refresh progress bar. Following is the consummate code of coffee action file.
Following is the content of colors.xml together with styles.xml file.
You bring done all things. Now run your Android Swipe Down to Refresh Layout Example application together with swipe downwards the screen, at that topographic point volition seem a round off loader together with the color of loader is changed. This swipe downwards to refresh app volition hold off similar higher upward screenshot.