diff --git a/.github/workflows/develop_PR_builder.yml b/.github/workflows/develop_PR_builder.yml index 5deeac7..893373f 100644 --- a/.github/workflows/develop_PR_builder.yml +++ b/.github/workflows/develop_PR_builder.yml @@ -47,9 +47,6 @@ jobs: - name: Lint Check run: ./gradlew ktlintCheck - - name: Spotless Apply - run: ./gradlew build - - name: Build debug APK run: ./gradlew assembleDebug --stacktrace diff --git a/app/src/androidTest/java/org/sopt/stamp/ExampleInstrumentedTest.kt b/app/src/androidTest/java/org/sopt/stamp/ExampleInstrumentedTest.kt deleted file mode 100644 index 01665fb..0000000 --- a/app/src/androidTest/java/org/sopt/stamp/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2022-2023 SOPT - Shout Our Passion Together - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.sopt.stamp - -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("org.sopt.stamp", appContext.packageName) - } -} diff --git a/app/src/main/java/org/sopt/stamp/designsystem/component/toolbar/Toolbar.kt b/app/src/main/java/org/sopt/stamp/designsystem/component/toolbar/Toolbar.kt index dc87a6b..5fc9cd9 100644 --- a/app/src/main/java/org/sopt/stamp/designsystem/component/toolbar/Toolbar.kt +++ b/app/src/main/java/org/sopt/stamp/designsystem/component/toolbar/Toolbar.kt @@ -32,6 +32,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp import org.sopt.stamp.R +import org.sopt.stamp.designsystem.component.util.noRippleClickable import org.sopt.stamp.designsystem.style.SoptTheme import org.sopt.stamp.util.MultiFormFactorPreviews @@ -74,7 +75,7 @@ fun Toolbar( painter = painterResource(id = R.drawable.ic_back), contentDescription = "Back Button", modifier = Modifier - .clickable(onClick = onBack) + .noRippleClickable(onClick = onBack) .align(Alignment.CenterVertically) .padding(8.dp) ) diff --git a/app/src/main/java/org/sopt/stamp/feature/mission/list/MissionListScreen.kt b/app/src/main/java/org/sopt/stamp/feature/mission/list/MissionListScreen.kt index adc09a4..be80170 100644 --- a/app/src/main/java/org/sopt/stamp/feature/mission/list/MissionListScreen.kt +++ b/app/src/main/java/org/sopt/stamp/feature/mission/list/MissionListScreen.kt @@ -67,6 +67,7 @@ import org.sopt.stamp.domain.error.Error import org.sopt.stamp.domain.model.MissionsFilter import org.sopt.stamp.feature.destinations.MissionDetailScreenDestination import org.sopt.stamp.feature.destinations.RankingScreenDestination +import org.sopt.stamp.feature.destinations.SettingScreenDestination import org.sopt.stamp.feature.mission.MissionsState import org.sopt.stamp.feature.mission.MissionsViewModel import org.sopt.stamp.feature.mission.model.MissionListUiModel @@ -110,7 +111,8 @@ fun MissionListScreen( menuTexts = MissionsFilter.getTitleOfMissionsList(), onMenuClick = { filter -> missionsViewModel.fetchMissions(filter = filter) }, onMissionItemClick = { item -> navigator.navigate(MissionDetailScreenDestination(item)) }, - onFloatingButtonClick = { navigator.navigate(RankingScreenDestination) } + onFloatingButtonClick = { navigator.navigate(RankingScreenDestination) }, + onSettingButtonClick = { navigator.navigate(SettingScreenDestination) } ) } } @@ -122,14 +124,16 @@ fun MissionListScreen( menuTexts: List, onMenuClick: (String) -> Unit = {}, onMissionItemClick: (item: MissionNavArgs) -> Unit = {}, - onFloatingButtonClick: () -> Unit = {} + onFloatingButtonClick: () -> Unit = {}, + onSettingButtonClick: () -> Unit = {} ) { Scaffold( topBar = { MissionListHeader( title = missionListUiModel.title, menuTexts = menuTexts, - onMenuClick = { onMenuClick(it) } + onMenuClick = { onMenuClick(it) }, + onSettingButtonClick = { onSettingButtonClick() } ) }, floatingActionButton = { @@ -207,7 +211,8 @@ fun MissionEmptyScreen(contentText: String) { fun MissionListHeader( title: String, menuTexts: List, - onMenuClick: (String) -> Unit = {} + onMenuClick: (String) -> Unit = {}, + onSettingButtonClick: () -> Unit = {} ) { var currentText by remember { mutableStateOf(title) } SoptTopAppBar( @@ -220,6 +225,13 @@ fun MissionListHeader( onMenuClick(selectedMenuText) } ) + }, + actions = { + SoptampIconButton( + imageVector = ImageVector.vectorResource(id = R.drawable.setting) + ) { + onSettingButtonClick() + } } ) } diff --git a/app/src/main/java/org/sopt/stamp/feature/mission/list/UserMissionListScreen.kt b/app/src/main/java/org/sopt/stamp/feature/mission/list/UserMissionListScreen.kt index fe6c62b..d94b603 100644 --- a/app/src/main/java/org/sopt/stamp/feature/mission/list/UserMissionListScreen.kt +++ b/app/src/main/java/org/sopt/stamp/feature/mission/list/UserMissionListScreen.kt @@ -164,7 +164,7 @@ fun UserMissionListHeader( title = { MissionListHeaderTitle(title = title) }, navigationIcon = { SoptampIconButton( - imageVector = ImageVector.vectorResource(id = R.drawable.arrow_letf), + imageVector = ImageVector.vectorResource(id = R.drawable.arrow_left), onClick = { onClickBack() } ) } diff --git a/app/src/main/java/org/sopt/stamp/feature/ranking/RankingScreen.kt b/app/src/main/java/org/sopt/stamp/feature/ranking/RankingScreen.kt index 5bea876..f733cc8 100644 --- a/app/src/main/java/org/sopt/stamp/feature/ranking/RankingScreen.kt +++ b/app/src/main/java/org/sopt/stamp/feature/ranking/RankingScreen.kt @@ -158,7 +158,7 @@ fun RankingHeader( }, navigationIcon = { SoptampIconButton( - imageVector = ImageVector.vectorResource(id = R.drawable.arrow_letf), + imageVector = ImageVector.vectorResource(id = R.drawable.arrow_left), onClick = { onClickBack() } ) } diff --git a/app/src/main/java/org/sopt/stamp/feature/setting/SettingScreen.kt b/app/src/main/java/org/sopt/stamp/feature/setting/SettingScreen.kt new file mode 100644 index 0000000..7faa953 --- /dev/null +++ b/app/src/main/java/org/sopt/stamp/feature/setting/SettingScreen.kt @@ -0,0 +1,196 @@ +/* + * Copyright 2023 SOPT - Shout Our Passion Together + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sopt.stamp.feature.setting + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +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.foundation.shape.RoundedCornerShape +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember +import androidx.compose.ui.Modifier +import androidx.compose.ui.text.style.TextDecoration +import androidx.compose.ui.unit.dp +import androidx.hilt.navigation.compose.hiltViewModel +import com.ramcosta.composedestinations.annotation.Destination +import com.ramcosta.composedestinations.navigation.DestinationsNavigator +import com.ramcosta.composedestinations.navigation.EmptyDestinationsNavigator +import org.sopt.stamp.R +import org.sopt.stamp.config.navigation.SettingNavGraph +import org.sopt.stamp.designsystem.component.layout.SoptColumn +import org.sopt.stamp.designsystem.component.toolbar.Toolbar +import org.sopt.stamp.designsystem.style.Access300 +import org.sopt.stamp.designsystem.style.Gray50 +import org.sopt.stamp.designsystem.style.SoptTheme +import org.sopt.stamp.feature.setting.component.Section +import org.sopt.stamp.feature.setting.model.SectionUiModel +import org.sopt.stamp.util.DefaultPreview + +@SettingNavGraph(true) +@Destination("menu") +@Composable +fun SettingScreen( + navigator: DestinationsNavigator, + viewModel: SettingScreenViewModel = hiltViewModel() +) { + val myInfoSectionItems = remember { + listOf( + SectionUiModel.Header(title = "내 정보"), + SectionUiModel.Option( + title = "한 마디 편집", + optionIconResId = R.drawable.arrow_right + ) { + // TODO by Nunu 한 마디 편집 화면으로 넘어가기 + }, + SectionUiModel.Spacer, + SectionUiModel.Option( + title = "비밀번호 변경", + optionIconResId = R.drawable.arrow_right + ) { + // TODO by Nunu 비밀번호 변경 화면으로 넘어가기 + }, + SectionUiModel.Spacer, + SectionUiModel.Option( + title = "닉네임 변경", + optionIconResId = R.drawable.arrow_right, + containerModifier = Modifier + .background( + color = Gray50, + shape = RoundedCornerShape(bottomStart = 12.dp, bottomEnd = 12.dp) + ) + .padding(horizontal = 16.dp) + ) { + // TODO by Nunu 닉네임 변경 화면으로 넘어가기 + } + ) + } + + val serviceTermSectionItems = remember { + listOf( + SectionUiModel.Header(title = "서비스 이용방침"), + SectionUiModel.Option( + title = "개인정보처리방침", + optionIconResId = R.drawable.arrow_right + ) { + // TODO by Nunu 개인정보처리방침 화면으로 넘어가기 + }, + SectionUiModel.Spacer, + SectionUiModel.Option( + title = "서비스 이용 약관", + optionIconResId = R.drawable.arrow_right + ) { + // TODO by Nunu 서비스 이용 약관 화면으로 넘어가기 + }, + SectionUiModel.Spacer, + SectionUiModel.Option( + title = "서비스 의견 제안", + optionIconResId = R.drawable.arrow_right, + containerModifier = Modifier + .background( + color = Gray50, + shape = RoundedCornerShape(bottomStart = 12.dp, bottomEnd = 12.dp) + ) + .padding(horizontal = 16.dp) + ) { + // TODO by Nunu 서비스 의견 제안 화면으로 넘어가기 + } + ) + } + + val missionSectionItems = listOf( + SectionUiModel.Header(title = "미션"), + SectionUiModel.Option( + title = "스탬프 초기화", + containerModifier = Modifier + .background( + color = Gray50, + shape = RoundedCornerShape(bottomStart = 12.dp, bottomEnd = 12.dp) + ) + .padding(horizontal = 16.dp) + ) { + // TODO by Nunu 스탬프 초기화하기 + } + ) + + val logOutSectionItems = listOf( + SectionUiModel.Option( + title = "로그아웃", + textColor = Access300, + containerModifier = Modifier + .background( + color = Gray50, + shape = RoundedCornerShape(12.dp) + ) + .padding(horizontal = 16.dp) + ) { + // TODO by Nunu 로그아웃하기 + } + ) + + SoptTheme { + SoptColumn( + modifier = Modifier.fillMaxSize() + ) { + Toolbar( + modifier = Modifier.padding(bottom = 10.dp), + title = { + Text( + text = "설정", + style = SoptTheme.typography.h2, + modifier = Modifier.padding(start = 4.dp), + color = SoptTheme.colors.onSurface + ) + }, + onBack = { navigator.popBackStack() } + ) + Spacer(modifier = Modifier.height(8.dp)) + Section(items = myInfoSectionItems) + Spacer(modifier = Modifier.height(16.dp)) + Section(items = serviceTermSectionItems) + Spacer(modifier = Modifier.height(16.dp)) + Section(items = missionSectionItems) + Spacer(modifier = Modifier.height(16.dp)) + Section(items = logOutSectionItems) + Spacer(modifier = Modifier.height(24.dp)) + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.End + ) { + Text( + text = "탈퇴하기", + style = SoptTheme.typography.caption1, + color = SoptTheme.colors.onSurface40, + textDecoration = TextDecoration.Underline + ) + } + } + } +} + +@DefaultPreview +@Composable +private fun SettingScreenPreview() { + SettingScreen( + navigator = EmptyDestinationsNavigator, + viewModel = SettingScreenViewModel() + ) +} diff --git a/app/src/test/java/org/sopt/stamp/ExampleUnitTest.kt b/app/src/main/java/org/sopt/stamp/feature/setting/SettingScreenViewModel.kt similarity index 59% rename from app/src/test/java/org/sopt/stamp/ExampleUnitTest.kt rename to app/src/main/java/org/sopt/stamp/feature/setting/SettingScreenViewModel.kt index 5925862..89d2f8a 100644 --- a/app/src/test/java/org/sopt/stamp/ExampleUnitTest.kt +++ b/app/src/main/java/org/sopt/stamp/feature/setting/SettingScreenViewModel.kt @@ -1,5 +1,5 @@ /* - * Copyright 2022-2023 SOPT - Shout Our Passion Together + * Copyright 2023 SOPT - Shout Our Passion Together * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,20 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sopt.stamp +package org.sopt.stamp.feature.setting -import org.junit.Test +import androidx.lifecycle.ViewModel +import dagger.hilt.android.lifecycle.HiltViewModel +import javax.inject.Inject -import org.junit.Assert.* - -/** - * Example local unit test, which will execute on the development machine (host). - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -class ExampleUnitTest { - @Test - fun addition_isCorrect() { - assertEquals(4, 2 + 2) - } -} +@HiltViewModel +class SettingScreenViewModel @Inject constructor() : ViewModel() diff --git a/app/src/main/java/org/sopt/stamp/feature/setting/component/Header.kt b/app/src/main/java/org/sopt/stamp/feature/setting/component/Header.kt new file mode 100644 index 0000000..e844f99 --- /dev/null +++ b/app/src/main/java/org/sopt/stamp/feature/setting/component/Header.kt @@ -0,0 +1,36 @@ +/* + * Copyright 2023 SOPT - Shout Our Passion Together + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sopt.stamp.feature.setting.component + +import androidx.compose.foundation.layout.padding +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import org.sopt.stamp.designsystem.style.SoptTheme + +@Composable +fun Header( + modifier: Modifier, + title: String +) { + Text( + text = title, + style = SoptTheme.typography.caption1, + color = SoptTheme.colors.onSurface50, + modifier = modifier.padding(bottom = 4.dp) + ) +} diff --git a/app/src/main/java/org/sopt/stamp/feature/setting/component/Option.kt b/app/src/main/java/org/sopt/stamp/feature/setting/component/Option.kt new file mode 100644 index 0000000..b6dad5d --- /dev/null +++ b/app/src/main/java/org/sopt/stamp/feature/setting/component/Option.kt @@ -0,0 +1,77 @@ +/* + * Copyright 2023 SOPT - Shout Our Passion Together + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sopt.stamp.feature.setting.component + +import androidx.annotation.DrawableRes +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +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.graphics.Color +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.res.vectorResource +import androidx.compose.ui.unit.dp +import org.sopt.stamp.R +import org.sopt.stamp.designsystem.component.button.SoptampIconButton +import org.sopt.stamp.designsystem.component.util.noRippleClickable +import org.sopt.stamp.designsystem.style.SoptTheme +import org.sopt.stamp.util.DefaultPreview + +@Composable +fun Option( + modifier: Modifier = Modifier, + title: String, + titleTextColor: Color, + @DrawableRes iconResId: Int, + onPress: () -> Unit +) { + Row( + modifier = modifier + .fillMaxWidth() + .padding(vertical = 12.dp) + .noRippleClickable { onPress() }, + horizontalArrangement = Arrangement.SpaceBetween, + verticalAlignment = Alignment.CenterVertically + ) { + Text( + text = title, + style = SoptTheme.typography.sub1, + color = titleTextColor + ) + if (iconResId != -1) { + SoptampIconButton( + imageVector = ImageVector.vectorResource(id = iconResId) + ) + } + } +} + +@DefaultPreview +@Composable +private fun OptionPreview() { + SoptTheme { + Option( + modifier = Modifier, + title = "비밀번호 변경하기", + iconResId = R.drawable.arrow_right, + titleTextColor = SoptTheme.colors.onSurface90 + ) {} + } +} diff --git a/app/src/main/java/org/sopt/stamp/feature/setting/component/Section.kt b/app/src/main/java/org/sopt/stamp/feature/setting/component/Section.kt new file mode 100644 index 0000000..2f1acba --- /dev/null +++ b/app/src/main/java/org/sopt/stamp/feature/setting/component/Section.kt @@ -0,0 +1,135 @@ +/* + * Copyright 2023 SOPT - Shout Our Passion Together + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sopt.stamp.feature.setting.component + +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.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.wrapContentHeight +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import org.sopt.stamp.R +import org.sopt.stamp.designsystem.style.Gray50 +import org.sopt.stamp.designsystem.style.SoptTheme +import org.sopt.stamp.feature.setting.model.SectionUiModel +import org.sopt.stamp.util.DefaultPreview + +@Composable +fun Section( + items: List +) { + Column( + modifier = Modifier + .background( + color = SoptTheme.colors.onSurface5, + shape = RoundedCornerShape(12.dp) + ) + .padding(vertical = 10.dp) + .fillMaxWidth() + .wrapContentHeight(), + horizontalAlignment = Alignment.Start + ) { + items.forEach { + when (it) { + is SectionUiModel.Header -> { + Header( + modifier = it.containerModifier, + title = it.title + ) + } + + is SectionUiModel.Option -> { + Option( + modifier = it.containerModifier, + title = it.title, + titleTextColor = it.textColor, + iconResId = it.optionIconResId, + onPress = it.onPress + ) + } + + is SectionUiModel.Spacer -> { + Spacer( + modifier = Modifier + .fillMaxWidth() + .height(1.dp) + .background(SoptTheme.colors.onSurface10) + ) + } + } + } + } +} + +@DefaultPreview +@Composable +private fun SectionPreview() { + val sectionItems = listOf( + SectionUiModel.Header( + containerModifier = Modifier + .background( + color = Gray50, + shape = RoundedCornerShape(topStart = 12.dp, topEnd = 12.dp) + ) + .padding(horizontal = 16.dp), + title = "내 정보" + ), + SectionUiModel.Option( + title = "한 마디 편집", + optionIconResId = R.drawable.arrow_right, + containerModifier = Modifier + .background(Gray50) + .padding(horizontal = 16.dp) + ), + SectionUiModel.Spacer, + SectionUiModel.Option( + title = "한 마디 편집", + optionIconResId = R.drawable.arrow_right, + containerModifier = Modifier + .background(Gray50) + .padding(horizontal = 16.dp) + ), + SectionUiModel.Spacer, + SectionUiModel.Option( + title = "한 마디 편집", + optionIconResId = R.drawable.arrow_right, + containerModifier = Modifier + .background( + color = Gray50, + shape = RoundedCornerShape(bottomStart = 12.dp, bottomEnd = 12.dp) + ) + .padding(horizontal = 16.dp) + ) + ) + SoptTheme { + Column( + modifier = Modifier + .background(SoptTheme.colors.white) + .fillMaxSize(), + verticalArrangement = Arrangement.Center + ) { + Section(items = sectionItems) + } + } +} diff --git a/app/src/main/java/org/sopt/stamp/feature/setting/model/SectionUiModel.kt b/app/src/main/java/org/sopt/stamp/feature/setting/model/SectionUiModel.kt new file mode 100644 index 0000000..a874ab8 --- /dev/null +++ b/app/src/main/java/org/sopt/stamp/feature/setting/model/SectionUiModel.kt @@ -0,0 +1,54 @@ +/* + * Copyright 2023 SOPT - Shout Our Passion Together + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sopt.stamp.feature.setting.model + +import androidx.annotation.DrawableRes +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.runtime.Immutable +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.dp +import org.sopt.stamp.designsystem.style.Gray50 +import org.sopt.stamp.designsystem.style.Gray900 + +sealed interface SectionUiModel { + @Immutable + data class Option( + val title: String, + @DrawableRes val optionIconResId: Int = -1, + val containerModifier: Modifier = Modifier + .background(Gray50) + .padding(horizontal = 16.dp), + val textColor: Color = Gray900, + val onPress: () -> Unit = {} + ) : SectionUiModel + + @Immutable + data class Header( + val containerModifier: Modifier = Modifier + .background( + color = Gray50, + shape = RoundedCornerShape(topStart = 12.dp, topEnd = 12.dp) + ) + .padding(horizontal = 16.dp), + val title: String + ) : SectionUiModel + + @Immutable + object Spacer : SectionUiModel +} diff --git a/app/src/main/res/drawable/arrow_letf.xml b/app/src/main/res/drawable/arrow_left.xml similarity index 100% rename from app/src/main/res/drawable/arrow_letf.xml rename to app/src/main/res/drawable/arrow_left.xml diff --git a/app/src/main/res/drawable/arrow_right.xml b/app/src/main/res/drawable/arrow_right.xml new file mode 100644 index 0000000..b6e997e --- /dev/null +++ b/app/src/main/res/drawable/arrow_right.xml @@ -0,0 +1,23 @@ + + + + +