From e408191e18bfd942ac494e4e1d49f54ef7aa3fa1 Mon Sep 17 00:00:00 2001 From: yonghanJu Date: Wed, 11 Oct 2023 17:21:31 +0900 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=ED=98=84=EC=9E=AC=20=EB=8B=AC?= =?UTF-8?q?=EB=A6=AC=EB=8A=94=20=ED=8C=94=EB=A1=9C=EC=9E=89=20=EB=B3=B4?= =?UTF-8?q?=EC=97=AC=EC=A3=BC=EA=B8=B0=20=ED=99=94=EB=A9=B4=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screens/running/RunningScreen.kt | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/presentation/src/main/java/com/whyranoid/presentation/screens/running/RunningScreen.kt b/presentation/src/main/java/com/whyranoid/presentation/screens/running/RunningScreen.kt index 497aa642..913777d1 100644 --- a/presentation/src/main/java/com/whyranoid/presentation/screens/running/RunningScreen.kt +++ b/presentation/src/main/java/com/whyranoid/presentation/screens/running/RunningScreen.kt @@ -104,6 +104,7 @@ fun RunningScreen( LaunchedEffect(LocalLifecycleOwner.current) { viewModel.startWorker = startWorker viewModel.getRunningState() + viewModel.getRunningFollowingsState() viewModel.onTrackingButtonClicked() } @@ -122,6 +123,7 @@ fun RunningScreen( viewModel::selectImage, viewModel::saveHistory, viewModel::takeSnapShot, + viewModel::sendLike, ) } @@ -139,6 +141,7 @@ fun RunningContent( selectImage: (Uri) -> Unit, saveHistory: (Bitmap, RunningFinishData) -> Unit, onTakeSnapShot: (RunningFinishData) -> Unit, + onSendLike: (uid: Long) -> Unit, ) { Column( modifier = Modifier.fillMaxHeight(), @@ -151,6 +154,7 @@ fun RunningContent( onEditOpen, onEditClose, saveHistory, + onSendLike, ) RunningInfoScreen( modifier = Modifier.height(280.dp), @@ -186,6 +190,7 @@ fun RunningMapScreen( onEditOpen: () -> Unit, onEditClose: () -> Unit, onSaveHistory: (Bitmap, RunningFinishData) -> Unit, + onSendLike: (uid: Long) -> Unit, ) { var mapProperties by remember { mutableStateOf( @@ -477,8 +482,21 @@ fun RunningMapScreen( } LazyRow { - repeat(10) { - item { RunningFollowerItemWithLikable(onClick = { Result.success(Unit) }) } + state.runningFollowerState.getDataOrNull()?.let { (running, notRunning) -> + items(running.size) { + RunningFollowerItemWithLikable( + user = running[it].user, + onClick = onSendLike, + circleBorderColor = WalkieColor.Primary, + isLiked = running[it].isLiked, + ) + } + items(notRunning.size) { + RunningFollowerItemWithLikable( + user = running[it].user, + circleBorderColor = WalkieColor.GrayBorder, + ) + } } } }