Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

Commit 0feec1c

Browse files
authored
Merge pull request #60 from Amirnlz/app-name-drawer
Feat: Add app-name to DrawerContent
2 parents 2518f45 + 497d4c6 commit 0feec1c

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

  • app/src/main/java/com/yangdai/opennote/presentation/component/main

app/src/main/java/com/yangdai/opennote/presentation/component/main/DrawerContent.kt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import androidx.compose.animation.AnimatedVisibility
44
import androidx.compose.foundation.layout.Arrangement
55
import androidx.compose.foundation.layout.Column
66
import androidx.compose.foundation.layout.Row
7-
import androidx.compose.foundation.layout.Spacer
87
import androidx.compose.foundation.layout.fillMaxWidth
98
import androidx.compose.foundation.layout.padding
109
import androidx.compose.foundation.rememberScrollState
@@ -60,14 +59,21 @@ fun DrawerContent(
6059
.fillMaxWidth()
6160
.verticalScroll(rememberScrollState())
6261
) {
63-
6462
Row(
6563
modifier = Modifier
6664
.fillMaxWidth()
6765
.padding(vertical = 12.dp, horizontal = 20.dp),
6866
horizontalArrangement = Arrangement.SpaceBetween,
6967
verticalAlignment = Alignment.CenterVertically
7068
) {
69+
Text(
70+
text = stringResource(R.string.app_name),
71+
style = MaterialTheme.typography.titleLarge,
72+
color = MaterialTheme.colorScheme.onSurface,
73+
fontWeight = FontWeight.SemiBold,
74+
modifier = Modifier.weight(1f)
75+
)
76+
7177
if (showLock)
7278
IconButton(onClick = onLockClick) {
7379
Icon(
@@ -77,8 +83,6 @@ fun DrawerContent(
7783
)
7884
}
7985

80-
Spacer(modifier = Modifier.weight(1f))
81-
8286
IconButton(onClick = { navigateTo(Settings) }) {
8387
Icon(
8488
imageVector = Icons.Outlined.Settings,
@@ -183,4 +187,4 @@ private fun DrawerItem(
183187
shape = MaterialTheme.shapes.medium,
184188
selected = isSelected,
185189
onClick = onClick
186-
)
190+
)

0 commit comments

Comments
 (0)