mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-14 14:32:49 +01:00
Added fade transition between states
This commit is contained in:
parent
e861b97bac
commit
5a42eb0d5f
@ -68,7 +68,7 @@ fun MangaNotesScreen(
|
|||||||
text = {
|
text = {
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(
|
text = stringResource(
|
||||||
if (state.editing) MR.strings.action_apply else MR.strings.action_edit
|
if (state.editing) MR.strings.action_apply else MR.strings.action_edit,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
@ -85,7 +85,11 @@ fun MangaNotesScreen(
|
|||||||
},
|
},
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
) { paddingValues ->
|
) { paddingValues ->
|
||||||
if (state.editing) {
|
AnimatedVisibility(
|
||||||
|
state.editing,
|
||||||
|
enter = fadeIn(),
|
||||||
|
exit = fadeOut(),
|
||||||
|
) {
|
||||||
MangaNotesTextArea(
|
MangaNotesTextArea(
|
||||||
state = state,
|
state = state,
|
||||||
onSave = onSave,
|
onSave = onSave,
|
||||||
@ -100,18 +104,24 @@ fun MangaNotesScreen(
|
|||||||
.only(WindowInsetsSides.Bottom),
|
.only(WindowInsetsSides.Bottom),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
return@Scaffold
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.notes.isNullOrBlank()) {
|
AnimatedVisibility(
|
||||||
|
!state.editing && state.notes.isNullOrBlank(),
|
||||||
|
enter = fadeIn(),
|
||||||
|
exit = fadeOut(),
|
||||||
|
) {
|
||||||
EmptyScreen(
|
EmptyScreen(
|
||||||
stringRes = MR.strings.information_no_notes,
|
stringRes = MR.strings.information_no_notes,
|
||||||
modifier = Modifier.padding(paddingValues),
|
modifier = Modifier.padding(paddingValues),
|
||||||
)
|
)
|
||||||
return@Scaffold
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AnimatedVisibility(
|
||||||
|
!state.editing && !state.notes.isNullOrBlank(),
|
||||||
|
enter = fadeIn(),
|
||||||
|
exit = fadeOut(),
|
||||||
|
) {
|
||||||
RichText(
|
RichText(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.verticalScroll(rememberScrollState())
|
.verticalScroll(rememberScrollState())
|
||||||
@ -126,9 +136,8 @@ fun MangaNotesScreen(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
) {
|
) {
|
||||||
Markdown(content = state.notes)
|
Markdown(content = state.notes.orEmpty())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return@Scaffold
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user