Enhance UI animations in SetPasswordScreen and SplashScreen

- Added animated visibility for elements in SetPasswordScreen to improve user experience during password setup.
- Introduced fade and scale animations for icons and text in SetPasswordScreen.
- Updated SplashScreen to include alpha animations for smoother transitions.
- Adjusted animation parameters for better performance and visual appeal.
- Addressed deprecation warnings related to Gradle configurations in the project.
This commit is contained in:
k1ngsterr1
2026-01-08 20:04:43 +05:00
parent 42ddfe5b18
commit fc54cc89df
5 changed files with 433 additions and 218 deletions

View File

@@ -11,6 +11,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.scale
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import com.rosetta.messenger.R
@@ -25,16 +26,23 @@ fun SplashScreen(
// Animation states
var startAnimation by remember { mutableStateOf(false) }
var alphaValue by remember { mutableStateOf(0f) }
val scale by animateFloatAsState(
targetValue = if (startAnimation) 1f else 0f,
targetValue = if (startAnimation) 1f else 0.3f,
animationSpec = spring(
dampingRatio = 0.5f,
dampingRatio = 0.6f,
stiffness = Spring.StiffnessLow
),
label = "scale"
)
val alpha by animateFloatAsState(
targetValue = alphaValue,
animationSpec = tween(600, easing = FastOutSlowInEasing),
label = "alpha"
)
val pulseScale by rememberInfiniteTransition(label = "pulse").animateFloat(
initialValue = 1f,
targetValue = 1.1f,
@@ -46,6 +54,8 @@ fun SplashScreen(
)
LaunchedEffect(Unit) {
delay(100)
alphaValue = 1f
startAnimation = true
delay(2000) // Show splash for 2 seconds
onSplashComplete()
@@ -62,6 +72,7 @@ fun SplashScreen(
modifier = Modifier
.size(180.dp)
.scale(scale * pulseScale)
.graphicsLayer { this.alpha = alpha }
.background(
color = Color(0xFF54A9EB).copy(alpha = 0.2f),
shape = CircleShape
@@ -75,6 +86,7 @@ fun SplashScreen(
modifier = Modifier
.size(150.dp)
.scale(scale)
.graphicsLayer { this.alpha = alpha }
.clip(CircleShape)
)
}