Skip to content

Commit

Permalink
Merge pull request #66 from tgyuuAn/feature/#65
Browse files Browse the repository at this point in the history
Feature/#65
  • Loading branch information
tgyuuAn authored Jun 27, 2024
2 parents 2fecbf9 + ed29f4b commit d056639
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.tgyuu.feature.profile.setting

internal const val PRIVACY_POLICY_URL =
"https://sequoia-soy-2ee.notion.site/846d2645fd1c4bf3b026aeec89542af2?pvs=4"
internal const val TERMS_AND_CONDITIONS_URL =
"https://sequoia-soy-2ee.notion.site/079b871c344c4b96a6d9d7d0b11723a5?pvs=4"
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.tgyuu.feature.profile.setting

import android.content.Context
import android.content.Intent
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
Expand Down Expand Up @@ -35,11 +37,14 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.core.content.ContextCompat.startActivity
import androidx.core.net.toUri
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.sd.lib.compose.wheel_picker.FVerticalWheelPicker
Expand Down Expand Up @@ -120,6 +125,8 @@ fun SettingScreen(
withdrawalKakao: () -> Unit,
navigateToAuth: () -> Unit,
) {
val context = LocalContext.current

Box(modifier = Modifier.fillMaxSize()) {
when (userInformationState) {
is UiState.Loading -> Loader(modifier = Modifier.fillMaxSize())
Expand Down Expand Up @@ -490,17 +497,17 @@ fun SettingScreen(
)

BaekyoungRow(
titleTextId = R.string.open_source_license,
titleTextId = R.string.terms_and_conditions,
showContentText = false,
showRightArrow = true,
onClick = { },
onClick = { navigateToUri(context, TERMS_AND_CONDITIONS_URL) },
)

BaekyoungRow(
titleTextId = R.string.privacy_policy,
showContentText = false,
showRightArrow = true,
onClick = { },
onClick = { navigateToUri(context, PRIVACY_POLICY_URL) },
)

HorizontalDivider(
Expand Down Expand Up @@ -531,6 +538,11 @@ fun SettingScreen(
}
}

private fun navigateToUri(context: Context, url: String) =
startActivity(context, generateUriIntent(url), null)

private fun generateUriIntent(url: String) = Intent(Intent.ACTION_VIEW, url.toUri())

enum class BottomSheetType {
INIT, CHANGE_NICKNAME, CHANGE_MAJOR, CHANGE_GRADE
}
4 changes: 2 additions & 2 deletions feature/profile/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<string name="change_major">학과 변경</string>
<string name="change_grade">학년 변경</string>
<string name="hint_major">백경이학과</string>
<string name="open_source_license">오픈소스 라이센스</string>
<string name="privacy_policy">개인정보처리방침</string>
<string name="terms_and_conditions">서비스 이용 약관</string>
<string name="privacy_policy">개인정보 처리 방침</string>
<string name="logout">로그아웃</string>
<string name="withdrawal">계정탈퇴</string>

Expand Down

0 comments on commit d056639

Please sign in to comment.