Verification: migrate to Epoxy - Disable item animation
This commit is contained in:
parent
cd1665a8e8
commit
a8e81d95cf
@ -28,12 +28,17 @@ fun RecyclerView.configureWith(epoxyController: EpoxyController,
|
|||||||
itemAnimator: RecyclerView.ItemAnimator? = null,
|
itemAnimator: RecyclerView.ItemAnimator? = null,
|
||||||
viewPool: RecyclerView.RecycledViewPool? = null,
|
viewPool: RecyclerView.RecycledViewPool? = null,
|
||||||
showDivider: Boolean = false,
|
showDivider: Boolean = false,
|
||||||
hasFixedSize: Boolean = true) {
|
hasFixedSize: Boolean = true,
|
||||||
|
disableItemAnimation: Boolean = false) {
|
||||||
layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false).apply {
|
layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false).apply {
|
||||||
recycleChildrenOnDetach = viewPool != null
|
recycleChildrenOnDetach = viewPool != null
|
||||||
}
|
}
|
||||||
setRecycledViewPool(viewPool)
|
setRecycledViewPool(viewPool)
|
||||||
itemAnimator?.let { this.itemAnimator = it }
|
if (disableItemAnimation) {
|
||||||
|
this.itemAnimator = null
|
||||||
|
} else {
|
||||||
|
itemAnimator?.let { this.itemAnimator = it }
|
||||||
|
}
|
||||||
if (showDivider) {
|
if (showDivider) {
|
||||||
addItemDecoration(DividerItemDecoration(context, DividerItemDecoration.VERTICAL))
|
addItemDecoration(DividerItemDecoration(context, DividerItemDecoration.VERTICAL))
|
||||||
}
|
}
|
||||||
|
@ -98,10 +98,9 @@ class CreateDirectRoomKnownUsersFragment @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun setupRecyclerView() {
|
private fun setupRecyclerView() {
|
||||||
// Don't activate animation as we might have way to much item animation when filtering
|
|
||||||
recyclerView.itemAnimator = null
|
|
||||||
knownUsersController.callback = this
|
knownUsersController.callback = this
|
||||||
recyclerView.configureWith(knownUsersController)
|
// Don't activate animation as we might have way to much item animation when filtering
|
||||||
|
recyclerView.configureWith(knownUsersController, disableItemAnimation = true)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupFilterView() {
|
private fun setupFilterView() {
|
||||||
|
@ -60,7 +60,7 @@ class VerificationConclusionFragment @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun setupRecyclerView() {
|
private fun setupRecyclerView() {
|
||||||
bottomSheetVerificationRecyclerView.configureWith(controller, hasFixedSize = false)
|
bottomSheetVerificationRecyclerView.configureWith(controller, hasFixedSize = false, disableItemAnimation = true)
|
||||||
controller.listener = this
|
controller.listener = this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ class VerificationEmojiCodeFragment @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun setupRecyclerView() {
|
private fun setupRecyclerView() {
|
||||||
bottomSheetVerificationRecyclerView.configureWith(controller, hasFixedSize = false)
|
bottomSheetVerificationRecyclerView.configureWith(controller, hasFixedSize = false, disableItemAnimation = true)
|
||||||
controller.listener = this
|
controller.listener = this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ class VerificationRequestFragment @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun setupRecyclerView() {
|
private fun setupRecyclerView() {
|
||||||
bottomSheetVerificationRecyclerView.configureWith(controller, hasFixedSize = false)
|
bottomSheetVerificationRecyclerView.configureWith(controller, hasFixedSize = false, disableItemAnimation = true)
|
||||||
controller.listener = this
|
controller.listener = this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,9 +54,7 @@ class MessageActionsBottomSheet : VectorBaseBottomSheetDialogFragment(), Message
|
|||||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||||
super.onActivityCreated(savedInstanceState)
|
super.onActivityCreated(savedInstanceState)
|
||||||
sharedActionViewModel = activityViewModelProvider.get(MessageSharedActionViewModel::class.java)
|
sharedActionViewModel = activityViewModelProvider.get(MessageSharedActionViewModel::class.java)
|
||||||
recyclerView.configureWith(messageActionsEpoxyController, hasFixedSize = false)
|
recyclerView.configureWith(messageActionsEpoxyController, hasFixedSize = false, disableItemAnimation = true)
|
||||||
// Disable item animation
|
|
||||||
recyclerView.itemAnimator = null
|
|
||||||
messageActionsEpoxyController.listener = this
|
messageActionsEpoxyController.listener = this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,9 +70,7 @@ class RoomListQuickActionsBottomSheet : VectorBaseBottomSheetDialogFragment(), R
|
|||||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||||
super.onActivityCreated(savedInstanceState)
|
super.onActivityCreated(savedInstanceState)
|
||||||
sharedActionViewModel = activityViewModelProvider.get(RoomListQuickActionsSharedActionViewModel::class.java)
|
sharedActionViewModel = activityViewModelProvider.get(RoomListQuickActionsSharedActionViewModel::class.java)
|
||||||
recyclerView.configureWith(roomListActionsEpoxyController, viewPool = sharedViewPool, hasFixedSize = false)
|
recyclerView.configureWith(roomListActionsEpoxyController, viewPool = sharedViewPool, hasFixedSize = false, disableItemAnimation = true)
|
||||||
// Disable item animation
|
|
||||||
recyclerView.itemAnimator = null
|
|
||||||
roomListActionsEpoxyController.listener = this
|
roomListActionsEpoxyController.listener = this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user