Skip to content

Instantly share code, notes, and snippets.

@magdamiu
Created December 28, 2020 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magdamiu/c7ad1083b71ff0c16232686f20b99e6f to your computer and use it in GitHub Desktop.
Save magdamiu/c7ad1083b71ff0c16232686f20b99e6f to your computer and use it in GitHub Desktop.
Setup swipe to refresh
private void setupSwipeToRefresh() {
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
// Make sure you call swipeRefreshLayout.setRefreshing(false)
// once the network request has completed successfully.
inbox();
}
});
// Configure the refreshing colors
swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright,
android.R.color.holo_green_light,
android.R.color.holo_orange_light,
android.R.color.holo_red_light);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment