-
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 #328 from 6QuizOnTheBlock/and/feat#317-relay_pass
And/feat#317 ํ์ ๋ฆด๋ ์ด ์ ๋ฌ ๊ธฐ๋ฅ
- Loading branch information
Showing
42 changed files
with
1,156 additions
and
67 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
153 changes: 153 additions & 0 deletions
153
...gnsystem/src/main/java/com/sixkids/designsystem/component/screen/RelayPassResultScreen.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,153 @@ | ||
package com.sixkids.designsystem.component.screen | ||
|
||
import androidx.annotation.DrawableRes | ||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.BoxWithConstraints | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.PaddingValues | ||
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.offset | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.clip | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.platform.LocalContext | ||
import androidx.compose.ui.platform.LocalDensity | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.text.style.TextAlign | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.sp | ||
import com.sixkids.designsystem.R | ||
import com.sixkids.designsystem.component.button.UlbanFilledButton | ||
import com.sixkids.designsystem.theme.Orange | ||
import com.sixkids.designsystem.theme.Purple | ||
import com.sixkids.designsystem.theme.UlbanTheme | ||
import com.sixkids.designsystem.theme.UlbanTypography | ||
|
||
@Composable | ||
fun RelayPassResultScreen( | ||
paddingValues: PaddingValues = PaddingValues(horizontal = 30.dp, vertical = 40.dp), | ||
title: String = stringResource(R.string.relay_pass_result_title), | ||
subTitle: String = stringResource(R.string.relay_pass_result_subtitle_sender), | ||
bodyTop: String = stringResource(R.string.relay_pass_result_body_top_receiver), | ||
bodyMiddle: String, | ||
bodyBottom: String = stringResource(R.string.relay_pass_result_body_bottom_sender), | ||
@DrawableRes imgRes: Int = R.drawable.relay_success, | ||
backgroundColor: Color = Orange, | ||
onClick: () -> Unit = {} | ||
) { | ||
val screenWidthDp = with(LocalDensity.current) { | ||
LocalContext.current.resources.displayMetrics.widthPixels.toDp() | ||
} | ||
|
||
Column( | ||
modifier = Modifier | ||
.fillMaxSize() | ||
.padding(paddingValues), | ||
) { | ||
Text( | ||
text = title, | ||
style = UlbanTypography.titleMedium, | ||
modifier = Modifier.padding(bottom = 15.dp) | ||
) | ||
|
||
Text(text = subTitle, style = UlbanTypography.bodyMedium) | ||
|
||
Spacer(modifier = Modifier.height(100.dp)) | ||
|
||
BoxWithConstraints(modifier = Modifier.fillMaxWidth()) { | ||
Box(modifier = Modifier.align(Alignment.Center)) { | ||
Box( | ||
modifier = Modifier | ||
.size(screenWidthDp / 2) | ||
.clip(RoundedCornerShape(28.dp)) | ||
.background(backgroundColor) | ||
.align(Alignment.Center) | ||
) | ||
|
||
Image( | ||
painter = painterResource(id = imgRes), | ||
contentDescription = "success", | ||
modifier = Modifier | ||
.size(screenWidthDp / 2 + screenWidthDp / 7) | ||
.offset(y = -screenWidthDp / 10) | ||
.align(Alignment.Center) | ||
) | ||
} | ||
} | ||
|
||
Column( | ||
modifier = Modifier.align(Alignment.CenterHorizontally), | ||
horizontalAlignment = Alignment.CenterHorizontally | ||
) { | ||
Text( | ||
text = bodyTop, | ||
style = UlbanTypography.bodyLarge, | ||
modifier = Modifier.padding(top = 30.dp), | ||
textAlign = TextAlign.Center | ||
) | ||
|
||
Text( | ||
text = bodyMiddle, | ||
style = UlbanTypography.titleMedium.copy(lineHeight = 30.sp), | ||
modifier = Modifier.padding(top = 30.dp, start = 20.dp, end = 20.dp), | ||
textAlign = TextAlign.Center | ||
) | ||
|
||
Text( | ||
text = bodyBottom, | ||
style = UlbanTypography.bodyLarge, | ||
modifier = Modifier.padding(top = 30.dp), | ||
textAlign = TextAlign.Center | ||
) | ||
|
||
} | ||
|
||
Spacer(modifier = Modifier.weight(1f)) | ||
|
||
UlbanFilledButton( | ||
modifier = Modifier.fillMaxWidth(), | ||
text = stringResource(R.string.relay_pass_result_button_done), | ||
onClick = { onClick() } | ||
) | ||
|
||
} | ||
} | ||
|
||
@Composable | ||
@Preview(showBackground = true) | ||
fun RelayPassResultScreenPreview() { | ||
UlbanTheme { | ||
RelayPassResultScreen( | ||
bodyTop = "์คํ๋น ํ์์ด", | ||
bodyMiddle = "\"์ฐ๋ฆฌ๋ฐ์์ ๊ฐ์ฅ ๊ณต๋ถ๋ฅผ ์ ํ๋ ์น๊ตฌ๋ ๋๊ตฌ์ผ?\"", | ||
) | ||
} | ||
} | ||
|
||
@Composable | ||
@Preview(showBackground = true) | ||
fun RelayPassResultBombScreenPreview() { | ||
UlbanTheme { | ||
RelayPassResultScreen( | ||
title = "์ด๋ฐ! ํญํ์ด ํฐ์ก์ด์", | ||
subTitle = "-100 exp", | ||
bodyTop = "์คํ๋น ํ์์ด", | ||
bodyMiddle = "\"์ฐ๋ฆฌ๋ฐ์์ ๊ฐ์ฅ ๊ณต๋ถ๋ฅผ ์ ํ๋ ์น๊ตฌ๋ ๋๊ตฌ์ผ?\"", | ||
imgRes = R.drawable.bomb, | ||
backgroundColor = Purple | ||
) | ||
} | ||
} |
86 changes: 86 additions & 0 deletions
86
...esignsystem/src/main/java/com/sixkids/designsystem/component/screen/RelayTaggingScreen.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,86 @@ | ||
package com.sixkids.designsystem.component.screen | ||
|
||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.aspectRatio | ||
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.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.clip | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import com.sixkids.designsystem.R | ||
import com.sixkids.designsystem.component.button.UlbanFilledButton | ||
import com.sixkids.designsystem.theme.UlbanTypography | ||
|
||
@Composable | ||
fun RelayTaggingScreen( | ||
isSender: Boolean = true, | ||
onClick: () -> Unit = {} | ||
) { | ||
val title = | ||
if (isSender) stringResource(R.string.relay_tagging_title_sender) | ||
else stringResource(R.string.relay_tagging_title_receiver) | ||
|
||
val subTitle = | ||
if (isSender) stringResource(R.string.relay_tagging_sub_title_sender) | ||
else stringResource(R.string.relay_tagging_sub_title_receiver) | ||
|
||
val body = | ||
if (isSender) stringResource(R.string.relay_tagging_body_sender) | ||
else stringResource(R.string.relay_tagging_body_receiver) | ||
|
||
Column( | ||
modifier = Modifier.fillMaxSize() | ||
) { | ||
Text( | ||
text = title, | ||
style = UlbanTypography.titleMedium, | ||
modifier = Modifier.padding(30.dp, 40.dp, 30.dp, 15.dp) | ||
) | ||
|
||
Text( | ||
text = subTitle, style = UlbanTypography.bodyMedium, | ||
modifier = Modifier.padding(start = 30.dp) | ||
) | ||
|
||
Spacer(modifier = Modifier.height(100.dp)) | ||
|
||
Image(painter = painterResource(id = R.drawable.relay_tag), contentDescription = "tagging", | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.aspectRatio(1f) | ||
) | ||
|
||
|
||
Text( | ||
text = body, style = UlbanTypography.bodyMedium, | ||
modifier = Modifier.align(Alignment.CenterHorizontally) | ||
) | ||
|
||
Spacer(modifier = Modifier.weight(1f)) | ||
if (isSender) { | ||
UlbanFilledButton( | ||
text = "๋ค์", | ||
onClick = { onClick() }, | ||
modifier = Modifier | ||
.padding(horizontal = 30.dp, vertical = 40.dp) | ||
.fillMaxWidth() | ||
) | ||
} | ||
} | ||
} | ||
|
||
@Composable | ||
@Preview(showBackground = true) | ||
fun RelayTaggingScreenPreview() { | ||
RelayTaggingScreen(false) | ||
} |
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
Binary file modified
BIN
+70.7 KB
(220%)
android/core/designsystem/src/main/res/drawable/relay_tag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
8 changes: 8 additions & 0 deletions
8
android/core/model/src/main/java/com/sixkids/model/RelayReceive.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,8 @@ | ||
package com.sixkids.model | ||
|
||
data class RelayReceive( | ||
val senderName: String = "", | ||
val question: String = "", | ||
val lastStatus: Boolean = false, | ||
val demerit: Int = 0, | ||
) |
6 changes: 6 additions & 0 deletions
6
android/core/model/src/main/java/com/sixkids/model/RelaySend.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,6 @@ | ||
package com.sixkids.model | ||
|
||
data class RelaySend( | ||
val prevMemberName: String = "", | ||
val prevQuestion: String = "" | ||
) |
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
6 changes: 6 additions & 0 deletions
6
android/data/src/main/java/com/sixkids/data/model/request/ReceiveRelayRequest.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,6 @@ | ||
package com.sixkids.data.model.request | ||
|
||
data class ReceiveRelayRequest( | ||
val senderId: Long, | ||
val question: String | ||
) |
Oops, something went wrong.