Skip to content

Commit

Permalink
Add transition to DeviceListScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
Rawa committed Mar 12, 2024
1 parent 9168341 commit 32fe74f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import net.mullvad.mullvadvpn.compose.destinations.RemoveDeviceConfirmationDialo
import net.mullvad.mullvadvpn.compose.destinations.SettingsDestination
import net.mullvad.mullvadvpn.compose.state.DeviceListItemUiState
import net.mullvad.mullvadvpn.compose.state.DeviceListUiState
import net.mullvad.mullvadvpn.compose.transitions.DefaultTransition
import net.mullvad.mullvadvpn.lib.common.util.parseAsDateTime
import net.mullvad.mullvadvpn.lib.theme.AppTheme
import net.mullvad.mullvadvpn.lib.theme.Dimens
Expand Down Expand Up @@ -164,7 +165,7 @@ private fun PreviewDeviceListLoading() {
}
}

@Destination
@Destination(style = DefaultTransition::class)
@Composable
fun DeviceList(
navigator: DestinationsNavigator,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.navigation.NavBackStackEntry
import com.ramcosta.composedestinations.spec.DestinationStyle
import com.ramcosta.composedestinations.utils.destination
import net.mullvad.mullvadvpn.compose.destinations.ConnectDestination
import net.mullvad.mullvadvpn.compose.destinations.DeviceListDestination
import net.mullvad.mullvadvpn.compose.destinations.OutOfTimeDestination
import net.mullvad.mullvadvpn.compose.destinations.WelcomeDestination
import net.mullvad.mullvadvpn.constant.SCREEN_ANIMATION_TIME_MILLIS
Expand All @@ -21,7 +22,8 @@ object LoginTransition : DestinationStyle.Animated {
when (this.targetState.destination()) {
is OutOfTimeDestination,
is WelcomeDestination,
is ConnectDestination -> fadeOut()
is ConnectDestination,
is DeviceListDestination -> fadeOut()
else -> fadeOut(snap(SCREEN_ANIMATION_TIME_MILLIS))
}

Expand Down

0 comments on commit 32fe74f

Please sign in to comment.