Skip to content

Commit

Permalink
Place set adapter to recycler in better place
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasBourdin88 committed May 14, 2024
1 parent 39b244d commit bf27c90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,7 @@ class SearchFragment : TwoPaneFragment() {
},
)

binding.mailRecyclerView.adapter = threadListAdapter.apply {
stateRestorationPolicy = StateRestorationPolicy.PREVENT_WHEN_EMPTY
}
threadListAdapter.stateRestorationPolicy = StateRestorationPolicy.PREVENT_WHEN_EMPTY
}

private fun setupListeners() = with(binding) {
Expand Down Expand Up @@ -265,6 +263,8 @@ class SearchFragment : TwoPaneFragment() {

private fun setMessagesUi() {
binding.mailRecyclerView.apply {
adapter = threadListAdapter

disableDragDirection(DirectionFlag.UP)
disableDragDirection(DirectionFlag.DOWN)
disableDragDirection(DirectionFlag.LEFT)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/infomaniak/mail/views/AvatarView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class AvatarView @JvmOverloads constructor(
initialsColor = context.getColor(R.color.onColorfulBackground),
)
}

// test
fun loadAvatar(correspondent: Correspondent?) {
if (correspondent == null) {
loadUnknownUserAvatar()
Expand Down

0 comments on commit bf27c90

Please sign in to comment.