Skip to content

Commit af74122

Browse files
committed
feat: changed notes sceen and decreased app size
1 parent d2ca43a commit af74122

File tree

5 files changed

+85
-58
lines changed

5 files changed

+85
-58
lines changed

.idea/workspace.xml

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

app/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ android {
3131

3232
buildTypes {
3333
release {
34-
minifyEnabled false
34+
minifyEnabled true
35+
shrinkResources true
3536
proguardFiles(
3637
getDefaultProguardFile('proguard-android-optimize.txt'),
3738
'proguard-rules.pro'

app/release/app-release.apk

-10.4 MB
Binary file not shown.

app/src/main/java/com/opennotes/feature_node/presentation/notes/NotesScreen.kt

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,15 @@ import androidx.compose.foundation.lazy.LazyColumn
77
import androidx.compose.foundation.lazy.items
88
import androidx.compose.foundation.shape.RoundedCornerShape
99
import androidx.compose.material.icons.Icons
10-
import androidx.compose.material.icons.filled.Add
1110
import androidx.compose.material.icons.filled.Edit
1211
import androidx.compose.material.icons.filled.Search
1312
import androidx.compose.material.icons.filled.Settings
1413
import androidx.compose.material.icons.filled.Sort
15-
16-
1714
import androidx.compose.material3.*
1815
import androidx.compose.runtime.*
1916
import androidx.compose.ui.Alignment
2017
import androidx.compose.ui.Modifier
18+
import androidx.compose.ui.graphics.Color
2119
import androidx.compose.ui.unit.dp
2220
import androidx.hilt.navigation.compose.hiltViewModel
2321
import androidx.navigation.NavController
@@ -51,7 +49,6 @@ fun NotesScreen(
5149
Text("New Note")
5250
}
5351
)
54-
5552
}
5653
) { paddingValues ->
5754
Surface(
@@ -69,11 +66,7 @@ fun NotesScreen(
6966
.fillMaxWidth()
7067
.padding(horizontal = 16.dp)
7168
) {
72-
Text(
73-
text = "Your notes",
74-
style = MaterialTheme.typography.headlineLarge,
75-
modifier = Modifier.padding(top = 16.dp, bottom = 8.dp)
76-
)
69+
7770

7871
OutlinedTextField(
7972
value = state.searchQuery,
@@ -83,19 +76,22 @@ fun NotesScreen(
8376
modifier = Modifier
8477
.fillMaxWidth()
8578
.height(60.dp)
86-
.width(200.dp)
8779
.padding(bottom = 8.dp),
88-
shape=RoundedCornerShape(28.dp),
89-
leadingIcon= {
80+
shape = RoundedCornerShape(28.dp),
81+
leadingIcon = {
9082
Icon(
9183
imageVector = Icons.Default.Search,
9284
contentDescription = "Search Notes"
9385
)
9486
},
95-
placeholder={Text("Search Notes")},
96-
singleLine = true
97-
98-
87+
placeholder = { Text("Search Notes") },
88+
singleLine = true,
89+
colors = TextFieldDefaults.colors(
90+
focusedContainerColor = Color.Transparent,
91+
unfocusedContainerColor = Color.Transparent,
92+
focusedIndicatorColor = Color.Transparent,
93+
unfocusedIndicatorColor = Color.Transparent
94+
)
9995
)
10096

10197
Row(
@@ -111,24 +107,20 @@ fun NotesScreen(
111107
imageVector = Icons.Default.Sort,
112108
contentDescription = "Sort"
113109
)
114-
115-
116-
117110
}
118111
IconButton(
119-
onClick={
112+
onClick = {
120113
navController.navigate(Screen.SettingsScreen.route)
121114
}
122115
) {
123116
Icon(
124-
imageVector=Icons.Default.Settings,
117+
imageVector = Icons.Default.Settings,
125118
contentDescription = "Settings"
126119
)
127120
}
128121
}
129122
}
130123

131-
132124
AnimatedVisibility(
133125
visible = state.isOrderSectionVisible,
134126
enter = fadeIn() + slideInVertically(),
@@ -178,5 +170,4 @@ fun NotesScreen(
178170
}
179171
}
180172
}
181-
182173
}

app/src/main/java/com/opennotes/feature_node/presentation/settings/SettingsScreen.kt

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,19 @@ import androidx.compose.foundation.layout.Spacer
1010
import androidx.compose.foundation.layout.fillMaxSize
1111
import androidx.compose.foundation.layout.height
1212
import androidx.compose.foundation.layout.padding
13+
import androidx.compose.material.icons.Icons
14+
import androidx.compose.material.icons.filled.ArrowBack
1315
import androidx.compose.material3.Button
16+
import androidx.compose.material3.ExperimentalMaterial3Api
17+
import androidx.compose.material3.Icon
18+
import androidx.compose.material3.IconButton
19+
import androidx.compose.material3.MaterialTheme
1420
import androidx.compose.material3.Scaffold
1521
import androidx.compose.material3.SnackbarHost
1622
import androidx.compose.material3.SnackbarHostState
1723
import androidx.compose.material3.Text
24+
import androidx.compose.material3.TextButton
25+
import androidx.compose.material3.TopAppBar
1826
import androidx.compose.runtime.Composable
1927
import androidx.compose.runtime.LaunchedEffect
2028
import androidx.compose.runtime.remember
@@ -25,7 +33,9 @@ import androidx.hilt.navigation.compose.hiltViewModel
2533
import androidx.navigation.NavController
2634
import kotlinx.coroutines.flow.collectLatest
2735
import androidx.compose.ui.platform.LocalContext
36+
import androidx.compose.ui.unit.sp
2837

38+
@OptIn(ExperimentalMaterial3Api::class)
2939
@Composable
3040
fun SettingsScreen(
3141
navController:NavController,
@@ -69,6 +79,25 @@ fun SettingsScreen(
6979
}
7080

7181
Scaffold(
82+
topBar={
83+
TopAppBar(
84+
title = {
85+
Text(
86+
text = "Settings",
87+
style = MaterialTheme.typography.headlineMedium
88+
)
89+
},
90+
navigationIcon = {
91+
IconButton(onClick = { navController.popBackStack() }) {
92+
Icon(
93+
imageVector = Icons.Default.ArrowBack,
94+
contentDescription = "Back"
95+
)
96+
}
97+
}
98+
)
99+
},
100+
72101
snackbarHost = { SnackbarHost(snackbarHostState) }
73102
) { paddingValues ->
74103
Column(
@@ -78,11 +107,14 @@ fun SettingsScreen(
78107
.padding(16.dp),
79108
horizontalAlignment = Alignment.CenterHorizontally
80109
) {
81-
Button(onClick = { viewModel.onExportClick() }) {
110+
111+
112+
Spacer(Modifier.height(16.dp))
113+
TextButton(onClick = { viewModel.onExportClick() }) {
82114
Text("Export Notes")
83115
}
84116
Spacer(Modifier.height(16.dp))
85-
Button(onClick = {
117+
TextButton(onClick = {
86118
filePickerLauncher.launch(arrayOf("application/json"))
87119
}) {
88120
Text("Import Notes")

0 commit comments

Comments
 (0)