Skip to content

Commit

Permalink
fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Santosh Pingle committed Feb 12, 2025
1 parent 2b3e439 commit 28b2fdd
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ class QuestionnaireFragment : Fragment() {
}

questionnaireEditRecyclerView.adapter = questionnaireEditAdapter
val linearLayoutManager = LinearLayoutManager(view.context)
questionnaireEditRecyclerView.layoutManager = getLayoutManager()
val linearLayoutManager = getLayoutManager()
questionnaireEditRecyclerView.layoutManager = linearLayoutManager
// Animation does work well with views that could gain focus
questionnaireEditRecyclerView.itemAnimator = null

Expand Down Expand Up @@ -594,8 +594,11 @@ class QuestionnaireFragment : Fragment() {
}

private fun getLayoutManager(): LinearLayoutManager {
return viewModel.columnCount?.let { GridLayoutManager(this.context, it) }
?: LinearLayoutManager(this.context)
return if (viewModel.columnCount != null) {
GridLayoutManager(context, viewModel.columnCount!!)
} else {
LinearLayoutManager(context)
}
}

internal fun QuestionnaireState.filterEmptyTextItems() =
Expand Down

0 comments on commit 28b2fdd

Please sign in to comment.