Skip to content

Commit

Permalink
Add checkmark animation
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarX committed Aug 20, 2024
1 parent 2d27c7b commit 4be7889
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ package com.infomaniak.swisstransfer.ui.components

import android.content.res.Configuration
import androidx.annotation.StringRes
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.scaleIn
import androidx.compose.animation.scaleOut
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.selection.selectable
import androidx.compose.foundation.selection.selectableGroup
Expand Down Expand Up @@ -69,8 +72,12 @@ private fun SettingOptionItem(item: SettingOption, isSelected: Boolean, onClick:

Text(text = stringResource(id = item.title), Modifier.weight(1f))

if (isSelected) {
Spacer(modifier = Modifier.width(Margin.Medium))
if (isSelected) Spacer(modifier = Modifier.width(Margin.Medium))
AnimatedVisibility(
visible = isSelected,
enter = scaleIn(),
exit = scaleOut(),
) {
Icon(
imageVector = AppIcons.Checkmark,
contentDescription = null,
Expand Down

0 comments on commit 4be7889

Please sign in to comment.