From 3940b24e5b89c8fd57a8621cbb508068c04863ab Mon Sep 17 00:00:00 2001 From: MR3Y Date: Mon, 11 Mar 2024 14:49:57 +0200 Subject: [PATCH] Fix Intrinsic measurement crash in DealsScreen TopAppBar --- .../mr3y/ludi/shared/ui/screens/deals/DealsScreenTest.kt | 2 -- .../com/mr3y/ludi/shared/ui/screens/deals/DealsScreen.kt | 1 - .../com/mr3y/ludi/shared/ui/screens/deals/DealsTopAppBar.kt | 6 ++---- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/shared/src/androidUnitTest/kotlin/com/mr3y/ludi/shared/ui/screens/deals/DealsScreenTest.kt b/shared/src/androidUnitTest/kotlin/com/mr3y/ludi/shared/ui/screens/deals/DealsScreenTest.kt index 6eb223a8..7464e48f 100644 --- a/shared/src/androidUnitTest/kotlin/com/mr3y/ludi/shared/ui/screens/deals/DealsScreenTest.kt +++ b/shared/src/androidUnitTest/kotlin/com/mr3y/ludi/shared/ui/screens/deals/DealsScreenTest.kt @@ -21,7 +21,6 @@ import com.mr3y.ludi.shared.ui.adaptive.LocalWindowSizeClass import com.mr3y.ludi.shared.ui.resources.LudiStrings import com.mr3y.ludi.shared.ui.screens.BaseRobolectricTest import com.mr3y.ludi.shared.ui.theme.LudiTheme -import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner @@ -31,7 +30,6 @@ class DealsScreenTest : BaseRobolectricTest() { @OptIn(ExperimentalMaterial3WindowSizeClassApi::class) @Test - @Ignore("java.lang.IllegalArgumentException: maxWidth(-48) must be >= than minWidth(0)") fun deals_launches_state_is_saved_and_survives_config_changes() { val restorationTester = StateRestorationTester(composeTestRule) var strings: LudiStrings? by mutableStateOf(null) diff --git a/shared/src/commonMain/kotlin/com/mr3y/ludi/shared/ui/screens/deals/DealsScreen.kt b/shared/src/commonMain/kotlin/com/mr3y/ludi/shared/ui/screens/deals/DealsScreen.kt index b7e96b35..c169c6f7 100644 --- a/shared/src/commonMain/kotlin/com/mr3y/ludi/shared/ui/screens/deals/DealsScreen.kt +++ b/shared/src/commonMain/kotlin/com/mr3y/ludi/shared/ui/screens/deals/DealsScreen.kt @@ -162,7 +162,6 @@ fun DealsScreen( onRefreshGiveaways = onRefreshGiveaways, modifier = Modifier .fillMaxWidth() - .height(IntrinsicSize.Min) .padding(horizontal = 16.dp, vertical = 8.dp) ) }, diff --git a/shared/src/commonMain/kotlin/com/mr3y/ludi/shared/ui/screens/deals/DealsTopAppBar.kt b/shared/src/commonMain/kotlin/com/mr3y/ludi/shared/ui/screens/deals/DealsTopAppBar.kt index 07a0204d..4ea10d12 100644 --- a/shared/src/commonMain/kotlin/com/mr3y/ludi/shared/ui/screens/deals/DealsTopAppBar.kt +++ b/shared/src/commonMain/kotlin/com/mr3y/ludi/shared/ui/screens/deals/DealsTopAppBar.kt @@ -27,7 +27,6 @@ import androidx.compose.material3.TopAppBarScrollBehavior import androidx.compose.material3.surfaceColorAtElevation import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment -import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.vector.rememberVectorPainter @@ -35,7 +34,6 @@ import androidx.compose.ui.platform.LocalSoftwareKeyboardController import androidx.compose.ui.semantics.clearAndSetSemantics import androidx.compose.ui.semantics.contentDescription import androidx.compose.ui.semantics.focused -import androidx.compose.ui.semantics.imeAction import androidx.compose.ui.semantics.onImeAction import androidx.compose.ui.semantics.semantics import androidx.compose.ui.text.input.ImeAction @@ -44,7 +42,7 @@ import cafe.adriel.lyricist.LocalStrings import com.mr3y.ludi.shared.ui.components.RefreshIconButton import com.mr3y.ludi.shared.ui.resources.isDesktopPlatform -@OptIn(ExperimentalMaterial3Api::class, ExperimentalComposeUiApi::class) +@OptIn(ExperimentalMaterial3Api::class) @Composable fun SearchFilterBar( searchQuery: String, @@ -81,7 +79,7 @@ fun SearchFilterBar( ), leadingIcon = { IconButton( - onClick = { /*TODO*/ }, + onClick = { }, modifier = Modifier.clearAndSetSemantics { } ) { Icon(