summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-01-25 20:03:12 +0200
committerPaul Buetow <paul@buetow.org>2024-01-25 20:03:12 +0200
commit61275a73f3d1d6559fca3c706b4dba30f326f3e9 (patch)
treeac48a98a3b360400942a0916c385b757aba9a6fd
parent5d8a28040830bdd1c05809bae298602008e275da (diff)
focus input window
-rw-r--r--AndroidManifest.xml12
-rw-r--r--main.go12
2 files changed, 3 insertions, 21 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 6a0e346..2fd280f 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -6,16 +6,4 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
- <application
- android:allowBackup="true"
- android:label="quicklogger">
-
- <activity android:name="org.golang.app.GoNativeActivity">
- <meta-data android:name="android.app.lib_name" android:value="npc" />
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
- </application>
</manifest>
diff --git a/main.go b/main.go
index 0bc5b57..9292e9a 100644
--- a/main.go
+++ b/main.go
@@ -1,11 +1,10 @@
package main
import (
- "crypto/sha256"
- "encoding/hex"
"fmt"
"log"
"os"
+ "time"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
@@ -24,7 +23,7 @@ func main() {
button := widget.NewButton("Log text", func() {
content := input.Text
- filename := fmt.Sprintf("%s/quicklog-%s.md", storageDir, getSHA256Hash(content))
+ filename := fmt.Sprintf("%s/quicklog-%d.md", storageDir, time.Now().Unix())
err := os.WriteFile(filename, []byte(content), 0644)
if err != nil {
log.Println("Error writing to file:", err)
@@ -40,11 +39,6 @@ func main() {
button,
))
w.Resize(fyne.NewSize(200, 100))
+ w.Canvas().Focus(input)
w.ShowAndRun()
}
-
-func getSHA256Hash(text string) string {
- hasher := sha256.New()
- hasher.Write([]byte(text))
- return hex.EncodeToString(hasher.Sum(nil))
-}