mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-11 13:00:49 +01:00
Fix last commit
This commit is contained in:
parent
6b326cfb79
commit
b8bc3476f4
4 changed files with 5 additions and 9 deletions
|
@ -2,6 +2,5 @@ package eu.kanade.tachiyomi.event
|
||||||
|
|
||||||
import eu.kanade.tachiyomi.data.database.models.Chapter
|
import eu.kanade.tachiyomi.data.database.models.Chapter
|
||||||
import eu.kanade.tachiyomi.data.database.models.Manga
|
import eu.kanade.tachiyomi.data.database.models.Manga
|
||||||
import eu.kanade.tachiyomi.data.source.base.Source
|
|
||||||
|
|
||||||
class ReaderEvent(val source: Source, val manga: Manga, val chapter: Chapter)
|
class ReaderEvent(val manga: Manga, val chapter: Chapter)
|
||||||
|
|
|
@ -179,7 +179,7 @@ class ChaptersPresenter : BasePresenter<ChaptersFragment>() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun onOpenChapter(chapter: Chapter) {
|
fun onOpenChapter(chapter: Chapter) {
|
||||||
EventBus.getDefault().postSticky(ReaderEvent(source, manga, chapter))
|
EventBus.getDefault().postSticky(ReaderEvent(manga, chapter))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getNextUnreadChapter(): Chapter? {
|
fun getNextUnreadChapter(): Chapter? {
|
||||||
|
|
|
@ -48,7 +48,6 @@ public class ReaderPresenter extends BasePresenter<ReaderActivity> {
|
||||||
|
|
||||||
@State Manga manga;
|
@State Manga manga;
|
||||||
@State Chapter activeChapter;
|
@State Chapter activeChapter;
|
||||||
@State int sourceId;
|
|
||||||
@State int requestedPage;
|
@State int requestedPage;
|
||||||
private Page currentPage;
|
private Page currentPage;
|
||||||
private Source source;
|
private Source source;
|
||||||
|
@ -72,7 +71,7 @@ public class ReaderPresenter extends BasePresenter<ReaderActivity> {
|
||||||
super.onCreate(savedState);
|
super.onCreate(savedState);
|
||||||
|
|
||||||
if (savedState != null) {
|
if (savedState != null) {
|
||||||
source = sourceManager.get(sourceId);
|
source = sourceManager.get(manga.source);
|
||||||
initializeSubjects();
|
initializeSubjects();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,8 +113,7 @@ public class ReaderPresenter extends BasePresenter<ReaderActivity> {
|
||||||
public void onEvent(ReaderEvent event) {
|
public void onEvent(ReaderEvent event) {
|
||||||
EventBus.getDefault().removeStickyEvent(event);
|
EventBus.getDefault().removeStickyEvent(event);
|
||||||
manga = event.getManga();
|
manga = event.getManga();
|
||||||
source = event.getSource();
|
source = sourceManager.get(manga.source);
|
||||||
sourceId = source.getId();
|
|
||||||
initializeSubjects();
|
initializeSubjects();
|
||||||
loadChapter(event.getChapter());
|
loadChapter(event.getChapter());
|
||||||
if (prefs.autoUpdateMangaSync()) {
|
if (prefs.autoUpdateMangaSync()) {
|
||||||
|
|
|
@ -250,8 +250,7 @@ class RecentChaptersPresenter : BasePresenter<RecentChaptersFragment>() {
|
||||||
* @param item chapter that is opened
|
* @param item chapter that is opened
|
||||||
*/
|
*/
|
||||||
fun onOpenChapter(item: MangaChapter) {
|
fun onOpenChapter(item: MangaChapter) {
|
||||||
val source = sourceManager.get(item.manga.source)
|
EventBus.getDefault().postSticky(ReaderEvent(item.manga, item.chapter))
|
||||||
EventBus.getDefault().postSticky(ReaderEvent(source, item.manga, item.chapter))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue