-
- All Implemented Interfaces:
-
io.getstream.chat.android.ui.common.feature.messages.composer.internal.ComposerStateSaver
public final class SavedStateComposerStateSaver implements ComposerStateSaver
ComposerStateSaver implementation backed by SavedStateHandle.
Attachments are only saved when all extra data values are parcel-safe; otherwise saving is skipped entirely to avoid crashes during android.app.Activity.onSaveInstanceState.
-
-
Constructor Summary
Constructors Constructor Description SavedStateComposerStateSaver(SavedStateHandle savedStateHandle)
-
Method Summary
Modifier and Type Method Description UnitsaveAttachments(List<Attachment> attachments)Save the attachments from the composer. List<Attachment>restoreAttachments()Restores the attachments to the composer. Unitclear()Clears the stored state. -
-
Constructor Detail
-
SavedStateComposerStateSaver
SavedStateComposerStateSaver(SavedStateHandle savedStateHandle)
-
-
Method Detail
-
saveAttachments
Unit saveAttachments(List<Attachment> attachments)
Save the attachments from the composer.
Implementations should be cheap to call frequently — this is invoked on every change to the attachment list.
-
restoreAttachments
List<Attachment> restoreAttachments()
Restores the attachments to the composer.
-
-
-
-