Skip to content

Commit b4acfae

Browse files
committed
UI update
1 parent 07d22f4 commit b4acfae

File tree

10 files changed

+126
-201
lines changed

10 files changed

+126
-201
lines changed

.idea/deploymentTargetDropDown.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/java/com/vladshurakov/jetnotesapp/feature_notes/presenter/components/NoteView.kt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.vladshurakov.jetnotesapp.feature_notes.presenter.components
22

3+
import androidx.compose.foundation.layout.Arrangement
34
import androidx.compose.foundation.layout.Column
45
import androidx.compose.foundation.layout.PaddingValues
56
import androidx.compose.foundation.layout.Row
@@ -42,12 +43,13 @@ fun NoteView(
4243
contentPadding = PaddingValues(12.dp),
4344
modifier = Modifier
4445
.fillMaxWidth()
45-
.padding(vertical = 8.dp)
46+
.padding(top = 12.dp)
4647
) {
4748
Row(
4849
verticalAlignment = Alignment.Top
4950
) {
5051
Column(
52+
verticalArrangement = Arrangement.SpaceBetween,
5153
modifier = Modifier.weight(1f)
5254
) {
5355

@@ -61,8 +63,6 @@ fun NoteView(
6163
.fillMaxWidth()
6264
)
6365

64-
Spacer(modifier = Modifier.height(6.dp))
65-
6666
Text(
6767
text = if (isContentBlank(content = note.content))
6868
stringResource(id = R.string.hint_no_content)
@@ -76,16 +76,15 @@ fun NoteView(
7676
Spacer(modifier = Modifier.height(6.dp))
7777

7878
Text(
79-
text = if (note.timestamp == 0.toLong()) " " else PrettyTime().format(Date(note.timestamp)),
79+
text = if (note.timestamp == 0.toLong()) ""
80+
else PrettyTime().format(Date(note.timestamp)),
8081
style = MainTheme.typography.caption,
8182
color = MainTheme.colors.secondaryTextColor
8283
)
8384
}
8485

8586
if (onPin != null){
86-
IconButton(
87-
onClick = (onPin)
88-
) {
87+
IconButton(onClick = (onPin)) {
8988
Icon(
9089
painter = painterResource(
9190
id = if (note.pinned) R.drawable.ic_pinned else R.drawable.ic_unpinned

app/src/main/java/com/vladshurakov/jetnotesapp/feature_notes/presenter/components/TransparentHintTextField.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ fun TransparentHintTextField(
4040
text = hint,
4141
style = textStyle,
4242
color = MainTheme.colors.secondaryTextColor,
43+
fontSize = MainTheme.typography.body.fontSize
4344
)
4445
}
4546
}

app/src/main/java/com/vladshurakov/jetnotesapp/feature_notes/presenter/screen/EditScreen.kt

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,12 @@ fun EditScreen(
7070
TransparentHintTextField(
7171
text = titleState.text,
7272
hint = stringResource(id = R.string.hint_title),
73-
onValueChange = {
74-
viewModel.onEvent(EditEvent.EnteredTitle(it))
75-
},
76-
onFocusChange = {
77-
viewModel.onEvent(EditEvent.ChangeTitleFocus(it))
78-
},
73+
onValueChange = { viewModel.onEvent(EditEvent.EnteredTitle(it)) },
74+
onFocusChange = { viewModel.onEvent(EditEvent.ChangeTitleFocus(it)) },
7975
isHintVisible = titleState.isHintVisible,
8076
textStyle = MainTheme.typography.title.copy(
81-
color = if (titleState.isHintVisible) {
82-
MainTheme.colors.secondaryTextColor
83-
} else {
84-
MainTheme.colors.primaryTextColor
85-
}
77+
color = if (titleState.isHintVisible) { MainTheme.colors.secondaryTextColor }
78+
else { MainTheme.colors.primaryTextColor }
8679
),
8780
singleLine = true
8881
)
@@ -103,19 +96,12 @@ fun EditScreen(
10396
TransparentHintTextField(
10497
text = contentState.text,
10598
hint = stringResource(id = R.string.hint_start_typing),
106-
onValueChange = {
107-
viewModel.onEvent(EditEvent.EnteredContent(it))
108-
},
109-
onFocusChange = {
110-
viewModel.onEvent(EditEvent.ChangeContentFocus(it))
111-
},
99+
onValueChange = { viewModel.onEvent(EditEvent.EnteredContent(it)) },
100+
onFocusChange = { viewModel.onEvent(EditEvent.ChangeContentFocus(it)) },
112101
isHintVisible = contentState.isHintVisible,
113102
textStyle = MainTheme.typography.body.copy(
114-
color = if (contentState.isHintVisible) {
115-
MainTheme.colors.secondaryTextColor
116-
} else {
117-
MainTheme.colors.primaryTextColor
118-
}
103+
color = if (contentState.isHintVisible) { MainTheme.colors.secondaryTextColor }
104+
else { MainTheme.colors.primaryTextColor }
119105
)
120106
)
121107
}

app/src/main/java/com/vladshurakov/jetnotesapp/feature_notes/presenter/screen/NotesScreen.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ fun NotesScreen(
5454
topBar = {
5555
NotesTopBar(
5656
orderType = notesViewModel.notesState.value.orderType,
57-
onSort = {
58-
notesViewModel.onEvent(NotesEvent.ToggleOrderType)
59-
}
57+
onSort = { notesViewModel.onEvent(NotesEvent.ToggleOrderType) }
6058
) {
6159
navController.navigate(Screen.Settings.route)
6260
}

app/src/main/java/com/vladshurakov/jetnotesapp/feature_settings/presenter/components/CustomTopAppBars.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ fun NotesTopBar(
5757
painter = painterResource(id = R.drawable.ic_order),
5858
contentDescription = stringResource(id = R.string.label_order),
5959
tint = MainTheme.colors.invertColor,
60-
modifier = Modifier
61-
.graphicsLayer(
60+
modifier = Modifier.graphicsLayer(
6261
scaleY = if (orderType == OrderType.Descending) 1f else -1f
63-
)
62+
)
6463
)
6564
}
6665
IconButton(

app/src/main/java/com/vladshurakov/jetnotesapp/feature_settings/presenter/components/Views.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fun SettingsView(
2929
contentPadding = PaddingValues(start = 16.dp),
3030
modifier = Modifier
3131
.fillMaxWidth()
32-
.defaultMinSize(minHeight = 72.dp)
32+
.defaultMinSize(minHeight = 62.dp)
3333
) {
3434
Column(
3535
modifier = Modifier

0 commit comments

Comments
 (0)