Created
August 8, 2018 08:00
-
-
Save dineshmm23/ebbf0ef7bb2d73550cddd0ebc5271486 to your computer and use it in GitHub Desktop.
Method for swipe to refresh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void initializeSwipeToRefresh() { | |
// Swipe down to force synchronize | |
//swipeRefreshLayoutUserRole = (SwipeRefreshLayout) findViewById(R.id.swipeRefreshLayout); | |
swipeRefreshLayoutUserRole.setDistanceToTriggerSync(390); | |
//swipeRefreshLayoutUserRole.setEnabled(true); //Controlled by fragments! | |
swipeRefreshLayoutUserRole.setColorSchemeResources( | |
android.R.color.holo_purple, android.R.color.holo_blue_light, | |
android.R.color.holo_green_light, android.R.color.holo_orange_light); | |
swipeRefreshLayoutUserRole.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { | |
@Override | |
public void onRefresh() { | |
// Passing true as parameter we always animate the changes between the old and the new data set | |
new GetUserRolesPrivleges().execute(skorkastBaseURL + "/user/" + userEmail + "/roleprivileges/" + communityId); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment