Skip to content

Commit

Permalink
ANDROAPP-5800 (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
andresmr authored Feb 8, 2024
1 parent e83729e commit 057a018
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,14 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.semantics.Role
import org.hisp.dhis.mobile.ui.designsystem.component.IconButton
import org.hisp.dhis.mobile.ui.designsystem.component.parameter.model.ParameterSelectorItemModel
import org.hisp.dhis.mobile.ui.designsystem.component.parameter.model.ParameterSelectorItemModel.Status.CLOSED
import org.hisp.dhis.mobile.ui.designsystem.component.parameter.model.ParameterSelectorItemModel.Status.FOCUSED
import org.hisp.dhis.mobile.ui.designsystem.theme.Border
import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing
import org.hisp.dhis.mobile.ui.designsystem.theme.SurfaceColor
Expand All @@ -43,23 +39,20 @@ import org.hisp.dhis.mobile.ui.designsystem.theme.hoverPointerIcon
fun ParameterSelectorItem(
model: ParameterSelectorItemModel,
) {
var status by remember(model.status) { mutableStateOf(model.status) }

AnimatedVisibility(
visible = status == CLOSED,
visible = model.status == CLOSED,
enter = fadeIn() + expandVertically(),
exit = shrinkVertically() + fadeOut(),
) {
EmptyParameterField(
model = model,
) {
status = FOCUSED
model.onExpand()
}
}

AnimatedVisibility(
visible = status != CLOSED,
visible = model.status != CLOSED,
enter = fadeIn() + expandVertically(),
exit = shrinkVertically() + fadeOut(),
) {
Expand Down

0 comments on commit 057a018

Please sign in to comment.