From 85e4c7073f6eb0dd4058b398dbd2e4219acaccf1 Mon Sep 17 00:00:00 2001 From: WeiHe Date: Sun, 3 Dec 2023 03:42:15 +0800 Subject: [PATCH] feat(home): Add import notes in HomeScreen --- .../picquest/feature/home/home/HomeScreen.kt | 34 ++++++++++++------- .../src/main/res/values-zh-rTW/strings.xml | 12 +++++++ feature/home/src/main/res/values/strings.xml | 13 +++++++ 3 files changed, 47 insertions(+), 12 deletions(-) create mode 100644 feature/home/src/main/res/values-zh-rTW/strings.xml create mode 100644 feature/home/src/main/res/values/strings.xml diff --git a/feature/home/src/main/java/com/wei/picquest/feature/home/home/HomeScreen.kt b/feature/home/src/main/java/com/wei/picquest/feature/home/home/HomeScreen.kt index 73ea884..1ed4645 100644 --- a/feature/home/src/main/java/com/wei/picquest/feature/home/home/HomeScreen.kt +++ b/feature/home/src/main/java/com/wei/picquest/feature/home/home/HomeScreen.kt @@ -4,9 +4,12 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.safeDrawing import androidx.compose.foundation.layout.windowInsetsBottomHeight import androidx.compose.foundation.layout.windowInsetsTopHeight +import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface import androidx.compose.material3.Text @@ -15,12 +18,17 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.semantics.contentDescription import androidx.compose.ui.semantics.semantics +import androidx.compose.ui.unit.dp import androidx.navigation.NavController import com.wei.picquest.core.designsystem.component.FunctionalityNotAvailablePopup import com.wei.picquest.core.designsystem.component.ThemePreviews import com.wei.picquest.core.designsystem.theme.PqTheme +import com.wei.picquest.core.designsystem.theme.SPACING_EXTRA_LARGE +import com.wei.picquest.core.designsystem.theme.SPACING_MEDIUM +import com.wei.picquest.feature.home.R /** * @@ -83,19 +91,21 @@ internal fun HomeScreen( if (withTopSpacer) { Spacer(Modifier.windowInsetsTopHeight(WindowInsets.safeDrawing)) } - - Column { - Spacer(modifier = Modifier.weight(1f)) - Text( - text = "Screen not available \uD83D\uDE48", - color = MaterialTheme.colorScheme.error, - style = MaterialTheme.typography.headlineMedium, - modifier = Modifier - .semantics { contentDescription = "" }, - ) - Spacer(modifier = Modifier.weight(1f)) + LazyColumn { + item { + Spacer(modifier = Modifier.height(SPACING_EXTRA_LARGE.dp)) + } + item { + val importantNotes = stringResource(id = R.string.important_notes) + Text( + text = importantNotes, + style = MaterialTheme.typography.bodyLarge, + modifier = Modifier + .padding(SPACING_MEDIUM.dp) + .semantics { contentDescription = importantNotes }, + ) + } } - if (withBottomSpacer) { Spacer(Modifier.windowInsetsBottomHeight(WindowInsets.safeDrawing)) } diff --git a/feature/home/src/main/res/values-zh-rTW/strings.xml b/feature/home/src/main/res/values-zh-rTW/strings.xml new file mode 100644 index 0000000..a6e143f --- /dev/null +++ b/feature/home/src/main/res/values-zh-rTW/strings.xml @@ -0,0 +1,12 @@ + + + + ❗重要提示:\n\n + - 這個 App 使用 Pixabay API 作為圖片來源。\n\n + - 對於開發人員:請將 `${專案根目錄}/secrets.defaults.properties` 中的 API_KEY 替換為你的 Pixabay API 金鑰。\n\n + - 對於非開發人員:確保你的 App Apk 來源為 github.com/azrael8576/picquest 此專案 Releases 之 apk。\n\n + ⚠️已知問題:\n\n + - 目前本專案尚未使用本地儲存方案。\n\n + - 最近搜尋關鍵字為 Screen 屏幕級別儲存,這意味著當你回退至頂部頁會清除已儲存的搜尋關鍵字。 + + \ No newline at end of file diff --git a/feature/home/src/main/res/values/strings.xml b/feature/home/src/main/res/values/strings.xml new file mode 100644 index 0000000..1aba2ac --- /dev/null +++ b/feature/home/src/main/res/values/strings.xml @@ -0,0 +1,13 @@ + + + + ❗Important Notes:\n + - This App uses Pixabay API as its image source.\n + - For developers:\nPlease replace the API_KEY in `${Project_Root_Directory}/secrets.defaults.properties` with your Pixabay API key.\n + - For non-developers:\nEnsure that your App Apk is sourced from github.com/azrael8576/picquest, specifically from the apk in the project\'s Releases.\n + \n + ⚠️Known Issues:\n + - Currently, this project does not use any local storage solution.\n + - The recent search keywords is stored at the Screen level, meaning that the keywords will be cleared when you navigate back to the top page. + +