-
Notifications
You must be signed in to change notification settings - Fork 1
[NDGL-105] 앱 아이콘, 스플래시 화면, 유저 가이드 모달 추가 #32
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,18 +4,60 @@ import android.os.Bundle | |
| import androidx.activity.ComponentActivity | ||
| import androidx.activity.compose.setContent | ||
| import androidx.activity.enableEdgeToEdge | ||
| import androidx.compose.animation.AnimatedContent | ||
| import androidx.compose.runtime.getValue | ||
| import androidx.compose.runtime.mutableStateOf | ||
| import androidx.compose.runtime.saveable.rememberSaveable | ||
| import androidx.compose.runtime.setValue | ||
| import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen | ||
| import com.yapp.ndgl.core.ui.designsystem.UserGuideModal | ||
| import com.yapp.ndgl.core.ui.theme.NDGLTheme | ||
| import com.yapp.ndgl.core.ui.util.launchBrowser | ||
| import com.yapp.ndgl.feature.splash.SplashRoute | ||
| import com.yapp.ndgl.navigation.AppScreen | ||
| import com.yapp.ndgl.ui.NDGLApp | ||
| import dagger.hilt.android.AndroidEntryPoint | ||
|
|
||
| @AndroidEntryPoint | ||
| class MainActivity : ComponentActivity() { | ||
| override fun onCreate(savedInstanceState: Bundle?) { | ||
| super.onCreate(savedInstanceState) | ||
| installSplashScreen() | ||
| enableEdgeToEdge() | ||
| setContent { | ||
| NDGLTheme { | ||
| NDGLApp() | ||
| var currentScreen by rememberSaveable { mutableStateOf(AppScreen.Splash) } | ||
| var showUserGuideModal by rememberSaveable { mutableStateOf(false) } | ||
|
|
||
| AnimatedContent( | ||
| targetState = currentScreen, | ||
| ) { screen -> | ||
| when (screen) { | ||
| AppScreen.Splash -> { | ||
| SplashRoute( | ||
| navigateToHome = { isFirstUser -> | ||
| showUserGuideModal = isFirstUser | ||
| currentScreen = AppScreen.Main | ||
| }, | ||
| ) | ||
|
Comment on lines
+36
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 추후 수정 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
🧠 Learnings used |
||
| } | ||
|
|
||
| AppScreen.Main -> { | ||
| NDGLApp() | ||
| } | ||
| } | ||
| } | ||
|
|
||
| if (showUserGuideModal) { | ||
| UserGuideModal( | ||
| onConfirmClick = { | ||
| showUserGuideModal = false | ||
| }, | ||
| onTermsClick = { | ||
| launchBrowser(BuildConfig.NDGL_TERMS_URL) | ||
| }, | ||
| ) | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,33 @@ | ||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| xmlns:aapt="http://schemas.android.com/aapt" | ||
| android:width="108dp" | ||
| android:height="108dp" | ||
| android:viewportWidth="108" | ||
| android:viewportWidth="72" | ||
| android:viewportHeight="108"> | ||
| <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> | ||
| <aapt:attr name="android:fillColor"> | ||
| <gradient | ||
| android:endX="85.84757" | ||
| android:endY="92.4963" | ||
| android:startX="42.9492" | ||
| android:startY="49.59793" | ||
| android:type="linear"> | ||
| <item | ||
| android:color="#44000000" | ||
| android:offset="0.0" /> | ||
| <item | ||
| android:color="#00000000" | ||
| android:offset="1.0" /> | ||
| </gradient> | ||
| </aapt:attr> | ||
| </path> | ||
| <path | ||
| android:fillColor="#FFFFFF" | ||
| android:fillType="nonZero" | ||
| android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" | ||
| android:strokeWidth="1" | ||
| android:strokeColor="#00000000" /> | ||
| <group android:scaleX="0.3" | ||
| android:scaleY="0.45" | ||
| android:translateX="25.2" | ||
| android:translateY="29.7"> | ||
| <group> | ||
| <clip-path | ||
| android:pathData="M0,0h72v108h-72z"/> | ||
| <path | ||
| android:pathData="M71.94,84.56C71.67,81.8 70.14,79.07 67.54,77.47C63.79,75.16 59.15,75.75 55.79,78.72L48.35,71.56L61.36,58.49C67.9,51.92 70.67,42.67 70.38,33.56C69.52,14.19 53.12,-0.72 33.82,0.03C21.56,0.5 10.29,7.33 4.31,18.18C-2.89,31.28 -1.03,48.48 9.58,59.09L35.24,84.72L35.3,84.67L54.26,103.95C55.1,104.83 56.4,104.84 57.26,104.02L68.99,92.85C71.33,90.62 72.25,87.67 71.94,84.56Z" | ||
| android:fillColor="#000000"/> | ||
| <path | ||
| android:pathData="M27.05,103.77C23.83,108.67 16.67,109.46 12.57,105.35L0.59,93.33C-0.16,92.47 -0.23,91.34 0.61,90.5L18.06,73.25L29.14,85.24L23.89,90.65C27.07,93.98 29.74,99.68 27.05,103.77Z" | ||
| android:fillColor="#000000"/> | ||
| <path | ||
| android:pathData="M64.1,32.64C64.1,41.72 58.58,49.08 51.75,49.08C44.93,49.08 39.4,41.72 39.4,32.64C39.4,23.56 44.93,16.2 51.75,16.2C58.58,16.2 64.1,23.56 64.1,32.64Z" | ||
| android:fillColor="#ffffff"/> | ||
| <path | ||
| android:pathData="M55.2,42.3C59.21,42.3 62.45,37.97 62.45,32.64C62.45,27.31 59.21,22.99 55.2,22.99C51.2,22.99 47.95,27.31 47.95,32.64C47.95,37.97 51.2,42.3 55.2,42.3Z" | ||
| android:fillColor="#000000"/> | ||
| <path | ||
| android:pathData="M42.69,32.64C42.69,41.72 37.16,49.08 30.34,49.08C23.52,49.08 17.99,41.72 17.99,32.64C17.99,23.56 23.52,16.2 30.34,16.2C37.16,16.2 42.69,23.56 42.69,32.64Z" | ||
| android:fillColor="#ffffff"/> | ||
| <path | ||
| android:pathData="M33.79,42.3C37.8,42.3 41.04,37.97 41.04,32.64C41.04,27.31 37.8,22.99 33.79,22.99C29.79,22.99 26.54,27.31 26.54,32.64C26.54,37.97 29.79,42.3 33.79,42.3Z" | ||
| android:fillColor="#000000"/> | ||
| </group> | ||
| </group> | ||
| </vector> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| <background android:drawable="@drawable/ic_launcher_background" /> | ||
| <foreground android:drawable="@drawable/ic_launcher_foreground" /> | ||
| <monochrome android:drawable="@drawable/ic_launcher_foreground" /> | ||
| </adaptive-icon> | ||
| <background android:drawable="@color/ic_launcher_background"/> | ||
| <foreground android:drawable="@drawable/ic_launcher_foreground"/> | ||
| </adaptive-icon> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| <background android:drawable="@drawable/ic_launcher_background" /> | ||
| <foreground android:drawable="@drawable/ic_launcher_foreground" /> | ||
| <monochrome android:drawable="@drawable/ic_launcher_foreground" /> | ||
| </adaptive-icon> | ||
| <background android:drawable="@color/ic_launcher_background"/> | ||
| <foreground android:drawable="@drawable/ic_launcher_foreground"/> | ||
| </adaptive-icon> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <resources> | ||
| <color name="ic_launcher_background">#2FED72</color> | ||
| </resources> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| <resources> | ||
| <string name="app_name">NDGL</string> | ||
| </resources> | ||
| <string name="app_name">나도갈래</string> | ||
| </resources> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| package com.yapp.ndgl.core.ui.designsystem | ||
|
|
||
| import androidx.compose.foundation.clickable | ||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.layout.wrapContentHeight | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.material3.Surface | ||
| import androidx.compose.material3.Text | ||
| 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.style.TextAlign | ||
| import androidx.compose.ui.text.style.TextDecoration | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import androidx.compose.ui.window.Dialog | ||
| import androidx.compose.ui.window.DialogProperties | ||
| import com.yapp.ndgl.core.ui.R | ||
| import com.yapp.ndgl.core.ui.theme.NDGLTheme | ||
|
|
||
| @Composable | ||
| fun UserGuideModal( | ||
| onConfirmClick: () -> Unit, | ||
| onTermsClick: () -> Unit, | ||
| modifier: Modifier = Modifier, | ||
| ) { | ||
| Dialog( | ||
| onDismissRequest = { /* 확인 버튼을 눌러야만 닫힘 */ }, | ||
| properties = DialogProperties( | ||
| dismissOnBackPress = false, | ||
| dismissOnClickOutside = false, | ||
| ), | ||
| ) { | ||
| Surface( | ||
| modifier = modifier.wrapContentHeight(), | ||
| shape = RoundedCornerShape(8.dp), | ||
| color = NDGLTheme.colors.white, | ||
| shadowElevation = 16.dp, | ||
| ) { | ||
| Column( | ||
| modifier = Modifier | ||
| .padding(horizontal = 28.dp) | ||
| .padding(top = 28.dp, bottom = 24.dp), | ||
| verticalArrangement = Arrangement.spacedBy(28.dp), | ||
| horizontalAlignment = Alignment.CenterHorizontally, | ||
| ) { | ||
| UserGuideContent( | ||
| onTermsClick = onTermsClick, | ||
| ) | ||
| NDGLCTAButton( | ||
| type = NDGLCTAButtonAttr.Type.PRIMARY, | ||
| size = NDGLCTAButtonAttr.Size.MEDIUM, | ||
| status = NDGLCTAButtonAttr.Status.ACTIVE, | ||
| label = stringResource(R.string.user_guide_modal_confirm), | ||
| onClick = onConfirmClick, | ||
| modifier = Modifier.fillMaxWidth(), | ||
| ) | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @Composable | ||
| private fun UserGuideContent( | ||
| onTermsClick: () -> Unit, | ||
| ) { | ||
| Column( | ||
| horizontalAlignment = Alignment.CenterHorizontally, | ||
| ) { | ||
| Text( | ||
| text = stringResource(R.string.user_guide_modal_title), | ||
| modifier = Modifier.fillMaxWidth(), | ||
| color = NDGLTheme.colors.black900, | ||
| textAlign = TextAlign.Center, | ||
| style = NDGLTheme.typography.subtitleLgSemiBold, | ||
| ) | ||
| Text( | ||
| text = stringResource(R.string.user_guide_modal_body), | ||
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .padding(top = 16.dp), | ||
| color = NDGLTheme.colors.black500, | ||
| textAlign = TextAlign.Center, | ||
| style = NDGLTheme.typography.bodyLgMedium, | ||
| ) | ||
| Text( | ||
| text = stringResource(R.string.user_guide_modal_terms), | ||
| modifier = Modifier | ||
| .padding(top = 12.dp) | ||
| .clickable(onClick = onTermsClick), | ||
| color = NDGLTheme.colors.black400, | ||
| textAlign = TextAlign.Center, | ||
| textDecoration = TextDecoration.Underline, | ||
| style = NDGLTheme.typography.bodyMdMedium, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| private fun UserGuideModalPreview() { | ||
| NDGLTheme { | ||
| UserGuideModal( | ||
| onConfirmClick = {}, | ||
| onTermsClick = {}, | ||
| ) | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| android:width="72dp" | ||
| android:height="108dp" | ||
| android:viewportWidth="72" | ||
| android:viewportHeight="108"> | ||
| <group> | ||
| <clip-path | ||
| android:pathData="M0,0h72v108h-72z"/> | ||
| <path | ||
| android:pathData="M71.94,84.56C71.67,81.8 70.14,79.07 67.54,77.47C63.79,75.16 59.15,75.75 55.79,78.72L48.35,71.56L61.36,58.49C67.9,51.92 70.67,42.67 70.38,33.56C69.52,14.19 53.12,-0.72 33.82,0.03C21.56,0.5 10.29,7.33 4.31,18.18C-2.89,31.28 -1.03,48.48 9.58,59.09L35.24,84.72L35.3,84.67L54.26,103.95C55.1,104.83 56.4,104.84 57.26,104.02L68.99,92.85C71.33,90.62 72.25,87.67 71.94,84.56Z" | ||
| android:fillColor="#000000"/> | ||
| <path | ||
| android:pathData="M27.05,103.77C23.83,108.67 16.67,109.46 12.57,105.35L0.59,93.33C-0.16,92.47 -0.23,91.34 0.61,90.5L18.06,73.25L29.14,85.24L23.89,90.65C27.07,93.98 29.74,99.68 27.05,103.77Z" | ||
| android:fillColor="#000000"/> | ||
| <path | ||
| android:pathData="M64.1,32.64C64.1,41.72 58.58,49.08 51.75,49.08C44.93,49.08 39.4,41.72 39.4,32.64C39.4,23.56 44.93,16.2 51.75,16.2C58.58,16.2 64.1,23.56 64.1,32.64Z" | ||
| android:fillColor="#ffffff"/> | ||
| <path | ||
| android:pathData="M55.2,42.3C59.21,42.3 62.45,37.97 62.45,32.64C62.45,27.31 59.21,22.99 55.2,22.99C51.2,22.99 47.95,27.31 47.95,32.64C47.95,37.97 51.2,42.3 55.2,42.3Z" | ||
| android:fillColor="#000000"/> | ||
| <path | ||
| android:pathData="M42.69,32.64C42.69,41.72 37.16,49.08 30.34,49.08C23.52,49.08 17.99,41.72 17.99,32.64C17.99,23.56 23.52,16.2 30.34,16.2C37.16,16.2 42.69,23.56 42.69,32.64Z" | ||
| android:fillColor="#ffffff"/> | ||
| <path | ||
| android:pathData="M33.79,42.3C37.8,42.3 41.04,37.97 41.04,32.64C41.04,27.31 37.8,22.99 33.79,22.99C29.79,22.99 26.54,27.31 26.54,32.64C26.54,37.97 29.79,42.3 33.79,42.3Z" | ||
| android:fillColor="#000000"/> | ||
| </group> | ||
| </vector> |
Uh oh!
There was an error while loading. Please reload this page.