Improved smoothness of animations to fragments with recyclerviews
This commit is contained in:
parent
1f13dbc193
commit
a6c0de10f0
8 changed files with 72 additions and 0 deletions
|
@ -70,6 +70,15 @@ class ChatRoomCreationFragment : SecureFragment<ChatRoomCreationFragmentBinding>
|
||||||
adapter.updateSecurity(viewModel.isEncrypted.value == true)
|
adapter.updateSecurity(viewModel.isEncrypted.value == true)
|
||||||
binding.contactsList.adapter = adapter
|
binding.contactsList.adapter = adapter
|
||||||
|
|
||||||
|
// To ensure animation will be smooth
|
||||||
|
binding.contactsList.apply {
|
||||||
|
postponeEnterTransition()
|
||||||
|
viewTreeObserver.addOnPreDrawListener {
|
||||||
|
startPostponedEnterTransition()
|
||||||
|
true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val layoutManager = LinearLayoutManager(activity)
|
val layoutManager = LinearLayoutManager(activity)
|
||||||
binding.contactsList.layoutManager = layoutManager
|
binding.contactsList.layoutManager = layoutManager
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,15 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
|
||||||
binding.chatMessagesList.adapter = adapter
|
binding.chatMessagesList.adapter = adapter
|
||||||
adapter.registerAdapterDataObserver(observer)
|
adapter.registerAdapterDataObserver(observer)
|
||||||
|
|
||||||
|
// To ensure animation will be smooth
|
||||||
|
binding.chatMessagesList.apply {
|
||||||
|
postponeEnterTransition()
|
||||||
|
viewTreeObserver.addOnPreDrawListener {
|
||||||
|
startPostponedEnterTransition()
|
||||||
|
true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val layoutManager = LinearLayoutManager(activity)
|
val layoutManager = LinearLayoutManager(activity)
|
||||||
layoutManager.stackFromEnd = true
|
layoutManager.stackFromEnd = true
|
||||||
binding.chatMessagesList.layoutManager = layoutManager
|
binding.chatMessagesList.layoutManager = layoutManager
|
||||||
|
|
|
@ -76,6 +76,15 @@ class GroupInfoFragment : SecureFragment<ChatRoomGroupInfoFragmentBinding>() {
|
||||||
)
|
)
|
||||||
binding.participants.adapter = adapter
|
binding.participants.adapter = adapter
|
||||||
|
|
||||||
|
// To ensure animation will be smooth
|
||||||
|
binding.participants.apply {
|
||||||
|
postponeEnterTransition()
|
||||||
|
viewTreeObserver.addOnPreDrawListener {
|
||||||
|
startPostponedEnterTransition()
|
||||||
|
true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val layoutManager = LinearLayoutManager(activity)
|
val layoutManager = LinearLayoutManager(activity)
|
||||||
binding.participants.layoutManager = layoutManager
|
binding.participants.layoutManager = layoutManager
|
||||||
|
|
||||||
|
|
|
@ -81,6 +81,15 @@ class ImdnFragment : SecureFragment<ChatRoomImdnFragmentBinding>() {
|
||||||
adapter = ImdnAdapter(viewLifecycleOwner)
|
adapter = ImdnAdapter(viewLifecycleOwner)
|
||||||
binding.participantsList.adapter = adapter
|
binding.participantsList.adapter = adapter
|
||||||
|
|
||||||
|
// To ensure animation will be smooth
|
||||||
|
binding.participantsList.apply {
|
||||||
|
postponeEnterTransition()
|
||||||
|
viewTreeObserver.addOnPreDrawListener {
|
||||||
|
startPostponedEnterTransition()
|
||||||
|
true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val layoutManager = LinearLayoutManager(activity)
|
val layoutManager = LinearLayoutManager(activity)
|
||||||
binding.participantsList.layoutManager = layoutManager
|
binding.participantsList.layoutManager = layoutManager
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,15 @@ class MasterChatRoomsFragment : MasterFragment<ChatRoomMasterFragmentBinding, Ch
|
||||||
adapter.registerAdapterDataObserver(observer)
|
adapter.registerAdapterDataObserver(observer)
|
||||||
binding.chatList.adapter = adapter
|
binding.chatList.adapter = adapter
|
||||||
|
|
||||||
|
// To ensure animation will be smooth
|
||||||
|
binding.chatList.apply {
|
||||||
|
postponeEnterTransition()
|
||||||
|
viewTreeObserver.addOnPreDrawListener {
|
||||||
|
startPostponedEnterTransition()
|
||||||
|
true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val layoutManager = LinearLayoutManager(activity)
|
val layoutManager = LinearLayoutManager(activity)
|
||||||
binding.chatList.layoutManager = layoutManager
|
binding.chatList.layoutManager = layoutManager
|
||||||
|
|
||||||
|
|
|
@ -74,6 +74,15 @@ class MasterContactsFragment : MasterFragment<ContactMasterFragmentBinding, Cont
|
||||||
_adapter = ContactsListAdapter(listSelectionViewModel, viewLifecycleOwner)
|
_adapter = ContactsListAdapter(listSelectionViewModel, viewLifecycleOwner)
|
||||||
binding.contactsList.adapter = adapter
|
binding.contactsList.adapter = adapter
|
||||||
|
|
||||||
|
// To ensure animation will be smooth
|
||||||
|
binding.contactsList.apply {
|
||||||
|
postponeEnterTransition()
|
||||||
|
viewTreeObserver.addOnPreDrawListener {
|
||||||
|
startPostponedEnterTransition()
|
||||||
|
true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
binding.setEditClickListener {
|
binding.setEditClickListener {
|
||||||
if (PermissionHelper.get().hasWriteContactsPermission()) {
|
if (PermissionHelper.get().hasWriteContactsPermission()) {
|
||||||
listSelectionViewModel.isEditionEnabled.value = true
|
listSelectionViewModel.isEditionEnabled.value = true
|
||||||
|
|
|
@ -81,6 +81,15 @@ class MasterCallLogsFragment : MasterFragment<HistoryMasterFragmentBinding, Call
|
||||||
adapter.registerAdapterDataObserver(observer)
|
adapter.registerAdapterDataObserver(observer)
|
||||||
binding.callLogsList.adapter = adapter
|
binding.callLogsList.adapter = adapter
|
||||||
|
|
||||||
|
// To ensure animation will be smooth
|
||||||
|
binding.callLogsList.apply {
|
||||||
|
postponeEnterTransition()
|
||||||
|
viewTreeObserver.addOnPreDrawListener {
|
||||||
|
startPostponedEnterTransition()
|
||||||
|
true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
binding.setEditClickListener {
|
binding.setEditClickListener {
|
||||||
listSelectionViewModel.isEditionEnabled.value = true
|
listSelectionViewModel.isEditionEnabled.value = true
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,15 @@ class RecordingsFragment : MasterFragment<RecordingsFragmentBinding, RecordingsL
|
||||||
_adapter = RecordingsListAdapter(listSelectionViewModel, viewLifecycleOwner)
|
_adapter = RecordingsListAdapter(listSelectionViewModel, viewLifecycleOwner)
|
||||||
binding.recordingsList.adapter = adapter
|
binding.recordingsList.adapter = adapter
|
||||||
|
|
||||||
|
// To ensure animation will be smooth
|
||||||
|
binding.recordingsList.apply {
|
||||||
|
postponeEnterTransition()
|
||||||
|
viewTreeObserver.addOnPreDrawListener {
|
||||||
|
startPostponedEnterTransition()
|
||||||
|
true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val layoutManager = LinearLayoutManager(activity)
|
val layoutManager = LinearLayoutManager(activity)
|
||||||
binding.recordingsList.layoutManager = layoutManager
|
binding.recordingsList.layoutManager = layoutManager
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue