From c45797631de05d0631d5fb42cda3ba74280effc9 Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Wed, 25 Nov 2015 21:35:15 +0100 Subject: [PATCH] Current RxJava version, not reloading when downloads are queued --- app/build.gradle | 1 + .../danoeh/antennapod/fragment/AllEpisodesFragment.java | 6 +++++- .../java/de/danoeh/antennapod/fragment/QueueFragment.java | 8 +++++++- build.gradle | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5a391b45e..0e6c9865b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -28,6 +28,7 @@ dependencies { compile "com.squareup.okio:okio:$okioVersion" compile "de.greenrobot:eventbus:$eventbusVersion" compile "io.reactivex:rxandroid:$rxAndroidVersion" + compile "io.reactivex:rxjava:$rxJavaVersion" compile "com.joanzapata.iconify:android-iconify-fontawesome:2.1.0" compile "com.afollestad:material-dialogs:0.7.8.1" compile "com.yqritc:recyclerview-flexibledivider:1.2.6" diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java index cdd6bc265..dab4ef8cd 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java @@ -393,7 +393,11 @@ public class AllEpisodesFragment extends Fragment { @Override public void update(EventDistributor eventDistributor, Integer arg) { if ((arg & EVENTS) != 0) { - loadItems(); + if((arg & EventDistributor.DOWNLOAD_QUEUED) != 0) { + listAdapter.notifyDataSetChanged(); + } else { + loadItems(); + } if (isUpdatingFeeds != updateRefreshMenuItemChecker.isRefreshing()) { getActivity().supportInvalidateOptionsMenu(); } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java index 433e72778..694b837d7 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java @@ -557,7 +557,12 @@ public class QueueFragment extends Fragment { @Override public void update(EventDistributor eventDistributor, Integer arg) { if ((arg & EVENTS) != 0) { - loadItems(); + Log.d(TAG, "arg: " + arg); + if((arg & EventDistributor.DOWNLOAD_QUEUED) != 0) { + recyclerAdapter.notifyDataSetChanged(); + } else { + loadItems(); + } if (isUpdatingFeeds != updateRefreshMenuItemChecker.isRefreshing()) { getActivity().supportInvalidateOptionsMenu(); } @@ -566,6 +571,7 @@ public class QueueFragment extends Fragment { }; private void loadItems() { + Log.d(TAG, "loadItems()"); if(subscription != null) { subscription.unsubscribe(); } diff --git a/build.gradle b/build.gradle index ab6884c76..56527f0fc 100644 --- a/build.gradle +++ b/build.gradle @@ -49,6 +49,7 @@ project.ext { glideVersion = "3.6.1" jsoupVersion = "1.7.3" rxAndroidVersion = "1.0.1" + rxJavaVersion = "1.0.16" okhttpVersion = "2.5.0" okioVersion = "1.6.0" }