Rename following to interests

Change-Id: Iabcb8b495717e0cb3a993ecc0e09e3338fe5140f
pull/2/head
Simona Stojanovic 3 years ago committed by Don Turner
parent 2b26ccf260
commit dc4af7e6f7

@ -61,7 +61,7 @@ android {
}
dependencies {
implementation(project(":feature-following"))
implementation(project(":feature-interests"))
implementation(project(":feature-foryou"))
implementation(project(":feature-topic"))

@ -183,7 +183,7 @@ class NavigationTest {
}
@Test
fun navigationBar_multipleBackStackFollowing() {
fun navigationBar_multipleBackStackInterests() {
composeTestRule.apply {
onNodeWithText(interests).performClick()
onNodeWithText("Android Studio").performClick() // TODO: Grab string from fake data
@ -191,7 +191,7 @@ class NavigationTest {
// Switch tab
onNodeWithText(forYou).performClick()
// Come back to Following
// Come back to Interests
onNodeWithText(interests).performClick()
// Verify we're not in the list of interests

@ -6494,55 +6494,55 @@ HSPLcom/google/samples/apps/nowinandroid/core/ui/theme/ThemeKt$NiaTheme$1;->invo
HSPLcom/google/samples/apps/nowinandroid/core/ui/theme/ThemeKt;-><clinit>()V
HSPLcom/google/samples/apps/nowinandroid/core/ui/theme/ThemeKt;->NiaTheme(ZZLkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V
HSPLcom/google/samples/apps/nowinandroid/core/ui/theme/TypeKt;-><clinit>()V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowButton$1$1;-><init>(Lkotlin/jvm/functions/Function2;IZ)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowButton$2;-><init>(Z)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowButton$2;->invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowingRoute$1;-><init>(Lcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel;)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowingRoute$2;-><init>(Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function0;Lcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel;II)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowingRoute$2;->invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowingScreen$1$1$1;-><init>(Lkotlin/jvm/functions/Function0;)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowingScreen$2;-><init>(Lcom/google/samples/apps/nowinandroid/feature/following/FollowingUiState;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function0;Landroidx/compose/ui/Modifier;II)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowingTopicCard$1$1$1;-><init>(Lkotlin/jvm/functions/Function0;)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowingWithTopicsScreen$1$1$1;-><init>(Lcom/google/samples/apps/nowinandroid/core/model/data/Topic;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;I)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowingWithTopicsScreen$1$1$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowingWithTopicsScreen$1;-><init>(Lcom/google/samples/apps/nowinandroid/feature/following/FollowingUiState$Topics;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;I)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowingWithTopicsScreen$1;->invoke(Ljava/lang/Object;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$TopicIcon$1$1;-><init>(Lkotlin/jvm/functions/Function0;)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$TopicIcon$2;-><init>(Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function0;II)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt;->FollowButton(IZLkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt;->FollowingRoute(Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function0;Lcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel;Landroidx/compose/runtime/Composer;II)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt;->FollowingScreen(Lcom/google/samples/apps/nowinandroid/feature/following/FollowingUiState;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function0;Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;II)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt;->FollowingTopicCard(Lcom/google/samples/apps/nowinandroid/core/model/data/Topic;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt;->FollowingWithTopicsScreen(Landroidx/compose/ui/Modifier;Lcom/google/samples/apps/nowinandroid/feature/following/FollowingUiState$Topics;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt;->TopicDescription(Ljava/lang/String;Landroidx/compose/runtime/Composer;I)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt;->TopicIcon(Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function0;Landroidx/compose/runtime/Composer;II)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt;->TopicTitle(Ljava/lang/String;Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;II)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingState$Topics;-><init>(Ljava/util/Set;)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingUiState$Loading;-><clinit>()V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingUiState$Loading;-><init>()V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingUiState$Topics;-><init>(Ljava/util/List;)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingUiState$Topics;->equals(Ljava/lang/Object;)Z
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$followedTopicIdsStream$1;-><init>(Lkotlin/coroutines/Continuation;)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$mapFollowedAndUnfollowedTopics$$inlined$map$1$2$1;-><init>(Lcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$mapFollowedAndUnfollowedTopics$$inlined$map$1$2;Lkotlin/coroutines/Continuation;)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$mapFollowedAndUnfollowedTopics$$inlined$map$1$2;-><init>(Lkotlinx/coroutines/flow/FlowCollector;Ljava/util/List;)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$mapFollowedAndUnfollowedTopics$$inlined$map$1$2;->emit(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$mapFollowedAndUnfollowedTopics$$inlined$map$1;-><init>(Lcom/google/samples/apps/nowinandroid/core/datastore/NiaPreferences$special$$inlined$map$1;Ljava/util/List;)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$mapFollowedAndUnfollowedTopics$$inlined$map$1;->collect(Lkotlinx/coroutines/flow/FlowCollector;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$mapFollowedAndUnfollowedTopics$lambda-4$$inlined$sortedBy$1;-><init>()V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$mapFollowedAndUnfollowedTopics$lambda-4$$inlined$sortedBy$1;->compare(Ljava/lang/Object;Ljava/lang/Object;)I
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$special$$inlined$flatMapLatest$1;-><init>(Lkotlin/coroutines/Continuation;)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$special$$inlined$flatMapLatest$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$special$$inlined$flatMapLatest$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$special$$inlined$map$1$2$1;-><init>(Lcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$special$$inlined$map$1$2;Lkotlin/coroutines/Continuation;)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$special$$inlined$map$1$2$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$special$$inlined$map$1$2;-><init>(Lkotlinx/coroutines/flow/FlowCollector;)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$special$$inlined$map$1$2;->emit(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$special$$inlined$map$1;-><init>(Lkotlinx/coroutines/flow/FlowKt__ErrorsKt$catch$$inlined$unsafeFlow$1;)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$special$$inlined$map$1;->collect(Lkotlinx/coroutines/flow/FlowCollector;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$uiState$1;-><init>(Lcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel;Lkotlin/coroutines/Continuation;)V
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$uiState$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$uiState$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel;-><init>(Lcom/google/samples/apps/nowinandroid/core/domain/repository/FakeTopicsRepository;)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$FollowButton$1$1;-><init>(Lkotlin/jvm/functions/Function2;IZ)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$FollowButton$2;-><init>(Z)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$FollowButton$2;->invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$InterestsRoute$1;-><init>(Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel;)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$InterestsRoute$2;-><init>(Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function0;Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel;II)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$InterestsRoute$2;->invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$InterestsScreen$1$1$1;-><init>(Lkotlin/jvm/functions/Function0;)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$InterestsScreen$2;-><init>(Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsUiState;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function0;Landroidx/compose/ui/Modifier;II)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$InterestsTopicCard$1$1$1;-><init>(Lkotlin/jvm/functions/Function0;)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$InterestsWithTopicsScreen$1$1$1;-><init>(Lcom/google/samples/apps/nowinandroid/core/model/data/Topic;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;I)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$InterestsWithTopicsScreen$1$1$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$InterestsWithTopicsScreen$1;-><init>(Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsUiState$Topics;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;I)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$InterestsWithTopicsScreen$1;->invoke(Ljava/lang/Object;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$TopicIcon$1$1;-><init>(Lkotlin/jvm/functions/Function0;)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$TopicIcon$2;-><init>(Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function0;II)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt;->FollowButton(IZLkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt;->InterestsRoute(Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function0;Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel;Landroidx/compose/runtime/Composer;II)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt;->InterestsScreen(Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsUiState;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function0;Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;II)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt;->InterestsTopicCard(Lcom/google/samples/apps/nowinandroid/core/model/data/Topic;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt;->InterestsWithTopicsScreen(Landroidx/compose/ui/Modifier;Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsUiState$Topics;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt;->TopicDescription(Ljava/lang/String;Landroidx/compose/runtime/Composer;I)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt;->TopicIcon(Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function0;Landroidx/compose/runtime/Composer;II)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt;->TopicTitle(Ljava/lang/String;Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;II)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsState$Topics;-><init>(Ljava/util/Set;)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsUiState$Loading;-><clinit>()V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsUiState$Loading;-><init>()V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsUiState$Topics;-><init>(Ljava/util/List;)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsUiState$Topics;->equals(Ljava/lang/Object;)Z
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$followedTopicIdsStream$1;-><init>(Lkotlin/coroutines/Continuation;)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$mapFollowedAndUnfollowedTopics$$inlined$map$1$2$1;-><init>(Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$mapFollowedAndUnfollowedTopics$$inlined$map$1$2;Lkotlin/coroutines/Continuation;)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$mapFollowedAndUnfollowedTopics$$inlined$map$1$2;-><init>(Lkotlinx/coroutines/flow/FlowCollector;Ljava/util/List;)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$mapFollowedAndUnfollowedTopics$$inlined$map$1$2;->emit(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$mapFollowedAndUnfollowedTopics$$inlined$map$1;-><init>(Lcom/google/samples/apps/nowinandroid/core/datastore/NiaPreferences$special$$inlined$map$1;Ljava/util/List;)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$mapFollowedAndUnfollowedTopics$$inlined$map$1;->collect(Lkotlinx/coroutines/flow/FlowCollector;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$mapFollowedAndUnfollowedTopics$lambda-4$$inlined$sortedBy$1;-><init>()V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$mapFollowedAndUnfollowedTopics$lambda-4$$inlined$sortedBy$1;->compare(Ljava/lang/Object;Ljava/lang/Object;)I
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$special$$inlined$flatMapLatest$1;-><init>(Lkotlin/coroutines/Continuation;)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$special$$inlined$flatMapLatest$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$special$$inlined$flatMapLatest$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$special$$inlined$map$1$2$1;-><init>(Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$special$$inlined$map$1$2;Lkotlin/coroutines/Continuation;)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$special$$inlined$map$1$2$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$special$$inlined$map$1$2;-><init>(Lkotlinx/coroutines/flow/FlowCollector;)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$special$$inlined$map$1$2;->emit(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$special$$inlined$map$1;-><init>(Lkotlinx/coroutines/flow/FlowKt__ErrorsKt$catch$$inlined$unsafeFlow$1;)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$special$$inlined$map$1;->collect(Lkotlinx/coroutines/flow/FlowCollector;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$uiState$1;-><init>(Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel;Lkotlin/coroutines/Continuation;)V
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$uiState$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$uiState$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
HSPLcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel;-><init>(Lcom/google/samples/apps/nowinandroid/core/domain/repository/FakeTopicsRepository;)V
HSPLcom/google/samples/apps/nowinandroid/feature/foryou/ComposableSingletons$ForYouScreenKt$lambda-1$1;-><clinit>()V
HSPLcom/google/samples/apps/nowinandroid/feature/foryou/ComposableSingletons$ForYouScreenKt$lambda-1$1;-><init>()V
HSPLcom/google/samples/apps/nowinandroid/feature/foryou/ComposableSingletons$ForYouScreenKt$lambda-1$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
@ -6613,8 +6613,8 @@ HSPLcom/google/samples/apps/nowinandroid/ui/ComposableSingletons$NiaAppKt$lambda
HSPLcom/google/samples/apps/nowinandroid/ui/ComposableSingletons$NiaAppKt;-><clinit>()V
HSPLcom/google/samples/apps/nowinandroid/ui/Destination$Episodes;-><clinit>()V
HSPLcom/google/samples/apps/nowinandroid/ui/Destination$Episodes;-><init>()V
HSPLcom/google/samples/apps/nowinandroid/ui/Destination$Following;-><clinit>()V
HSPLcom/google/samples/apps/nowinandroid/ui/Destination$Following;-><init>()V
HSPLcom/google/samples/apps/nowinandroid/ui/Destination$Interests;-><clinit>()V
HSPLcom/google/samples/apps/nowinandroid/ui/Destination$Interests;-><init>()V
HSPLcom/google/samples/apps/nowinandroid/ui/Destination$ForYou;-><clinit>()V
HSPLcom/google/samples/apps/nowinandroid/ui/Destination$ForYou;-><init>()V
HSPLcom/google/samples/apps/nowinandroid/ui/Destination$Saved;-><clinit>()V
@ -8383,7 +8383,7 @@ HSPLkotlinx/coroutines/flow/FlowKt__DistinctKt$defaultKeySelector$1;-><clinit>()
HSPLkotlinx/coroutines/flow/FlowKt__DistinctKt$defaultKeySelector$1;-><init>()V
HSPLkotlinx/coroutines/flow/FlowKt__DistinctKt$defaultKeySelector$1;->invoke(Ljava/lang/Object;)Ljava/lang/Object;
HSPLkotlinx/coroutines/flow/FlowKt__ErrorsKt$catch$$inlined$unsafeFlow$1$1;-><init>(Lkotlinx/coroutines/flow/FlowKt__ErrorsKt$catch$$inlined$unsafeFlow$1;Lkotlin/coroutines/Continuation;)V
HSPLkotlinx/coroutines/flow/FlowKt__ErrorsKt$catch$$inlined$unsafeFlow$1;-><init>(Lcom/google/samples/apps/nowinandroid/core/datastore/NiaPreferences$special$$inlined$map$1;Lcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$followedTopicIdsStream$1;)V
HSPLkotlinx/coroutines/flow/FlowKt__ErrorsKt$catch$$inlined$unsafeFlow$1;-><init>(Lcom/google/samples/apps/nowinandroid/core/datastore/NiaPreferences$special$$inlined$map$1;Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$followedTopicIdsStream$1;)V
HSPLkotlinx/coroutines/flow/FlowKt__ErrorsKt$catch$$inlined$unsafeFlow$1;->collect(Lkotlinx/coroutines/flow/FlowCollector;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
HSPLkotlinx/coroutines/flow/FlowKt__ErrorsKt$catchImpl$1;-><init>(Lkotlin/coroutines/Continuation;)V
HSPLkotlinx/coroutines/flow/FlowKt__ErrorsKt$catchImpl$2$emit$1;-><init>(Lkotlinx/coroutines/flow/FlowKt__ErrorsKt$catchImpl$2;Lkotlin/coroutines/Continuation;)V
@ -8421,7 +8421,7 @@ HSPLkotlinx/coroutines/flow/FlowKt__ZipKt$combine$$inlined$combineUnsafe$FlowKt_
HSPLkotlinx/coroutines/flow/FlowKt__ZipKt$combine$$inlined$combineUnsafe$FlowKt__ZipKt$1$2;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
HSPLkotlinx/coroutines/flow/FlowKt__ZipKt$combine$$inlined$combineUnsafe$FlowKt__ZipKt$1;-><init>([Lkotlinx/coroutines/flow/Flow;Lcom/google/samples/apps/nowinandroid/feature/foryou/ForYouViewModel$uiState$2;)V
HSPLkotlinx/coroutines/flow/FlowKt__ZipKt$combine$$inlined$combineUnsafe$FlowKt__ZipKt$1;->collect(Lkotlinx/coroutines/flow/FlowCollector;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
HSPLkotlinx/coroutines/flow/FlowKt__ZipKt$combine$$inlined$unsafeFlow$1;-><init>(Lcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$special$$inlined$map$1;Lkotlinx/coroutines/flow/Flow;Lcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$uiState$1;)V
HSPLkotlinx/coroutines/flow/FlowKt__ZipKt$combine$$inlined$unsafeFlow$1;-><init>(Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$special$$inlined$map$1;Lkotlinx/coroutines/flow/Flow;Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$uiState$1;)V
HSPLkotlinx/coroutines/flow/FlowKt__ZipKt$combine$$inlined$unsafeFlow$1;->collect(Lkotlinx/coroutines/flow/FlowCollector;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
HSPLkotlinx/coroutines/flow/FlowKt__ZipKt$combine$1$1;-><init>(Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)V
HSPLkotlinx/coroutines/flow/FlowKt__ZipKt$combine$1$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
@ -11105,34 +11105,34 @@ Lcom/google/samples/apps/nowinandroid/core/ui/theme/ColorKt;
Lcom/google/samples/apps/nowinandroid/core/ui/theme/ThemeKt$NiaTheme$1;
Lcom/google/samples/apps/nowinandroid/core/ui/theme/ThemeKt;
Lcom/google/samples/apps/nowinandroid/core/ui/theme/TypeKt;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowButton$1$1;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowButton$2;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowingRoute$1;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowingRoute$2;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowingScreen$1$1$1;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowingScreen$2;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowingTopicCard$1$1$1;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowingTopicCard$2;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowingWithTopicsScreen$1$1$1;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$FollowingWithTopicsScreen$1;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$TopicIcon$1$1;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt$TopicIcon$2;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingScreenKt;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingState$Topics;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingUiState$Loading;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingUiState$Topics;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingUiState;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$followedTopicIdsStream$1;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$mapFollowedAndUnfollowedTopics$$inlined$map$1$2$1;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$mapFollowedAndUnfollowedTopics$$inlined$map$1$2;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$mapFollowedAndUnfollowedTopics$$inlined$map$1;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$mapFollowedAndUnfollowedTopics$lambda-4$$inlined$sortedBy$1;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$special$$inlined$flatMapLatest$1;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$special$$inlined$map$1$2$1;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$special$$inlined$map$1$2;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$special$$inlined$map$1;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel$uiState$1;
Lcom/google/samples/apps/nowinandroid/feature/following/FollowingViewModel;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$FollowButton$1$1;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$FollowButton$2;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$InterestsRoute$1;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$InterestsRoute$2;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$InterestsScreen$1$1$1;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$InterestsScreen$2;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$InterestsTopicCard$1$1$1;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$InterestsTopicCard$2;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$InterestsWithTopicsScreen$1$1$1;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$InterestsWithTopicsScreen$1;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$TopicIcon$1$1;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt$TopicIcon$2;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsScreenKt;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsState$Topics;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsUiState$Loading;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsUiState$Topics;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsUiState;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$followedTopicIdsStream$1;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$mapFollowedAndUnfollowedTopics$$inlined$map$1$2$1;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$mapFollowedAndUnfollowedTopics$$inlined$map$1$2;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$mapFollowedAndUnfollowedTopics$$inlined$map$1;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$mapFollowedAndUnfollowedTopics$lambda-4$$inlined$sortedBy$1;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$special$$inlined$flatMapLatest$1;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$special$$inlined$map$1$2$1;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$special$$inlined$map$1$2;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$special$$inlined$map$1;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel$uiState$1;
Lcom/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel;
Lcom/google/samples/apps/nowinandroid/feature/foryou/ComposableSingletons$ForYouScreenKt$lambda-1$1;
Lcom/google/samples/apps/nowinandroid/feature/foryou/ComposableSingletons$ForYouScreenKt;
Lcom/google/samples/apps/nowinandroid/feature/foryou/FollowedTopicsState$FollowedTopics;
@ -11176,7 +11176,7 @@ Lcom/google/samples/apps/nowinandroid/ui/ComposableSingletons$NiaAppKt$lambda-1$
Lcom/google/samples/apps/nowinandroid/ui/ComposableSingletons$NiaAppKt$lambda-1$1;
Lcom/google/samples/apps/nowinandroid/ui/ComposableSingletons$NiaAppKt;
Lcom/google/samples/apps/nowinandroid/ui/Destination$Episodes;
Lcom/google/samples/apps/nowinandroid/ui/Destination$Following;
Lcom/google/samples/apps/nowinandroid/ui/Destination$Interests;
Lcom/google/samples/apps/nowinandroid/ui/Destination$ForYou;
Lcom/google/samples/apps/nowinandroid/ui/Destination$Saved;
Lcom/google/samples/apps/nowinandroid/ui/Destination;

@ -220,8 +220,8 @@ private sealed class Destination(
iconTextId = R.string.saved
)
object Following : Destination(
route = NiaDestinations.FOLLOWING_ROUTE,
object Interests : Destination(
route = NiaDestinations.INTERESTS_ROUTE,
selectedIcon = Icons.Filled.Grid3x3,
unselectedIcon = Icons.Outlined.Grid3x3,
iconTextId = R.string.interests
@ -231,5 +231,5 @@ private sealed class Destination(
private val TOP_LEVEL_DESTINATIONS = listOf(
Destination.ForYou,
// TODO: Add destinations here, see b/226359180.
Destination.Following
Destination.Interests
)

@ -27,8 +27,8 @@ import androidx.navigation.compose.composable
import androidx.navigation.compose.navigation
import androidx.navigation.compose.rememberNavController
import androidx.navigation.navArgument
import com.google.samples.apps.nowinandroid.feature.following.InterestsRoute
import com.google.samples.apps.nowinandroid.feature.foryou.ForYouRoute
import com.google.samples.apps.nowinandroid.feature.interests.InterestsRoute
import com.google.samples.apps.nowinandroid.feature.topic.InterestsDestinations
import com.google.samples.apps.nowinandroid.feature.topic.InterestsScreens.TOPIC_SCREEN
import com.google.samples.apps.nowinandroid.feature.topic.TopicDestinationsArgs
@ -63,10 +63,10 @@ fun NiaNavGraph(
Text("SAVED")
}
navigation(
startDestination = InterestsDestinations.INTERESTS_ROUTE,
route = NiaDestinations.FOLLOWING_ROUTE
startDestination = InterestsDestinations.INTERESTS_DESTINATION,
route = NiaDestinations.INTERESTS_ROUTE
) {
composable(InterestsDestinations.INTERESTS_ROUTE) {
composable(InterestsDestinations.INTERESTS_DESTINATION) {
InterestsRoute(
navigateToTopic = { navController.navigate("$TOPIC_SCREEN/$it") },
navigateToAuthor = { /* TO IMPLEMENT */ },

@ -28,7 +28,7 @@ object NiaDestinations {
const val FOR_YOU_ROUTE = "for_you"
const val EPISODES_ROUTE = "episodes"
const val SAVED_ROUTE = "saved"
const val FOLLOWING_ROUTE = "following"
const val INTERESTS_ROUTE = "interests"
}
/**

@ -40,7 +40,7 @@ class BaselineProfileGenerator {
// through your most important UI.
startActivityAndWait()
device.waitForIdle()
listOf("Episodes", "Saved", "Following").forEach {
listOf("Episodes", "Saved", "Interests").forEach {
device.run {
findObject(By.text(it))
.click()

@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.samples.apps.nowinandroid.following
package com.google.samples.apps.nowinandroid.interests
import androidx.activity.ComponentActivity
import androidx.compose.runtime.Composable
@ -29,10 +29,10 @@ import com.google.samples.apps.nowinandroid.core.model.data.Author
import com.google.samples.apps.nowinandroid.core.model.data.FollowableAuthor
import com.google.samples.apps.nowinandroid.core.model.data.FollowableTopic
import com.google.samples.apps.nowinandroid.core.model.data.Topic
import com.google.samples.apps.nowinandroid.feature.following.FollowingScreen
import com.google.samples.apps.nowinandroid.feature.following.FollowingTabState
import com.google.samples.apps.nowinandroid.feature.following.FollowingUiState
import com.google.samples.apps.nowinandroid.feature.following.R
import com.google.samples.apps.nowinandroid.feature.interests.InterestsScreen
import com.google.samples.apps.nowinandroid.feature.interests.InterestsTabState
import com.google.samples.apps.nowinandroid.feature.interests.InterestsUiState
import com.google.samples.apps.nowinandroid.feature.interests.R
import org.junit.Before
import org.junit.Rule
import org.junit.Test
@ -47,19 +47,19 @@ class InterestsScreenTest {
@get:Rule
val composeTestRule = createAndroidComposeRule<ComponentActivity>()
private lateinit var followingLoading: String
private lateinit var followingEmptyHeader: String
private lateinit var followingTopicCardFollowButton: String
private lateinit var followingTopicCardUnfollowButton: String
private lateinit var interestsLoading: String
private lateinit var interestsEmptyHeader: String
private lateinit var interestsTopicCardFollowButton: String
private lateinit var interestsTopicCardUnfollowButton: String
@Before
fun setup() {
composeTestRule.activity.apply {
followingLoading = getString(R.string.following_loading)
followingEmptyHeader = getString(R.string.following_empty_header)
followingTopicCardFollowButton =
interestsLoading = getString(R.string.interests_loading)
interestsEmptyHeader = getString(R.string.interests_empty_header)
interestsTopicCardFollowButton =
getString(R.string.interests_card_follow_button_content_desc)
followingTopicCardUnfollowButton =
interestsTopicCardUnfollowButton =
getString(R.string.interests_card_unfollow_button_content_desc)
}
}
@ -67,22 +67,22 @@ class InterestsScreenTest {
@Test
fun niaLoadingWheel_inTopics_whenScreenIsLoading_showLoading() {
composeTestRule.setContent {
InterestsScreen(uiState = FollowingUiState.Loading, tabIndex = 0)
InterestsScreen(uiState = InterestsUiState.Loading, tabIndex = 0)
}
composeTestRule
.onNodeWithContentDescription(followingLoading)
.onNodeWithContentDescription(interestsLoading)
.assertExists()
}
@Test
fun niaLoadingWheel_inAuthors_whenScreenIsLoading_showLoading() {
composeTestRule.setContent {
InterestsScreen(uiState = FollowingUiState.Loading, tabIndex = 1)
InterestsScreen(uiState = InterestsUiState.Loading, tabIndex = 1)
}
composeTestRule
.onNodeWithContentDescription(followingLoading)
.onNodeWithContentDescription(interestsLoading)
.assertExists()
}
@ -90,7 +90,7 @@ class InterestsScreenTest {
fun interestsWithTopics_whenTopicsFollowed_showFollowedAndUnfollowedTopicsWithInfo() {
composeTestRule.setContent {
InterestsScreen(
uiState = FollowingUiState.Interests(topics = testTopics, authors = listOf()),
uiState = InterestsUiState.Interests(topics = testTopics, authors = listOf()),
tabIndex = 0
)
}
@ -110,11 +110,11 @@ class InterestsScreenTest {
.assertCountEquals(testTopics.count())
composeTestRule
.onAllNodesWithContentDescription(followingTopicCardFollowButton)
.onAllNodesWithContentDescription(interestsTopicCardFollowButton)
.assertCountEquals(numberOfUnfollowedTopics)
composeTestRule
.onAllNodesWithContentDescription(followingTopicCardUnfollowButton)
.onAllNodesWithContentDescription(interestsTopicCardUnfollowButton)
.assertCountEquals(testAuthors.filter { it.isFollowed }.size)
}
@ -122,7 +122,7 @@ class InterestsScreenTest {
fun interestsWithTopics_whenAuthorsFollowed_showFollowedAndUnfollowedTopicsWithInfo() {
composeTestRule.setContent {
InterestsScreen(
uiState = FollowingUiState.Interests(topics = listOf(), authors = testAuthors),
uiState = InterestsUiState.Interests(topics = listOf(), authors = testAuthors),
tabIndex = 1
)
}
@ -138,42 +138,42 @@ class InterestsScreenTest {
.assertIsDisplayed()
composeTestRule
.onAllNodesWithContentDescription(followingTopicCardFollowButton)
.onAllNodesWithContentDescription(interestsTopicCardFollowButton)
.assertCountEquals(numberOfUnfollowedAuthors)
composeTestRule
.onAllNodesWithContentDescription(followingTopicCardUnfollowButton)
.onAllNodesWithContentDescription(interestsTopicCardUnfollowButton)
.assertCountEquals(testTopics.filter { it.isFollowed }.size)
}
@Test
fun topicsEmpty_whenDataIsEmptyOccurs_thenShowEmptyScreen() {
composeTestRule.setContent {
InterestsScreen(uiState = FollowingUiState.Empty, tabIndex = 0)
InterestsScreen(uiState = InterestsUiState.Empty, tabIndex = 0)
}
composeTestRule
.onNodeWithText(followingEmptyHeader)
.onNodeWithText(interestsEmptyHeader)
.assertIsDisplayed()
}
@Test
fun authorsEmpty_whenDataIsEmptyOccurs_thenShowEmptyScreen() {
composeTestRule.setContent {
InterestsScreen(uiState = FollowingUiState.Empty, tabIndex = 1)
InterestsScreen(uiState = InterestsUiState.Empty, tabIndex = 1)
}
composeTestRule
.onNodeWithText(followingEmptyHeader)
.onNodeWithText(interestsEmptyHeader)
.assertIsDisplayed()
}
@Composable
private fun InterestsScreen(uiState: FollowingUiState, tabIndex: Int = 0) {
FollowingScreen(
private fun InterestsScreen(uiState: InterestsUiState, tabIndex: Int = 0) {
InterestsScreen(
uiState = uiState,
tabState = FollowingTabState(
titles = listOf(R.string.following_topics, R.string.following_people),
tabState = InterestsTabState(
titles = listOf(R.string.interests_topics, R.string.interests_people),
currentIndex = tabIndex
),
followAuthor = { _, _ -> },

@ -15,6 +15,6 @@
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.samples.apps.nowinandroid.feature.following">
package="com.google.samples.apps.nowinandroid.feature.interests">
</manifest>

@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.samples.apps.nowinandroid.feature.following
package com.google.samples.apps.nowinandroid.feature.interests
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
@ -40,10 +40,10 @@ import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage
import com.google.samples.apps.nowinandroid.core.ui.FollowButton
import com.google.samples.apps.nowinandroid.core.ui.theme.NiaTheme
import com.google.samples.apps.nowinandroid.feature.following.R.string
import com.google.samples.apps.nowinandroid.feature.interests.R.string
@Composable
fun FollowingItem(
fun InterestsItem(
name: String,
following: Boolean,
topicImageUrl: String,
@ -65,7 +65,7 @@ fun FollowingItem(
.clickable { onClick() }
.padding(vertical = itemSeparation)
) {
FollowingIcon(topicImageUrl, iconModifier.size(64.dp))
InterestsIcon(topicImageUrl, iconModifier.size(64.dp))
Spacer(modifier = Modifier.width(16.dp))
InterestContent(name, description)
}
@ -102,7 +102,7 @@ private fun InterestContent(name: String, description: String, modifier: Modifie
}
@Composable
private fun FollowingIcon(topicImageUrl: String, modifier: Modifier = Modifier) {
private fun InterestsIcon(topicImageUrl: String, modifier: Modifier = Modifier) {
if (topicImageUrl.isEmpty()) {
Icon(
imageVector = Filled.Android,
@ -121,10 +121,10 @@ private fun FollowingIcon(topicImageUrl: String, modifier: Modifier = Modifier)
@Preview
@Composable
private fun FollowingCardPreview() {
private fun InterestsCardPreview() {
NiaTheme {
Surface {
FollowingItem(
InterestsItem(
name = "Compose",
description = "Description",
following = false,
@ -138,10 +138,10 @@ private fun FollowingCardPreview() {
@Preview
@Composable
private fun FollowingCardLongNamePreview() {
private fun InterestsCardLongNamePreview() {
NiaTheme {
Surface {
FollowingItem(
InterestsItem(
name = "This is a very very very very long name",
description = "Description",
following = true,
@ -155,10 +155,10 @@ private fun FollowingCardLongNamePreview() {
@Preview
@Composable
private fun FollowingCardLongDescriptionPreview() {
private fun InterestsCardLongDescriptionPreview() {
NiaTheme {
Surface {
FollowingItem(
InterestsItem(
name = "Compose",
description = "This is a very very very very very very very " +
"very very very long description",
@ -173,10 +173,10 @@ private fun FollowingCardLongDescriptionPreview() {
@Preview
@Composable
private fun FollowingCardWithEmptyDescriptionPreview() {
private fun InterestsCardWithEmptyDescriptionPreview() {
NiaTheme {
Surface {
FollowingItem(
InterestsItem(
name = "Compose",
description = "",
following = true,

@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.samples.apps.nowinandroid.feature.following
package com.google.samples.apps.nowinandroid.feature.interests
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
@ -46,12 +46,12 @@ fun InterestsRoute(
modifier: Modifier = Modifier,
navigateToAuthor: () -> Unit,
navigateToTopic: (String) -> Unit,
viewModel: FollowingViewModel = hiltViewModel()
viewModel: InterestsViewModel = hiltViewModel()
) {
val uiState by viewModel.uiState.collectAsState()
val tabState by viewModel.tabState.collectAsState()
FollowingScreen(
InterestsScreen(
uiState = uiState,
tabState = tabState,
followTopic = viewModel::followTopic,
@ -64,9 +64,9 @@ fun InterestsRoute(
}
@Composable
fun FollowingScreen(
uiState: FollowingUiState,
tabState: FollowingTabState,
fun InterestsScreen(
uiState: InterestsUiState,
tabState: InterestsTabState,
followAuthor: (String, Boolean) -> Unit,
followTopic: (String, Boolean) -> Unit,
navigateToAuthor: () -> Unit,
@ -98,26 +98,26 @@ fun FollowingScreen(
)
)
when (uiState) {
FollowingUiState.Loading ->
InterestsUiState.Loading ->
LoadingWheel(
modifier = modifier,
contentDesc = stringResource(id = R.string.following_loading),
contentDesc = stringResource(id = R.string.interests_loading),
)
is FollowingUiState.Interests ->
FollowingContent(
is InterestsUiState.Interests ->
InterestsContent(
tabState, switchTab, uiState, navigateToTopic, followTopic,
navigateToAuthor, followAuthor
)
is FollowingUiState.Empty -> InterestsEmptyScreen()
is InterestsUiState.Empty -> InterestsEmptyScreen()
}
}
}
@Composable
private fun FollowingContent(
tabState: FollowingTabState,
private fun InterestsContent(
tabState: InterestsTabState,
switchTab: (Int) -> Unit,
uiState: FollowingUiState.Interests,
uiState: InterestsUiState.Interests,
navigateToTopic: (String) -> Unit,
followTopic: (String, Boolean) -> Unit,
navigateToAuthor: () -> Unit,
@ -157,5 +157,5 @@ private fun FollowingContent(
@Composable
private fun InterestsEmptyScreen() {
Text(text = stringResource(id = R.string.following_empty_header))
Text(text = stringResource(id = R.string.interests_empty_header))
}

@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.samples.apps.nowinandroid.feature.following
package com.google.samples.apps.nowinandroid.feature.interests
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
@ -34,27 +34,27 @@ import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch
@HiltViewModel
class FollowingViewModel @Inject constructor(
class InterestsViewModel @Inject constructor(
private val authorsRepository: AuthorsRepository,
private val topicsRepository: TopicsRepository
) : ViewModel() {
private val _tabState = MutableStateFlow(
FollowingTabState(
titles = listOf(R.string.following_topics, R.string.following_people),
InterestsTabState(
titles = listOf(R.string.interests_topics, R.string.interests_people),
currentIndex = 0
)
)
val tabState: StateFlow<FollowingTabState> = _tabState.asStateFlow()
val tabState: StateFlow<InterestsTabState> = _tabState.asStateFlow()
val uiState: StateFlow<FollowingUiState> = combine(
val uiState: StateFlow<InterestsUiState> = combine(
authorsRepository.getAuthorsStream(),
authorsRepository.getFollowedAuthorIdsStream(),
topicsRepository.getTopicsStream(),
topicsRepository.getFollowedTopicIdsStream(),
) { availableAuthors, followedAuthorIdsState, availableTopics, followedTopicIdsState ->
FollowingUiState.Interests(
InterestsUiState.Interests(
authors = availableAuthors
.map { author ->
FollowableAuthor(
@ -76,7 +76,7 @@ class FollowingViewModel @Inject constructor(
.stateIn(
scope = viewModelScope,
started = SharingStarted.WhileSubscribed(5_000),
initialValue = FollowingUiState.Loading
initialValue = InterestsUiState.Loading
)
fun followTopic(followedTopicId: String, followed: Boolean) {
@ -100,18 +100,18 @@ class FollowingViewModel @Inject constructor(
}
}
data class FollowingTabState(
data class InterestsTabState(
val titles: List<Int>,
val currentIndex: Int
)
sealed interface FollowingUiState {
object Loading : FollowingUiState
sealed interface InterestsUiState {
object Loading : InterestsUiState
data class Interests(
val authors: List<FollowableAuthor>,
val topics: List<FollowableTopic>
) : FollowingUiState
) : InterestsUiState
object Empty : FollowingUiState
object Empty : InterestsUiState
}

@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.samples.apps.nowinandroid.feature.following
package com.google.samples.apps.nowinandroid.feature.interests
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
@ -44,7 +44,7 @@ fun TopicsTabContent(
) {
topics.forEach { followableTopic ->
item {
FollowingItem(
InterestsItem(
name = followableTopic.topic.name,
following = followableTopic.isFollowed,
description = followableTopic.topic.shortDescription,
@ -79,7 +79,7 @@ fun AuthorsTabContent(
) {
authors.forEach { followableTopic ->
item {
FollowingItem(
InterestsItem(
name = followableTopic.author.name,
following = followableTopic.isFollowed,
topicImageUrl = followableTopic.author.imageUrl,

@ -16,10 +16,10 @@
-->
<resources>
<string name="interests">Interests</string>
<string name="following_topics">Topics</string>
<string name="following_people">People</string>
<string name="following_loading">Loading data</string>
<string name="following_empty_header">"No available data"</string>
<string name="interests_topics">Topics</string>
<string name="interests_people">People</string>
<string name="interests_loading">Loading data</string>
<string name="interests_empty_header">"No available data"</string>
<string name="interests_card_follow_button_content_desc">Follow interest button</string>
<string name="interests_card_unfollow_button_content_desc">Unfollow interest button</string>
<string name="top_app_bar_action_button_content_desc">Menu</string>

@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.samples.apps.nowinandroid.following
package com.google.samples.apps.nowinandroid.interests
import app.cash.turbine.test
import com.google.samples.apps.nowinandroid.core.model.data.Author
@ -24,32 +24,32 @@ import com.google.samples.apps.nowinandroid.core.model.data.Topic
import com.google.samples.apps.nowinandroid.core.testing.repository.TestAuthorsRepository
import com.google.samples.apps.nowinandroid.core.testing.repository.TestTopicsRepository
import com.google.samples.apps.nowinandroid.core.testing.util.TestDispatcherRule
import com.google.samples.apps.nowinandroid.feature.following.FollowingUiState
import com.google.samples.apps.nowinandroid.feature.following.FollowingViewModel
import com.google.samples.apps.nowinandroid.feature.interests.InterestsUiState
import com.google.samples.apps.nowinandroid.feature.interests.InterestsViewModel
import kotlinx.coroutines.test.runTest
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Rule
import org.junit.Test
class FollowingViewModelTest {
class InterestsViewModelTest {
@get:Rule
val dispatcherRule = TestDispatcherRule()
private val authorsRepository = TestAuthorsRepository()
private val topicsRepository = TestTopicsRepository()
private lateinit var viewModel: FollowingViewModel
private lateinit var viewModel: InterestsViewModel
@Before
fun setup() {
viewModel = FollowingViewModel(authorsRepository, topicsRepository)
viewModel = InterestsViewModel(authorsRepository, topicsRepository)
}
@Test
fun uiState_whenInitialized_thenShowLoading() = runTest {
viewModel.uiState.test {
assertEquals(FollowingUiState.Loading, awaitItem())
assertEquals(InterestsUiState.Loading, awaitItem())
cancel()
}
}
@ -57,7 +57,7 @@ class FollowingViewModelTest {
@Test
fun uiState_whenFollowedTopicsAreLoading_thenShowLoading() = runTest {
viewModel.uiState.test {
assertEquals(FollowingUiState.Loading, awaitItem())
assertEquals(InterestsUiState.Loading, awaitItem())
authorsRepository.setFollowedAuthorIds(setOf("1"))
topicsRepository.setFollowedTopicIds(emptySet())
cancel()
@ -67,7 +67,7 @@ class FollowingViewModelTest {
@Test
fun uiState_whenFollowedAuthorsAreLoading_thenShowLoading() = runTest {
viewModel.uiState.test {
assertEquals(FollowingUiState.Loading, awaitItem())
assertEquals(InterestsUiState.Loading, awaitItem())
authorsRepository.setFollowedAuthorIds(emptySet())
topicsRepository.setFollowedTopicIds(setOf("1"))
cancel()
@ -87,7 +87,7 @@ class FollowingViewModelTest {
assertEquals(
false,
(awaitItem() as FollowingUiState.Interests)
(awaitItem() as InterestsUiState.Interests)
.topics.first { it.topic.id == toggleTopicId }.isFollowed
)
@ -97,7 +97,7 @@ class FollowingViewModelTest {
)
assertEquals(
FollowingUiState.Interests(topics = testOutputTopics, authors = emptyList()),
InterestsUiState.Interests(topics = testOutputTopics, authors = emptyList()),
awaitItem()
)
cancel()
@ -121,7 +121,7 @@ class FollowingViewModelTest {
)
assertEquals(
FollowingUiState.Interests(topics = emptyList(), authors = testOutputAuthors),
InterestsUiState.Interests(topics = emptyList(), authors = testOutputAuthors),
awaitItem()
)
cancel()
@ -143,7 +143,7 @@ class FollowingViewModelTest {
assertEquals(
true,
(awaitItem() as FollowingUiState.Interests)
(awaitItem() as InterestsUiState.Interests)
.topics.first { it.topic.id == toggleTopicId }.isFollowed
)
@ -153,7 +153,7 @@ class FollowingViewModelTest {
)
assertEquals(
FollowingUiState.Interests(topics = testInputTopics, authors = emptyList()),
InterestsUiState.Interests(topics = testInputTopics, authors = emptyList()),
awaitItem()
)
cancel()
@ -179,7 +179,7 @@ class FollowingViewModelTest {
)
assertEquals(
FollowingUiState.Interests(topics = emptyList(), authors = testInputAuthors),
InterestsUiState.Interests(topics = emptyList(), authors = testInputAuthors),
awaitItem()
)
cancel()

@ -20,7 +20,7 @@ import com.google.samples.apps.nowinandroid.feature.topic.InterestsScreens.TOPIC
import com.google.samples.apps.nowinandroid.feature.topic.TopicDestinationsArgs.TOPIC_ID_ARG
object InterestsDestinations {
const val INTERESTS_ROUTE = "interests"
const val INTERESTS_DESTINATION = "interests_destination"
const val TOPIC_ROUTE = "$TOPIC_SCREEN/{$TOPIC_ID_ARG}"
}

@ -53,7 +53,7 @@ include(":core-model")
include(":core-network")
include(":core-ui")
include(":core-testing")
include(":feature-following")
include(":feature-foryou")
include(":feature-interests")
include(":feature-topic")
include(":sync")

Loading…
Cancel
Save