-
Notifications
You must be signed in to change notification settings - Fork 3
[UI] 데이터 없는 화면, 사용자 찾기 화면 구현 #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
JJUYAAA
merged 22 commits into
THIP-TextHip:develop
from
JJUYAAA:ui/#74-empty_data_screen
Aug 12, 2025
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
d9b3c22
[ui]: 유저의 구독리스트 구독자 없는 경우(#74)
JJUYAAA 46302b6
[ui]: 내피드 - 작성된 글 없는 경우(#74)
JJUYAAA 604afd3
[ui]: 내피드 - 작성된 글 없는 경우 프리뷰 분리(#74)
JJUYAAA 2a1ab49
[ui]: 내피드 - 작성된 글 없는 경우 멘트 수정(#74)
JJUYAAA 6b23c85
[ui]: 피드 - 내가 구독하는 유저가 없는 경우(#74)
JJUYAAA d73b6a3
[ui]: 마이페이지-저장피드-> 데이터 없는 경우 추가(#74)
JJUYAAA 66dc72e
[ui]: 마이페이지-책피드-> 데이터 없는 경우 추가(#74)
JJUYAAA f1d9636
[ui]: 사용자 찾기 페이지에 쓰이는 컴포넌트 추가(#74)
JJUYAAA e294248
[ui]: 사용자 찾기 페이지 구현(#74)
JJUYAAA aa32dec
[ui]: 사용자 찾기 페이지 텍스트 수정(#74)
JJUYAAA a53c0bb
[ui]: 사용자 찾기 패딩값 수정 등 자잘한 수정(#74)
JJUYAAA 360a4e2
[ui]: 다른 사람 피드 조회 페이지 추가(#74)
JJUYAAA 5d0cdb6
[ui]: 반응화면 - 데이터 없는 경우(#74)
JJUYAAA c30f3d3
[refactor]: 불필요한 분기 제거(#74)
JJUYAAA 3d18451
[refactor]: 하드코딩 제거, take(5)로직 재사용(#74)
JJUYAAA d2e07f2
[refactor]: 하드코딩 제거, take(5)로직 재사용(#74)
JJUYAAA 4670a92
[refactor]: 오타수정(#74)
JJUYAAA cb8534d
[refactor]: EmptySavedBookViewModel 수정(#74)
JJUYAAA 37e2fc8
[refactor]: feedOthersScreen 수정(#74)
JJUYAAA 1d608c3
[refactor]: feedOthersScreen 수정(#74)
JJUYAAA 5b508b1
[refactor]: 패딩값, text 수정(#74)
JJUYAAA 19374f1
[fix]: 충돌 해결(#74)
JJUYAAA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
app/src/main/java/com/texthip/thip/ui/feed/component/LiveSearchPeopleResult.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| package com.texthip.thip.ui.feed.component | ||
|
|
||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Box | ||
| import androidx.compose.foundation.layout.Spacer | ||
| import androidx.compose.foundation.layout.fillMaxSize | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.lazy.LazyColumn | ||
| import androidx.compose.foundation.lazy.itemsIndexed | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import com.texthip.thip.ui.common.header.AuthorHeader | ||
| import com.texthip.thip.ui.feed.mock.MySubscriptionData | ||
| import com.texthip.thip.ui.theme.ThipTheme | ||
| import com.texthip.thip.ui.theme.ThipTheme.colors | ||
|
|
||
| @Composable | ||
| fun SearchPeopleResult( | ||
| modifier: Modifier = Modifier, | ||
| peopleList: List<MySubscriptionData>, | ||
| onThipNumClick: (MySubscriptionData) -> Unit = {} | ||
| ) { | ||
| LazyColumn (modifier = modifier){ | ||
| itemsIndexed(peopleList) { index, user -> | ||
| AuthorHeader( | ||
| profileImage = user.profileImageUrl, | ||
| nickname = user.nickname, | ||
| badgeText = user.role, | ||
| profileImageSize = 36.dp, | ||
| showButton = false, | ||
| showThipNum = true, | ||
| thipNum = user.subscriberCount, | ||
| onThipNumClick = { onThipNumClick(user) } | ||
| ) | ||
| if (index < peopleList.size - 1) { | ||
| Spacer( | ||
| modifier = Modifier | ||
| .padding(vertical = 12.dp, horizontal = 20.dp) | ||
| .fillMaxWidth() | ||
| .height(1.dp) | ||
| .background(colors.DarkGrey02) | ||
| ) | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| fun SearchPeopleResultPreview() { | ||
| ThipTheme { | ||
| Box( | ||
| modifier = Modifier | ||
| .fillMaxSize() | ||
| ) { | ||
| SearchPeopleResult( | ||
| peopleList = listOf( | ||
| MySubscriptionData( | ||
| profileImageUrl = null, | ||
| nickname = "Thiper_Official", | ||
| role = "공식 인플루언서", | ||
| roleColor = colors.NeonGreen, | ||
| subscriberCount = 50, | ||
| isSubscribed = false | ||
| ), | ||
| MySubscriptionData( | ||
| profileImageUrl = null, | ||
| nickname = "Thiper_Writer", | ||
| role = "작가", | ||
| roleColor = colors.Yellow, | ||
| subscriberCount = 120, | ||
| isSubscribed = true | ||
| ), | ||
| MySubscriptionData( | ||
| profileImageUrl = null, | ||
| nickname = "Thiper_Newbie", | ||
| role = "칭호칭호", | ||
| roleColor = colors.White, | ||
| subscriberCount = 0, | ||
| isSubscribed = false | ||
| ) | ||
| ) | ||
| ) | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
LazyColumn 아이템에 안정적 key를 지정해 재구성 비용과 스크롤 깜빡임을 줄여주세요.
현재
itemsIndexed(peopleList)에 key가 없어 Diff 계산 시 불필요한 재구성이 발생할 수 있습니다. 고유 식별자가 있다면 그 값을 key로 사용하세요. (닉네임이 유일하지 않을 수 있으므로 가능하면 id 사용 권장)다음과 같이 적용을 제안드립니다(예: 임시로 nickname 사용):
닉네임이 유일하지 않다면
MySubscriptionData에id를 추가한 뒤 해당 id를 key로 사용해주세요.📝 Committable suggestion
🤖 Prompt for AI Agents