mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-30 19:04:54 +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) {
|
||||
val intent = CreatePollActivity.getIntent(
|
||||
context,
|
||||
CreatePollArgs(roomId = roomId, minOptionsCount = CreatePollViewModel.MIN_OPTIONS_COUNT)
|
||||
CreatePollArgs(roomId = roomId)
|
||||
)
|
||||
context.startActivity(intent)
|
||||
}
|
||||
|
@ -34,7 +34,6 @@ import javax.inject.Inject
|
||||
@Parcelize
|
||||
data class CreatePollArgs(
|
||||
val roomId: String,
|
||||
val minOptionsCount: Int
|
||||
) : Parcelable
|
||||
|
||||
class CreatePollFragment @Inject constructor(
|
||||
|
@ -21,14 +21,13 @@ import com.airbnb.mvrx.MavericksState
|
||||
data class CreatePollViewState(
|
||||
val roomId: String,
|
||||
val question: String = "",
|
||||
val options: List<String> = emptyList(),
|
||||
val options: List<String> = List(CreatePollViewModel.MIN_OPTIONS_COUNT) { "" },
|
||||
val canCreatePoll: Boolean = false,
|
||||
val canAddMoreOptions: Boolean = true
|
||||
) : MavericksState {
|
||||
|
||||
constructor(args: CreatePollArgs) : this(
|
||||
roomId = args.roomId,
|
||||
options = List(args.minOptionsCount) { "" }
|
||||
roomId = args.roomId
|
||||
)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user