-
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.
Merge pull request #288 from 6QuizOnTheBlock/and/feat#268-student_posโฆ
โฆt_announce And/feat#268 ๏ฟฝํ์ ์๋ฆผ์ฅ ์์ ๊ฒ์ํ ๊ตฌํ
- Loading branch information
Showing
36 changed files
with
2,526 additions
and
3 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
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
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 |
---|---|---|
|
@@ -7,4 +7,5 @@ android { | |
} | ||
|
||
dependencies { | ||
implementation(libs.bundles.paging) | ||
} |
34 changes: 34 additions & 0 deletions
34
...d/feature/student/board/src/main/java/com/sixkids/student/board/component/CommentCount.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,34 @@ | ||
package com.sixkids.student.board.component | ||
|
||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.graphics.vector.ImageVector | ||
import androidx.compose.ui.res.vectorResource | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import com.sixkids.designsystem.theme.UlbanTypography | ||
import com.sixkids.designsystem.R as UlbanRes | ||
|
||
@Composable | ||
fun CommentCount( | ||
count: Int | ||
) { | ||
Row { | ||
Icon( | ||
imageVector = ImageVector.vectorResource(id = UlbanRes.drawable.ic_chat_bubble), | ||
contentDescription = null | ||
) | ||
Text( | ||
text = count.toString(), | ||
style = UlbanTypography.bodyMedium | ||
) | ||
} | ||
} | ||
|
||
|
||
@Preview(showBackground = true) | ||
@Composable | ||
fun CommentCountPreview() { | ||
CommentCount(10) | ||
} |
133 changes: 133 additions & 0 deletions
133
...id/feature/student/board/src/main/java/com/sixkids/student/board/component/CommentItem.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,133 @@ | ||
package com.sixkids.student.board.component | ||
|
||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.aspectRatio | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.width | ||
import androidx.compose.material3.Card | ||
import androidx.compose.material3.CardColors | ||
import androidx.compose.material3.CardDefaults | ||
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.graphics.Color | ||
import androidx.compose.ui.graphics.vector.ImageVector | ||
import androidx.compose.ui.layout.ContentScale | ||
import androidx.compose.ui.res.vectorResource | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import coil.compose.AsyncImage | ||
import com.sixkids.designsystem.theme.Blue | ||
import com.sixkids.designsystem.theme.Gray | ||
import com.sixkids.designsystem.theme.GrayLight | ||
import com.sixkids.designsystem.theme.UlbanTypography | ||
import com.sixkids.designsystem.R as UlbanRes | ||
|
||
@Composable | ||
fun CommentItem( | ||
modifier: Modifier = Modifier, | ||
selected: Boolean = false, | ||
writer: String = "", | ||
dateString: String = "00/00 00:00", | ||
writerImageUrl: String = "", | ||
commentString: String = "", | ||
isRecomment: Boolean = false, | ||
recommentOnclick: () -> Unit = {}, | ||
deleteOnclick: (() -> Unit)? = null | ||
){ | ||
Card( | ||
colors = CardDefaults.cardColors( | ||
containerColor = | ||
if (selected) { Blue} | ||
else if (isRecomment) {GrayLight} | ||
else {Color.Transparent} | ||
), | ||
) { | ||
Column( | ||
modifier = modifier | ||
.padding(start = 10.dp) | ||
) { | ||
Row( | ||
verticalAlignment = Alignment.CenterVertically, | ||
) { | ||
AsyncImage( | ||
modifier = Modifier | ||
.height(36.dp) | ||
.aspectRatio(1f), | ||
model = writerImageUrl, | ||
contentScale = ContentScale.Crop, | ||
contentDescription = "์์ฑ์ ํ๋กํ ์ฌ์ง" | ||
) | ||
Spacer(modifier = Modifier.width(4.dp)) | ||
Text( | ||
text = writer, | ||
style = UlbanTypography.bodyMedium | ||
) | ||
Spacer(modifier = Modifier.weight(1f)) | ||
if (!isRecomment) { | ||
Icon( | ||
modifier = Modifier.clickable{recommentOnclick()}, | ||
imageVector = ImageVector.vectorResource(id = UlbanRes.drawable.ic_chat_bubble_outline), | ||
contentDescription = null | ||
) | ||
} | ||
if (deleteOnclick != null) { | ||
Icon( | ||
modifier = Modifier.clickable{deleteOnclick()}, | ||
imageVector = ImageVector.vectorResource(id = UlbanRes.drawable.ic_delete), | ||
contentDescription = null | ||
) | ||
} | ||
} | ||
Spacer(modifier = Modifier.height(4.dp)) | ||
Text( | ||
text = commentString, | ||
style = UlbanTypography.bodyMedium | ||
) | ||
Spacer(modifier = Modifier.height(4.dp)) | ||
Text( | ||
text = dateString, | ||
style = UlbanTypography.bodySmall.copy( | ||
color = Gray | ||
) | ||
) | ||
Spacer(modifier = Modifier.height(4.dp)) | ||
} | ||
} | ||
} | ||
|
||
@Preview(showBackground = true) | ||
@Composable | ||
fun CommentItemPreview() { | ||
Column { | ||
CommentItem( | ||
writer = "์คํ๋น", | ||
dateString = "09/01 12:00", | ||
writerImageUrl = "https://www.google.com/images/branding/googlelogo/2x/googlelogo_light_color_272x92dp.png", | ||
commentString = "๋๊ธ ๋ด์ฉ", | ||
deleteOnclick = {}, | ||
selected = true | ||
) | ||
CommentItem( | ||
writer = "์คํ๋น", | ||
dateString = "09/01 12:00", | ||
commentString = "๋๊ธ ๋ด์ฉ", | ||
writerImageUrl = "https://www.google.com/images/branding/googlelogo/2x/googlelogo_light_color_272x92dp.png", | ||
) | ||
CommentItem( | ||
writer = "์คํ๋น", | ||
dateString = "09/01 12:00", | ||
commentString = "๋๊ธ ๋ด์ฉ", | ||
writerImageUrl = "https://www.google.com/images/branding/googlelogo/2x/googlelogo_light_color_272x92dp.png", | ||
isRecomment = true, | ||
deleteOnclick = {} | ||
) | ||
} | ||
|
||
} |
77 changes: 77 additions & 0 deletions
77
...ature/student/board/src/main/java/com/sixkids/student/board/component/CommentTextField.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,77 @@ | ||
package com.sixkids.student.board.component | ||
|
||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.foundation.layout.wrapContentHeight | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.automirrored.outlined.Send | ||
import androidx.compose.material3.Card | ||
import androidx.compose.material3.CardDefaults | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import com.sixkids.designsystem.component.textfield.UlbanBasicTextField | ||
import com.sixkids.designsystem.theme.GrayLight | ||
import com.sixkids.designsystem.theme.UlbanTypography | ||
import com.sixkids.student.board.R | ||
|
||
|
||
@Composable | ||
fun CommentTextField( | ||
msg: String = "", | ||
onTextIuputChange: (String) -> Unit = {}, | ||
onSendClick: (String) -> Unit = {}, | ||
) { | ||
Card( | ||
modifier = Modifier | ||
.padding(6.dp), | ||
colors = CardDefaults.cardColors( | ||
containerColor = GrayLight | ||
) | ||
) { | ||
Row( | ||
modifier = Modifier | ||
.fillMaxWidth(), | ||
verticalAlignment = Alignment.CenterVertically | ||
) { | ||
UlbanBasicTextField( | ||
text = msg, | ||
onTextChange = onTextIuputChange, | ||
modifier = Modifier | ||
.padding(10.dp, 0.dp) | ||
.weight(1f) | ||
.wrapContentHeight(), | ||
maxLines = 3, | ||
textStyle = UlbanTypography.bodyMedium.copy(fontWeight = FontWeight.Normal), | ||
hint = stringResource(id = R.string.student_board_detail_comment_hint) | ||
) | ||
|
||
Icon( | ||
Icons.AutoMirrored.Outlined.Send, | ||
contentDescription = "", | ||
modifier = Modifier | ||
.size(30.dp) | ||
.padding(end = 4.dp) | ||
.clickable { | ||
onSendClick(msg) | ||
} | ||
) | ||
|
||
} | ||
} | ||
|
||
} | ||
|
||
@Preview(showBackground = true) | ||
@Composable | ||
fun CommentTextFieldPreview() { | ||
CommentTextField() | ||
} |
Oops, something went wrong.