mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-06 10:47:25 +01:00
Make the edit notes button edit directly
This commit is contained in:
parent
23be98b6d4
commit
e861b97bac
@ -114,6 +114,7 @@ fun MangaScreen(
|
||||
onEditFetchIntervalClicked: (() -> Unit)?,
|
||||
onMigrateClicked: (() -> Unit)?,
|
||||
onNotesClicked: () -> Unit,
|
||||
onNotesEditClicked: () -> Unit,
|
||||
|
||||
// For bottom action menu
|
||||
onMultiBookmarkClicked: (List<Chapter>, bookmarked: Boolean) -> Unit,
|
||||
@ -163,6 +164,7 @@ fun MangaScreen(
|
||||
onEditIntervalClicked = onEditFetchIntervalClicked,
|
||||
onMigrateClicked = onMigrateClicked,
|
||||
onNotesClicked = onNotesClicked,
|
||||
onNotesEditClicked = onNotesEditClicked,
|
||||
onMultiBookmarkClicked = onMultiBookmarkClicked,
|
||||
onMultiMarkAsReadClicked = onMultiMarkAsReadClicked,
|
||||
onMarkPreviousAsReadClicked = onMarkPreviousAsReadClicked,
|
||||
@ -199,6 +201,7 @@ fun MangaScreen(
|
||||
onEditIntervalClicked = onEditFetchIntervalClicked,
|
||||
onMigrateClicked = onMigrateClicked,
|
||||
onNotesClicked = onNotesClicked,
|
||||
onNotesEditClicked = onNotesEditClicked,
|
||||
onMultiBookmarkClicked = onMultiBookmarkClicked,
|
||||
onMultiMarkAsReadClicked = onMultiMarkAsReadClicked,
|
||||
onMarkPreviousAsReadClicked = onMarkPreviousAsReadClicked,
|
||||
@ -245,6 +248,7 @@ private fun MangaScreenSmallImpl(
|
||||
onEditIntervalClicked: (() -> Unit)?,
|
||||
onMigrateClicked: (() -> Unit)?,
|
||||
onNotesClicked: () -> Unit,
|
||||
onNotesEditClicked: () -> Unit,
|
||||
|
||||
// For bottom action menu
|
||||
onMultiBookmarkClicked: (List<Chapter>, bookmarked: Boolean) -> Unit,
|
||||
@ -430,7 +434,7 @@ private fun MangaScreenSmallImpl(
|
||||
contentType = MangaScreenItem.NOTES_SECTION,
|
||||
) {
|
||||
MangaNotesSection(
|
||||
onClickNotes = onNotesClicked,
|
||||
onClickNotes = onNotesEditClicked,
|
||||
content = state.manga.notes,
|
||||
)
|
||||
}
|
||||
@ -501,6 +505,7 @@ fun MangaScreenLargeImpl(
|
||||
onEditIntervalClicked: (() -> Unit)?,
|
||||
onMigrateClicked: (() -> Unit)?,
|
||||
onNotesClicked: () -> Unit,
|
||||
onNotesEditClicked: () -> Unit,
|
||||
|
||||
// For bottom action menu
|
||||
onMultiBookmarkClicked: (List<Chapter>, bookmarked: Boolean) -> Unit,
|
||||
@ -662,7 +667,7 @@ fun MangaScreenLargeImpl(
|
||||
onCopyTagToClipboard = onCopyTagToClipboard,
|
||||
)
|
||||
MangaNotesSection(
|
||||
onClickNotes = onNotesClicked,
|
||||
onClickNotes = onNotesEditClicked,
|
||||
content = state.manga.notes,
|
||||
)
|
||||
}
|
||||
|
@ -165,7 +165,8 @@ class MangaScreen(
|
||||
onMigrateClicked = {
|
||||
navigator.push(MigrateSearchScreen(successState.manga.id))
|
||||
}.takeIf { successState.manga.favorite },
|
||||
onNotesClicked = { navigator.push(MangaNotesScreen(successState.manga)) },
|
||||
onNotesClicked = { navigator.push(MangaNotesScreen(manga = successState.manga)) },
|
||||
onNotesEditClicked = { navigator.push(MangaNotesScreen(manga = successState.manga, editing = true)) },
|
||||
onMultiBookmarkClicked = screenModel::bookmarkChapters,
|
||||
onMultiMarkAsReadClicked = screenModel::markChaptersRead,
|
||||
onMarkPreviousAsReadClicked = screenModel::markPreviousChapterRead,
|
||||
|
@ -12,12 +12,20 @@ import eu.kanade.presentation.util.Screen
|
||||
import tachiyomi.domain.manga.model.Manga
|
||||
import tachiyomi.presentation.core.screens.LoadingScreen
|
||||
|
||||
class MangaNotesScreen(private val manga: Manga) : Screen() {
|
||||
class MangaNotesScreen(
|
||||
private val manga: Manga,
|
||||
private val editing: Boolean = false,
|
||||
) : Screen() {
|
||||
@Composable
|
||||
override fun Content() {
|
||||
val navigator = LocalNavigator.currentOrThrow
|
||||
|
||||
val screenModel = rememberScreenModel { MangaNotesScreenModel(manga = manga) }
|
||||
val screenModel = rememberScreenModel {
|
||||
MangaNotesScreenModel(
|
||||
manga = manga,
|
||||
editing = editing,
|
||||
)
|
||||
}
|
||||
val state by screenModel.state.collectAsState()
|
||||
|
||||
if (state is MangaNotesScreenState.Loading) {
|
||||
|
@ -12,6 +12,7 @@ import uy.kohesive.injekt.api.get
|
||||
|
||||
class MangaNotesScreenModel(
|
||||
val manga: Manga,
|
||||
editing: Boolean,
|
||||
private val setMangaNotes: SetMangaNotes = Injekt.get(),
|
||||
) : StateScreenModel<MangaNotesScreenState>(MangaNotesScreenState.Loading) {
|
||||
|
||||
@ -23,6 +24,7 @@ class MangaNotesScreenModel(
|
||||
MangaNotesScreenState.Success(
|
||||
manga = manga,
|
||||
notes = manga.notes,
|
||||
editing = editing,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user