Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

Commit

Permalink
Added spacing and string resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Simba-97 committed Oct 16, 2022
1 parent b19c457 commit 46fc61b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
1 change: 1 addition & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import androidx.compose.ui.draw.clip
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.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -97,7 +98,7 @@ fun NoteFolderScreen(
verticalAlignment = Alignment.CenterVertically,
) {
Text(
text = "Categories",
text = stringResource(id = R.string.categories),
style = MaterialTheme.typography.headlineMedium,
modifier = modifier.padding(start = 120.dp)
)
Expand All @@ -112,6 +113,7 @@ fun NoteFolderScreen(
)

}

Row(
modifier = Modifier
.fillMaxWidth()
Expand All @@ -120,10 +122,11 @@ fun NoteFolderScreen(
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = "List Categories",
text = stringResource(id = R.string.list_categories),
style = MaterialTheme.typography.bodyMedium
)
}

LazyVerticalGrid(
modifier = modifier.padding(8.dp),
columns = GridCells.Fixed(2),
Expand All @@ -137,7 +140,7 @@ fun NoteFolderScreen(
it.title
}
) { noteItem ->
NoteFolderItemUI(onClick = {}, data = noteItem)
NoteFolderItemUI(onClick = {}, folder = noteItem)
}
}
}
Expand All @@ -148,7 +151,7 @@ fun NoteFolderScreen(
fun NoteFolderItemUI(
modifier: Modifier = Modifier,
onClick: () -> Unit,
data: Folder,
folder: Folder,
) {
Box(
modifier = modifier
Expand All @@ -163,13 +166,15 @@ fun NoteFolderItemUI(
horizontalAlignment = Alignment.CenterHorizontally
) {
Icon(painterResource(id = R.drawable.ic_folder_filled), contentDescription = null)

Text(
text = "Item ${data.title}",
text = "Item ${folder.title}",
style = MaterialTheme.typography.bodyLarge,
fontWeight = FontWeight.Bold
)

Text(
text = "${data.description}",
text = "${folder.description}",
style = MaterialTheme.typography.bodyMedium
)
}
Expand All @@ -192,18 +197,19 @@ private fun NoteFolderScreenPreview() {
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = "Categories",
text = stringResource(id = R.string.categories),
style = MaterialTheme.typography.headlineMedium,
modifier = Modifier.padding(start = 130.dp)
)

Icon(
painter = painterResource(id = R.drawable.ic_add_circle_outline),
contentDescription = "add_note",
modifier = Modifier
.padding(end = 10.dp)
)

}

Row(
modifier = Modifier
.fillMaxWidth()
Expand All @@ -212,10 +218,11 @@ private fun NoteFolderScreenPreview() {
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = "List Categories",
text = stringResource(id = R.string.list_categories),
style = MaterialTheme.typography.bodyMedium
)
}

LazyVerticalGrid(
columns = GridCells.Fixed(2),
verticalArrangement = Arrangement.spacedBy(8.dp),
Expand All @@ -239,11 +246,13 @@ private fun NoteFolderScreenPreview() {
painterResource(id = R.drawable.ic_folder_filled),
contentDescription = null
)

Text(
text = "Item $noteFolderItems",
style = MaterialTheme.typography.bodyLarge,
fontWeight = FontWeight.Bold
)

Text(
text = "$noteFolderItems item description",
style = MaterialTheme.typography.bodyMedium
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-hi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
<string name="welcome_message">NoteX में आपका स्वागत है</string>
<string name="retry">फिर से प्रयास करें</string>
<string name="empty_message">यहाँ सब खाली है</string>
<string name="categories">श्रेणियाँ</string>
<string name="list_categories">सूची श्रेणियाँ</string>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
<string name="welcome_message">Welcome to NoteX</string>
<string name="retry">Retry</string>
<string name="empty_message">It\'s all empty here</string>
<string name="categories">Categories</string>
<string name="list_categories">List Categories</string>
</resources>

0 comments on commit 46fc61b

Please sign in to comment.