Current RxJava version, not reloading when downloads are queued

This commit is contained in:
Martin Fietz 2015-11-25 21:35:15 +01:00
parent af30f4f9d2
commit c45797631d
4 changed files with 14 additions and 2 deletions

View File

@ -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"

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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"
}