diff --git a/mobile/build.gradle b/mobile/build.gradle index bc06b96..cafe039 100644 --- a/mobile/build.gradle +++ b/mobile/build.gradle @@ -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 } diff --git a/mobile/mobile-release.apk b/mobile/mobile-release.apk index 152264a..a44bf75 100644 Binary files a/mobile/mobile-release.apk and b/mobile/mobile-release.apk differ diff --git a/mobile/src/main/java/com/hackfsu/android/hackfsu/MapsFragment.java b/mobile/src/main/java/com/hackfsu/android/hackfsu/MapsFragment.java index 1dbedbc..4c4ffb8 100644 --- a/mobile/src/main/java/com/hackfsu/android/hackfsu/MapsFragment.java +++ b/mobile/src/main/java/com/hackfsu/android/hackfsu/MapsFragment.java @@ -105,7 +105,23 @@ public void done(List list, ParseException e) { mSwipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { - mSwipeLayout.setRefreshing(false); + + ParseQuery query = ParseQuery.getQuery(ParseName.MAPITEM); + query.setCachePolicy(ParseQuery.CachePolicy.NETWORK_ELSE_CACHE); + query.orderByAscending(ParseName.MAP_FLOOR); + query.findInBackground(new FindCallback() { + @Override + public void done(List 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);