TextComposer: Add more preview content.
This commit is contained in:
parent
87dba718be
commit
4b7ffb141e
1 changed files with 28 additions and 30 deletions
|
|
@ -494,19 +494,29 @@ private fun TextInput(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun aTextEditorStateMarkdownList() = persistentListOf(
|
||||||
|
aTextEditorStateMarkdown(initialText = "", initialFocus = true),
|
||||||
|
aTextEditorStateMarkdown(initialText = "A message", initialFocus = true),
|
||||||
|
aTextEditorStateMarkdown(
|
||||||
|
initialText = "A message\nWith several lines\nTo preview larger textfields and long lines with overflow",
|
||||||
|
initialFocus = true,
|
||||||
|
),
|
||||||
|
aTextEditorStateMarkdown(initialText = "A message without focus", initialFocus = false),
|
||||||
|
)
|
||||||
|
|
||||||
|
private fun aTextEditorStateRichList() = persistentListOf(
|
||||||
|
aTextEditorStateRich(),
|
||||||
|
aTextEditorStateRich(initialText = "A message"),
|
||||||
|
aTextEditorStateRich(
|
||||||
|
initialText = "A message\nWith several lines\nTo preview larger textfields and long lines with overflow",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
@PreviewsDayNight
|
@PreviewsDayNight
|
||||||
@Composable
|
@Composable
|
||||||
internal fun TextComposerSimplePreview() = ElementPreview {
|
internal fun TextComposerSimplePreview() = ElementPreview {
|
||||||
PreviewColumn(
|
PreviewColumn(
|
||||||
items = persistentListOf(
|
items = aTextEditorStateMarkdownList()
|
||||||
aTextEditorStateMarkdown(initialText = "", initialFocus = true),
|
|
||||||
aTextEditorStateMarkdown(initialText = "A message", initialFocus = true),
|
|
||||||
aTextEditorStateMarkdown(
|
|
||||||
initialText = "A message\nWith several lines\nTo preview larger textfields and long lines with overflow",
|
|
||||||
initialFocus = true,
|
|
||||||
),
|
|
||||||
aTextEditorStateMarkdown(initialText = "A message without focus", initialFocus = false),
|
|
||||||
)
|
|
||||||
) { textEditorState ->
|
) { textEditorState ->
|
||||||
ATextComposer(
|
ATextComposer(
|
||||||
state = textEditorState,
|
state = textEditorState,
|
||||||
|
|
@ -521,13 +531,7 @@ internal fun TextComposerSimplePreview() = ElementPreview {
|
||||||
@Composable
|
@Composable
|
||||||
internal fun TextComposerFormattingPreview() = ElementPreview {
|
internal fun TextComposerFormattingPreview() = ElementPreview {
|
||||||
PreviewColumn(
|
PreviewColumn(
|
||||||
items = persistentListOf(
|
items = aTextEditorStateRichList()
|
||||||
aTextEditorStateRich(),
|
|
||||||
aTextEditorStateRich(initialText = "A message"),
|
|
||||||
aTextEditorStateRich(
|
|
||||||
initialText = "A message\nWith several lines\nTo preview larger textfields and long lines with overflow",
|
|
||||||
),
|
|
||||||
)
|
|
||||||
) { textEditorState ->
|
) { textEditorState ->
|
||||||
ATextComposer(
|
ATextComposer(
|
||||||
state = textEditorState,
|
state = textEditorState,
|
||||||
|
|
@ -543,9 +547,7 @@ internal fun TextComposerFormattingPreview() = ElementPreview {
|
||||||
@Composable
|
@Composable
|
||||||
internal fun TextComposerEditPreview() = ElementPreview {
|
internal fun TextComposerEditPreview() = ElementPreview {
|
||||||
PreviewColumn(
|
PreviewColumn(
|
||||||
items = persistentListOf(
|
items = aTextEditorStateRichList()
|
||||||
aTextEditorStateRich(initialText = "A message", initialFocus = true),
|
|
||||||
)
|
|
||||||
) { textEditorState ->
|
) { textEditorState ->
|
||||||
ATextComposer(
|
ATextComposer(
|
||||||
state = textEditorState,
|
state = textEditorState,
|
||||||
|
|
@ -560,9 +562,7 @@ internal fun TextComposerEditPreview() = ElementPreview {
|
||||||
@Composable
|
@Composable
|
||||||
internal fun MarkdownTextComposerEditPreview() = ElementPreview {
|
internal fun MarkdownTextComposerEditPreview() = ElementPreview {
|
||||||
PreviewColumn(
|
PreviewColumn(
|
||||||
items = persistentListOf(
|
items = aTextEditorStateMarkdownList()
|
||||||
aTextEditorStateMarkdown(initialText = "A message", initialFocus = true),
|
|
||||||
)
|
|
||||||
) { textEditorState ->
|
) { textEditorState ->
|
||||||
ATextComposer(
|
ATextComposer(
|
||||||
state = textEditorState,
|
state = textEditorState,
|
||||||
|
|
@ -577,16 +577,14 @@ internal fun MarkdownTextComposerEditPreview() = ElementPreview {
|
||||||
@Composable
|
@Composable
|
||||||
internal fun TextComposerReplyPreview(@PreviewParameter(InReplyToDetailsProvider::class) inReplyToDetails: InReplyToDetails) = ElementPreview {
|
internal fun TextComposerReplyPreview(@PreviewParameter(InReplyToDetailsProvider::class) inReplyToDetails: InReplyToDetails) = ElementPreview {
|
||||||
PreviewColumn(
|
PreviewColumn(
|
||||||
items = persistentListOf(
|
items = aTextEditorStateRichList()
|
||||||
aMessageComposerModeReply(
|
) { textEditorState ->
|
||||||
|
ATextComposer(
|
||||||
|
state = textEditorState,
|
||||||
|
voiceMessageState = VoiceMessageState.Idle,
|
||||||
|
composerMode = aMessageComposerModeReply(
|
||||||
replyToDetails = inReplyToDetails,
|
replyToDetails = inReplyToDetails,
|
||||||
),
|
),
|
||||||
)
|
|
||||||
) { composerMode ->
|
|
||||||
ATextComposer(
|
|
||||||
state = aTextEditorStateRich(),
|
|
||||||
voiceMessageState = VoiceMessageState.Idle,
|
|
||||||
composerMode = composerMode,
|
|
||||||
enableVoiceMessages = true,
|
enableVoiceMessages = true,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue