Merge pull request #1184 from maskaravivek/notificationOrder

Fix order of notifications
This commit is contained in:
Josephine Lim 2018-02-25 19:44:41 +10:00 committed by GitHub
commit 12b852f82d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,6 +10,7 @@ import android.support.v7.widget.RecyclerView;
import com.pedrogomez.renderers.RVRendererAdapter; import com.pedrogomez.renderers.RVRendererAdapter;
import java.util.Collections;
import java.util.List; import java.util.List;
import javax.inject.Inject; import javax.inject.Inject;
@ -58,6 +59,7 @@ public class NotificationActivity extends NavigationBaseActivity {
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(notificationList -> { .subscribe(notificationList -> {
Collections.reverse(notificationList);
Timber.d("Number of notifications is %d", notificationList.size()); Timber.d("Number of notifications is %d", notificationList.size());
setAdapter(notificationList); setAdapter(notificationList);
}, throwable -> Timber.e(throwable, "Error occurred while loading notifications")); }, throwable -> Timber.e(throwable, "Error occurred while loading notifications"));