From 420076f01aadd61f650b6848cd23643ca59226b8 Mon Sep 17 00:00:00 2001 From: Don Turner Date: Mon, 15 Jul 2024 19:10:59 +0100 Subject: [PATCH 1/5] Update README.md Add note about screenshot tests failing. --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index be1270b16..1f5270323 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,8 @@ Examples: To run the tests execute the following gradle tasks: -- `testDemoDebug` run all local tests against the `demoDebug` variant. +- `testDemoDebug` run all local tests against the `demoDebug` variant. Screenshot tests will fail +(see below for explanation). To avoid this, run `recordRoborazziDemoDebug` prior to running unit tests. - `connectedDemoDebugAndroidTest` run all instrumented tests against the `demoDebug` variant. **Note:** You should not run `./gradlew test` or `./gradlew connectedAndroidTest` as this will execute @@ -137,7 +138,7 @@ stored in `modulename/src/test/screenshots`. - `compareRoborazziDemoDebug` create comparison images between failed tests and the known correct images. These can also be found in `modulename/src/test/screenshots`. -**Note:** The known correct screenshots stored in this repository are recorded on CI using Linux. Other +**Note on failing screenshot tests:** The known correct screenshots stored in this repository are recorded on CI using Linux. Other platforms may (and probably will) generate slightly different images, making the screenshot tests fail. When working on a non-Linux platform, a workaround to this is to run `recordRoborazziDemoDebug` on the `main` branch before starting work. After making changes, `verifyRoborazziDemoDebug` will identify only From 4e62d0c084b003fdca43eb249ddec130a160d2d8 Mon Sep 17 00:00:00 2001 From: Rob Orgiu Date: Mon, 22 Jul 2024 17:45:05 +0200 Subject: [PATCH 2/5] Add drag feature --- .../nowinandroid/core/ui/NewsResourceCard.kt | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt b/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt index e60c498eb..4aaa4f7ad 100644 --- a/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt +++ b/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt @@ -16,8 +16,15 @@ package com.google.samples.apps.nowinandroid.core.ui +import android.content.ClipData +import android.os.Build.VERSION +import android.os.Build.VERSION_CODES +import android.view.View import androidx.compose.foundation.Canvas +import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.Image +import androidx.compose.foundation.draganddrop.dragAndDropSource +import androidx.compose.foundation.gestures.detectTapGestures import androidx.compose.foundation.horizontalScroll import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box @@ -45,6 +52,7 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.draganddrop.DragAndDropTransferData import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalInspectionMode @@ -77,6 +85,7 @@ import java.util.Locale * [NewsResource] card used on the following screens: For You, Saved */ +@OptIn(ExperimentalFoundationApi::class) @Composable fun NewsResourceCardExpanded( userNewsResource: UserNewsResource, @@ -88,6 +97,13 @@ fun NewsResourceCardExpanded( modifier: Modifier = Modifier, ) { val clickActionLabel = stringResource(R.string.core_ui_card_tap_action) + + val dragAndDropFlags = if (VERSION.SDK_INT >= VERSION_CODES.N) { + View.DRAG_FLAG_GLOBAL + } else { + 0 + } + Card( onClick = onClick, shape = RoundedCornerShape(16.dp), @@ -112,7 +128,22 @@ fun NewsResourceCardExpanded( Row { NewsResourceTitle( userNewsResource.title, - modifier = Modifier.fillMaxWidth((.8f)), + modifier = Modifier.fillMaxWidth((.8f)) + .dragAndDropSource { + detectTapGestures( + onLongPress = { + startTransfer( + DragAndDropTransferData( + ClipData.newPlainText( + "Feed sharing", + userNewsResource.title + ": " + userNewsResource.url, + ), + flags = dragAndDropFlags, + ), + ) + }, + ) + }, ) Spacer(modifier = Modifier.weight(1f)) BookmarkButton(isBookmarked, onToggleBookmark) From 52713e4489e3d7c3ae8eec167b6fbaa7b466b362 Mon Sep 17 00:00:00 2001 From: songgyubin Date: Wed, 14 Aug 2024 22:27:23 +0900 Subject: [PATCH 3/5] Fix Overlap When Moving Between Tabs --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7047ac665..ed6428e16 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -20,7 +20,7 @@ androidxHiltNavigationCompose = "1.2.0" androidxLifecycle = "2.8.3" androidxMacroBenchmark = "1.2.4" androidxMetrics = "1.0.0-alpha04" -androidxNavigation = "2.8.0-alpha06" +androidxNavigation = "2.8.0-beta06" androidxProfileinstaller = "1.3.1" androidxTestCore = "1.5.0" androidxTestExt = "1.1.5" From 650471b1c2bf034c168f91d70330a6b7f1d6ac0d Mon Sep 17 00:00:00 2001 From: Rob Orgiu Date: Wed, 21 Aug 2024 16:05:12 +0200 Subject: [PATCH 4/5] Improve internalization --- .../apps/nowinandroid/core/ui/NewsResourceCard.kt | 13 ++++++++++--- core/ui/src/main/res/values/strings.xml | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt b/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt index 4aaa4f7ad..7c41d74d0 100644 --- a/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt +++ b/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt @@ -97,6 +97,12 @@ fun NewsResourceCardExpanded( modifier: Modifier = Modifier, ) { val clickActionLabel = stringResource(R.string.core_ui_card_tap_action) + val sharingLabel = stringResource(R.string.core_ui_feed_sharing) + val sharingContent = stringResource( + R.string.core_ui_feed_sharing_data, + userNewsResource.title, + userNewsResource.url, + ) val dragAndDropFlags = if (VERSION.SDK_INT >= VERSION_CODES.N) { View.DRAG_FLAG_GLOBAL @@ -128,15 +134,16 @@ fun NewsResourceCardExpanded( Row { NewsResourceTitle( userNewsResource.title, - modifier = Modifier.fillMaxWidth((.8f)) + modifier = Modifier + .fillMaxWidth((.8f)) .dragAndDropSource { detectTapGestures( onLongPress = { startTransfer( DragAndDropTransferData( ClipData.newPlainText( - "Feed sharing", - userNewsResource.title + ": " + userNewsResource.url, + sharingLabel, + sharingContent, ), flags = dragAndDropFlags, ), diff --git a/core/ui/src/main/res/values/strings.xml b/core/ui/src/main/res/values/strings.xml index ab76748ef..a97746a9c 100644 --- a/core/ui/src/main/res/values/strings.xml +++ b/core/ui/src/main/res/values/strings.xml @@ -29,4 +29,6 @@ Follow interest Unfollow interest + Feed sharing + %1$s: %2$s From a8a8647c20b8db1a054e0fbc4ac7918a8703bd2c Mon Sep 17 00:00:00 2001 From: songgyubin Date: Sat, 24 Aug 2024 14:44:14 +0900 Subject: [PATCH 5/5] Update to Material Adaptive 1.0.0-rc01 --- .../dependencies/releaseRuntimeClasspath.txt | 10 +-- .../prodReleaseRuntimeClasspath.txt | 82 +++++++++---------- gradle/libs.versions.toml | 2 +- 3 files changed, 47 insertions(+), 47 deletions(-) diff --git a/app-nia-catalog/dependencies/releaseRuntimeClasspath.txt b/app-nia-catalog/dependencies/releaseRuntimeClasspath.txt index b9135ed42..fcbb409ee 100644 --- a/app-nia-catalog/dependencies/releaseRuntimeClasspath.txt +++ b/app-nia-catalog/dependencies/releaseRuntimeClasspath.txt @@ -20,8 +20,8 @@ androidx.compose.foundation:foundation-android:1.7.0-beta01 androidx.compose.foundation:foundation-layout-android:1.7.0-beta01 androidx.compose.foundation:foundation-layout:1.7.0-beta01 androidx.compose.foundation:foundation:1.7.0-beta01 -androidx.compose.material3.adaptive:adaptive-android:1.0.0-beta01 -androidx.compose.material3.adaptive:adaptive:1.0.0-beta01 +androidx.compose.material3.adaptive:adaptive-android:1.0.0-rc01 +androidx.compose.material3.adaptive:adaptive:1.0.0-rc01 androidx.compose.material3:material3-adaptive-navigation-suite-android:1.3.0-beta01 androidx.compose.material3:material3-adaptive-navigation-suite:1.3.0-beta01 androidx.compose.material3:material3-android:1.3.0-beta01 @@ -91,9 +91,9 @@ androidx.vectordrawable:vectordrawable:1.1.0 androidx.versionedparcelable:versionedparcelable:1.1.1 androidx.viewpager:viewpager:1.0.0 androidx.window.extensions.core:core:1.0.0 -androidx.window:window-core-android:1.3.0-beta02 -androidx.window:window-core:1.3.0-beta02 -androidx.window:window:1.3.0-beta02 +androidx.window:window-core-android:1.3.0-rc01 +androidx.window:window-core:1.3.0-rc01 +androidx.window:window:1.3.0-rc01 com.google.accompanist:accompanist-drawablepainter:0.32.0 com.google.code.findbugs:jsr305:3.0.2 com.google.dagger:dagger-lint-aar:2.51.1 diff --git a/app/dependencies/prodReleaseRuntimeClasspath.txt b/app/dependencies/prodReleaseRuntimeClasspath.txt index 96e5940e8..669f0e181 100644 --- a/app/dependencies/prodReleaseRuntimeClasspath.txt +++ b/app/dependencies/prodReleaseRuntimeClasspath.txt @@ -1,7 +1,7 @@ androidx.activity:activity-compose:1.8.2 androidx.activity:activity-ktx:1.8.2 androidx.activity:activity:1.8.2 -androidx.annotation:annotation-experimental:1.4.0 +androidx.annotation:annotation-experimental:1.4.1 androidx.annotation:annotation-jvm:1.8.0 androidx.annotation:annotation:1.8.0 androidx.appcompat:appcompat-resources:1.7.0 @@ -13,20 +13,20 @@ androidx.browser:browser:1.8.0 androidx.collection:collection-jvm:1.4.0 androidx.collection:collection-ktx:1.4.0 androidx.collection:collection:1.4.0 -androidx.compose.animation:animation-android:1.7.0-beta01 -androidx.compose.animation:animation-core-android:1.7.0-beta01 -androidx.compose.animation:animation-core:1.7.0-beta01 -androidx.compose.animation:animation:1.7.0-beta01 -androidx.compose.foundation:foundation-android:1.7.0-beta01 -androidx.compose.foundation:foundation-layout-android:1.7.0-beta01 -androidx.compose.foundation:foundation-layout:1.7.0-beta01 -androidx.compose.foundation:foundation:1.7.0-beta01 -androidx.compose.material3.adaptive:adaptive-android:1.0.0-beta01 -androidx.compose.material3.adaptive:adaptive-layout-android:1.0.0-beta01 -androidx.compose.material3.adaptive:adaptive-layout:1.0.0-beta01 -androidx.compose.material3.adaptive:adaptive-navigation-android:1.0.0-beta01 -androidx.compose.material3.adaptive:adaptive-navigation:1.0.0-beta01 -androidx.compose.material3.adaptive:adaptive:1.0.0-beta01 +androidx.compose.animation:animation-android:1.7.0-rc01 +androidx.compose.animation:animation-core-android:1.7.0-rc01 +androidx.compose.animation:animation-core:1.7.0-rc01 +androidx.compose.animation:animation:1.7.0-rc01 +androidx.compose.foundation:foundation-android:1.7.0-rc01 +androidx.compose.foundation:foundation-layout-android:1.7.0-rc01 +androidx.compose.foundation:foundation-layout:1.7.0-rc01 +androidx.compose.foundation:foundation:1.7.0-rc01 +androidx.compose.material3.adaptive:adaptive-android:1.0.0-rc01 +androidx.compose.material3.adaptive:adaptive-layout-android:1.0.0-rc01 +androidx.compose.material3.adaptive:adaptive-layout:1.0.0-rc01 +androidx.compose.material3.adaptive:adaptive-navigation-android:1.0.0-rc01 +androidx.compose.material3.adaptive:adaptive-navigation:1.0.0-rc01 +androidx.compose.material3.adaptive:adaptive:1.0.0-rc01 androidx.compose.material3:material3-adaptive-navigation-suite-android:1.3.0-beta01 androidx.compose.material3:material3-adaptive-navigation-suite:1.3.0-beta01 androidx.compose.material3:material3-android:1.3.0-beta01 @@ -39,25 +39,25 @@ androidx.compose.material:material-icons-extended-android:1.6.3 androidx.compose.material:material-icons-extended:1.6.3 androidx.compose.material:material-ripple-android:1.7.0-beta01 androidx.compose.material:material-ripple:1.7.0-beta01 -androidx.compose.runtime:runtime-android:1.7.0-beta01 -androidx.compose.runtime:runtime-saveable-android:1.7.0-beta01 -androidx.compose.runtime:runtime-saveable:1.7.0-beta01 +androidx.compose.runtime:runtime-android:1.7.0-rc01 +androidx.compose.runtime:runtime-saveable-android:1.7.0-rc01 +androidx.compose.runtime:runtime-saveable:1.7.0-rc01 androidx.compose.runtime:runtime-tracing:1.0.0-beta01 -androidx.compose.runtime:runtime:1.7.0-beta01 -androidx.compose.ui:ui-android:1.7.0-beta01 -androidx.compose.ui:ui-geometry-android:1.7.0-beta01 -androidx.compose.ui:ui-geometry:1.7.0-beta01 -androidx.compose.ui:ui-graphics-android:1.7.0-beta01 -androidx.compose.ui:ui-graphics:1.7.0-beta01 -androidx.compose.ui:ui-text-android:1.7.0-beta01 -androidx.compose.ui:ui-text:1.7.0-beta01 -androidx.compose.ui:ui-tooling-preview-android:1.7.0-beta01 -androidx.compose.ui:ui-tooling-preview:1.7.0-beta01 -androidx.compose.ui:ui-unit-android:1.7.0-beta01 -androidx.compose.ui:ui-unit:1.7.0-beta01 -androidx.compose.ui:ui-util-android:1.7.0-beta01 -androidx.compose.ui:ui-util:1.7.0-beta01 -androidx.compose.ui:ui:1.7.0-beta01 +androidx.compose.runtime:runtime:1.7.0-rc01 +androidx.compose.ui:ui-android:1.7.0-rc01 +androidx.compose.ui:ui-geometry-android:1.7.0-rc01 +androidx.compose.ui:ui-geometry:1.7.0-rc01 +androidx.compose.ui:ui-graphics-android:1.7.0-rc01 +androidx.compose.ui:ui-graphics:1.7.0-rc01 +androidx.compose.ui:ui-text-android:1.7.0-rc01 +androidx.compose.ui:ui-text:1.7.0-rc01 +androidx.compose.ui:ui-tooling-preview-android:1.7.0-rc01 +androidx.compose.ui:ui-tooling-preview:1.7.0-rc01 +androidx.compose.ui:ui-unit-android:1.7.0-rc01 +androidx.compose.ui:ui-unit:1.7.0-rc01 +androidx.compose.ui:ui-util-android:1.7.0-rc01 +androidx.compose.ui:ui-util:1.7.0-rc01 +androidx.compose.ui:ui:1.7.0-rc01 androidx.compose:compose-bom:2024.02.02 androidx.concurrent:concurrent-futures:1.1.0 androidx.core:core-ktx:1.13.1 @@ -106,11 +106,11 @@ androidx.lifecycle:lifecycle-viewmodel:2.8.3 androidx.loader:loader:1.0.0 androidx.localbroadcastmanager:localbroadcastmanager:1.0.0 androidx.metrics:metrics-performance:1.0.0-alpha04 -androidx.navigation:navigation-common-ktx:2.8.0-alpha06 -androidx.navigation:navigation-common:2.8.0-alpha06 -androidx.navigation:navigation-compose:2.8.0-alpha06 -androidx.navigation:navigation-runtime-ktx:2.8.0-alpha06 -androidx.navigation:navigation-runtime:2.8.0-alpha06 +androidx.navigation:navigation-common-ktx:2.8.0-beta06 +androidx.navigation:navigation-common:2.8.0-beta06 +androidx.navigation:navigation-compose:2.8.0-beta06 +androidx.navigation:navigation-runtime-ktx:2.8.0-beta06 +androidx.navigation:navigation-runtime:2.8.0-beta06 androidx.print:print:1.0.0 androidx.privacysandbox.ads:ads-adservices-java:1.0.0-beta05 androidx.privacysandbox.ads:ads-adservices:1.0.0-beta05 @@ -132,9 +132,9 @@ androidx.vectordrawable:vectordrawable:1.1.0 androidx.versionedparcelable:versionedparcelable:1.1.1 androidx.viewpager:viewpager:1.0.0 androidx.window.extensions.core:core:1.0.0 -androidx.window:window-core-android:1.3.0-beta02 -androidx.window:window-core:1.3.0-beta02 -androidx.window:window:1.3.0-beta02 +androidx.window:window-core-android:1.3.0-rc01 +androidx.window:window-core:1.3.0-rc01 +androidx.window:window:1.3.0-rc01 androidx.work:work-runtime-ktx:2.9.0 androidx.work:work-runtime:2.9.0 com.caverock:androidsvg-aar:1.4 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ed6428e16..83af1ad5c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -9,7 +9,7 @@ androidxAppCompat = "1.7.0" androidxBrowser = "1.8.0" androidxComposeAlpha = "1.7.0-beta01" androidxComposeBom = "2024.02.02" -androidxComposeMaterial3Adaptive = "1.0.0-beta01" +androidxComposeMaterial3Adaptive = "1.0.0-rc01" androidxComposeMaterial3AdaptiveNavigationSuite = "1.3.0-beta01" androidxComposeRuntimeTracing = "1.0.0-beta01" androidxCore = "1.12.0"