Skip to content

Open-source Android PDF and document toolkit with PDF tools, Office viewing, XLSX editing, scanning, and image editing. Built with Kotlin and Jetpack Compose.

3.0.0-beta.11: Today's sky without the mock's dock, file menus on plain menu glass

chethan6167272f9d52daa
diff --git a/android/app/src/main/java/com/chethan616/clearpdf/ui/desk/Common.kt b/android/app/src/main/java/com/chethan616/clearpdf/ui/desk/Common.kt
index 9ca48d3..963c739 100644
--- a/android/app/src/main/java/com/chethan616/clearpdf/ui/desk/Common.kt
+++ b/android/app/src/main/java/com/chethan616/clearpdf/ui/desk/Common.kt
@@ -203,7 +203,7 @@ fun SettingsButton(vm: AppViewModel) {
/**
* A file in a list: its paper, its name, when and how big, its star (a tap stars or unstars it, there
- * and then) and its ⋯, whose glass grows into the file's menu ([FileMenu]).
+ * and then) and its ⋯, which opens the file's menu ([FileMenu]).
*/
@Composable
fun FileListItem(vm: AppViewModel, r: FileRow, recent: Boolean, modifier: Modifier = Modifier) {
@@ -242,8 +242,6 @@ fun FileListItem(vm: AppViewModel, r: FileRow, recent: Boolean, modifier: Modifi
Box(
Modifier.size(44.dp)
.onGloballyPositioned { dots = it.boundsInWindow() }
- // stepped aside while its glass is the menu (the menu's own ⋯ is drawn there instead)
- .drawWithContent { if (!com.chethan616.clearpdf.ui.glass.MorphAnchors.hides(dots)) drawContent() }
.pressable({ if (vm.fileMenu == null) vm.fileMenu = FileMenuAt(r, recent, dots) }, pressedScale = 0.85f),
contentAlignment = Alignment.Center,
) {
diff --git a/android/app/src/main/java/com/chethan616/clearpdf/ui/desk/FileMenu.kt b/android/app/src/main/java/com/chethan616/clearpdf/ui/desk/FileMenu.kt
index f033b45..101ce1e 100644
--- a/android/app/src/main/java/com/chethan616/clearpdf/ui/desk/FileMenu.kt
+++ b/android/app/src/main/java/com/chethan616/clearpdf/ui/desk/FileMenu.kt
@@ -49,8 +49,6 @@ import com.chethan616.clearpdf.ui.glass.GlassMenuItem
import com.chethan616.clearpdf.ui.glass.GlassMotion
import com.chethan616.clearpdf.ui.glass.GlassTextField
import com.chethan616.clearpdf.ui.glass.LocalGlassInk
-import com.chethan616.clearpdf.ui.glass.MorphAnchors
-import com.chethan616.clearpdf.ui.glass.MorphButtonSurface
import com.chethan616.clearpdf.ui.glass.MorphMenuRow
import com.chethan616.clearpdf.ui.glass.RoundedRectangle
import com.chethan616.clearpdf.ui.glass.pressable
@@ -80,34 +78,27 @@ fun cardMenuAnchor(bounds: Rect, density: androidx.compose.ui.unit.Density, side
}
/**
- * A file's menu as liquid glass, the same glass every round button's menu is: it grows out of the
- * file's ⋯ (or the corner of a long-pressed card) in the morph's four states and settles with the
- * user's bounce. The file at the top with its star, one tap to star or unstar right there (the menu
+ * A file's menu on the app's frosted menu glass, unfolding beside the file's ⋯ (or the corner of a
+ * long-pressed card). The file at the top with its star, one tap to star or unstar right there (the menu
* stays open and the star pops); four quick actions; then its tools. A row closes the menu, which
* folds back into the ⋯ before the row's action runs.
*/
@Composable
fun FileMenu(vm: AppViewModel, at: FileMenuAt, onGone: () -> Unit) {
- var open by remember(at) { mutableStateOf(true) }
- val dots: @Composable () -> Unit = {
- val ink = LocalGlassInk.current
- Icon(LucideIcons.EllipsisVertical, null, tint = if (ink.isSpecified) ink else clear.inkSoft, modifier = Modifier.size(20.dp))
- }
- // the ⋯ stands in for a round button: the glass folds back into it, and it steps aside meanwhile
- DisposableEffect(at.anchor, at.ghost) {
- if (!at.ghost) MorphAnchors.register(at.anchor, dots)
- onDispose { if (!at.ghost) MorphAnchors.unregister(at.anchor) }
+ // the app's glass popover, unfolding beside what was pressed (no glass button grows out of the ⋯)
+ var chosen by remember(at) { mutableStateOf(false) }
+ com.chethan616.clearpdf.ui.glass.GlassMenuLayout(at.anchor, onDismiss = onGone, width = 292.dp, maxHeight = 600.dp) {
+ Spacer(Modifier.height(6.dp))
+ FileMenuBody(vm, at.row, at.recent, chosen) { action ->
+ if (!chosen) {
+ chosen = true
+ onGone()
+ // once the menu has folded away (as GlassMenu's rows wait)
+ android.os.Handler(android.os.Looper.getMainLooper()).postDelayed({ action() }, 220L)
+ }
+ }
+ Spacer(Modifier.height(6.dp))
}
- MorphButtonSurface(
- anchor = at.anchor,
- open = open,
- onDismiss = { open = false },
- onGone = onGone,
- menuWidth = 292.dp,
- maxHeight = 600.dp,
- icon = dots,
- ghost = at.ghost,
- ) { shut, choose -> FileMenuBody(vm, at.row, at.recent, shut, choose) }
}
@Composable
diff --git a/android/app/src/main/res/drawable-nodpi/sky_today.png b/android/app/src/main/res/drawable-nodpi/sky_today.png
index 3627dab..9869781 100644
Binary files a/android/app/src/main/res/drawable-nodpi/sky_today.png and b/android/app/src/main/res/drawable-nodpi/sky_today.png differ
diff --git a/android/gradle.properties b/android/gradle.properties
index 0acce17..969a1ef 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -12,5 +12,5 @@ artefact.abis=arm64-v8a,x86_64
# The app's version and its version code (before the ABI digit: see app/build.gradle.kts, the build
# checks the two agree). Set both to the release's before tagging it: the release workflow refuses a
# tag that differs, and F-Droid's update check reads them from here.
-artefact.version=3.0.0-beta.10
-artefact.versionCode=3000010
+artefact.version=3.0.0-beta.11
+artefact.versionCode=3000011
diff --git a/fastlane/metadata/android/en-US/changelogs/30000110.txt b/fastlane/metadata/android/en-US/changelogs/30000110.txt
new file mode 100644
index 0000000..a96664e
--- /dev/null
+++ b/fastlane/metadata/android/en-US/changelogs/30000110.txt
@@ -0,0 +1,10 @@
+Widgets, a deck of thoughts, cards you arrange
+* To-Do widget: the real glass card, ticks land at once; turn to the next list
+* Starred widget; widget taps open Files
+* Star any file from its row; a new file menu
+* Drag desk cards where you want them
+* Bold or italic only the selected words
+* Thought of the day and Today pages
+* New typeface; menus bounce with your Motion setting
+* Scan filters preview before saving
+* A new document info sheet
diff --git a/fastlane/metadata/android/en-US/changelogs/30000111.txt b/fastlane/metadata/android/en-US/changelogs/30000111.txt
new file mode 100644
index 0000000..a96664e
--- /dev/null
+++ b/fastlane/metadata/android/en-US/changelogs/30000111.txt
@@ -0,0 +1,10 @@
+Widgets, a deck of thoughts, cards you arrange
+* To-Do widget: the real glass card, ticks land at once; turn to the next list
+* Starred widget; widget taps open Files
+* Star any file from its row; a new file menu
+* Drag desk cards where you want them
+* Bold or italic only the selected words
+* Thought of the day and Today pages
+* New typeface; menus bounce with your Motion setting
+* Scan filters preview before saving
+* A new document info sheet
diff --git a/fastlane/metadata/android/en-US/changelogs/30000112.txt b/fastlane/metadata/android/en-US/changelogs/30000112.txt
new file mode 100644
index 0000000..a96664e
--- /dev/null
+++ b/fastlane/metadata/android/en-US/changelogs/30000112.txt
@@ -0,0 +1,10 @@
+Widgets, a deck of thoughts, cards you arrange
+* To-Do widget: the real glass card, ticks land at once; turn to the next list
+* Starred widget; widget taps open Files
+* Star any file from its row; a new file menu
+* Drag desk cards where you want them
+* Bold or italic only the selected words
+* Thought of the day and Today pages
+* New typeface; menus bounce with your Motion setting
+* Scan filters preview before saving
+* A new document info sheet
diff --git a/fastlane/metadata/android/en-US/changelogs/30000113.txt b/fastlane/metadata/android/en-US/changelogs/30000113.txt
new file mode 100644
index 0000000..a96664e
--- /dev/null
+++ b/fastlane/metadata/android/en-US/changelogs/30000113.txt
@@ -0,0 +1,10 @@
+Widgets, a deck of thoughts, cards you arrange
+* To-Do widget: the real glass card, ticks land at once; turn to the next list
+* Starred widget; widget taps open Files
+* Star any file from its row; a new file menu
+* Drag desk cards where you want them
+* Bold or italic only the selected words
+* Thought of the day and Today pages
+* New typeface; menus bounce with your Motion setting
+* Scan filters preview before saving
+* A new document info sheet
diff --git a/fastlane/metadata/android/en-US/changelogs/30000114.txt b/fastlane/metadata/android/en-US/changelogs/30000114.txt
new file mode 100644
index 0000000..a96664e
--- /dev/null
+++ b/fastlane/metadata/android/en-US/changelogs/30000114.txt
@@ -0,0 +1,10 @@
+Widgets, a deck of thoughts, cards you arrange
+* To-Do widget: the real glass card, ticks land at once; turn to the next list
+* Starred widget; widget taps open Files
+* Star any file from its row; a new file menu
+* Drag desk cards where you want them
+* Bold or italic only the selected words
+* Thought of the day and Today pages
+* New typeface; menus bounce with your Motion setting
+* Scan filters preview before saving
+* A new document info sheet