diff --git a/app-nia-catalog/src/desktopMain/kotlin/main.kt b/app-nia-catalog/src/desktopMain/kotlin/Main.kt similarity index 99% rename from app-nia-catalog/src/desktopMain/kotlin/main.kt rename to app-nia-catalog/src/desktopMain/kotlin/Main.kt index 7d5527f4f..fd1dacc94 100644 --- a/app-nia-catalog/src/desktopMain/kotlin/main.kt +++ b/app-nia-catalog/src/desktopMain/kotlin/Main.kt @@ -25,4 +25,4 @@ fun main() = application { ) { NiaCatalog() } -} \ No newline at end of file +} diff --git a/app-nia-catalog/src/iosMain/kotlin/MainViewController.kt b/app-nia-catalog/src/iosMain/kotlin/MainViewController.kt index da9607f1d..114e0e6fd 100644 --- a/app-nia-catalog/src/iosMain/kotlin/MainViewController.kt +++ b/app-nia-catalog/src/iosMain/kotlin/MainViewController.kt @@ -1,4 +1,20 @@ +/* + * Copyright 2024 The Android Open Source Project + * + * 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 + * + * https://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. + */ + import androidx.compose.ui.window.ComposeUIViewController import com.google.samples.apps.niacatalog.ui.NiaCatalog -fun MainViewController() = ComposeUIViewController { NiaCatalog() } \ No newline at end of file +fun mainViewController() = ComposeUIViewController { NiaCatalog() } diff --git a/app-nia-catalog/src/wasmJsMain/kotlin/Application.kt b/app-nia-catalog/src/wasmJsMain/kotlin/Application.kt index 3d92e05be..67cee28cb 100644 --- a/app-nia-catalog/src/wasmJsMain/kotlin/Application.kt +++ b/app-nia-catalog/src/wasmJsMain/kotlin/Application.kt @@ -35,9 +35,8 @@ import kotlinx.browser.document * limitations under the License. */ - @OptIn(ExperimentalComposeUiApi::class) -fun main () { +fun main() { ComposeViewport(document.body!!) { NiaCatalog() } diff --git a/core/designsystem/build.gradle.kts b/core/designsystem/build.gradle.kts index 7f0a2b90b..4029dfeb0 100644 --- a/core/designsystem/build.gradle.kts +++ b/core/designsystem/build.gradle.kts @@ -1,3 +1,18 @@ +/* + * Copyright 2024 The Android Open Source Project + * + * 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 + * + * https://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. + */ import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig diff --git a/core/network/src/androidMain/kotlin/com/google/samples/apps/nowinandroid/core/network/ApplicationComponent.kt b/core/network/src/androidMain/kotlin/com/google/samples/apps/nowinandroid/core/network/ApplicationComponent.kt index f288f5b63..503118078 100644 --- a/core/network/src/androidMain/kotlin/com/google/samples/apps/nowinandroid/core/network/ApplicationComponent.kt +++ b/core/network/src/androidMain/kotlin/com/google/samples/apps/nowinandroid/core/network/ApplicationComponent.kt @@ -21,12 +21,12 @@ import me.tatarka.inject.annotations.Component import me.tatarka.inject.annotations.Provides @Component -abstract class ApplicationComponent ( +abstract class ApplicationComponent( @get:Provides val context: Context, -): PlatformComponent +) : PlatformComponent interface ApplicationComponentProvider { val component: ApplicationComponent } -val Context.applicationComponent get() = (applicationContext as ApplicationComponentProvider).component \ No newline at end of file +val Context.applicationComponent get() = (applicationContext as ApplicationComponentProvider).component diff --git a/core/network/src/androidMain/kotlin/com/google/samples/apps/nowinandroid/core/network/PlatformComponent.kt b/core/network/src/androidMain/kotlin/com/google/samples/apps/nowinandroid/core/network/PlatformComponent.kt index e2a0681fa..f22b84143 100644 --- a/core/network/src/androidMain/kotlin/com/google/samples/apps/nowinandroid/core/network/PlatformComponent.kt +++ b/core/network/src/androidMain/kotlin/com/google/samples/apps/nowinandroid/core/network/PlatformComponent.kt @@ -23,4 +23,4 @@ import me.tatarka.inject.annotations.Provides interface PlatformComponent { @Provides fun providePlatformContext(context: Context): PlatformContext = context -} \ No newline at end of file +} diff --git a/core/network/src/commonTest/kotlin/com/google/samples/apps/nowinandroid/core/network/demo/FakeNiaNetworkDataSourceTest.kt b/core/network/src/commonTest/kotlin/com/google/samples/apps/nowinandroid/core/network/demo/DemoNiaNetworkDataSourceTest.kt similarity index 100% rename from core/network/src/commonTest/kotlin/com/google/samples/apps/nowinandroid/core/network/demo/FakeNiaNetworkDataSourceTest.kt rename to core/network/src/commonTest/kotlin/com/google/samples/apps/nowinandroid/core/network/demo/DemoNiaNetworkDataSourceTest.kt diff --git a/core/ui/src/commonMain/kotlin/com/google/samples/apps/nowinandroid/core/ui/DevicePreviews.kt b/core/ui/src/commonMain/kotlin/com/google/samples/apps/nowinandroid/core/ui/DevicePreviews.kt index 2e29d6886..057ed4afb 100644 --- a/core/ui/src/commonMain/kotlin/com/google/samples/apps/nowinandroid/core/ui/DevicePreviews.kt +++ b/core/ui/src/commonMain/kotlin/com/google/samples/apps/nowinandroid/core/ui/DevicePreviews.kt @@ -22,9 +22,9 @@ import org.jetbrains.compose.ui.tooling.preview.Preview * Multipreview annotation that represents various device sizes. Add this annotation to a composable * to render various devices. */ -//@Preview(name = "phone", device = "spec:shape=Normal,width=360,height=640,unit=dp,dpi=480") -//@Preview(name = "landscape", device = "spec:shape=Normal,width=640,height=360,unit=dp,dpi=480") -//@Preview(name = "foldable", device = "spec:shape=Normal,width=673,height=841,unit=dp,dpi=480") -//@Preview(name = "tablet", device = "spec:shape=Normal,width=1280,height=800,unit=dp,dpi=480") +// @Preview(name = "phone", device = "spec:shape=Normal,width=360,height=640,unit=dp,dpi=480") +// @Preview(name = "landscape", device = "spec:shape=Normal,width=640,height=360,unit=dp,dpi=480") +// @Preview(name = "foldable", device = "spec:shape=Normal,width=673,height=841,unit=dp,dpi=480") +// @Preview(name = "tablet", device = "spec:shape=Normal,width=1280,height=800,unit=dp,dpi=480") @Preview annotation class DevicePreviews diff --git a/core/ui/src/commonMain/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt b/core/ui/src/commonMain/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt index 474226f09..3fd4005d6 100644 --- a/core/ui/src/commonMain/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt +++ b/core/ui/src/commonMain/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt @@ -122,7 +122,7 @@ private fun NewsFeedLoadingPreview() { } @Preview -//@Preview(device = Devices.TABLET) +// @Preview(device = Devices.TABLET) @Composable private fun NewsFeedContentPreview( @PreviewParameter(UserNewsResourcePreviewParameterProvider::class) diff --git a/core/ui/src/commonMain/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt b/core/ui/src/commonMain/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt index 1641fafc5..02e3f91d7 100644 --- a/core/ui/src/commonMain/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt +++ b/core/ui/src/commonMain/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt @@ -53,10 +53,7 @@ import androidx.compose.ui.platform.LocalInspectionMode import androidx.compose.ui.semantics.contentDescription import androidx.compose.ui.semantics.onClick import androidx.compose.ui.semantics.semantics -import androidx.compose.ui.text.intl.Locale import androidx.compose.ui.unit.dp -import coil3.ImageLoader -import coil3.PlatformContext import coil3.compose.AsyncImagePainter import coil3.compose.rememberAsyncImagePainter import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaIconToggleButton @@ -183,9 +180,9 @@ fun NewsResourceHeaderImage( .fillMaxWidth() .height(180.dp), contentScale = ContentScale.Crop, - painter = + painter = imagePainter, // if (isError.not() && !isLocalInspection) { - imagePainter, +// imagePainter, // } else { // painterResource(drawable.core_designsystem_ic_placeholder_default) // }, @@ -312,7 +309,7 @@ fun NewsResourceTopics( } } -//@Preview("Bookmark Button") +// @Preview("Bookmark Button") @Preview @Composable private fun BookmarkButtonPreview() { @@ -323,7 +320,7 @@ private fun BookmarkButtonPreview() { } } -//@Preview("Bookmark Button Bookmarked") +// @Preview("Bookmark Button Bookmarked") @Preview @Composable private fun BookmarkButtonBookmarkedPreview() { @@ -335,7 +332,7 @@ private fun BookmarkButtonBookmarkedPreview() { } @Preview -//@Preview("NewsResourceCardExpanded") +// @Preview("NewsResourceCardExpanded") @Composable private fun ExpandedNewsResourcePreview( @PreviewParameter(UserNewsResourcePreviewParameterProvider::class)