Skip to content

Commit

Permalink
animate InputShell content
Browse files Browse the repository at this point in the history
This will animate the visibility of supporting text and other composable contents used inside `InputShell`
  • Loading branch information
Siddharth Agarwal committed Dec 13, 2023
1 parent 52d727c commit 3426747
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.hisp.dhis.mobile.ui.designsystem.component

import androidx.compose.animation.animateContentSize
import androidx.compose.foundation.background
import androidx.compose.foundation.gestures.detectTapGestures
import androidx.compose.foundation.layout.Arrangement
Expand Down Expand Up @@ -62,7 +63,12 @@ fun InputShell(
isRequiredField: Boolean = false,
modifier: Modifier = Modifier,
) {
Column(modifier = modifier.fillMaxWidth().clip(shape = RoundedCornerShape(Radius.XS, Radius.XS))) {
Column(
modifier = modifier
.fillMaxWidth()
.clip(shape = RoundedCornerShape(Radius.XS, Radius.XS))
.animateContentSize()
) {
var indicatorColor by remember(state) { mutableStateOf(state.color) }
var indicatorThickness by remember { mutableStateOf(Border.Thin) }
val backgroundColor = if (state != InputShellState.DISABLED) SurfaceColor.Surface else SurfaceColor.DisabledSurface
Expand Down

0 comments on commit 3426747

Please sign in to comment.