A fully functional Android app built entirely with Kotlin and Jetpack Compose
Merge branch 'main' into kotlinify
Don Turner707117a4f2fd
diff --cc app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/NavigationTest.ktindex d57556ac2,7a7a82180..13f11c3b9--- a/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/NavigationTest.kt+++ b/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/NavigationTest.kt@@@ -90,18 -90,18 +90,18 @@@ class NavigationTestlateinit var topicsRepository: TopicsRepositoryprivate fun AndroidComposeTestRule<*, *>.stringResource(@StringRes resId: Int) =- ReadOnlyProperty<Any?, String> { _, _ -> activity.getString(resId) }+ ReadOnlyProperty<Any, String> { _, _ -> activity.getString(resId) }// The strings used for matching in these tests- private val navigateUp by composeTestRule.stringResource(FeatureForyouR.string.navigate_up)- private val forYou by composeTestRule.stringResource(FeatureForyouR.string.for_you)- private val interests by composeTestRule.stringResource(FeatureInterestsR.string.interests)+ private val navigateUp by composeTestRule.stringResource(FeatureForyouR.string.feature_foryou_navigate_up)+ private val forYou by composeTestRule.stringResource(FeatureForyouR.string.feature_foryou_title)+ private val interests by composeTestRule.stringResource(FeatureSearchR.string.feature_search_interests)private val sampleTopic = "Headlines"private val appName by composeTestRule.stringResource(R.string.app_name)- private val saved by composeTestRule.stringResource(BookmarksR.string.saved)- private val settings by composeTestRule.stringResource(SettingsR.string.top_app_bar_action_icon_description)- private val brand by composeTestRule.stringResource(SettingsR.string.brand_android)- private val ok by composeTestRule.stringResource(SettingsR.string.dismiss_dialog_button_text)+ private val saved by composeTestRule.stringResource(BookmarksR.string.feature_bookmarks_title)+ private val settings by composeTestRule.stringResource(SettingsR.string.feature_settings_top_app_bar_action_icon_description)+ private val brand by composeTestRule.stringResource(SettingsR.string.feature_settings_brand_android)+ private val ok by composeTestRule.stringResource(SettingsR.string.feature_settings_dismiss_dialog_button_text)@Beforefun setup() = hiltRule.inject()diff --cc core/notifications/src/main/kotlin/com/google/samples/apps/nowinandroid/core/notifications/SystemTrayNotifier.ktindex fbc60baf1,ebad9fda3..1c9e7ab63--- a/core/notifications/src/main/kotlin/com/google/samples/apps/nowinandroid/core/notifications/SystemTrayNotifier.kt+++ b/core/notifications/src/main/kotlin/com/google/samples/apps/nowinandroid/core/notifications/SystemTrayNotifier.kt@@@ -61,23 -65,25 +61,23 @@@ internal class SystemTrayNotifier @Injereturn}- val truncatedNewsResources = newsResources- .take(MAX_NUM_NOTIFICATIONS)+ val truncatedNewsResources = newsResources.take(MAX_NUM_NOTIFICATIONS)- val newsNotifications = truncatedNewsResources- .map { newsResource ->- createNewsNotification {- setSmallIcon(- com.google.samples.apps.nowinandroid.core.common.R.drawable.core_common_ic_nia_notification,- )- .setContentTitle(newsResource.title)- .setContentText(newsResource.content)- .setContentIntent(newsPendingIntent(newsResource))- .setGroup(NEWS_NOTIFICATION_GROUP)- .setAutoCancel(true)- }+ val newsNotifications = truncatedNewsResources.map { newsResource ->+ createNewsNotification {+ setSmallIcon(- com.google.samples.apps.nowinandroid.core.common.R.drawable.ic_nia_notification,++ com.google.samples.apps.nowinandroid.core.common.R.drawable.core_common_ic_nia_notification,+ )+ .setContentTitle(newsResource.title)+ .setContentText(newsResource.content)+ .setContentIntent(newsPendingIntent(newsResource))+ .setGroup(NEWS_NOTIFICATION_GROUP)+ .setAutoCancel(true)}+ }val summaryNotification = createNewsNotification {val title = getString(- R.string.news_notification_group_summary,+ R.string.core_notifications_news_notification_group_summary,truncatedNewsResources.size,)setContentTitle(title)diff --cc feature/bookmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksScreen.ktindex 1fa429d21,d316b0bfd..5b54db7cd--- a/feature/bookmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksScreen.kt+++ b/feature/bookmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksScreen.kt@@@ -237,8 -236,8 +237,8 @@@ private fun EmptyState(modifier: Modifival iconTint = LocalTintTheme.current.iconTintImage(modifier = Modifier.fillMaxWidth(),- painter = painterResource(id = R.drawable.img_empty_bookmarks),+ painter = painterResource(id = R.drawable.feature_bookmarks_img_empty_bookmarks),- colorFilter = if (iconTint != null) ColorFilter.tint(iconTint) else null,+ colorFilter = if (iconTint != Color.Unspecified) ColorFilter.tint(iconTint) else null,contentDescription = null,)