Modern Apps git

← Modern-Apps.git

notes: added copy all button to note screen

Commit
99a17d57b6865fa531300a5cb296ac5feae95435
Author
Vayun Mathur <[email protected]>
When
2026-06-02 00:22 UTC (6 months ago)
Parents
9b23550

Diff

notes/src/main/java/com/vayunmathur/notes/ui/NotePage.kt
diff --git a/notes/src/main/java/com/vayunmathur/notes/ui/NotePage.kt b/notes/src/main/java/com/vayunmathur/notes/ui/NotePage.ktindex bba04dc5b3..af01559f45 100644--- a/notes/src/main/java/com/vayunmathur/notes/ui/NotePage.kt+++ b/notes/src/main/java/com/vayunmathur/notes/ui/NotePage.kt@@ -1,10 +1,14 @@ package com.vayunmathur.notes.ui +import android.content.ClipData+import android.content.ClipboardManager+import android.content.Context import android.content.Intent import androidx.activity.compose.BackHandler import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues+import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth@@ -45,6 +49,7 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.TextFieldValue import androidx.compose.ui.unit.dp+import com.vayunmathur.library.ui.IconCopy import com.vayunmathur.library.ui.IconDelete import com.vayunmathur.library.ui.IconEdit import com.vayunmathur.library.ui.IconNavigation@@ -138,11 +143,21 @@ fun NotePage(                 )             }         }, navigationIcon = {-            IconNavigation {-                if (showSearchBar) {-                    showSearchBar = false-                } else {-                    backStack.pop()+            Row {+                IconNavigation {+                    if (showSearchBar) {+                        showSearchBar = false+                    } else {+                        backStack.pop()+                    }+                }+                if (!showSearchBar) {+                    IconButton({+                        val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager+                        clipboard.setPrimaryClip(ClipData.newPlainText("note", note.content))+                    }) {+                        IconCopy()+                    }                 }             }         }, actions = {