Adding click listeners on verify button

This commit is contained in:
Maxime NATUREL 2022-09-14 11:14:53 +02:00
parent 81beccdd8e
commit 5759a0f7da
3 changed files with 11 additions and 0 deletions

View File

@ -227,6 +227,9 @@ class VectorSettingsDevicesFragment :
views.deviceListCurrentSession.viewDetailsButton.debouncedClicks { views.deviceListCurrentSession.viewDetailsButton.debouncedClicks {
currentDeviceInfo.deviceInfo.deviceId?.let { deviceId -> navigateToSessionOverview(deviceId) } currentDeviceInfo.deviceInfo.deviceId?.let { deviceId -> navigateToSessionOverview(deviceId) }
} }
views.deviceListCurrentSession.viewVerifyButton.debouncedClicks {
// TODO show bottom Sheet verification process
}
} ?: run { } ?: run {
hideCurrentSessionView() hideCurrentSessionView()
} }

View File

@ -49,6 +49,7 @@ class SessionInfoView @JvmOverloads constructor(
} }
val viewDetailsButton = views.sessionInfoViewDetailsButton val viewDetailsButton = views.sessionInfoViewDetailsButton
val viewVerifyButton = views.sessionInfoVerifySessionButton
fun render( fun render(
sessionInfoViewState: SessionInfoViewState, sessionInfoViewState: SessionInfoViewState,

View File

@ -81,6 +81,7 @@ class SessionOverviewFragment :
override fun invalidate() = withState(viewModel) { state -> override fun invalidate() = withState(viewModel) { state ->
updateToolbar(state.isCurrentSession) updateToolbar(state.isCurrentSession)
updateVerifyButton()
updateEntryDetails(state.deviceId) updateEntryDetails(state.deviceId)
if (state.deviceInfo is Success) { if (state.deviceInfo is Success) {
renderSessionInfo(state.isCurrentSession, state.deviceInfo.invoke()) renderSessionInfo(state.isCurrentSession, state.deviceInfo.invoke())
@ -96,6 +97,12 @@ class SessionOverviewFragment :
?.setTitle(titleResId) ?.setTitle(titleResId)
} }
private fun updateVerifyButton() {
views.sessionOverviewInfo.viewVerifyButton.debouncedClicks {
// TODO show bottom Sheet verification process
}
}
private fun updateEntryDetails(deviceId: String) { private fun updateEntryDetails(deviceId: String) {
views.sessionOverviewEntryDetails.setOnClickListener { views.sessionOverviewEntryDetails.setOnClickListener {
viewNavigator.navigateToSessionDetails(requireContext(), deviceId) viewNavigator.navigateToSessionDetails(requireContext(), deviceId)