mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
Rename SavedState to SavedValue to avoid this class to be checked for stability.
This commit is contained in:
committed by
Benoit Marty
parent
c2b2e00107
commit
19238acf5d
+5
-5
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user