Fixing navigation to session details + layout in session overview screen

This commit is contained in:
Maxime NATUREL 2022-10-12 11:06:59 +02:00
parent def67b2e7d
commit 9f006a2940
2 changed files with 8 additions and 1 deletions

View file

@ -177,6 +177,7 @@ class SessionOverviewFragment :
override fun invalidate() = withState(viewModel) { state -> override fun invalidate() = withState(viewModel) { state ->
updateToolbar(state) updateToolbar(state)
updateEntryDetails(state.deviceId)
updateSessionInfo(state) updateSessionInfo(state)
updateLoading(state.isLoading) updateLoading(state.isLoading)
updatePushNotificationToggle(state.deviceId, state.pushers.invoke().orEmpty()) updatePushNotificationToggle(state.deviceId, state.pushers.invoke().orEmpty())
@ -197,6 +198,12 @@ class SessionOverviewFragment :
} }
} }
private fun updateEntryDetails(deviceId: String) {
views.sessionOverviewEntryDetails.setOnClickListener {
viewNavigator.goToSessionDetails(requireContext(), deviceId)
}
}
private fun updateSessionInfo(viewState: SessionOverviewViewState) { private fun updateSessionInfo(viewState: SessionOverviewViewState) {
if (viewState.deviceInfo is Success) { if (viewState.deviceInfo is Success) {
views.sessionOverviewInfo.isVisible = true views.sessionOverviewInfo.isVisible = true

View file

@ -51,7 +51,7 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0" app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/sessionOverviewEntryDetails" app:layout_constraintTop_toBottomOf="@id/sessionOverviewPushNotifications"
app:layout_constraintWidth="wrap_content" /> app:layout_constraintWidth="wrap_content" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>