Bye bye NavAnimation.kt
This commit is contained in:
@@ -1,33 +0,0 @@
|
|||||||
package `in`.sminnovations.attendanceapp.navigation
|
|
||||||
|
|
||||||
import androidx.compose.animation.AnimatedContent
|
|
||||||
import androidx.compose.animation.core.tween
|
|
||||||
import androidx.compose.animation.fadeIn
|
|
||||||
import androidx.compose.animation.fadeOut
|
|
||||||
import androidx.compose.animation.togetherWith
|
|
||||||
import androidx.compose.material3.Icon
|
|
||||||
import androidx.compose.material3.MaterialTheme
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.ui.graphics.vector.ImageVector
|
|
||||||
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun BottomNavAnimatedIcon(
|
|
||||||
isSelected: Boolean,
|
|
||||||
icon: ImageVector,
|
|
||||||
selectedIcon: ImageVector,
|
|
||||||
contentDescription: String?
|
|
||||||
) {
|
|
||||||
AnimatedContent(
|
|
||||||
targetState = isSelected,
|
|
||||||
transitionSpec = {
|
|
||||||
fadeIn(animationSpec = tween(300)) togetherWith fadeOut(animationSpec = tween(300))
|
|
||||||
}, label = "animated icon"
|
|
||||||
) { targetState ->
|
|
||||||
Icon(
|
|
||||||
imageVector = if (targetState) selectedIcon else icon,
|
|
||||||
contentDescription = contentDescription,
|
|
||||||
tint = if (targetState) MaterialTheme.colorScheme.surface else MaterialTheme.colorScheme.onSurface
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user