Rename SavedState to SavedValue to avoid this class to be checked for stability.

This commit is contained in:
Benoit Marty 2025-10-09 17:49:49 +02:00 committed by Benoit Marty
parent 403a58d7a7
commit 5e7437e827

View file

@ -128,15 +128,15 @@ class MarkdownTextEditorState(
} }
@Parcelize @Parcelize
data class SavedState( data class SavedValue(
val text: CharSequence, val text: CharSequence,
val selectionStart: Int, val selectionStart: Int,
val selectionEnd: Int, val selectionEnd: Int,
) : Parcelable ) : Parcelable
} }
object MarkdownTextEditorStateSaver : Saver<MarkdownTextEditorState, MarkdownTextEditorState.SavedState> { object MarkdownTextEditorStateSaver : Saver<MarkdownTextEditorState, MarkdownTextEditorState.SavedValue> {
override fun restore(value: MarkdownTextEditorState.SavedState): MarkdownTextEditorState { override fun restore(value: MarkdownTextEditorState.SavedValue): MarkdownTextEditorState {
return MarkdownTextEditorState( return MarkdownTextEditorState(
initialText = "", initialText = "",
initialFocus = false, initialFocus = false,
@ -146,8 +146,8 @@ object MarkdownTextEditorStateSaver : Saver<MarkdownTextEditorState, MarkdownTex
} }
} }
override fun SaverScope.save(value: MarkdownTextEditorState): MarkdownTextEditorState.SavedState { override fun SaverScope.save(value: MarkdownTextEditorState): MarkdownTextEditorState.SavedValue {
return MarkdownTextEditorState.SavedState( return MarkdownTextEditorState.SavedValue(
text = value.text.value(), text = value.text.value(),
selectionStart = value.selection.first, selectionStart = value.selection.first,
selectionEnd = value.selection.last, selectionEnd = value.selection.last,