Skip to content

Commit 451c0e0

Browse files
committed
Fall back to Parse 1.11.0 because of parse-community/Parse-SDK-Android#355 and convert the DonationCategory fetch to an Observable.
1 parent 1b514cc commit 451c0e0

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ dependencies {
138138

139139
// compile 'com.androidmapsextensions:android-maps-extensions:2.1.0+'
140140

141-
compile 'com.parse:parse-android:1.12.0'
141+
compile 'com.parse:parse-android:1.11.0'
142142
compile 'com.parse.bolts:bolts-android:1.3.0'
143143
compile 'com.parse:parseui-login-android:0.0.1'
144144
compile 'com.parse:parseui-widget-android:0.0.1'

app/src/main/java/io/givenow/app/fragments/main/donate/RequestPickupFragment.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -649,15 +649,10 @@ public void onAnimationEnd(Animator animation) {
649649
private void buildCategoryGrid() {
650650
//get categories from parse
651651
mDonationCategoryAdapter.clearItems();
652-
DonationCategory.getTop9().findInBackground((categoryList, error) -> {
653-
if (error == null) {
654-
for (DonationCategory category : categoryList) {
655-
mDonationCategoryAdapter.addItem(category);
656-
}
657-
} else {
658-
Log.d("RPDF", "Error fetching categories: " + error.getMessage());
659-
}
660-
});
652+
ParseObservable.find(DonationCategory.fetchTop9()).observeOn(mainThread()).subscribe(
653+
mDonationCategoryAdapter::addItem,
654+
error -> ErrorDialogs.connectionFailure(getActivity(), error)
655+
);
661656
}
662657

663658
@NonNull

app/src/main/java/io/givenow/app/models/DonationCategory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public DonationCategory(int priority, ParseFile image,
3030
setDescription(description_en, description_de);
3131
}
3232

33-
public static ParseQuery<DonationCategory> getTop9() {
33+
public static ParseQuery<DonationCategory> fetchTop9() {
3434
return ParseQuery.getQuery(DonationCategory.class)
3535
.orderByAscending("priority")
3636
.setLimit(9);

0 commit comments

Comments
 (0)