Skip to content

Commit

Permalink
Merge pull request #14 from azrael8576/feat/home
Browse files Browse the repository at this point in the history
feat(home): Add import notes in HomeScreen
  • Loading branch information
azrael8576 authored Dec 2, 2023
2 parents 4c63a6e + 85e4c70 commit 62e92ec
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

/**
*
Expand Down Expand Up @@ -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))
}
Expand Down
12 changes: 12 additions & 0 deletions feature/home/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="important_notes">
❗重要提示:\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 屏幕級別儲存,這意味著當你回退至頂部頁會清除已儲存的搜尋關鍵字。
</string>
</resources>
13 changes: 13 additions & 0 deletions feature/home/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="important_notes">
❗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.
</string>
</resources>

0 comments on commit 62e92ec

Please sign in to comment.