Skip to content

Commit cb16a89

Browse files
committed
Adjusted Fade timing
1 parent db5a288 commit cb16a89

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

feature/forecast/src/main/java/com/iiddd/weather/forecast/presentation/view/component/HourlyForecastWidget.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.iiddd.weather.forecast.presentation.view.component
22

3+
import androidx.compose.animation.core.tween
34
import androidx.compose.animation.fadeIn
45
import androidx.compose.animation.fadeOut
56
import androidx.compose.foundation.background
@@ -27,6 +28,8 @@ import com.iiddd.weather.core.ui.theme.WeatherTheme
2728
import com.iiddd.weather.core.ui.theme.WeatherThemeTokens
2829
import com.iiddd.weather.forecast.domain.model.HourlyForecast
2930

31+
private const val ANIMATION_DURATION_MS = 25
32+
3033
@Composable
3134
fun HourlyForecastWidget(
3235
forecasts: List<HourlyForecast>,
@@ -72,8 +75,8 @@ fun HourlyForecastWidget(
7275
// Left fade - only show when there are items to scroll back to
7376
androidx.compose.animation.AnimatedVisibility(
7477
visible = canScrollBackward,
75-
enter = fadeIn(),
76-
exit = fadeOut(),
78+
enter = fadeIn(animationSpec = tween(durationMillis = ANIMATION_DURATION_MS)),
79+
exit = fadeOut(animationSpec = tween(durationMillis = ANIMATION_DURATION_MS)),
7780
modifier = Modifier.align(alignment = Alignment.CenterStart),
7881
) {
7982
Box(
@@ -94,8 +97,8 @@ fun HourlyForecastWidget(
9497
// Right fade - only show when there are items to scroll to
9598
androidx.compose.animation.AnimatedVisibility(
9699
visible = canScrollForward,
97-
enter = fadeIn(),
98-
exit = fadeOut(),
100+
enter = fadeIn(animationSpec = tween(durationMillis = ANIMATION_DURATION_MS)),
101+
exit = fadeOut(animationSpec = tween(durationMillis = ANIMATION_DURATION_MS)),
99102
modifier = Modifier.align(alignment = Alignment.CenterEnd),
100103
) {
101104
Box(

0 commit comments

Comments
 (0)