Skip to content

Commit

Permalink
Merge pull request #4893 from vector-im/feature/ons/fix_create_poll_r…
Browse files Browse the repository at this point in the history
…ecyclerview

Workaround to not to reuse poll option cells
  • Loading branch information
bmarty authored Jan 11, 2022
2 parents dded566 + 5feafbd commit 0080348
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/4735.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Polls: unable to create a poll with more than 10 answers
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import im.vector.app.R
import im.vector.app.core.extensions.configureWith
import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentCreatePollBinding
import im.vector.app.features.poll.create.CreatePollViewModel.Companion.MAX_OPTIONS_COUNT
import kotlinx.parcelize.Parcelize
import javax.inject.Inject

Expand All @@ -51,6 +52,7 @@ class CreatePollFragment @Inject constructor(
vectorBaseActivity.setSupportActionBar(views.createPollToolbar)

views.createPollRecyclerView.configureWith(controller, disableItemAnimation = true)
views.createPollRecyclerView.setItemViewCacheSize(MAX_OPTIONS_COUNT + 4)
controller.callback = this

views.createPollClose.debouncedClicks {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CreatePollViewModel @AssistedInject constructor(
companion object : MavericksViewModelFactory<CreatePollViewModel, CreatePollViewState> by hiltMavericksViewModelFactory() {

const val MIN_OPTIONS_COUNT = 2
private const val MAX_OPTIONS_COUNT = 20
const val MAX_OPTIONS_COUNT = 20
}

init {
Expand Down

0 comments on commit 0080348

Please sign in to comment.