Skip to content

Commit

Permalink
Updated anmited visibility for categories to possibly fix flickering
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickunterwegs committed Jan 22, 2025
1 parent a5a221f commit d2a65fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ fun DetailsCardCategories(
all.category.lowercase().contains(newCategory.lowercase())
&& categories.none { existing -> existing.text.lowercase() == all.category.lowercase() }
}
AnimatedVisibility(categoriesToSelectFiltered.isNotEmpty() && isEditMode) {
AnimatedVisibility(isEditMode && categoriesToSelectFiltered.isNotEmpty()) {
LazyRow(
horizontalArrangement = Arrangement.spacedBy(8.dp),
modifier = Modifier.fillMaxWidth()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import androidx.compose.material.icons.outlined.WorkOutline
import androidx.compose.material3.AssistChipDefaults
import androidx.compose.material3.ElevatedAssistChip
import androidx.compose.material3.ElevatedCard
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.InputChip
Expand Down Expand Up @@ -65,7 +64,7 @@ import at.techbee.jtx.ui.reusable.elements.HeadlineWithIcon
import at.techbee.jtx.ui.theme.getContrastSurfaceColorFor


@OptIn(ExperimentalMaterial3Api::class, ExperimentalLayoutApi::class)
@OptIn(ExperimentalLayoutApi::class)
@Composable
fun DetailsCardResources(
resources: SnapshotStateList<Resource>,
Expand Down Expand Up @@ -149,7 +148,7 @@ fun DetailsCardResources(
&& resources.none { existing -> existing.text?.lowercase() == all.resource.lowercase() }
}

AnimatedVisibility(resourcesToSelectFiltered.isNotEmpty() && isEditMode) {
AnimatedVisibility(isEditMode && resourcesToSelectFiltered.isNotEmpty()) {
LazyRow(
horizontalArrangement = Arrangement.spacedBy(8.dp),
modifier = Modifier.fillMaxWidth()
Expand Down

0 comments on commit d2a65fc

Please sign in to comment.