diff --git a/appyx-components/experimental/promoter/android/src/main/kotlin/com/bumble/appyx/components/experimental/promoter/android/PromoterExperiment.kt b/appyx-components/experimental/promoter/android/src/main/kotlin/com/bumble/appyx/components/experimental/promoter/android/PromoterExperiment.kt index dd23935e3..2b606e03a 100644 --- a/appyx-components/experimental/promoter/android/src/main/kotlin/com/bumble/appyx/components/experimental/promoter/android/PromoterExperiment.kt +++ b/appyx-components/experimental/promoter/android/src/main/kotlin/com/bumble/appyx/components/experimental/promoter/android/PromoterExperiment.kt @@ -10,9 +10,9 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size -import androidx.compose.material.Button import androidx.compose.material.ExperimentalMaterialApi -import androidx.compose.material.Text +import androidx.compose.material3.Button +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.remember @@ -29,12 +29,12 @@ import com.bumble.appyx.interactions.composable.AppyxInteractionsContainer import com.bumble.appyx.interactions.model.transition.Operation.Mode.IMMEDIATE import com.bumble.appyx.interactions.model.transition.Operation.Mode.KEYFRAME import com.bumble.appyx.interactions.ui.helper.AppyxComponentSetup -import com.bumble.appyx.interactions.utils.ui.Element import com.bumble.appyx.interactions.utils.testing.TestTarget import com.bumble.appyx.interactions.utils.testing.TestTarget.Child1 import com.bumble.appyx.interactions.utils.testing.TestTarget.Child2 import com.bumble.appyx.interactions.utils.testing.TestTarget.Child3 import com.bumble.appyx.interactions.utils.testing.TestTarget.Child4 +import com.bumble.appyx.interactions.utils.ui.Element import kotlin.math.roundToInt @@ -71,8 +71,10 @@ fun PromoterExperiment(modifier: Modifier = Modifier) { .fillMaxSize() ) { val density = LocalDensity.current - val screenWidthPx = (LocalConfiguration.current.screenWidthDp * density.density).roundToInt() - val screenHeightPx = (LocalConfiguration.current.screenHeightDp * density.density).roundToInt() + val screenWidthPx = + (LocalConfiguration.current.screenWidthDp * density.density).roundToInt() + val screenHeightPx = + (LocalConfiguration.current.screenHeightDp * density.density).roundToInt() AppyxInteractionsContainer( appyxComponent = promoter, diff --git a/appyx-components/experimental/puzzle15/web/src/jsMain/kotlin/com/bumble/appyx/experimental/puzzle15/web/main.js.kt b/appyx-components/experimental/puzzle15/web/src/jsMain/kotlin/com/bumble/appyx/experimental/puzzle15/web/main.js.kt index 109b1b82a..be5c03358 100644 --- a/appyx-components/experimental/puzzle15/web/src/jsMain/kotlin/com/bumble/appyx/experimental/puzzle15/web/main.js.kt +++ b/appyx-components/experimental/puzzle15/web/src/jsMain/kotlin/com/bumble/appyx/experimental/puzzle15/web/main.js.kt @@ -9,19 +9,21 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.focusRequester import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.unit.IntSize -import androidx.compose.ui.window.Window +import androidx.compose.ui.window.CanvasBasedWindow import com.bumble.appyx.components.experimental.puzzle15.ui.Puzzle15Ui import org.jetbrains.skiko.wasm.onWasmReady +@OptIn(ExperimentalComposeUiApi::class) fun main() { onWasmReady { - Window("Puzzle15") { + CanvasBasedWindow("Puzzle15") { val requester = remember { FocusRequester() } var size by remember { mutableStateOf(IntSize.Zero) } Surface( diff --git a/appyx-components/internal/test-drive/android/screenshots/GesturesTest_drag_to_middle.png b/appyx-components/internal/test-drive/android/screenshots/GesturesTest_drag_to_middle.png index 1c1727237..e65c42a65 100644 Binary files a/appyx-components/internal/test-drive/android/screenshots/GesturesTest_drag_to_middle.png and b/appyx-components/internal/test-drive/android/screenshots/GesturesTest_drag_to_middle.png differ diff --git a/appyx-components/internal/test-drive/android/screenshots/GesturesTest_given_element_dragged_to_the_second_position_when_dragged_back_then_first_element_is_visible_1.png b/appyx-components/internal/test-drive/android/screenshots/GesturesTest_given_element_dragged_to_the_second_position_when_dragged_back_then_first_element_is_visible_1.png index d1ddb2cf7..7747ee2c0 100644 Binary files a/appyx-components/internal/test-drive/android/screenshots/GesturesTest_given_element_dragged_to_the_second_position_when_dragged_back_then_first_element_is_visible_1.png and b/appyx-components/internal/test-drive/android/screenshots/GesturesTest_given_element_dragged_to_the_second_position_when_dragged_back_then_first_element_is_visible_1.png differ diff --git a/appyx-components/internal/test-drive/android/screenshots/GesturesTest_given_element_dragged_to_the_second_position_when_dragged_back_then_first_element_is_visible_2.png b/appyx-components/internal/test-drive/android/screenshots/GesturesTest_given_element_dragged_to_the_second_position_when_dragged_back_then_first_element_is_visible_2.png index 3cb35703e..0da77999b 100644 Binary files a/appyx-components/internal/test-drive/android/screenshots/GesturesTest_given_element_dragged_to_the_second_position_when_dragged_back_then_first_element_is_visible_2.png and b/appyx-components/internal/test-drive/android/screenshots/GesturesTest_given_element_dragged_to_the_second_position_when_dragged_back_then_first_element_is_visible_2.png differ diff --git a/appyx-components/internal/test-drive/android/screenshots/GesturesTest_when_drag_past_maximum_value_then_second_at_maximum_value_is_visible.png b/appyx-components/internal/test-drive/android/screenshots/GesturesTest_when_drag_past_maximum_value_then_second_at_maximum_value_is_visible.png index 61a3acdad..0dcd7054f 100644 Binary files a/appyx-components/internal/test-drive/android/screenshots/GesturesTest_when_drag_past_maximum_value_then_second_at_maximum_value_is_visible.png and b/appyx-components/internal/test-drive/android/screenshots/GesturesTest_when_drag_past_maximum_value_then_second_at_maximum_value_is_visible.png differ diff --git a/appyx-components/internal/test-drive/android/screenshots/GesturesTest_when_released_after_threshold_snaps_to_destination.png b/appyx-components/internal/test-drive/android/screenshots/GesturesTest_when_released_after_threshold_snaps_to_destination.png index 3cb35703e..0da77999b 100644 Binary files a/appyx-components/internal/test-drive/android/screenshots/GesturesTest_when_released_after_threshold_snaps_to_destination.png and b/appyx-components/internal/test-drive/android/screenshots/GesturesTest_when_released_after_threshold_snaps_to_destination.png differ diff --git a/appyx-components/internal/test-drive/android/screenshots/GesturesTest_when_released_before_threshold_snaps_to_origin.png b/appyx-components/internal/test-drive/android/screenshots/GesturesTest_when_released_before_threshold_snaps_to_origin.png index 3cb35703e..0da77999b 100644 Binary files a/appyx-components/internal/test-drive/android/screenshots/GesturesTest_when_released_before_threshold_snaps_to_origin.png and b/appyx-components/internal/test-drive/android/screenshots/GesturesTest_when_released_before_threshold_snaps_to_origin.png differ diff --git a/appyx-components/internal/test-drive/android/screenshots/KeyframesTest_basic_behaviour_all_at_once.png b/appyx-components/internal/test-drive/android/screenshots/KeyframesTest_basic_behaviour_all_at_once.png index fb0d587e7..1a661fd72 100644 Binary files a/appyx-components/internal/test-drive/android/screenshots/KeyframesTest_basic_behaviour_all_at_once.png and b/appyx-components/internal/test-drive/android/screenshots/KeyframesTest_basic_behaviour_all_at_once.png differ diff --git a/appyx-components/internal/test-drive/android/screenshots/KeyframesTest_basic_behaviour_one_segment.png b/appyx-components/internal/test-drive/android/screenshots/KeyframesTest_basic_behaviour_one_segment.png index 5ed6df7cc..4d70cb240 100644 Binary files a/appyx-components/internal/test-drive/android/screenshots/KeyframesTest_basic_behaviour_one_segment.png and b/appyx-components/internal/test-drive/android/screenshots/KeyframesTest_basic_behaviour_one_segment.png differ diff --git a/appyx-components/internal/test-drive/android/screenshots/KeyframesTest_basic_behaviour_sequential.png b/appyx-components/internal/test-drive/android/screenshots/KeyframesTest_basic_behaviour_sequential.png index fcd5b09c6..bf343978b 100644 Binary files a/appyx-components/internal/test-drive/android/screenshots/KeyframesTest_basic_behaviour_sequential.png and b/appyx-components/internal/test-drive/android/screenshots/KeyframesTest_basic_behaviour_sequential.png differ diff --git a/appyx-components/internal/test-drive/android/screenshots/KeyframesTest_when_keyframe_is_running_then_possible_to_enqueue_more_operations.png b/appyx-components/internal/test-drive/android/screenshots/KeyframesTest_when_keyframe_is_running_then_possible_to_enqueue_more_operations.png index ecd450101..8d38c1b5c 100644 Binary files a/appyx-components/internal/test-drive/android/screenshots/KeyframesTest_when_keyframe_is_running_then_possible_to_enqueue_more_operations.png and b/appyx-components/internal/test-drive/android/screenshots/KeyframesTest_when_keyframe_is_running_then_possible_to_enqueue_more_operations.png differ diff --git a/appyx-components/internal/test-drive/android/screenshots/KeyframesTest_when_passing_segment_threshold_then_no_artefacts.png b/appyx-components/internal/test-drive/android/screenshots/KeyframesTest_when_passing_segment_threshold_then_no_artefacts.png index 61a3acdad..0dcd7054f 100644 Binary files a/appyx-components/internal/test-drive/android/screenshots/KeyframesTest_when_passing_segment_threshold_then_no_artefacts.png and b/appyx-components/internal/test-drive/android/screenshots/KeyframesTest_when_passing_segment_threshold_then_no_artefacts.png differ diff --git a/appyx-components/internal/test-drive/android/screenshots/KeyframesToUpdateTest_when_in_segment_interrupt_with_update.png b/appyx-components/internal/test-drive/android/screenshots/KeyframesToUpdateTest_when_in_segment_interrupt_with_update.png index cc708a8e1..fbf8e1f4d 100644 Binary files a/appyx-components/internal/test-drive/android/screenshots/KeyframesToUpdateTest_when_in_segment_interrupt_with_update.png and b/appyx-components/internal/test-drive/android/screenshots/KeyframesToUpdateTest_when_in_segment_interrupt_with_update.png differ diff --git a/appyx-components/internal/test-drive/android/screenshots/UpdateTest_basic_behaviour_multiple.png b/appyx-components/internal/test-drive/android/screenshots/UpdateTest_basic_behaviour_multiple.png index 8102a6f17..bb943cb09 100644 Binary files a/appyx-components/internal/test-drive/android/screenshots/UpdateTest_basic_behaviour_multiple.png and b/appyx-components/internal/test-drive/android/screenshots/UpdateTest_basic_behaviour_multiple.png differ diff --git a/appyx-components/internal/test-drive/android/screenshots/UpdateTest_basic_behaviour_one_update.png b/appyx-components/internal/test-drive/android/screenshots/UpdateTest_basic_behaviour_one_update.png index 1622e6c6c..0a98e62d0 100644 Binary files a/appyx-components/internal/test-drive/android/screenshots/UpdateTest_basic_behaviour_one_update.png and b/appyx-components/internal/test-drive/android/screenshots/UpdateTest_basic_behaviour_one_update.png differ diff --git a/appyx-components/internal/test-drive/android/screenshots/UpdateToKeyframesTest_when_animation_settles_go_back_to_keyframe_mode.png b/appyx-components/internal/test-drive/android/screenshots/UpdateToKeyframesTest_when_animation_settles_go_back_to_keyframe_mode.png index 07db393e9..429a27d85 100644 Binary files a/appyx-components/internal/test-drive/android/screenshots/UpdateToKeyframesTest_when_animation_settles_go_back_to_keyframe_mode.png and b/appyx-components/internal/test-drive/android/screenshots/UpdateToKeyframesTest_when_animation_settles_go_back_to_keyframe_mode.png differ diff --git a/appyx-components/internal/test-drive/android/screenshots/UpdateToKeyframesTest_when_update_not_settled_keyframe_is_update.png b/appyx-components/internal/test-drive/android/screenshots/UpdateToKeyframesTest_when_update_not_settled_keyframe_is_update.png index e5925edc8..3ac6657d6 100644 Binary files a/appyx-components/internal/test-drive/android/screenshots/UpdateToKeyframesTest_when_update_not_settled_keyframe_is_update.png and b/appyx-components/internal/test-drive/android/screenshots/UpdateToKeyframesTest_when_update_not_settled_keyframe_is_update.png differ diff --git a/appyx-components/internal/test-drive/android/src/androidTest/kotlin/com/bumble/appyx/components/internal/testdrive/android/helper/TestDriveUtils.kt b/appyx-components/internal/test-drive/android/src/androidTest/kotlin/com/bumble/appyx/components/internal/testdrive/android/helper/TestDriveUtils.kt index f716186ec..17e6aca45 100644 --- a/appyx-components/internal/test-drive/android/src/androidTest/kotlin/com/bumble/appyx/components/internal/testdrive/android/helper/TestDriveUtils.kt +++ b/appyx-components/internal/test-drive/android/src/androidTest/kotlin/com/bumble/appyx/components/internal/testdrive/android/helper/TestDriveUtils.kt @@ -6,7 +6,7 @@ import androidx.compose.animation.core.SpringSpec import androidx.compose.animation.core.spring import androidx.compose.animation.core.tween import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.material.Surface +import androidx.compose.material3.Surface import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.platform.LocalDensity diff --git a/appyx-components/standard/spotlight/android/screenshots/SpotlightViewpointTest_when_keyframe_operation_then_scroll_using_viewpoint.png b/appyx-components/standard/spotlight/android/screenshots/SpotlightViewpointTest_when_keyframe_operation_then_scroll_using_viewpoint.png index 1b5958eb2..ec4a57b26 100644 Binary files a/appyx-components/standard/spotlight/android/screenshots/SpotlightViewpointTest_when_keyframe_operation_then_scroll_using_viewpoint.png and b/appyx-components/standard/spotlight/android/screenshots/SpotlightViewpointTest_when_keyframe_operation_then_scroll_using_viewpoint.png differ diff --git a/appyx-components/standard/spotlight/android/screenshots/SpotlightViewpointTest_when_update__operation_then_scroll_using_viewpoint.png b/appyx-components/standard/spotlight/android/screenshots/SpotlightViewpointTest_when_update__operation_then_scroll_using_viewpoint.png index 5452671bf..b8c774972 100644 Binary files a/appyx-components/standard/spotlight/android/screenshots/SpotlightViewpointTest_when_update__operation_then_scroll_using_viewpoint.png and b/appyx-components/standard/spotlight/android/screenshots/SpotlightViewpointTest_when_update__operation_then_scroll_using_viewpoint.png differ diff --git a/appyx-interactions/android-utils/src/main/java/com/bumble/appyx/interactions/utils/testing/Utils.kt b/appyx-interactions/android-utils/src/main/java/com/bumble/appyx/interactions/utils/testing/Utils.kt index a407dfc50..253eabb22 100644 --- a/appyx-interactions/android-utils/src/main/java/com/bumble/appyx/interactions/utils/testing/Utils.kt +++ b/appyx-interactions/android-utils/src/main/java/com/bumble/appyx/interactions/utils/testing/Utils.kt @@ -5,8 +5,8 @@ import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.BoxWithConstraints import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding -import androidx.compose.material.Surface -import androidx.compose.material.Text +import androidx.compose.material3.Surface +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier diff --git a/appyx-navigation/common/src/jsMain/kotlin/com/bumble/appyx/navigation/integration/BrowserViewportWindow.kt b/appyx-navigation/common/src/jsMain/kotlin/com/bumble/appyx/navigation/integration/BrowserViewportWindow.kt index 1d96469f4..90f94b819 100644 --- a/appyx-navigation/common/src/jsMain/kotlin/com/bumble/appyx/navigation/integration/BrowserViewportWindow.kt +++ b/appyx-navigation/common/src/jsMain/kotlin/com/bumble/appyx/navigation/integration/BrowserViewportWindow.kt @@ -23,10 +23,11 @@ private const val CANVAS_ELEMENT_ID = "ComposeTarget" // Hardwired into ComposeW /** * A Skiko/Canvas-based top-level window using the browser's entire viewport. Supports resizing. */ +@Composable @Suppress("FunctionNaming") fun BrowserViewportWindow( title: String = "Untitled", - content: @Composable ComposeWindow.() -> Unit + content: @Composable () -> Unit ) { val htmlHeadElement = document.head!! htmlHeadElement.appendChild( @@ -59,7 +60,7 @@ fun BrowserViewportWindow( fillViewportSize() } - ComposeWindow().apply { + ComposeWindow(canvasId = "Appyx", content = content).apply { window.addEventListener("resize", { canvas.fillViewportSize() layer.layer.attachTo(canvas) @@ -77,9 +78,5 @@ fun BrowserViewportWindow( ?: document.createElement("title").also { htmlHeadElement.appendChild(it) } ) as HTMLTitleElement htmlTitleElement.textContent = title - - setContent { - content(this) - } } } diff --git a/demos/appyx-interactions/android/lint-baseline.xml b/demos/appyx-interactions/android/lint-baseline.xml index 1d527bcea..3452b0677 100644 --- a/demos/appyx-interactions/android/lint-baseline.xml +++ b/demos/appyx-interactions/android/lint-baseline.xml @@ -1,4 +1,59 @@ - + + + + + + + + + + + + + + + + + + + + + diff --git a/demos/appyx-interactions/web/src/jsMain/kotlin/com/bumble/appyx/interactions/main.js.kt b/demos/appyx-interactions/web/src/jsMain/kotlin/com/bumble/appyx/interactions/main.js.kt index 1be807ba9..53b130781 100644 --- a/demos/appyx-interactions/web/src/jsMain/kotlin/com/bumble/appyx/interactions/main.js.kt +++ b/demos/appyx-interactions/web/src/jsMain/kotlin/com/bumble/appyx/interactions/main.js.kt @@ -7,11 +7,12 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.unit.IntSize -import androidx.compose.ui.window.Window +import androidx.compose.ui.window.CanvasBasedWindow import com.bumble.appyx.components.internal.testdrive.TestDriveExperiment import com.bumble.appyx.components.internal.testdrive.ui.md_amber_500 import com.bumble.appyx.components.internal.testdrive.ui.md_blue_500 @@ -53,9 +54,10 @@ enum class InteractionTarget { Child1 } +@OptIn(ExperimentalComposeUiApi::class) fun main() { onWasmReady { - Window("Appyx") { + CanvasBasedWindow("Appyx") { var size by remember { mutableStateOf(IntSize.Zero) } Surface( modifier = Modifier diff --git a/demos/appyx-navigation/common/build.gradle.kts b/demos/appyx-navigation/common/build.gradle.kts index 1d23e8f3b..85c316443 100644 --- a/demos/appyx-navigation/common/build.gradle.kts +++ b/demos/appyx-navigation/common/build.gradle.kts @@ -38,7 +38,7 @@ kotlin { api(project(":utils:utils-customisations")) api(project(":utils:utils-material3")) api(project(":utils:utils-multiplatform")) - api(project(":demos:image-loader:image-loader")) + api(project(":demos:image-loader:loader")) implementation(project(":appyx-components:experimental:cards:cards")) implementation(project(":appyx-components:experimental:promoter:promoter")) implementation(project(":appyx-components:standard:backstack:backstack")) diff --git a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/demos/navigation/node/checkout/CartContent.kt b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/demos/navigation/node/checkout/CartContent.kt index 78f8e7fcd..97a00a33f 100644 --- a/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/demos/navigation/node/checkout/CartContent.kt +++ b/demos/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/demos/navigation/node/checkout/CartContent.kt @@ -28,14 +28,13 @@ import androidx.compose.material.icons.filled.Delete import androidx.compose.material3.Button import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.Card -import androidx.compose.material3.DismissDirection.EndToStart -import androidx.compose.material3.DismissValue import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.SwipeToDismiss +import androidx.compose.material3.SwipeToDismissBox +import androidx.compose.material3.SwipeToDismissBoxValue import androidx.compose.material3.Text -import androidx.compose.material3.rememberDismissState +import androidx.compose.material3.rememberSwipeToDismissBoxState import androidx.compose.runtime.Composable import androidx.compose.runtime.remember import androidx.compose.runtime.rememberCoroutineScope @@ -118,12 +117,12 @@ private fun LazyItemScope.CartListItem( val quantity = cakeToQuantity.second val coroutineScope = rememberCoroutineScope() - val dismissState = rememberDismissState(confirmValueChange = { dismissValue -> + val dismissState = rememberSwipeToDismissBoxState(confirmValueChange = { dismissValue -> when (dismissValue) { - DismissValue.Default, - DismissValue.DismissedToEnd -> false + SwipeToDismissBoxValue.Settled, + SwipeToDismissBoxValue.StartToEnd -> false - DismissValue.DismissedToStart -> { + SwipeToDismissBoxValue.EndToStart -> { coroutineScope.launch { delay(250) onDeleteCake(cake) @@ -133,21 +132,21 @@ private fun LazyItemScope.CartListItem( } }) - SwipeToDismiss( + SwipeToDismissBox( modifier = Modifier.animateItemPlacement(), state = dismissState, - directions = setOf(EndToStart), - background = { CartItemDismissBackground() }, - dismissContent = { - CardItem( - cake = cake, - quantity = quantity, - onGoToCake = onGoToCake, - plusOneCakeAction = onPlusOneCake, - minusOneCakeAction = onMinusOneCake, - ) - }, - ) + enableDismissFromStartToEnd = false, + enableDismissFromEndToStart = true, + backgroundContent = { CartItemDismissBackground() }, + ) { + CardItem( + cake = cake, + quantity = quantity, + onGoToCake = onGoToCake, + plusOneCakeAction = onPlusOneCake, + minusOneCakeAction = onMinusOneCake, + ) + } } @Composable diff --git a/demos/image-loader/common/src/commonMain/kotlin/com/bumble/appyx/imageloader/ResourceImage.kt b/demos/image-loader/common/src/commonMain/kotlin/com/bumble/appyx/imageloader/ResourceImage.kt index b03954d58..06f6508f1 100644 --- a/demos/image-loader/common/src/commonMain/kotlin/com/bumble/appyx/imageloader/ResourceImage.kt +++ b/demos/image-loader/common/src/commonMain/kotlin/com/bumble/appyx/imageloader/ResourceImage.kt @@ -12,11 +12,11 @@ import androidx.compose.ui.graphics.ImageBitmap import androidx.compose.ui.layout.ContentScale import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext -import org.jetbrains.compose.resources.ExperimentalResourceApi -import org.jetbrains.compose.resources.resource +import org.jetbrains.compose.resources.InternalResourceApi +import org.jetbrains.compose.resources.readResourceBytes +@OptIn(InternalResourceApi::class) @Suppress("TooGenericExceptionCaught", "SwallowedException") -@OptIn(ExperimentalResourceApi::class) @Composable fun ResourceImage( path: String, @@ -29,13 +29,11 @@ fun ResourceImage( LaunchedEffect(Unit) { image = withContext(Dispatchers.Default) { try { - resource(path) - .readBytes() + readResourceBytes(path) .toImageBitmap() } catch (e: Throwable) { try { - resource(fallbackUrl) - .readBytes() + readResourceBytes(fallbackUrl) .toImageBitmap() } catch (e: Throwable) { null diff --git a/demos/mkdocs/appyx-components/backstack/fader/web/src/jsMain/kotlin/com/bumble/appyx/demos/backstack/fader/main.js.kt b/demos/mkdocs/appyx-components/backstack/fader/web/src/jsMain/kotlin/com/bumble/appyx/demos/backstack/fader/main.js.kt index 3851bbfe5..15e0c3fe8 100644 --- a/demos/mkdocs/appyx-components/backstack/fader/web/src/jsMain/kotlin/com/bumble/appyx/demos/backstack/fader/main.js.kt +++ b/demos/mkdocs/appyx-components/backstack/fader/web/src/jsMain/kotlin/com/bumble/appyx/demos/backstack/fader/main.js.kt @@ -8,18 +8,20 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Window +import androidx.compose.ui.window.CanvasBasedWindow import com.bumble.appyx.demos.appyxSample import com.bumble.appyx.demos.common.color_dark +@OptIn(ExperimentalComposeUiApi::class) fun main() { appyxSample { - Window("Appyx") { + CanvasBasedWindow("Appyx") { var size by remember { mutableStateOf(IntSize.Zero) } Surface( modifier = Modifier diff --git a/demos/mkdocs/appyx-components/backstack/parallax/web/src/jsMain/kotlin/com/bumble/appyx/demos/backstack/parallax/main.js.kt b/demos/mkdocs/appyx-components/backstack/parallax/web/src/jsMain/kotlin/com/bumble/appyx/demos/backstack/parallax/main.js.kt index 02d62ffa8..810e353c1 100644 --- a/demos/mkdocs/appyx-components/backstack/parallax/web/src/jsMain/kotlin/com/bumble/appyx/demos/backstack/parallax/main.js.kt +++ b/demos/mkdocs/appyx-components/backstack/parallax/web/src/jsMain/kotlin/com/bumble/appyx/demos/backstack/parallax/main.js.kt @@ -8,18 +8,20 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Window +import androidx.compose.ui.window.CanvasBasedWindow import com.bumble.appyx.demos.appyxSample import com.bumble.appyx.demos.common.color_dark +@OptIn(ExperimentalComposeUiApi::class) fun main() { appyxSample { - Window("Appyx") { + CanvasBasedWindow("Appyx") { var size by remember { mutableStateOf(IntSize.Zero) } Surface( modifier = Modifier diff --git a/demos/mkdocs/appyx-components/backstack/slider/web/src/jsMain/kotlin/com/bumble/appyx/demos/backstack/slider/main.js.kt b/demos/mkdocs/appyx-components/backstack/slider/web/src/jsMain/kotlin/com/bumble/appyx/demos/backstack/slider/main.js.kt index 8e3d67a6c..997896eca 100644 --- a/demos/mkdocs/appyx-components/backstack/slider/web/src/jsMain/kotlin/com/bumble/appyx/demos/backstack/slider/main.js.kt +++ b/demos/mkdocs/appyx-components/backstack/slider/web/src/jsMain/kotlin/com/bumble/appyx/demos/backstack/slider/main.js.kt @@ -8,18 +8,20 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Window +import androidx.compose.ui.window.CanvasBasedWindow import com.bumble.appyx.demos.appyxSample import com.bumble.appyx.demos.common.color_dark +@OptIn(ExperimentalComposeUiApi::class) fun main() { appyxSample { - Window("Appyx") { + CanvasBasedWindow("Appyx") { var size by remember { mutableStateOf(IntSize.Zero) } Surface( modifier = Modifier diff --git a/demos/mkdocs/appyx-components/backstack/stack3d/web/src/jsMain/kotlin/com/bumble/appyx/demos/backstack/stack3d/main.js.kt b/demos/mkdocs/appyx-components/backstack/stack3d/web/src/jsMain/kotlin/com/bumble/appyx/demos/backstack/stack3d/main.js.kt index 48ea48c2e..840b348dc 100644 --- a/demos/mkdocs/appyx-components/backstack/stack3d/web/src/jsMain/kotlin/com/bumble/appyx/demos/backstack/stack3d/main.js.kt +++ b/demos/mkdocs/appyx-components/backstack/stack3d/web/src/jsMain/kotlin/com/bumble/appyx/demos/backstack/stack3d/main.js.kt @@ -8,18 +8,20 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Window +import androidx.compose.ui.window.CanvasBasedWindow import com.bumble.appyx.demos.appyxSample import com.bumble.appyx.demos.common.color_dark +@OptIn(ExperimentalComposeUiApi::class) fun main() { appyxSample { - Window("Appyx") { + CanvasBasedWindow("Appyx") { var size by remember { mutableStateOf(IntSize.Zero) } Surface( modifier = Modifier diff --git a/demos/mkdocs/appyx-components/experimental/datingcards/web/src/jsMain/kotlin/com/bumble/appyx/demos/experimental/datingcards/main.js.kt b/demos/mkdocs/appyx-components/experimental/datingcards/web/src/jsMain/kotlin/com/bumble/appyx/demos/experimental/datingcards/main.js.kt index 92911830e..41c268dee 100644 --- a/demos/mkdocs/appyx-components/experimental/datingcards/web/src/jsMain/kotlin/com/bumble/appyx/demos/experimental/datingcards/main.js.kt +++ b/demos/mkdocs/appyx-components/experimental/datingcards/web/src/jsMain/kotlin/com/bumble/appyx/demos/experimental/datingcards/main.js.kt @@ -8,18 +8,20 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Window +import androidx.compose.ui.window.CanvasBasedWindow import com.bumble.appyx.demos.appyxSample import com.bumble.appyx.demos.common.color_dark +@OptIn(ExperimentalComposeUiApi::class) fun main() { appyxSample { - Window("Appyx") { + CanvasBasedWindow("Appyx") { var size by remember { mutableStateOf(IntSize.Zero) } Surface( modifier = Modifier diff --git a/demos/mkdocs/appyx-components/experimental/puzzle15/web/src/jsMain/kotlin/com/bumble/appyx/demos/experimental/puzzle15/main.js.kt b/demos/mkdocs/appyx-components/experimental/puzzle15/web/src/jsMain/kotlin/com/bumble/appyx/demos/experimental/puzzle15/main.js.kt index 144f28295..ab71d5098 100644 --- a/demos/mkdocs/appyx-components/experimental/puzzle15/web/src/jsMain/kotlin/com/bumble/appyx/demos/experimental/puzzle15/main.js.kt +++ b/demos/mkdocs/appyx-components/experimental/puzzle15/web/src/jsMain/kotlin/com/bumble/appyx/demos/experimental/puzzle15/main.js.kt @@ -8,20 +8,22 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Window +import androidx.compose.ui.window.CanvasBasedWindow import com.bumble.appyx.components.experimental.puzzle15.ui.Puzzle15Ui import com.bumble.appyx.demos.appyxSample import com.bumble.appyx.demos.common.color_dark import com.bumble.appyx.demos.common.color_primary +@OptIn(ExperimentalComposeUiApi::class) fun main() { appyxSample { - Window("Appyx") { + CanvasBasedWindow("Appyx") { var size by remember { mutableStateOf(IntSize.Zero) } Surface( modifier = Modifier diff --git a/demos/mkdocs/appyx-components/spotlight/fader/web/src/jsMain/kotlin/com/bumble/appyx/demos/spotlight/fader/main.js.kt b/demos/mkdocs/appyx-components/spotlight/fader/web/src/jsMain/kotlin/com/bumble/appyx/demos/spotlight/fader/main.js.kt index 3a7db12ca..2c7277c71 100644 --- a/demos/mkdocs/appyx-components/spotlight/fader/web/src/jsMain/kotlin/com/bumble/appyx/demos/spotlight/fader/main.js.kt +++ b/demos/mkdocs/appyx-components/spotlight/fader/web/src/jsMain/kotlin/com/bumble/appyx/demos/spotlight/fader/main.js.kt @@ -8,18 +8,20 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Window +import androidx.compose.ui.window.CanvasBasedWindow import com.bumble.appyx.demos.appyxSample import com.bumble.appyx.demos.common.color_dark +@OptIn(ExperimentalComposeUiApi::class) fun main() { appyxSample { - Window("Appyx") { + CanvasBasedWindow("Appyx") { var size by remember { mutableStateOf(IntSize.Zero) } Surface( modifier = Modifier diff --git a/demos/mkdocs/appyx-components/spotlight/slider/web/src/jsMain/kotlin/com/bumble/appyx/demos/spotlight/slider/main.js.kt b/demos/mkdocs/appyx-components/spotlight/slider/web/src/jsMain/kotlin/com/bumble/appyx/demos/spotlight/slider/main.js.kt index 935307aae..eb8f4b292 100644 --- a/demos/mkdocs/appyx-components/spotlight/slider/web/src/jsMain/kotlin/com/bumble/appyx/demos/spotlight/slider/main.js.kt +++ b/demos/mkdocs/appyx-components/spotlight/slider/web/src/jsMain/kotlin/com/bumble/appyx/demos/spotlight/slider/main.js.kt @@ -8,18 +8,20 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Window +import androidx.compose.ui.window.CanvasBasedWindow import com.bumble.appyx.demos.appyxSample import com.bumble.appyx.demos.common.color_dark +@OptIn(ExperimentalComposeUiApi::class) fun main() { appyxSample { - Window("Appyx") { + CanvasBasedWindow("Appyx") { var size by remember { mutableStateOf(IntSize.Zero) } Surface( modifier = Modifier diff --git a/demos/mkdocs/appyx-components/spotlight/sliderrotation/web/src/jsMain/kotlin/com/bumble/appyx/demos/spotlight/sliderrotation/main.js.kt b/demos/mkdocs/appyx-components/spotlight/sliderrotation/web/src/jsMain/kotlin/com/bumble/appyx/demos/spotlight/sliderrotation/main.js.kt index d1adbd35f..6999e1c8d 100644 --- a/demos/mkdocs/appyx-components/spotlight/sliderrotation/web/src/jsMain/kotlin/com/bumble/appyx/demos/spotlight/sliderrotation/main.js.kt +++ b/demos/mkdocs/appyx-components/spotlight/sliderrotation/web/src/jsMain/kotlin/com/bumble/appyx/demos/spotlight/sliderrotation/main.js.kt @@ -8,18 +8,20 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Window +import androidx.compose.ui.window.CanvasBasedWindow import com.bumble.appyx.demos.appyxSample import com.bumble.appyx.demos.common.color_dark +@OptIn(ExperimentalComposeUiApi::class) fun main() { appyxSample { - Window("Appyx") { + CanvasBasedWindow("Appyx") { var size by remember { mutableStateOf(IntSize.Zero) } Surface( modifier = Modifier diff --git a/demos/mkdocs/appyx-components/spotlight/sliderscale/web/src/jsMain/kotlin/com/bumble/appyx/demos/spotlight/sliderscale/main.js.kt b/demos/mkdocs/appyx-components/spotlight/sliderscale/web/src/jsMain/kotlin/com/bumble/appyx/demos/spotlight/sliderscale/main.js.kt index 6e1dbecd0..72ed61307 100644 --- a/demos/mkdocs/appyx-components/spotlight/sliderscale/web/src/jsMain/kotlin/com/bumble/appyx/demos/spotlight/sliderscale/main.js.kt +++ b/demos/mkdocs/appyx-components/spotlight/sliderscale/web/src/jsMain/kotlin/com/bumble/appyx/demos/spotlight/sliderscale/main.js.kt @@ -8,18 +8,20 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Window +import androidx.compose.ui.window.CanvasBasedWindow import com.bumble.appyx.demos.appyxSample import com.bumble.appyx.demos.common.color_dark +@OptIn(ExperimentalComposeUiApi::class) fun main() { appyxSample { - Window("Appyx") { + CanvasBasedWindow("Appyx") { var size by remember { mutableStateOf(IntSize.Zero) } Surface( modifier = Modifier diff --git a/demos/mkdocs/appyx-components/spotlight/stack3d/web/src/jsMain/kotlin/com/bumble/appyx/demos/spotlight/stack3d/main.js.kt b/demos/mkdocs/appyx-components/spotlight/stack3d/web/src/jsMain/kotlin/com/bumble/appyx/demos/spotlight/stack3d/main.js.kt index 4ed9abc7e..39f40cc69 100644 --- a/demos/mkdocs/appyx-components/spotlight/stack3d/web/src/jsMain/kotlin/com/bumble/appyx/demos/spotlight/stack3d/main.js.kt +++ b/demos/mkdocs/appyx-components/spotlight/stack3d/web/src/jsMain/kotlin/com/bumble/appyx/demos/spotlight/stack3d/main.js.kt @@ -8,18 +8,20 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Window +import androidx.compose.ui.window.CanvasBasedWindow import com.bumble.appyx.demos.appyxSample import com.bumble.appyx.demos.common.color_dark +@OptIn(ExperimentalComposeUiApi::class) fun main() { appyxSample { - Window("Appyx") { + CanvasBasedWindow("Appyx") { var size by remember { mutableStateOf(IntSize.Zero) } Surface( modifier = Modifier diff --git a/demos/mkdocs/appyx-interactions/gestures/dragprediction/web/src/jsMain/kotlin/com/bumble/appyx/demos/dragprediction/main.js.kt b/demos/mkdocs/appyx-interactions/gestures/dragprediction/web/src/jsMain/kotlin/com/bumble/appyx/demos/dragprediction/main.js.kt index dde40fed0..8cb6ad058 100644 --- a/demos/mkdocs/appyx-interactions/gestures/dragprediction/web/src/jsMain/kotlin/com/bumble/appyx/demos/dragprediction/main.js.kt +++ b/demos/mkdocs/appyx-interactions/gestures/dragprediction/web/src/jsMain/kotlin/com/bumble/appyx/demos/dragprediction/main.js.kt @@ -8,12 +8,13 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Window +import androidx.compose.ui.window.CanvasBasedWindow import com.bumble.appyx.demos.appyxSample val color_bright = Color(0xFFFFFFFF) @@ -27,9 +28,10 @@ val color_neutral3 = Color(0xFFD9E8ED) val color_neutral4 = Color(0xFFBEA489) +@OptIn(ExperimentalComposeUiApi::class) fun main() { appyxSample { - Window("Appyx") { + CanvasBasedWindow("Appyx") { var size by remember { mutableStateOf(IntSize.Zero) } Surface( modifier = Modifier diff --git a/demos/mkdocs/appyx-interactions/gestures/incompletedrag/web/src/jsMain/kotlin/com/bumble/appyx/demos/incompletedrag/main.js.kt b/demos/mkdocs/appyx-interactions/gestures/incompletedrag/web/src/jsMain/kotlin/com/bumble/appyx/demos/incompletedrag/main.js.kt index 2277c3919..421193d13 100644 --- a/demos/mkdocs/appyx-interactions/gestures/incompletedrag/web/src/jsMain/kotlin/com/bumble/appyx/demos/incompletedrag/main.js.kt +++ b/demos/mkdocs/appyx-interactions/gestures/incompletedrag/web/src/jsMain/kotlin/com/bumble/appyx/demos/incompletedrag/main.js.kt @@ -8,12 +8,13 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Window +import androidx.compose.ui.window.CanvasBasedWindow import com.bumble.appyx.demos.appyxSample val color_bright = Color(0xFFFFFFFF) @@ -27,9 +28,10 @@ val color_neutral3 = Color(0xFFD9E8ED) val color_neutral4 = Color(0xFFBEA489) +@OptIn(ExperimentalComposeUiApi::class) fun main() { appyxSample { - Window("Appyx") { + CanvasBasedWindow("Appyx") { var size by remember { mutableStateOf(IntSize.Zero) } Surface( modifier = Modifier diff --git a/demos/mkdocs/appyx-interactions/interactions/observemp/web/src/jsMain/kotlin/com/bumble/appyx/demos/observemp/main.js.kt b/demos/mkdocs/appyx-interactions/interactions/observemp/web/src/jsMain/kotlin/com/bumble/appyx/demos/observemp/main.js.kt index a0874742e..2028b19b8 100644 --- a/demos/mkdocs/appyx-interactions/interactions/observemp/web/src/jsMain/kotlin/com/bumble/appyx/demos/observemp/main.js.kt +++ b/demos/mkdocs/appyx-interactions/interactions/observemp/web/src/jsMain/kotlin/com/bumble/appyx/demos/observemp/main.js.kt @@ -8,18 +8,20 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Window +import androidx.compose.ui.window.CanvasBasedWindow import com.bumble.appyx.demos.common.color_dark import org.jetbrains.skiko.wasm.onWasmReady +@OptIn(ExperimentalComposeUiApi::class) fun main() { onWasmReady { - Window("Appyx") { + CanvasBasedWindow("Appyx") { var size by remember { mutableStateOf(IntSize.Zero) } Surface( modifier = Modifier diff --git a/demos/mkdocs/appyx-interactions/interactions/sample1/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample1/main.js.kt b/demos/mkdocs/appyx-interactions/interactions/sample1/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample1/main.js.kt index 4b86a1721..ecd275657 100644 --- a/demos/mkdocs/appyx-interactions/interactions/sample1/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample1/main.js.kt +++ b/demos/mkdocs/appyx-interactions/interactions/sample1/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample1/main.js.kt @@ -8,12 +8,13 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Window +import androidx.compose.ui.window.CanvasBasedWindow import com.bumble.appyx.demos.appyxSample val color_bright = Color(0xFFFFFFFF) @@ -27,9 +28,10 @@ val color_neutral3 = Color(0xFFD9E8ED) val color_neutral4 = Color(0xFFBEA489) +@OptIn(ExperimentalComposeUiApi::class) fun main() { appyxSample { - Window("Appyx") { + CanvasBasedWindow("Appyx") { var size by remember { mutableStateOf(IntSize.Zero) } Surface( modifier = Modifier diff --git a/demos/mkdocs/appyx-interactions/interactions/sample2/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample2/main.js.kt b/demos/mkdocs/appyx-interactions/interactions/sample2/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample2/main.js.kt index b77d09c81..5f074c3c2 100644 --- a/demos/mkdocs/appyx-interactions/interactions/sample2/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample2/main.js.kt +++ b/demos/mkdocs/appyx-interactions/interactions/sample2/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample2/main.js.kt @@ -8,12 +8,13 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Window +import androidx.compose.ui.window.CanvasBasedWindow import com.bumble.appyx.demos.appyxSample val color_bright = Color(0xFFFFFFFF) @@ -27,9 +28,10 @@ val color_neutral3 = Color(0xFFD9E8ED) val color_neutral4 = Color(0xFFBEA489) +@OptIn(ExperimentalComposeUiApi::class) fun main() { appyxSample { - Window("Appyx") { + CanvasBasedWindow("Appyx") { var size by remember { mutableStateOf(IntSize.Zero) } Surface( modifier = Modifier diff --git a/demos/mkdocs/appyx-interactions/interactions/sample3/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample3/main.js.kt b/demos/mkdocs/appyx-interactions/interactions/sample3/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample3/main.js.kt index 394da11e4..ae3c04bf4 100644 --- a/demos/mkdocs/appyx-interactions/interactions/sample3/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample3/main.js.kt +++ b/demos/mkdocs/appyx-interactions/interactions/sample3/web/src/jsMain/kotlin/com/bumble/appyx/demos/sample3/main.js.kt @@ -8,12 +8,13 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Window +import androidx.compose.ui.window.CanvasBasedWindow import com.bumble.appyx.demos.appyxSample val color_bright = Color(0xFFFFFFFF) @@ -27,9 +28,10 @@ val color_neutral3 = Color(0xFFD9E8ED) val color_neutral4 = Color(0xFFBEA489) +@OptIn(ExperimentalComposeUiApi::class) fun main() { appyxSample { - Window("Appyx") { + CanvasBasedWindow("Appyx") { var size by remember { mutableStateOf(IntSize.Zero) } Surface( modifier = Modifier diff --git a/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/demos/sandbox/navigation/node/profilecard/ProfileCardNode.kt b/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/demos/sandbox/navigation/node/profilecard/ProfileCardNode.kt index 4d5a67ab3..4bbf6ac82 100644 --- a/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/demos/sandbox/navigation/node/profilecard/ProfileCardNode.kt +++ b/demos/sandbox-appyx-navigation/android/src/main/kotlin/com/bumble/appyx/demos/sandbox/navigation/node/profilecard/ProfileCardNode.kt @@ -7,7 +7,7 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.requiredHeight import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material.Text +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier diff --git a/demos/sandbox-appyx-navigation/web/src/jsMain/kotlin/com/bumble/appyx/demos/sandbox/navigation/Main.kt b/demos/sandbox-appyx-navigation/web/src/jsMain/kotlin/com/bumble/appyx/demos/sandbox/navigation/Main.kt index a138c466a..b65cea23c 100644 --- a/demos/sandbox-appyx-navigation/web/src/jsMain/kotlin/com/bumble/appyx/demos/sandbox/navigation/Main.kt +++ b/demos/sandbox-appyx-navigation/web/src/jsMain/kotlin/com/bumble/appyx/demos/sandbox/navigation/Main.kt @@ -22,9 +22,9 @@ import androidx.compose.ui.input.key.onKeyEvent import androidx.compose.ui.input.key.type import androidx.compose.ui.layout.onSizeChanged import androidx.compose.ui.unit.dp +import androidx.compose.ui.window.CanvasBasedWindow import com.bumble.appyx.demos.sandbox.navigation.node.container.MainNavNode import com.bumble.appyx.demos.sandbox.navigation.ui.AppyxSampleAppTheme -import com.bumble.appyx.navigation.integration.BrowserViewportWindow import com.bumble.appyx.navigation.integration.ScreenSize import com.bumble.appyx.navigation.integration.WebNodeHost import kotlinx.coroutines.CoroutineScope @@ -35,10 +35,11 @@ import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.launch import org.jetbrains.skiko.wasm.onWasmReady +@OptIn(ExperimentalComposeUiApi::class) fun main() { val events: Channel = Channel() onWasmReady { - BrowserViewportWindow("Navigation Demo") { + CanvasBasedWindow("Navigation Demo") { val requester = remember { FocusRequester() } var hasFocus by remember { mutableStateOf(false) } @@ -78,7 +79,6 @@ fun main() { } } -@OptIn(ExperimentalComposeUiApi::class) private fun onKeyEvent( keyEvent: KeyEvent, events: Channel, diff --git a/documentation/navigation/multiplatform.md b/documentation/navigation/multiplatform.md index aa9da73e6..2cf2e5d1d 100644 --- a/documentation/navigation/multiplatform.md +++ b/documentation/navigation/multiplatform.md @@ -138,7 +138,7 @@ fun main() = application { fun main() { val events: Channel = Channel() onWasmReady { - BrowserViewportWindow("Your app") { + CanvasBasedWindow("Your app") { val requester = remember { FocusRequester() } var hasFocus by remember { mutableStateOf(false) } var screenSize by remember { mutableStateOf(ScreenSize(0.dp, 0.dp)) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f2c2c649b..6093a067b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -9,16 +9,16 @@ androidTargetSdk = "32" androidx-lifecycle = "2.6.1" androidx-navigation-compose = "2.5.1" coil = "2.2.1" -composePlugin = "1.5.11" -composeBom = "2023.10.01" -composeCompiler = "1.5.7" +composePlugin = "1.6.1" +composeBom = "2024.03.00" +composeCompiler = "1.5.11" coroutines = "1.6.4" dependencyAnalysis = "1.27.0" detekt = "1.21.0" junit5 = "5.8.2" jvmTarget = "11" -kotlin = "1.9.21" -ksp = "1.9.21-1.0.16" +kotlin = "1.9.23" +ksp = "1.9.23-1.0.19" mvicore = "1.2.6" ribs = "0.39.0" serialization-json = "1.5.0" diff --git a/plugins/verification-plugin/src/main/kotlin/LintPlugin.kt b/plugins/verification-plugin/src/main/kotlin/LintPlugin.kt index 698096ed6..65e8573a1 100644 --- a/plugins/verification-plugin/src/main/kotlin/LintPlugin.kt +++ b/plugins/verification-plugin/src/main/kotlin/LintPlugin.kt @@ -21,6 +21,7 @@ class LintPlugin : Plugin { sarifReport = true baseline = target.file("lint-baseline.xml") warningsAsErrors = true + disable += listOf("ObsoleteLintCustomCheck") } } diff --git a/settings.gradle.kts b/settings.gradle.kts index 2d0cc4898..9eb7d1353 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -106,7 +106,7 @@ project(":appyx-components:experimental:promoter:common").name = "promoter" project(":appyx-components:experimental:puzzle15:common").name = "puzzle15" project(":appyx-components:experimental:puzzle15:web").name = "puzzle15-web" project(":appyx-components:internal:test-drive:common").name = "test-drive" -project(":demos:image-loader:common").name = "image-loader" +project(":demos:image-loader:common").name = "loader" project(":demos:sandbox-appyx-navigation:web").name = "navigation-web" project(":utils:customisations").name = "utils-customisations" project(":utils:material3").name = "utils-material3"