diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1866f4565a..5de66d8615 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -21,6 +21,7 @@ kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" } kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" } +kotlinx-coroutines-swing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "kotlinx-coroutines" } kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" } kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kotlinx-serialization" } @@ -68,7 +69,7 @@ assertk = "com.willowtreeapps.assertk:assertk:0.28.0" robolectric = { module = "org.robolectric:robolectric", version = "4.11.1" } okio = { module = "com.squareup.okio:okio", version.ref = "okio" } okio-assetfilesystem = { module = "com.squareup.okio:okio-assetfilesystem", version.ref = "okio" } -okHttp = { module = "com.squareup.okhttp3:okhttp", version = "4.12.0" } +okhttp = { module = "com.squareup.okhttp3:okhttp", version = "4.12.0" } paging-compose-common = { module = "app.cash.paging:paging-compose-common", version = "3.3.0-alpha02-0.4.0" } zipline = { module = "app.cash.zipline:zipline", version.ref = "zipline" } zipline-gradlePlugin = { module = "app.cash.zipline:zipline-gradle-plugin", version.ref = "zipline" } diff --git a/redwood-treehouse-host/build.gradle b/redwood-treehouse-host/build.gradle index a8a6f629e7..b04ef0ff17 100644 --- a/redwood-treehouse-host/build.gradle +++ b/redwood-treehouse-host/build.gradle @@ -28,7 +28,7 @@ kotlin { androidMain { dependencies { - api libs.okHttp + api libs.okhttp implementation libs.androidx.activity } } diff --git a/samples/emoji-search/android-composeui/build.gradle b/samples/emoji-search/android-composeui/build.gradle index 2ac6b5d90c..0768e0abbf 100644 --- a/samples/emoji-search/android-composeui/build.gradle +++ b/samples/emoji-search/android-composeui/build.gradle @@ -20,19 +20,18 @@ android { } dependencies { - implementation libs.coil.compose implementation libs.coil.network.okhttp implementation libs.google.material implementation libs.kotlinx.coroutines.android implementation projects.samples.emojiSearch.launcher implementation projects.samples.emojiSearch.presenterTreehouse implementation projects.samples.emojiSearch.schema.widget.protocol + implementation projects.samples.emojiSearch.sharedComposeui implementation libs.androidx.activity.compose implementation libs.androidx.appCompat implementation libs.androidx.core implementation libs.jetbrains.compose.material implementation libs.jetbrains.compose.ui - implementation libs.jetbrains.compose.ui.tooling.preview debugImplementation libs.jetbrains.compose.ui.tooling implementation projects.redwoodLayoutComposeui implementation projects.redwoodLazylayoutComposeui diff --git a/samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/EmojiSearchActivity.kt b/samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/EmojiSearchActivity.kt index 1ce10b0158..845526f385 100644 --- a/samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/EmojiSearchActivity.kt +++ b/samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/EmojiSearchActivity.kt @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 Square, Inc. + * Copyright (C) 2024 Square, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,8 @@ */ package com.example.redwood.emojisearch.android.composeui +import android.content.Intent +import android.net.Uri import android.os.Bundle import android.util.Log import androidx.activity.ComponentActivity @@ -42,6 +44,8 @@ import app.cash.zipline.ZiplineManifest import app.cash.zipline.loader.ManifestVerifier import app.cash.zipline.loader.asZiplineHttpClient import app.cash.zipline.loader.withDevelopmentServerPush +import com.example.redwood.emojisearch.composeui.ComposeUiEmojiSearchWidgetFactory +import com.example.redwood.emojisearch.composeui.EmojiSearchTheme import com.example.redwood.emojisearch.launcher.EmojiSearchAppSpec import com.example.redwood.emojisearch.treehouse.EmojiSearchPresenter import com.example.redwood.emojisearch.widget.EmojiSearchProtocolFactory @@ -70,7 +74,7 @@ class EmojiSearchActivity : ComponentActivity() { val widgetSystem = WidgetSystem { json, protocolMismatchHandler -> EmojiSearchProtocolFactory<@Composable () -> Unit>( provider = EmojiSearchWidgetFactories( - EmojiSearch = AndroidEmojiSearchWidgetFactory(), + EmojiSearch = ComposeUiEmojiSearchWidgetFactory(), RedwoodLayout = ComposeUiRedwoodLayoutWidgetFactory(), RedwoodLazyLayout = ComposeUiRedwoodLazyLayoutWidgetFactory(), ), @@ -140,7 +144,14 @@ class EmojiSearchActivity : ComponentActivity() { appScope = scope, spec = EmojiSearchAppSpec( manifestUrl = manifestUrlFlow, - hostApi = RealHostApi(this@EmojiSearchActivity, httpClient), + hostApi = RealHostApi( + client = httpClient, + openUrl = { url -> + val intent = Intent(Intent.ACTION_VIEW) + intent.setData(Uri.parse(url)) + startActivity(intent) + }, + ), ), eventListenerFactory = { app, manifestUrl -> appEventListener }, ) diff --git a/samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/RealHostApi.kt b/samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/RealHostApi.kt index 92bf6e2834..8939af8b4d 100644 --- a/samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/RealHostApi.kt +++ b/samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/RealHostApi.kt @@ -15,10 +15,6 @@ */ package com.example.redwood.emojisearch.android.composeui -import android.content.Context -import android.content.Intent -import android.net.Uri -import androidx.core.content.ContextCompat.startActivity import com.example.redwood.emojisearch.treehouse.HostApi import kotlin.coroutines.resume import kotlin.coroutines.resumeWithException @@ -36,8 +32,8 @@ class HttpException(response: Response) : RuntimeException("HTTP ${response.code} ${response.message}") class RealHostApi( - private val context: Context, private val client: OkHttpClient, + private val openUrl: (url: String) -> Unit, ) : HostApi { override suspend fun httpCall(url: String, headers: Map): String { return suspendCancellableCoroutine { continuation -> @@ -67,8 +63,6 @@ class RealHostApi( } override fun openUrl(url: String) { - val intent = Intent(Intent.ACTION_VIEW) - intent.setData(Uri.parse(url)) - startActivity(context, intent, null) + openUrl.invoke(url) } } diff --git a/samples/emoji-search/desktop-composeui/build.gradle b/samples/emoji-search/desktop-composeui/build.gradle new file mode 100644 index 0000000000..849f87e767 --- /dev/null +++ b/samples/emoji-search/desktop-composeui/build.gradle @@ -0,0 +1,28 @@ +apply plugin: 'org.jetbrains.kotlin.jvm' +apply plugin: 'org.jetbrains.compose' + +compose { + desktop { + application { + mainClass = "com.example.redwood.emojisearch.desktop.Main" + } + } +} + +dependencies { + implementation compose.desktop.currentOs + implementation projects.samples.emojiSearch.launcher + implementation projects.samples.emojiSearch.presenter + implementation projects.samples.emojiSearch.presenterTreehouse + implementation projects.samples.emojiSearch.schema.widget.protocol + implementation projects.samples.emojiSearch.sharedComposeui + implementation projects.redwoodComposeui + implementation projects.redwoodLayoutComposeui + implementation projects.redwoodLazylayoutComposeui + implementation projects.redwoodTreehouseHost + implementation projects.redwoodTreehouseHostComposeui + implementation projects.redwoodWidgetCompose + implementation libs.coil.network.okhttp + implementation libs.zipline.loader + implementation libs.kotlinx.coroutines.swing +} diff --git a/samples/emoji-search/desktop-composeui/src/main/kotlin/com/example/redwood/emojisearch/desktop/DesktopNavigator.kt b/samples/emoji-search/desktop-composeui/src/main/kotlin/com/example/redwood/emojisearch/desktop/DesktopNavigator.kt new file mode 100644 index 0000000000..cded0474f5 --- /dev/null +++ b/samples/emoji-search/desktop-composeui/src/main/kotlin/com/example/redwood/emojisearch/desktop/DesktopNavigator.kt @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2024 Square, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.redwood.emojisearch.desktop + +import com.example.redwood.emojisearch.presenter.Navigator +import java.awt.Desktop +import java.net.URI + +object DesktopNavigator : Navigator { + override fun openUrl(url: String) { + Desktop.getDesktop().browse(URI(url)) + } +} diff --git a/samples/emoji-search/desktop-composeui/src/main/kotlin/com/example/redwood/emojisearch/desktop/JvmHttpClient.kt b/samples/emoji-search/desktop-composeui/src/main/kotlin/com/example/redwood/emojisearch/desktop/JvmHttpClient.kt new file mode 100644 index 0000000000..38c790f555 --- /dev/null +++ b/samples/emoji-search/desktop-composeui/src/main/kotlin/com/example/redwood/emojisearch/desktop/JvmHttpClient.kt @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2022 Square, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.redwood.emojisearch.composeui + +import com.example.redwood.emojisearch.presenter.HttpClient +import kotlin.coroutines.resume +import kotlin.coroutines.resumeWithException +import kotlinx.coroutines.CancellableContinuation +import kotlinx.coroutines.CompletionHandler +import kotlinx.coroutines.suspendCancellableCoroutine +import okhttp3.Call +import okhttp3.Callback +import okhttp3.Headers.Companion.toHeaders +import okhttp3.OkHttpClient +import okhttp3.Request +import okhttp3.Response +import okio.IOException + +class JvmHttpClient( + private val okHttpClient: OkHttpClient = OkHttpClient(), +) : HttpClient { + + override suspend fun call(url: String, headers: Map): String { + val request = Request.Builder() + .url(url) + .headers(headers.toHeaders()) + .build() + val response = okHttpClient.newCall(request).await() + return response.body?.string().orEmpty() + } +} + +private suspend fun Call.await(): Response { + return suspendCancellableCoroutine { continuation -> + val callback = ContinuationCallback(this, continuation) + enqueue(callback) + continuation.invokeOnCancellation(callback) + } +} + +private class ContinuationCallback( + private val call: Call, + private val continuation: CancellableContinuation, +) : Callback, CompletionHandler { + + override fun onResponse(call: Call, response: Response) { + continuation.resume(response) + } + + override fun onFailure(call: Call, e: IOException) { + if (!call.isCanceled()) { + continuation.resumeWithException(e) + } + } + + override fun invoke(cause: Throwable?) { + try { + call.cancel() + } catch (_: Throwable) {} + } +} diff --git a/samples/emoji-search/desktop-composeui/src/main/kotlin/com/example/redwood/emojisearch/desktop/main.kt b/samples/emoji-search/desktop-composeui/src/main/kotlin/com/example/redwood/emojisearch/desktop/main.kt new file mode 100644 index 0000000000..e685d05cb8 --- /dev/null +++ b/samples/emoji-search/desktop-composeui/src/main/kotlin/com/example/redwood/emojisearch/desktop/main.kt @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 Square, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@file:JvmName("Main") + +package com.example.redwood.emojisearch.desktop + +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.padding +import androidx.compose.material.Scaffold +import androidx.compose.ui.Modifier +import androidx.compose.ui.window.Window +import androidx.compose.ui.window.application +import app.cash.redwood.composeui.RedwoodContent +import app.cash.redwood.layout.composeui.ComposeUiRedwoodLayoutWidgetFactory +import app.cash.redwood.lazylayout.composeui.ComposeUiRedwoodLazyLayoutWidgetFactory +import app.cash.redwood.ui.Margin +import com.example.redwood.emojisearch.composeui.ComposeUiEmojiSearchWidgetFactory +import com.example.redwood.emojisearch.composeui.EmojiSearchTheme +import com.example.redwood.emojisearch.composeui.JvmHttpClient +import com.example.redwood.emojisearch.presenter.EmojiSearch +import com.example.redwood.emojisearch.widget.EmojiSearchWidgetFactories + +fun main() { + val httpClient = JvmHttpClient() + val navigator = DesktopNavigator + val factories = EmojiSearchWidgetFactories( + EmojiSearch = ComposeUiEmojiSearchWidgetFactory(), + RedwoodLayout = ComposeUiRedwoodLayoutWidgetFactory(), + RedwoodLazyLayout = ComposeUiRedwoodLazyLayoutWidgetFactory(), + ) + + application { + Window( + onCloseRequest = ::exitApplication, + title = "Emoji Search", + ) { + EmojiSearchTheme { + Scaffold { contentPadding -> + Box( + modifier = Modifier.padding(contentPadding), + ) { + RedwoodContent(factories) { + EmojiSearch( + httpClient = httpClient, + navigator = navigator, + safeAreaInsets = Margin.Zero, + ) + } + } + } + } + } + } +} diff --git a/samples/emoji-search/launcher/build.gradle b/samples/emoji-search/launcher/build.gradle index 9c68fa7519..73afa80738 100644 --- a/samples/emoji-search/launcher/build.gradle +++ b/samples/emoji-search/launcher/build.gradle @@ -9,6 +9,8 @@ kotlin { androidTarget() + jvm() + sourceSets { commonMain { dependencies { diff --git a/samples/emoji-search/presenter/src/commonMain/kotlin/com/example/redwood/emojisearch/presenter/EmojiSearch.kt b/samples/emoji-search/presenter/src/commonMain/kotlin/com/example/redwood/emojisearch/presenter/EmojiSearch.kt index d954971b05..dd9a19b2c2 100644 --- a/samples/emoji-search/presenter/src/commonMain/kotlin/com/example/redwood/emojisearch/presenter/EmojiSearch.kt +++ b/samples/emoji-search/presenter/src/commonMain/kotlin/com/example/redwood/emojisearch/presenter/EmojiSearch.kt @@ -73,10 +73,11 @@ fun EmojiSearch( httpClient: HttpClient, navigator: Navigator, variant: Variant = Variant.LAZY_COLUMN, + safeAreaInsets: Margin = LocalUiConfiguration.current.safeAreaInsets, ) { when (variant) { - Variant.LAZY_COLUMN -> LazyColumn(httpClient, navigator) - Variant.SCROLLABLE_FLEXBOX -> NestedFlexBoxContainers(httpClient) + Variant.LAZY_COLUMN -> LazyColumn(httpClient, navigator, safeAreaInsets) + Variant.SCROLLABLE_FLEXBOX -> NestedFlexBoxContainers(httpClient, safeAreaInsets) } } @@ -85,6 +86,7 @@ fun EmojiSearch( private fun LazyColumn( httpClient: HttpClient, navigator: Navigator, + safeAreaInsets: Margin, ) { val scope = rememberCoroutineScope() val allEmojis = remember { mutableStateListOf() } @@ -134,7 +136,7 @@ private fun LazyColumn( width = Constraint.Fill, height = Constraint.Fill, horizontalAlignment = CrossAxisAlignment.Stretch, - margin = LocalUiConfiguration.current.safeAreaInsets, + margin = safeAreaInsets, ) { TextInput( state = TextFieldState(searchTerm.text), diff --git a/samples/emoji-search/presenter/src/commonMain/kotlin/com/example/redwood/emojisearch/presenter/NestedFlexBoxContainers.kt b/samples/emoji-search/presenter/src/commonMain/kotlin/com/example/redwood/emojisearch/presenter/NestedFlexBoxContainers.kt index 7e8f09eece..4f06caa7ad 100644 --- a/samples/emoji-search/presenter/src/commonMain/kotlin/com/example/redwood/emojisearch/presenter/NestedFlexBoxContainers.kt +++ b/samples/emoji-search/presenter/src/commonMain/kotlin/com/example/redwood/emojisearch/presenter/NestedFlexBoxContainers.kt @@ -27,7 +27,6 @@ import androidx.compose.runtime.saveable.SaverScope import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import app.cash.redwood.Modifier -import app.cash.redwood.compose.LocalUiConfiguration import app.cash.redwood.layout.api.Constraint import app.cash.redwood.layout.api.CrossAxisAlignment import app.cash.redwood.layout.api.MainAxisAlignment @@ -42,7 +41,10 @@ import example.values.TextFieldState import kotlinx.serialization.json.Json @Composable -fun NestedFlexBoxContainers(httpClient: HttpClient) { +fun NestedFlexBoxContainers( + httpClient: HttpClient, + safeAreaInsets: Margin, +) { val allEmojis = remember { mutableStateListOf() } val searchTermSaver = object : Saver { @@ -79,7 +81,7 @@ fun NestedFlexBoxContainers(httpClient: HttpClient) { height = Constraint.Fill, overflow = Overflow.Clip, horizontalAlignment = CrossAxisAlignment.Stretch, - margin = LocalUiConfiguration.current.safeAreaInsets, + margin = safeAreaInsets, verticalAlignment = MainAxisAlignment.Start, ) { TextInput( @@ -89,7 +91,7 @@ fun NestedFlexBoxContainers(httpClient: HttpClient) { modifier = Modifier.shrink(0.0), ) - if (filteredEmojis.count() > 0) { + if (filteredEmojis.isNotEmpty()) { Text( text = "Scroll Column - Nested Scroll Row + B Emojis", modifier = Modifier.margin(Margin(12.dp)), diff --git a/samples/emoji-search/shared-composeui/build.gradle b/samples/emoji-search/shared-composeui/build.gradle new file mode 100644 index 0000000000..5f205f28d5 --- /dev/null +++ b/samples/emoji-search/shared-composeui/build.gradle @@ -0,0 +1,11 @@ +apply plugin: 'org.jetbrains.kotlin.jvm' +apply plugin: 'app.cash.redwood' + +dependencies { + api projects.samples.emojiSearch.schema.widget + implementation projects.redwoodWidgetCompose + implementation libs.jetbrains.compose.material + implementation libs.jetbrains.compose.ui + implementation libs.jetbrains.compose.ui.tooling.preview + implementation libs.coil.compose +} diff --git a/samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/AndroidEmojiSearchWidgetFactory.kt b/samples/emoji-search/shared-composeui/src/main/kotlin/com/example/redwood/emojisearch/composeui/ComposeUiEmojiSearchWidgetFactory.kt similarity index 88% rename from samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/AndroidEmojiSearchWidgetFactory.kt rename to samples/emoji-search/shared-composeui/src/main/kotlin/com/example/redwood/emojisearch/composeui/ComposeUiEmojiSearchWidgetFactory.kt index 92aaabc39c..2ac7b76634 100644 --- a/samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/AndroidEmojiSearchWidgetFactory.kt +++ b/samples/emoji-search/shared-composeui/src/main/kotlin/com/example/redwood/emojisearch/composeui/ComposeUiEmojiSearchWidgetFactory.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.example.redwood.emojisearch.android.composeui +package com.example.redwood.emojisearch.composeui import androidx.compose.runtime.Composable import com.example.redwood.emojisearch.widget.EmojiSearchWidgetFactory @@ -21,7 +21,7 @@ import com.example.redwood.emojisearch.widget.Image import com.example.redwood.emojisearch.widget.Text import com.example.redwood.emojisearch.widget.TextInput -class AndroidEmojiSearchWidgetFactory : EmojiSearchWidgetFactory<@Composable () -> Unit> { +class ComposeUiEmojiSearchWidgetFactory : EmojiSearchWidgetFactory<@Composable () -> Unit> { override fun TextInput(): TextInput<@Composable () -> Unit> = ComposeUiTextInput() override fun Text(): Text<@Composable () -> Unit> = ComposeUiText() override fun Image(): Image<@Composable () -> Unit> = ComposeUiImage() diff --git a/samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/ComposeUiImage.kt b/samples/emoji-search/shared-composeui/src/main/kotlin/com/example/redwood/emojisearch/composeui/ComposeUiImage.kt similarity index 96% rename from samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/ComposeUiImage.kt rename to samples/emoji-search/shared-composeui/src/main/kotlin/com/example/redwood/emojisearch/composeui/ComposeUiImage.kt index 4d1a5c6229..b35634ece3 100644 --- a/samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/ComposeUiImage.kt +++ b/samples/emoji-search/shared-composeui/src/main/kotlin/com/example/redwood/emojisearch/composeui/ComposeUiImage.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.example.redwood.emojisearch.android.composeui +package com.example.redwood.emojisearch.composeui import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.size diff --git a/samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/ComposeUiText.kt b/samples/emoji-search/shared-composeui/src/main/kotlin/com/example/redwood/emojisearch/composeui/ComposeUiText.kt similarity index 95% rename from samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/ComposeUiText.kt rename to samples/emoji-search/shared-composeui/src/main/kotlin/com/example/redwood/emojisearch/composeui/ComposeUiText.kt index dc409734b3..6f87870dc6 100644 --- a/samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/ComposeUiText.kt +++ b/samples/emoji-search/shared-composeui/src/main/kotlin/com/example/redwood/emojisearch/composeui/ComposeUiText.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.example.redwood.emojisearch.android.composeui +package com.example.redwood.emojisearch.composeui import androidx.compose.material.MaterialTheme import androidx.compose.material.Text diff --git a/samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/ComposeUiTextInput.kt b/samples/emoji-search/shared-composeui/src/main/kotlin/com/example/redwood/emojisearch/composeui/ComposeUiTextInput.kt similarity index 98% rename from samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/ComposeUiTextInput.kt rename to samples/emoji-search/shared-composeui/src/main/kotlin/com/example/redwood/emojisearch/composeui/ComposeUiTextInput.kt index f28e663995..f100f09b23 100644 --- a/samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/ComposeUiTextInput.kt +++ b/samples/emoji-search/shared-composeui/src/main/kotlin/com/example/redwood/emojisearch/composeui/ComposeUiTextInput.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.example.redwood.emojisearch.android.composeui +package com.example.redwood.emojisearch.composeui import androidx.compose.material.Text import androidx.compose.material.TextField diff --git a/samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/theme.kt b/samples/emoji-search/shared-composeui/src/main/kotlin/com/example/redwood/emojisearch/composeui/theme.kt similarity index 97% rename from samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/theme.kt rename to samples/emoji-search/shared-composeui/src/main/kotlin/com/example/redwood/emojisearch/composeui/theme.kt index 6d3c10c7e2..b8aea95402 100644 --- a/samples/emoji-search/android-composeui/src/main/kotlin/com/example/redwood/emojisearch/android/composeui/theme.kt +++ b/samples/emoji-search/shared-composeui/src/main/kotlin/com/example/redwood/emojisearch/composeui/theme.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.example.redwood.emojisearch.android.composeui +package com.example.redwood.emojisearch.composeui import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.foundation.shape.RoundedCornerShape diff --git a/settings.gradle b/settings.gradle index fe45912b62..4668125fa6 100644 --- a/settings.gradle +++ b/settings.gradle @@ -117,6 +117,7 @@ if (!hasProperty('redwoodNoApps')) { include ':samples:emoji-search:android-tests' include ':samples:emoji-search:android-views' include ':samples:emoji-search:browser' + include ':samples:emoji-search:desktop-composeui' include ':samples:emoji-search:ios-shared' include ':samples:emoji-search:launcher' include ':samples:emoji-search:presenter' @@ -127,5 +128,6 @@ if (!hasProperty('redwoodNoApps')) { include ':samples:emoji-search:schema:testing' include ':samples:emoji-search:schema:widget' include ':samples:emoji-search:schema:widget:protocol' + include ':samples:emoji-search:shared-composeui' include ':samples:emoji-search:values' }