@@ -11,7 +11,7 @@ object StepQuizHintsFeature {
11
11
step.commentsStatistics.any { it.thread == CommentThread .HINT && it.totalCount > 0 }
12
12
13
13
sealed interface State {
14
- object Idle : State
14
+ data object Idle : State
15
15
16
16
/* *
17
17
* @property isInitialLoading true in case of initial data loading, false in case of certain hint loading
@@ -52,11 +52,11 @@ object StepQuizHintsFeature {
52
52
}
53
53
54
54
sealed interface ViewState {
55
- object Idle : ViewState
55
+ data object Idle : ViewState
56
56
57
- object InitialLoading : ViewState
57
+ data object InitialLoading : ViewState
58
58
59
- object HintLoading : ViewState
59
+ data object HintLoading : ViewState
60
60
61
61
sealed interface Content : ViewState {
62
62
object SeeHintButton : Content
@@ -68,7 +68,7 @@ object StepQuizHintsFeature {
68
68
) : Content
69
69
}
70
70
71
- object Error : ViewState
71
+ data object Error : ViewState
72
72
73
73
enum class HintState {
74
74
REACT_TO_HINT ,
@@ -110,32 +110,32 @@ object StepQuizHintsFeature {
110
110
/* *
111
111
* Indicates that react hint succeed
112
112
*/
113
- object ReactHintSuccess : Message
113
+ data object ReactHintSuccess : Message
114
114
115
115
/* *
116
116
* Indicates that react hint failed
117
117
*/
118
- object ReactHintFailure : Message
118
+ data object ReactHintFailure : Message
119
119
120
120
/* *
121
121
* Creates report for current hint, assumes that user confirmed that action
122
122
*/
123
- object ReportHint : Message
123
+ data object ReportHint : Message
124
124
125
125
/* *
126
126
* Indicates that report hint succeed
127
127
*/
128
- object ReportHintSuccess : Message
128
+ data object ReportHintSuccess : Message
129
129
130
130
/* *
131
131
* Indicates that report hint failed
132
132
*/
133
- object ReportHintFailure : Message
133
+ data object ReportHintFailure : Message
134
134
135
135
/* *
136
136
* Initiate loading next hint
137
137
*/
138
- object LoadHintButtonClicked : Message
138
+ data object LoadHintButtonClicked : Message
139
139
140
140
/* *
141
141
* Message to fill state with ready data
@@ -170,8 +170,8 @@ object StepQuizHintsFeature {
170
170
/* *
171
171
* Analytic
172
172
*/
173
- object ClickedReportEventMessage : Message
174
- object ReportHintNoticeShownEventMessage : Message
173
+ data object ClickedReportEventMessage : Message
174
+ data object ReportHintNoticeShownEventMessage : Message
175
175
data class ReportHintNoticeHiddenEventMessage (val isReported : Boolean ) : Message
176
176
}
177
177
@@ -183,13 +183,22 @@ object StepQuizHintsFeature {
183
183
}
184
184
185
185
sealed interface Action {
186
+ sealed interface ViewAction : Action {
187
+ /* *
188
+ * Shows snackbar with error message
189
+ */
190
+ data object ShowNetworkError : ViewAction
191
+ }
192
+ }
193
+
194
+ internal sealed interface InternalAction : Action {
186
195
/* *
187
196
* Reporting hint action
188
197
*
189
198
* @property hintId hint ID to be reported
190
199
* @property stepId is used to create user storage record
191
200
*/
192
- data class ReportHint (val hintId : Long , val stepId : Long ) : Action
201
+ data class ReportHint (val hintId : Long , val stepId : Long ) : InternalAction
193
202
194
203
/* *
195
204
* Creating reaction for hint
@@ -198,14 +207,14 @@ object StepQuizHintsFeature {
198
207
* @property stepId is used to create user storage record
199
208
* @property reaction reaction from user
200
209
*/
201
- data class ReactHint (val hintId : Long , val stepId : Long , val reaction : ReactionType ) : Action
210
+ data class ReactHint (val hintId : Long , val stepId : Long , val reaction : ReactionType ) : InternalAction
202
211
203
212
/* *
204
213
* Loading all hints IDs for given step
205
214
*
206
215
* @property stepId step ID to load hints for it
207
216
*/
208
- data class FetchHintsIds (val stepId : Long ) : Action
217
+ data class FetchHintsIds (val stepId : Long ) : InternalAction
209
218
210
219
/* *
211
220
* Loading next hint action
@@ -220,20 +229,13 @@ object StepQuizHintsFeature {
220
229
val remainingHintsIds : List <Long >,
221
230
val areHintsLimited : Boolean ,
222
231
val stepId : Long
223
- ) : Action
232
+ ) : InternalAction
224
233
225
234
/* *
226
235
* Logging analytic event action
227
236
*
228
237
* @property analyticEvent event to be logged
229
238
*/
230
- data class LogAnalyticEvent (val analyticEvent : AnalyticEvent ) : Action
231
-
232
- sealed interface ViewAction : Action {
233
- /* *
234
- * Shows snackbar with error message
235
- */
236
- object ShowNetworkError : ViewAction
237
- }
239
+ data class LogAnalyticEvent (val analyticEvent : AnalyticEvent ) : InternalAction
238
240
}
239
241
}
0 commit comments