mirror of
https://github.com/element-hq/element-android
synced 2024-11-25 02:45:37 +03:00
Use debouncedClicks every where, for faster UI (it uses throttleFirst operator instead of debounce)
This commit is contained in:
parent
9520aff848
commit
22955e6b34
11 changed files with 16 additions and 16 deletions
|
@ -123,7 +123,7 @@ class KeysBackupSetupStep3Fragment @Inject constructor() : VectorBaseFragment()
|
|||
.joinToString(" ")
|
||||
}
|
||||
|
||||
it.setOnClickListener {
|
||||
it.debouncedClicks {
|
||||
copyToClipboard(activity!!, recoveryKey)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -209,7 +209,7 @@ class HomeDetailFragment @Inject constructor(
|
|||
parentActivity.configure(groupToolbar)
|
||||
}
|
||||
groupToolbar.title = ""
|
||||
groupToolbarAvatarImageView.setOnClickListener {
|
||||
groupToolbarAvatarImageView.debouncedClicks {
|
||||
sharedActionViewModel.post(HomeActivitySharedAction.OpenDrawer)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,13 +53,13 @@ class HomeDrawerFragment @Inject constructor(
|
|||
homeDrawerUserIdView.text = user.userId
|
||||
}
|
||||
}
|
||||
homeDrawerHeaderSettingsView.setOnClickListener {
|
||||
homeDrawerHeaderSettingsView.debouncedClicks {
|
||||
sharedActionViewModel.post(HomeActivitySharedAction.CloseDrawer)
|
||||
navigator.openSettings(requireActivity())
|
||||
}
|
||||
|
||||
// Debug menu
|
||||
homeDrawerHeaderDebugView.setOnClickListener {
|
||||
homeDrawerHeaderDebugView.debouncedClicks {
|
||||
sharedActionViewModel.post(HomeActivitySharedAction.CloseDrawer)
|
||||
navigator.openDebug(requireActivity())
|
||||
}
|
||||
|
|
|
@ -264,7 +264,7 @@ class RoomDetailFragment @Inject constructor(
|
|||
setupNotificationView()
|
||||
setupJumpToReadMarkerView()
|
||||
setupJumpToBottomView()
|
||||
roomToolbarContentView.setOnClickListener {
|
||||
roomToolbarContentView.debouncedClicks {
|
||||
navigator.openRoomProfile(requireActivity(), roomDetailArgs.roomId)
|
||||
}
|
||||
roomDetailViewModel.subscribe { renderState(it) }
|
||||
|
@ -348,7 +348,7 @@ class RoomDetailFragment @Inject constructor(
|
|||
|
||||
private fun setupJumpToBottomView() {
|
||||
jumpToBottomView.visibility = View.INVISIBLE
|
||||
jumpToBottomView.setOnClickListener {
|
||||
jumpToBottomView.debouncedClicks {
|
||||
roomDetailViewModel.handle(RoomDetailAction.ExitTrackingUnreadMessagesState)
|
||||
jumpToBottomView.visibility = View.INVISIBLE
|
||||
if (!roomDetailViewModel.timeline.isLive) {
|
||||
|
|
|
@ -142,10 +142,10 @@ class RoomListFragment @Inject constructor(
|
|||
else -> Unit // No button in this mode
|
||||
}
|
||||
|
||||
createChatRoomButton.setOnClickListener {
|
||||
createChatRoomButton.debouncedClicks {
|
||||
createDirectChat()
|
||||
}
|
||||
createGroupRoomButton.setOnClickListener {
|
||||
createGroupRoomButton.debouncedClicks {
|
||||
openRoomDirectory()
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ class PublicRoomsFragment @Inject constructor(
|
|||
}
|
||||
.disposeOnDestroyView()
|
||||
|
||||
publicRoomsCreateNewRoom.setOnClickListener {
|
||||
publicRoomsCreateNewRoom.debouncedClicks {
|
||||
sharedActionViewModel.post(RoomDirectorySharedAction.CreateRoom)
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ class CreateRoomFragment @Inject constructor(private val createRoomController: C
|
|||
vectorBaseActivity.setSupportActionBar(createRoomToolbar)
|
||||
sharedActionViewModel = activityViewModelProvider.get(RoomDirectorySharedActionViewModel::class.java)
|
||||
setupRecyclerView()
|
||||
createRoomClose.setOnClickListener {
|
||||
createRoomClose.debouncedClicks {
|
||||
sharedActionViewModel.post(RoomDirectorySharedAction.Back)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,11 +71,11 @@ class VectorSettingsNotificationsTroubleshootFragment @Inject constructor(
|
|||
layoutManager.orientation)
|
||||
mRecyclerView.addItemDecoration(dividerItemDecoration)
|
||||
|
||||
mSummaryButton.setOnClickListener {
|
||||
mSummaryButton.debouncedClicks {
|
||||
bugReporter.openBugReportScreen(activity!!)
|
||||
}
|
||||
|
||||
mRunButton.setOnClickListener {
|
||||
mRunButton.debouncedClicks {
|
||||
testManager?.retry()
|
||||
}
|
||||
startUI()
|
||||
|
|
|
@ -80,7 +80,7 @@ class DeactivateAccountFragment @Inject constructor(
|
|||
viewModel.handle(DeactivateAccountAction.TogglePassword)
|
||||
}
|
||||
|
||||
deactivateAccountSubmit.setOnClickListener {
|
||||
deactivateAccountSubmit.debouncedClicks {
|
||||
viewModel.handle(DeactivateAccountAction.DeactivateAccount(
|
||||
deactivateAccountPassword.text.toString(),
|
||||
deactivateAccountEraseCheckbox.isChecked))
|
||||
|
|
|
@ -91,7 +91,7 @@ class KnownUsersFragment @Inject constructor(
|
|||
}
|
||||
|
||||
private fun setupAddByMatrixIdView() {
|
||||
addByMatrixId.setOnClickListener {
|
||||
addByMatrixId.debouncedClicks {
|
||||
sharedActionViewModel.post(UserDirectorySharedAction.OpenUsersDirectory)
|
||||
}
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ class KnownUsersFragment @Inject constructor(
|
|||
}
|
||||
|
||||
private fun setupCloseView() {
|
||||
knownUsersClose.setOnClickListener {
|
||||
knownUsersClose.debouncedClicks {
|
||||
requireActivity().finish()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ class UserDirectoryFragment @Inject constructor(
|
|||
}
|
||||
|
||||
private fun setupCloseView() {
|
||||
userDirectoryClose.setOnClickListener {
|
||||
userDirectoryClose.debouncedClicks {
|
||||
sharedActionViewModel.post(UserDirectorySharedAction.GoBack)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue