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

Commit 947da13

Browse files
committed
Update 1.6.5
1 parent 1dcf181 commit 947da13

5 files changed

Lines changed: 76 additions & 106 deletions

File tree

.idea/deploymentTargetSelector.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
package com.yangdai.opennote.presentation.component.main
22

33
import androidx.compose.foundation.layout.ColumnScope
4+
import androidx.compose.foundation.layout.width
45
import androidx.compose.material3.DrawerState
56
import androidx.compose.material3.ModalDrawerSheet
67
import androidx.compose.material3.ModalNavigationDrawer
78
import androidx.compose.material3.PermanentDrawerSheet
89
import androidx.compose.material3.PermanentNavigationDrawer
910
import androidx.compose.runtime.Composable
11+
import androidx.compose.ui.Modifier
12+
import androidx.compose.ui.unit.dp
1013

1114
/**
1215
* A composable function that adapts the navigation drawer based on the screen size.
@@ -46,7 +49,10 @@ private fun ModalNavigationScreen(
4649
content: @Composable () -> Unit
4750
) = ModalNavigationDrawer(
4851
drawerContent = {
49-
ModalDrawerSheet(drawerState = drawerState) {
52+
ModalDrawerSheet(
53+
drawerState = drawerState,
54+
modifier = Modifier.width(320.dp)
55+
) {
5056
drawerContent()
5157
}
5258
},
@@ -61,7 +67,7 @@ private fun PermanentNavigationScreen(
6167
content: @Composable () -> Unit
6268
) = PermanentNavigationDrawer(
6369
drawerContent = {
64-
PermanentDrawerSheet {
70+
PermanentDrawerSheet(Modifier.width(320.dp)) {
6571
drawerContent()
6672
}
6773
},

app/src/main/java/com/yangdai/opennote/presentation/screen/MainScreen.kt

Lines changed: 54 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ import androidx.compose.foundation.interaction.MutableInteractionSource
1717
import androidx.compose.foundation.interaction.collectIsPressedAsState
1818
import androidx.compose.foundation.layout.Arrangement
1919
import androidx.compose.foundation.layout.Box
20-
import androidx.compose.foundation.layout.Column
2120
import androidx.compose.foundation.layout.PaddingValues
2221
import androidx.compose.foundation.layout.Row
22+
import androidx.compose.foundation.layout.Spacer
2323
import androidx.compose.foundation.layout.WindowInsets
2424
import androidx.compose.foundation.layout.asPaddingValues
2525
import androidx.compose.foundation.layout.calculateEndPadding
@@ -56,10 +56,10 @@ import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
5656
import androidx.compose.material3.FloatingActionButtonDefaults
5757
import androidx.compose.material3.Icon
5858
import androidx.compose.material3.IconButton
59+
import androidx.compose.material3.MaterialTheme
5960
import androidx.compose.material3.Scaffold
6061
import androidx.compose.material3.Surface
6162
import androidx.compose.material3.Text
62-
import androidx.compose.material3.TextButton
6363
import androidx.compose.material3.TopAppBar
6464
import androidx.compose.material3.rememberDrawerState
6565
import androidx.compose.runtime.Composable
@@ -106,6 +106,7 @@ import com.yangdai.opennote.presentation.component.main.AdaptiveNoteCard
106106
import com.yangdai.opennote.presentation.component.main.AdaptiveTopSearchbar
107107
import com.yangdai.opennote.presentation.component.main.DrawerContent
108108
import com.yangdai.opennote.presentation.component.main.Timeline
109+
import com.yangdai.opennote.presentation.component.note.IconButtonWithTooltip
109110
import com.yangdai.opennote.presentation.event.DatabaseEvent
110111
import com.yangdai.opennote.presentation.event.ListEvent
111112
import com.yangdai.opennote.presentation.navigation.Screen
@@ -328,102 +329,65 @@ fun MainScreen(
328329
exit = slideOutVertically { fullHeight -> fullHeight }
329330
) {
330331
BottomAppBar {
331-
Row(
332-
modifier = Modifier
333-
.fillMaxSize()
334-
.padding(horizontal = 16.dp),
335-
horizontalArrangement = Arrangement.SpaceBetween,
336-
verticalAlignment = Alignment.CenterVertically
337-
) {
338-
339-
Row(
340-
modifier = Modifier.fillMaxHeight(),
341-
verticalAlignment = Alignment.CenterVertically
342-
) {
343-
Checkbox(
344-
checked = allNotesSelected,
345-
onCheckedChange = { allNotesSelected = it }
346-
)
332+
Row(verticalAlignment = Alignment.CenterVertically) {
333+
Checkbox(
334+
checked = allNotesSelected,
335+
onCheckedChange = { allNotesSelected = it }
336+
)
347337

348-
Text(text = stringResource(R.string.checked))
349-
Text(text = selectedNotesSet.size.toString())
350-
}
338+
Text(text = stringResource(R.string.checked))
339+
Text(text = selectedNotesSet.size.toString())
340+
}
351341

352-
Row(
353-
modifier = Modifier.fillMaxHeight(),
354-
verticalAlignment = Alignment.CenterVertically
355-
) {
342+
Spacer(Modifier.weight(1f))
356343

357-
if (selectedNavDrawerIndex == 1) {
358-
TextButton(onClick = {
359-
viewModel.onListEvent(
360-
ListEvent.RestoreNotes(selectedNotesSet)
361-
)
362-
initializeNoteSelection()
363-
}) {
364-
Column(horizontalAlignment = Alignment.CenterHorizontally) {
365-
Icon(
366-
imageVector = Icons.Outlined.RestartAlt,
367-
contentDescription = "Restore"
368-
)
369-
Text(
370-
text = stringResource(id = R.string.restore),
371-
maxLines = 1,
372-
overflow = TextOverflow.Ellipsis
373-
)
374-
}
375-
}
376-
} else {
377-
TextButton(onClick = { isExportNotesDialogVisible = true }) {
378-
Column(horizontalAlignment = Alignment.CenterHorizontally) {
379-
Icon(
380-
imageVector = Icons.Outlined.Upload,
381-
contentDescription = "Export"
382-
)
383-
Text(
384-
text = stringResource(id = R.string.export),
385-
maxLines = 1,
386-
overflow = TextOverflow.Ellipsis
387-
)
388-
}
389-
}
344+
Row(verticalAlignment = Alignment.CenterVertically) {
390345

391-
TextButton(onClick = { isMoveToFolderDialogVisible = true }) {
392-
Column(horizontalAlignment = Alignment.CenterHorizontally) {
393-
Icon(
394-
imageVector = Icons.AutoMirrored.Outlined.DriveFileMove,
395-
contentDescription = "Move"
396-
)
397-
Text(
398-
text = stringResource(id = R.string.move),
399-
maxLines = 1,
400-
overflow = TextOverflow.Ellipsis
401-
)
402-
}
403-
}
404-
}
405-
406-
TextButton(onClick = {
346+
if (selectedNavDrawerIndex == 1) {
347+
IconButtonWithTooltip(
348+
imageVector = Icons.Outlined.RestartAlt,
349+
tint = MaterialTheme.colorScheme.primary,
350+
contentDescription = stringResource(id = R.string.restore),
351+
shortCutDescription = stringResource(id = R.string.restore)
352+
) {
407353
viewModel.onListEvent(
408-
ListEvent.DeleteNotes(
409-
selectedNotesSet,
410-
selectedNavDrawerIndex != 1
411-
)
354+
ListEvent.RestoreNotes(selectedNotesSet)
412355
)
413356
initializeNoteSelection()
414-
}) {
415-
Column(horizontalAlignment = Alignment.CenterHorizontally) {
416-
Icon(
417-
imageVector = Icons.Outlined.Delete,
418-
contentDescription = "Delete"
419-
)
420-
Text(
421-
text = stringResource(id = R.string.delete),
422-
maxLines = 1,
423-
overflow = TextOverflow.Ellipsis
424-
)
425-
}
426357
}
358+
} else {
359+
IconButtonWithTooltip(
360+
imageVector = Icons.Outlined.Upload,
361+
tint = MaterialTheme.colorScheme.primary,
362+
contentDescription = stringResource(id = R.string.export),
363+
shortCutDescription = stringResource(id = R.string.export)
364+
) {
365+
isExportNotesDialogVisible = true
366+
}
367+
368+
IconButtonWithTooltip(
369+
imageVector = Icons.AutoMirrored.Outlined.DriveFileMove,
370+
tint = MaterialTheme.colorScheme.primary,
371+
contentDescription = stringResource(id = R.string.move),
372+
shortCutDescription = stringResource(id = R.string.move)
373+
) {
374+
isMoveToFolderDialogVisible = true
375+
}
376+
}
377+
378+
IconButtonWithTooltip(
379+
imageVector = Icons.Outlined.Delete,
380+
tint = MaterialTheme.colorScheme.primary,
381+
contentDescription = stringResource(id = R.string.delete),
382+
shortCutDescription = stringResource(id = R.string.delete)
383+
) {
384+
viewModel.onListEvent(
385+
ListEvent.DeleteNotes(
386+
selectedNotesSet,
387+
selectedNavDrawerIndex != 1
388+
)
389+
)
390+
initializeNoteSelection()
427391
}
428392
}
429393
}

gradle/libs.versions.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
[versions]
2-
agp = "8.10.0"
2+
agp = "8.10.1"
33
colorpickerCompose = "1.1.2"
44
documentfile = "1.1.0"
55
glance = "1.1.1"
66
kotlin = "2.1.21"
77
ksp = "2.1.21-2.0.1"
88
kotlinxSerialization = "1.8.1"
99

10-
composeBom = "2025.05.00"
10+
composeBom = "2025.06.01"
1111
activityCompose = "1.10.1"
1212
ktor = "3.1.2"
13-
lifecycleRuntimeCompose = "2.9.0"
13+
lifecycleRuntimeCompose = "2.9.1"
1414
navigationCompose = "2.9.0"
1515

1616
junit = "4.13.2"
1717
junitVersion = "1.2.1"
1818
espressoCore = "3.6.1"
1919

20-
appcompat = "1.7.0"
21-
hilt = "2.56.1"
20+
appcompat = "1.7.1"
21+
hilt = "2.56.2"
2222
hiltNav = "1.2.0"
23-
room = "2.7.1"
23+
room = "2.7.2"
2424
browser = "1.8.0"
25-
commonmark = "0.24.0"
26-
datastorePreferences = "1.1.4"
27-
workRuntimeKtx = "2.10.1"
25+
commonmark = "0.25.0"
26+
datastorePreferences = "1.1.7"
27+
workRuntimeKtx = "2.10.2"
2828
coreSplashscreen = "1.2.0-beta02"
29-
biometricVersion = "1.4.0-alpha03"
29+
biometricVersion = "1.4.0-alpha04"
3030

3131
[libraries]
3232

@@ -65,7 +65,7 @@ androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-toolin
6565
androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
6666
androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
6767
androidx-compose-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
68-
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3", version = "1.4.0-alpha14" }
68+
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3", version = "1.4.0-alpha16" }
6969
androidx-compose-material3-adaptive = { group = "androidx.compose.material3.adaptive", name = "adaptive" }
7070
androidx-compose-material3-adaptive-layout = { group = "androidx.compose.material3.adaptive", name = "adaptive-layout" }
7171
androidx-compose-material3-adaptive-navigation = { group = "androidx.compose.material3.adaptive", name = "adaptive-navigation" }
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Thu May 01 14:41:14 CEST 2025
1+
#Sun Jun 22 13:50:16 CEST 2025
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)