Skip to content

Commit e50c462

Browse files
committed
chore: Deactivate reverseOnRepeat and iterate only once for the flag animation
1 parent bf9de35 commit e50c462

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/UploadProgressAdType.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,31 @@ import androidx.annotation.StringRes
2222
import androidx.compose.runtime.Composable
2323
import androidx.compose.ui.res.stringResource
2424
import androidx.compose.ui.text.AnnotatedString
25+
import com.airbnb.lottie.compose.LottieConstants
2526
import com.infomaniak.swisstransfer.R
2627
import com.infomaniak.swisstransfer.ui.utils.TextUtils
2728

2829
enum class UploadProgressAdType(
2930
@StringRes private val descriptionTemplate: Int,
3031
@StringRes private val descriptionAccentuatedPart: Int,
3132
@RawRes val illustration: Int,
32-
val shouldReverseOnRepeat: Boolean,
33+
val iterations: Int = LottieConstants.IterateForever,
3334
) {
3435
INDEPENDENCE(
3536
R.string.uploadProgressDescriptionTemplateIndependence,
3637
R.string.uploadProgressDescriptionArgumentIndependence,
3738
R.raw.swiss_with_flag,
38-
true,
39+
1,
3940
),
4041
ENERGY(
4142
R.string.uploadProgressDescriptionTemplateEnergy,
4243
R.string.uploadProgressDescriptionArgumentEnergy,
4344
R.raw.mountain_gondola,
44-
false,
4545
),
4646
CONFIDENTIALITY(
4747
R.string.uploadProgressDescriptionTemplateConfidentiality,
4848
R.string.uploadProgressDescriptionArgumentConfidentiality,
4949
R.raw.metallic_safe,
50-
false,
5150
);
5251

5352
@Composable

app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/upload/components/AdHeader.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ fun ColumnScope.AdHeader(adScreenType: UploadProgressAdType) {
7575
LottieAnimation(
7676
composition,
7777
isPlaying = true,
78-
reverseOnRepeat = adScreenType.shouldReverseOnRepeat,
79-
iterations = LottieConstants.IterateForever,
78+
iterations = adScreenType.iterations,
8079
)
8180

8281
WeightOneSpacer(minHeight = Margin.Medium)

0 commit comments

Comments
 (0)