diff --git a/core/designsystem/src/main/kotlin/io/github/hangillab/hangil/core/designsystem/ParkedComponents.kt b/core/designsystem/src/main/kotlin/io/github/hangillab/hangil/core/designsystem/ParkedComponents.kt index 10fba76..4608555 100644 --- a/core/designsystem/src/main/kotlin/io/github/hangillab/hangil/core/designsystem/ParkedComponents.kt +++ b/core/designsystem/src/main/kotlin/io/github/hangillab/hangil/core/designsystem/ParkedComponents.kt @@ -1,5 +1,6 @@ package io.github.hangillab.hangil.core.designsystem +import androidx.annotation.StringRes import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -124,14 +125,17 @@ fun ParkedChoice( } @Composable -fun ParkedLockedNotice() { +fun ParkedLockedNotice( + @StringRes titleRes: Int = R.string.practice_locked_title, + @StringRes descriptionRes: Int = R.string.practice_locked_description, +) { ParkedPanel { Text( - stringResource(R.string.practice_locked_title), + stringResource(titleRes), style = MaterialTheme.typography.headlineMedium, fontWeight = FontWeight.SemiBold, ) - Text(stringResource(R.string.practice_locked_description), style = MaterialTheme.typography.bodyLarge) + Text(stringResource(descriptionRes), style = MaterialTheme.typography.bodyLarge) Text( stringResource(R.string.practice_locked_saved), style = MaterialTheme.typography.bodyLarge, diff --git a/feature/home/src/main/kotlin/io/github/hangillab/hangil/feature/home/HomeScreen.kt b/feature/home/src/main/kotlin/io/github/hangillab/hangil/feature/home/HomeScreen.kt index 57a6a4e..5b92ef2 100644 --- a/feature/home/src/main/kotlin/io/github/hangillab/hangil/feature/home/HomeScreen.kt +++ b/feature/home/src/main/kotlin/io/github/hangillab/hangil/feature/home/HomeScreen.kt @@ -31,6 +31,7 @@ import io.github.hangillab.hangil.core.designsystem.ParkedDisclosure import io.github.hangillab.hangil.core.designsystem.ParkedLockedNotice import io.github.hangillab.hangil.core.designsystem.ParkedPage import io.github.hangillab.hangil.core.designsystem.ParkedPanel +import io.github.hangillab.hangil.core.domain.ConnectionState import io.github.hangillab.hangil.core.domain.LocationRecordingState import io.github.hangillab.hangil.core.domain.PracticeSession import io.github.hangillab.hangil.core.domain.Preparation @@ -191,7 +192,14 @@ internal fun HomeScreen( Modifier.testTag("home_locked_title"), style = MaterialTheme.typography.titleLarge, ) - ParkedLockedNotice() + if (state.vehicle.connection == ConnectionState.PERMISSION_DENIED) { + ParkedLockedNotice( + titleRes = R.string.home_vehicle_permission_locked_title, + descriptionRes = R.string.home_vehicle_permission_locked_description, + ) + } else { + ParkedLockedNotice() + } } else { HomeHeader() HomeDashboard(first = sessionContent, second = { diff --git a/feature/home/src/main/res/values/strings.xml b/feature/home/src/main/res/values/strings.xml index 02293fa..ef9d4ea 100644 --- a/feature/home/src/main/res/values/strings.xml +++ b/feature/home/src/main/res/values/strings.xml @@ -2,6 +2,8 @@ 시연 지도 보기 한길졸업 + 차량 상태를 확인할 수 없어요 + 차량 정보를 읽을 권한이 없어 준비와 복습을 잠갔어요. 내가 매일 가야 하는 길 하나부터, 내 힘으로. 출발 전 준비부터 주차 후 복습까지, 생활 경로 하나를 익히는 연습을 준비하고 있어요. 차량 연결