generated from GSM-MSG/MSG-Repository-Generator
-
Notifications
You must be signed in to change notification settings - Fork 1
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 #133 from GSM-MSG/feature/#130_publishing_my_page
🔀 :: (#130) - Publishing my page
- Loading branch information
Showing
16 changed files
with
615 additions
and
0 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
58 changes: 58 additions & 0 deletions
58
core/design-system/src/main/java/com/msg/design_system/component/screen/SuccessScreen.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,58 @@ | ||
package com.msg.design_system.component.screen | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Column | ||
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.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import com.msg.design_system.component.button.BitgoeulButton | ||
import com.msg.design_system.component.icon.SuccessIcon | ||
import com.msg.design_system.theme.BitgoeulAndroidTheme | ||
|
||
@Composable | ||
fun SuccessScreen( | ||
modifier: Modifier, | ||
title: String, | ||
content: String, | ||
buttonText: String, | ||
buttonAction: () -> Unit | ||
) { | ||
BitgoeulAndroidTheme { colors, typography -> | ||
Column( | ||
modifier = modifier | ||
.fillMaxSize() | ||
.background(color = colors.WHITE) | ||
.padding(horizontal = 28.dp), | ||
horizontalAlignment = Alignment.CenterHorizontally | ||
) { | ||
Spacer(modifier = modifier.height(228.dp)) | ||
SuccessIcon() | ||
Spacer(modifier = modifier.height(24.dp)) | ||
Text( | ||
text = title, | ||
style = typography.titleMedium, | ||
color = colors.BLACK | ||
) | ||
Text( | ||
text = content, | ||
style = typography.bodySmall, | ||
color = colors.G2 | ||
) | ||
Spacer(modifier = modifier.weight(1f)) | ||
BitgoeulButton( | ||
modifier = modifier.fillMaxWidth(), | ||
text = buttonText | ||
) { | ||
buttonAction() | ||
} | ||
Spacer(modifier = modifier.height(56.dp)) | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
core/design-system/src/main/java/com/msg/design_system/util/BitgoeulIndication.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,32 @@ | ||
package com.msg.design_system.util | ||
|
||
import androidx.compose.foundation.Indication | ||
import androidx.compose.foundation.IndicationInstance | ||
import androidx.compose.foundation.interaction.InteractionSource | ||
import androidx.compose.foundation.interaction.collectIsPressedAsState | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.State | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.graphics.drawscope.ContentDrawScope | ||
|
||
object BitgoeulIndication : Indication { | ||
private class DefaultDebugIndicationInstance( | ||
private val isPressed: State<Boolean> | ||
) : IndicationInstance { | ||
override fun ContentDrawScope.drawIndication() { | ||
drawContent() | ||
if (isPressed.value) { | ||
drawRect(color = Color.Gray.copy(alpha = 0.1f), size = size) | ||
} | ||
} | ||
} | ||
|
||
@Composable | ||
override fun rememberUpdatedInstance(interactionSource: InteractionSource): IndicationInstance { | ||
val isPressed = interactionSource.collectIsPressedAsState() | ||
return remember(interactionSource) { | ||
DefaultDebugIndicationInstance(isPressed) | ||
} | ||
} | ||
} |
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,18 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="120dp" | ||
android:height="120dp" | ||
android:viewportWidth="120" | ||
android:viewportHeight="120"> | ||
<group> | ||
<clip-path | ||
android:pathData="M0,0h120v120h-120z"/> | ||
<path | ||
android:pathData="M60,60m-55,0a55,55 0,1 1,110 0a55,55 0,1 1,-110 0" | ||
android:strokeWidth="10" | ||
android:fillColor="#00000000" | ||
android:strokeColor="#288BE1"/> | ||
<path | ||
android:pathData="M52.5,85C55.26,85 57.5,82.5 57.5,82.5L92.5,47.5C94.45,45.55 94.45,42.38 92.5,40.43C90.55,38.48 87.38,38.48 85.43,40.43L52.5,73.36L34.57,55.43C32.62,53.48 29.45,53.48 27.5,55.43C25.55,57.38 25.55,60.55 27.5,62.5L47.5,82.5C47.5,82.5 49.74,85 52.5,85Z" | ||
android:fillColor="#288BE1"/> | ||
</group> | ||
</vector> |
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 @@ | ||
/build |
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 @@ | ||
plugins { | ||
id("bitgoeul.android.feature") | ||
id("bitgoeul.android.hilt") | ||
} | ||
|
||
android { | ||
namespace = "com.msg.my_page" | ||
} |
24 changes: 24 additions & 0 deletions
24
feature/my-page/src/androidTest/java/com/example/my_page/ExampleInstrumentedTest.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,24 @@ | ||
package com.example.my_page | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
|
||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
import org.junit.Assert.* | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("com.example.my_page.test", appContext.packageName) | ||
} | ||
} |
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,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
</manifest> |
98 changes: 98 additions & 0 deletions
98
feature/my-page/src/main/java/com/example/my_page/MyPageScreen.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,98 @@ | ||
package com.example.my_page | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
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.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import com.example.my_page.component.AccountInfoView | ||
import com.example.my_page.component.AccountSettingView | ||
import com.example.my_page.component.MyInfoView | ||
import com.msg.design_system.component.dialog.NegativeActionDialog | ||
import com.msg.design_system.theme.BitgoeulAndroidTheme | ||
import com.msg.model.remote.enumdatatype.Authority | ||
import com.msg.model.remote.response.user.InquiryMyPageResponse | ||
|
||
@Composable | ||
fun MyPageScreen( | ||
onPasswordChangeClicked: () -> Unit, | ||
onLogOutClicked: () -> Unit, | ||
onWithdrawClicked: () -> Unit, | ||
data: InquiryMyPageResponse, | ||
modifier: Modifier = Modifier | ||
) { | ||
val showDialog = remember { mutableStateOf(false) } | ||
|
||
BitgoeulAndroidTheme { colors, typography -> | ||
Column( | ||
modifier = modifier | ||
.fillMaxSize() | ||
.background(color = colors.WHITE) | ||
.padding(horizontal = 28.dp), | ||
verticalArrangement = Arrangement.SpaceBetween | ||
) { | ||
Spacer(modifier = modifier.height(20.dp)) | ||
Text( | ||
text = "내 정보", | ||
style = typography.titleMedium, | ||
color = colors.BLACK | ||
) | ||
Spacer(modifier = modifier.height(32.dp)) | ||
MyInfoView( | ||
data = data, | ||
modifier = modifier | ||
) | ||
Spacer(modifier = modifier.height(40.dp)) | ||
AccountInfoView( | ||
data = data, | ||
modifier = modifier | ||
) | ||
Spacer(modifier = modifier.height(68.dp)) | ||
AccountSettingView( | ||
modifier = modifier, | ||
onPasswordChangeClicked = onPasswordChangeClicked, | ||
onLogOutClicked = onLogOutClicked, | ||
onWithdrawClicked = { | ||
showDialog.value = true | ||
} | ||
) | ||
Spacer(modifier = modifier.height(24.dp)) | ||
} | ||
NegativeActionDialog( | ||
title = "회원 탈퇴하시겠습니까?", | ||
negativeAction = "탈퇴", | ||
content = "회원 탈퇴하면 계정을 복구할 수 없으며,\n회원가입을 다시 진행해야 합니다!", | ||
isVisible = showDialog.value, | ||
onQuit = { showDialog.value = false } | ||
) { | ||
onWithdrawClicked() | ||
} | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
fun MyPageScreenPre() { | ||
MyPageScreen( | ||
onPasswordChangeClicked = {}, | ||
onLogOutClicked = {}, | ||
onWithdrawClicked = {}, | ||
data = InquiryMyPageResponse( | ||
name = "채종인", | ||
email = "bitgoeul@gmail.com", | ||
phoneNumber = "010-0000-0000", | ||
authority = Authority.ROLE_STUDENT, | ||
organization = "광주소프트웨어마이스터고등학교/dev.GSM/2학년 3반 16번" | ||
) | ||
) | ||
} |
Oops, something went wrong.