From 213f4d85a88dfed9f753cb97e17079b3c79e37f5 Mon Sep 17 00:00:00 2001 From: peng-u-0807 Date: Tue, 5 Dec 2023 17:32:06 +0900 Subject: [PATCH] feat: navigate to `PlayEmojiView` from `ProfileTab` --- .../com/goliath/emojihub/views/ProfilePage.kt | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/android/app/src/main/java/com/goliath/emojihub/views/ProfilePage.kt b/android/app/src/main/java/com/goliath/emojihub/views/ProfilePage.kt index 56a743a5..7ac3b8d0 100644 --- a/android/app/src/main/java/com/goliath/emojihub/views/ProfilePage.kt +++ b/android/app/src/main/java/com/goliath/emojihub/views/ProfilePage.kt @@ -126,11 +126,14 @@ fun ProfilePage() { navigateToDestination = { navController.navigate(NavigationDestination.MyEmojiList) } ) { items(myCreatedEmojiList.itemCount) { index -> - myCreatedEmojiList[index]?.let { + myCreatedEmojiList[index]?.let { emoji -> EmojiCell( - emoji = it, + emoji = emoji, displayMode = EmojiCellDisplay.HORIZONTAL, - onSelected = {}) + onSelected = { + emojiViewModel.currentEmoji = emoji + navController.navigate(NavigationDestination.PlayEmojiVideo) + }) } } } @@ -143,11 +146,14 @@ fun ProfilePage() { navigateToDestination = { navController.navigate(NavigationDestination.MySavedEmojiList) } ) { items(mySavedEmojiList.itemCount) { index -> - mySavedEmojiList[index]?.let { + mySavedEmojiList[index]?.let { emoji -> EmojiCell( - emoji = it, + emoji = emoji, displayMode = EmojiCellDisplay.HORIZONTAL, - onSelected = {}) + onSelected = { + emojiViewModel.currentEmoji = emoji + navController.navigate(NavigationDestination.PlayEmojiVideo) + }) } } }