Skip to content

Commit

Permalink
chore: Improve animation of data broker mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Chrylo committed Sep 25, 2023
1 parent e51a13f commit 597e719
Showing 1 changed file with 10 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ package org.eclipse.kuksa.testapp.databroker.view
import android.app.Application
import androidx.compose.animation.AnimatedContent
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
Expand Down Expand Up @@ -130,19 +128,16 @@ fun DataBrokerView(
Column {
val dataBrokerMode = topAppBarViewModel.dataBrokerMode
DataBrokerConnection(connectionViewModel)
AnimatedVisibility(
visible = connectionViewModel.isConnected && dataBrokerMode == DataBrokerMode.MANUAL,
enter = fadeIn(),
exit = fadeOut(),
) {
DataBrokerProperties(vssPropertiesViewModel)
}
AnimatedVisibility(
visible = connectionViewModel.isConnected && dataBrokerMode == DataBrokerMode.SPECIFICATION,
enter = fadeIn(),
exit = fadeOut(),
) {
DataBrokerSpecifications(vssSpecificationsViewModel)
if (connectionViewModel.isConnected) {
AnimatedContent(
targetState = dataBrokerMode,
label = "DataBrokerModeAnimation",
) { mode ->
when (mode) {
DataBrokerMode.MANUAL -> DataBrokerProperties(vssPropertiesViewModel)
DataBrokerMode.SPECIFICATION -> DataBrokerSpecifications(vssSpecificationsViewModel)
}
}
}
Spacer(modifier = Modifier.padding(top = DefaultElementPadding))
}
Expand Down

0 comments on commit 597e719

Please sign in to comment.