mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-10 12:47:26 +01:00
Trying to fix a backpressure issue (#17).
This commit is contained in:
parent
2f66b6e56c
commit
dd833852ad
@ -147,14 +147,15 @@ public class ReaderPresenter extends BasePresenter<ReaderActivity> {
|
|||||||
|
|
||||||
if (!isDownloaded) {
|
if (!isDownloaded) {
|
||||||
pageObservable = source.getAllImageUrlsFromPageList(pageList)
|
pageObservable = source.getAllImageUrlsFromPageList(pageList)
|
||||||
.flatMap(source::getCachedImage, 3);
|
.flatMap(source::getCachedImage, 2);
|
||||||
} else {
|
} else {
|
||||||
File chapterDir = downloadManager.getAbsoluteChapterDirectory(source, manga, chapter);
|
File chapterDir = downloadManager.getAbsoluteChapterDirectory(source, manga, chapter);
|
||||||
pageObservable = Observable.from(pageList)
|
pageObservable = Observable.from(pageList)
|
||||||
.flatMap(page -> downloadManager.getDownloadedImage(page, chapterDir));
|
.flatMap(page -> downloadManager.getDownloadedImage(page, chapterDir));
|
||||||
}
|
}
|
||||||
return pageObservable
|
return Observable.defer(() -> pageObservable)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
|
.onBackpressureBuffer()
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,8 +7,6 @@
|
|||||||
<item name="alertDialogTheme">@style/AlertDialogStyle</item>
|
<item name="alertDialogTheme">@style/AlertDialogStyle</item>
|
||||||
<item name="android:itemTextAppearance">@style/OptionsMenuTextColor</item>
|
<item name="android:itemTextAppearance">@style/OptionsMenuTextColor</item>
|
||||||
<item name="android:textColor">@color/primary_text</item>
|
<item name="android:textColor">@color/primary_text</item>
|
||||||
<item name="android:textColorPrimary">@color/primary_text</item>
|
|
||||||
<item name="colorControlNormal">@color/white</item>
|
|
||||||
<item name="android:windowActionModeOverlay">true</item>
|
<item name="android:windowActionModeOverlay">true</item>
|
||||||
<item name="windowActionModeOverlay">true</item>
|
<item name="windowActionModeOverlay">true</item>
|
||||||
</style>
|
</style>
|
||||||
@ -19,6 +17,7 @@
|
|||||||
<item name="android:spinnerItemStyle">@style/ActionBarSpinner</item>
|
<item name="android:spinnerItemStyle">@style/ActionBarSpinner</item>
|
||||||
<item name="android:actionModeBackground">@color/colorPrimarySuperDark</item>
|
<item name="android:actionModeBackground">@color/colorPrimarySuperDark</item>
|
||||||
<item name="actionModeBackground">@color/colorPrimarySuperDark</item>
|
<item name="actionModeBackground">@color/colorPrimarySuperDark</item>
|
||||||
|
<item name="colorControlNormal">@color/white</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="AppTheme.Overlay.Dark" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
|
<style name="AppTheme.Overlay.Dark" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
|
||||||
|
Loading…
Reference in New Issue
Block a user