Skip to content

Commit

Permalink
chore: Deactivate reverseOnRepeat and iterate only once for the flag …
Browse files Browse the repository at this point in the history
…animation
  • Loading branch information
tevincent committed Feb 26, 2025
1 parent bf9de35 commit e50c462
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,31 @@ import androidx.annotation.StringRes
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.AnnotatedString
import com.airbnb.lottie.compose.LottieConstants
import com.infomaniak.swisstransfer.R
import com.infomaniak.swisstransfer.ui.utils.TextUtils

enum class UploadProgressAdType(
@StringRes private val descriptionTemplate: Int,
@StringRes private val descriptionAccentuatedPart: Int,
@RawRes val illustration: Int,
val shouldReverseOnRepeat: Boolean,
val iterations: Int = LottieConstants.IterateForever,
) {
INDEPENDENCE(
R.string.uploadProgressDescriptionTemplateIndependence,
R.string.uploadProgressDescriptionArgumentIndependence,
R.raw.swiss_with_flag,
true,
1,
),
ENERGY(
R.string.uploadProgressDescriptionTemplateEnergy,
R.string.uploadProgressDescriptionArgumentEnergy,
R.raw.mountain_gondola,
false,
),
CONFIDENTIALITY(
R.string.uploadProgressDescriptionTemplateConfidentiality,
R.string.uploadProgressDescriptionArgumentConfidentiality,
R.raw.metallic_safe,
false,
);

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ fun ColumnScope.AdHeader(adScreenType: UploadProgressAdType) {
LottieAnimation(
composition,
isPlaying = true,
reverseOnRepeat = adScreenType.shouldReverseOnRepeat,
iterations = LottieConstants.IterateForever,
iterations = adScreenType.iterations,
)

WeightOneSpacer(minHeight = Margin.Medium)
Expand Down

0 comments on commit e50c462

Please sign in to comment.