mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-26 03:16:02 +03:00
When sharing to a room save a draft to pre-fill the composer
This commit is contained in:
parent
8d1b2b35fd
commit
7b3fcb7798
2 changed files with 5 additions and 4 deletions
|
@ -303,13 +303,14 @@ class RoomDetailFragment @Inject constructor(
|
|||
if (savedInstanceState == null) {
|
||||
when (val sharedData = roomDetailArgs.sharedData) {
|
||||
is SharedData.Text -> {
|
||||
roomDetailViewModel.handle(RoomDetailAction.ExitSpecialMode(composerLayout.text.toString()))
|
||||
// Save a draft to set the shared text to the composer
|
||||
roomDetailViewModel.handle(RoomDetailAction.SaveDraft(sharedData.text))
|
||||
}
|
||||
is SharedData.Attachments -> {
|
||||
// open share edition
|
||||
onContentAttachmentsReady(sharedData.attachmentData)
|
||||
}
|
||||
null -> Timber.v("No share data to process")
|
||||
null -> Timber.v("No share data to process")
|
||||
}.exhaustive
|
||||
}
|
||||
}
|
||||
|
@ -435,7 +436,7 @@ class RoomDetailFragment @Inject constructor(
|
|||
composerLayout.collapse()
|
||||
|
||||
updateComposerText(text)
|
||||
composerLayout.sendButton.setContentDescription(getString(R.string.send))
|
||||
composerLayout.sendButton.contentDescription = getString(R.string.send)
|
||||
}
|
||||
|
||||
private fun renderSpecialMode(event: TimelineEvent,
|
||||
|
|
|
@ -243,7 +243,7 @@ class RoomDetailViewModel @AssistedInject constructor(@Assisted initialState: Ro
|
|||
is SendMode.REPLY -> room.saveDraft(UserDraft.REPLY(it.sendMode.timelineEvent.root.eventId!!, action.draft), NoOpMatrixCallback())
|
||||
is SendMode.QUOTE -> room.saveDraft(UserDraft.QUOTE(it.sendMode.timelineEvent.root.eventId!!, action.draft), NoOpMatrixCallback())
|
||||
is SendMode.EDIT -> room.saveDraft(UserDraft.EDIT(it.sendMode.timelineEvent.root.eventId!!, action.draft), NoOpMatrixCallback())
|
||||
}
|
||||
}.exhaustive
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue