mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-31 03:17:13 +01:00
Code review fixes.
This commit is contained in:
parent
b8ca520552
commit
cbe07c4aee
@ -504,7 +504,7 @@ class DefaultNavigator @Inject constructor(
|
|||||||
override fun openCreatePoll(context: Context, roomId: String) {
|
override fun openCreatePoll(context: Context, roomId: String) {
|
||||||
val intent = CreatePollActivity.getIntent(
|
val intent = CreatePollActivity.getIntent(
|
||||||
context,
|
context,
|
||||||
CreatePollArgs(roomId = roomId, minOptionsCount = CreatePollViewModel.MIN_OPTIONS_COUNT)
|
CreatePollArgs(roomId = roomId)
|
||||||
)
|
)
|
||||||
context.startActivity(intent)
|
context.startActivity(intent)
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,6 @@ import javax.inject.Inject
|
|||||||
@Parcelize
|
@Parcelize
|
||||||
data class CreatePollArgs(
|
data class CreatePollArgs(
|
||||||
val roomId: String,
|
val roomId: String,
|
||||||
val minOptionsCount: Int
|
|
||||||
) : Parcelable
|
) : Parcelable
|
||||||
|
|
||||||
class CreatePollFragment @Inject constructor(
|
class CreatePollFragment @Inject constructor(
|
||||||
|
@ -21,14 +21,13 @@ import com.airbnb.mvrx.MavericksState
|
|||||||
data class CreatePollViewState(
|
data class CreatePollViewState(
|
||||||
val roomId: String,
|
val roomId: String,
|
||||||
val question: String = "",
|
val question: String = "",
|
||||||
val options: List<String> = emptyList(),
|
val options: List<String> = List(CreatePollViewModel.MIN_OPTIONS_COUNT) { "" },
|
||||||
val canCreatePoll: Boolean = false,
|
val canCreatePoll: Boolean = false,
|
||||||
val canAddMoreOptions: Boolean = true
|
val canAddMoreOptions: Boolean = true
|
||||||
) : MavericksState {
|
) : MavericksState {
|
||||||
|
|
||||||
constructor(args: CreatePollArgs) : this(
|
constructor(args: CreatePollArgs) : this(
|
||||||
roomId = args.roomId,
|
roomId = args.roomId
|
||||||
options = List(args.minOptionsCount) { "" }
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user