Skip to content

Commit

Permalink
v3.0.5 - Maps now network refreshable
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Sosa committed Feb 5, 2016
1 parent 0cd2b47 commit bf5bae8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mobile/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId 'com.hackfsu.android.hackfsu'
minSdkVersion 16
targetSdkVersion 23
versionCode 7
versionName "3.0.4"
versionCode 8
versionName "3.0.5"
multiDexEnabled true //enable this

}
Expand Down
Binary file modified mobile/mobile-release.apk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,23 @@ public void done(List<MapItem> list, ParseException e) {
mSwipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
mSwipeLayout.setRefreshing(false);

ParseQuery<MapItem> query = ParseQuery.getQuery(ParseName.MAPITEM);
query.setCachePolicy(ParseQuery.CachePolicy.NETWORK_ELSE_CACHE);
query.orderByAscending(ParseName.MAP_FLOOR);
query.findInBackground(new FindCallback<MapItem>() {
@Override
public void done(List<MapItem> list, ParseException e) {
if(e != null) {
Log.e("HackFSU", "Error: " + e.getMessage());
} else {
mAdapter.notifyItemRangeRemoved(0, mAdapter.getItemCount());
mAdapter.replaceDataset(list);
mAdapter.notifyItemRangeInserted(0, mAdapter.getItemCount());
}
mSwipeLayout.setRefreshing(false);
}
});
}
});
mSwipeLayout.setColorSchemeResources(R.color.accent);
Expand Down

0 comments on commit bf5bae8

Please sign in to comment.