generated from NOW-SOPT-ANDROID/now-sopt-android-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
379 additions
and
53 deletions.
There are no files selected for viewing
This file contains 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,9 @@ | ||
package com.sopt.now.compose | ||
|
||
import androidx.compose.ui.graphics.vector.ImageVector | ||
|
||
data class Friend( | ||
val profileImage: ImageVector, | ||
val name: String, | ||
val selfDescription: String, | ||
) |
50 changes: 50 additions & 0 deletions
50
app/src/main/java/com/sopt/now/compose/FriendProfileItem.kt
This file contains 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,50 @@ | ||
package com.sopt.now.compose | ||
|
||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.foundation.layout.width | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.text.style.TextOverflow | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.sp | ||
|
||
|
||
@Composable | ||
fun FriendProfileItem(friend: Friend) { | ||
Row( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(vertical = 10.dp), | ||
verticalAlignment = Alignment.CenterVertically | ||
) { | ||
Icon( | ||
modifier = Modifier.size(50.dp), | ||
imageVector = friend.profileImage, | ||
contentDescription = null | ||
) | ||
Spacer(modifier = Modifier.width(10.dp)) | ||
Text( | ||
text = friend.name, | ||
fontSize = 14.sp, | ||
fontWeight = FontWeight.Bold, | ||
overflow = TextOverflow.Ellipsis, | ||
maxLines = 1 | ||
) | ||
Spacer(modifier = Modifier.width(30.dp)) | ||
Spacer(modifier = Modifier.weight(1f)) | ||
Text( | ||
text = friend.selfDescription, | ||
fontSize = 10.sp, | ||
overflow = TextOverflow.Ellipsis, | ||
maxLines = 1 | ||
) | ||
} | ||
} |
This file contains 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,102 @@ | ||
package com.sopt.now.compose | ||
|
||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.lazy.LazyColumn | ||
import androidx.compose.foundation.lazy.items | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.filled.Person | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
|
||
@Composable | ||
fun HomeUi() { | ||
Column( | ||
modifier = Modifier | ||
.fillMaxSize() | ||
.padding(horizontal = 10.dp), | ||
horizontalAlignment = Alignment.CenterHorizontally | ||
) { | ||
LazyColumn { | ||
items(userList) { | ||
UserProfileItem(it) | ||
} | ||
items(friendList) { | ||
FriendProfileItem(it) | ||
} | ||
} | ||
} | ||
} | ||
val userList = listOf<User>( | ||
User( | ||
profileImage = Icons.Filled.Person, | ||
name = "송혜음", | ||
selfDescription = "컴포즈 커피 최고" | ||
) | ||
) | ||
|
||
val friendList = listOf<Friend>( | ||
Friend( | ||
profileImage = Icons.Filled.Person, | ||
name = "이의경", | ||
selfDescription = "다들 빨리 끝내고 뒤풀이 가고 싶지?" | ||
), | ||
Friend( | ||
profileImage = Icons.Filled.Person, | ||
name = "우상욱", | ||
selfDescription = "나보다 안드 잘하는 사람 있으면 나와봐" | ||
), | ||
Friend( | ||
profileImage = Icons.Filled.Person, | ||
name = "배지현", | ||
selfDescription = "표정 풀자 ^^" | ||
), | ||
Friend( | ||
profileImage = Icons.Filled.Person, | ||
name = "이의경", | ||
selfDescription = "다들 빨리 끝내고 뒤풀이 가고 싶지?" | ||
), | ||
Friend( | ||
profileImage = Icons.Filled.Person, | ||
name = "우상욱", | ||
selfDescription = "나보다 안드 잘하는 사람 있으면 나와봐" | ||
), | ||
Friend( | ||
profileImage = Icons.Filled.Person, | ||
name = "배지현", | ||
selfDescription = "표정 풀자 ^^" | ||
), | ||
Friend( | ||
profileImage = Icons.Filled.Person, | ||
name = "이의경", | ||
selfDescription = "다들 빨리 끝내고 뒤풀이 가고 싶지?" | ||
), | ||
Friend( | ||
profileImage = Icons.Filled.Person, | ||
name = "우상욱", | ||
selfDescription = "나보다 안드 잘하는 사람 있으면 나와봐" | ||
), | ||
Friend( | ||
profileImage = Icons.Filled.Person, | ||
name = "배지현", | ||
selfDescription = "표정 풀자 ^^" | ||
), | ||
Friend( | ||
profileImage = Icons.Filled.Person, | ||
name = "이의경", | ||
selfDescription = "다들 빨리 끝내고 뒤풀이 가고 싶지?" | ||
), | ||
Friend( | ||
profileImage = Icons.Filled.Person, | ||
name = "우상욱", | ||
selfDescription = "나보다 안드 잘하는 사람 있으면 나와봐" | ||
), | ||
Friend( | ||
profileImage = Icons.Filled.Person, | ||
name = "배지현", | ||
selfDescription = "표정 풀자 ^^" | ||
) | ||
) |
This file contains 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 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,8 @@ | ||
package com.sopt.now.compose | ||
|
||
import androidx.compose.ui.graphics.vector.ImageVector | ||
|
||
data class BottomNavigationItem( | ||
val icon: ImageVector, | ||
val label: String | ||
) |
Oops, something went wrong.