From dd833852ad720b06cb4672af3490642d86dae16e Mon Sep 17 00:00:00 2001 From: inorichi Date: Tue, 5 Jan 2016 18:47:25 +0100 Subject: [PATCH] Trying to fix a backpressure issue (#17). --- .../java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java | 5 +++-- app/src/main/res/values/styles.xml | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java index 1368e08e37..d92d7361dd 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/reader/ReaderPresenter.java @@ -147,14 +147,15 @@ public class ReaderPresenter extends BasePresenter { if (!isDownloaded) { pageObservable = source.getAllImageUrlsFromPageList(pageList) - .flatMap(source::getCachedImage, 3); + .flatMap(source::getCachedImage, 2); } else { File chapterDir = downloadManager.getAbsoluteChapterDirectory(source, manga, chapter); pageObservable = Observable.from(pageList) .flatMap(page -> downloadManager.getDownloadedImage(page, chapterDir)); } - return pageObservable + return Observable.defer(() -> pageObservable) .subscribeOn(Schedulers.io()) + .onBackpressureBuffer() .observeOn(AndroidSchedulers.mainThread()); } diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 120bfd2c9a..320db14473 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -7,8 +7,6 @@ @style/AlertDialogStyle @style/OptionsMenuTextColor @color/primary_text - @color/primary_text - @color/white true true @@ -19,6 +17,7 @@ @style/ActionBarSpinner @color/colorPrimarySuperDark @color/colorPrimarySuperDark + @color/white