Update to newer nswrap, gogio.
This commit is contained in:
@@ -9,8 +9,8 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
|
||||
ndk "git.wow.st/gmp/android-go/android27"
|
||||
"gioui.org/app"
|
||||
ndk "git.wow.st/gmp/android-go/android27"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -22,7 +22,7 @@ func mkHomeDir() {
|
||||
ndk.AndroidLogWrite(ndk.ANDROID_LOG_WARN, tag, msg)
|
||||
msg.Free()
|
||||
|
||||
godir,_ := app.DataDir()
|
||||
godir, _ := app.DataDir()
|
||||
labchan <- fmt.Sprintf("DataDir is %s", godir)
|
||||
|
||||
msg = ndk.CharWithGoString("ok. calling mkdir")
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"image/color"
|
||||
"log"
|
||||
|
||||
"gioui.org/app"
|
||||
"gioui.org/layout"
|
||||
@@ -12,14 +12,14 @@ import (
|
||||
"gioui.org/text/shape"
|
||||
"gioui.org/unit"
|
||||
|
||||
"golang.org/x/image/font/sfnt"
|
||||
"golang.org/x/image/font/gofont/goregular"
|
||||
"golang.org/x/image/font/sfnt"
|
||||
)
|
||||
|
||||
var (
|
||||
face text.Face
|
||||
face text.Face
|
||||
white = color.RGBA{A: 0xff, R: 0xff, G: 0xff, B: 0xff}
|
||||
gray = color.RGBA{A: 0xff, R: 0xb0, G: 0xb0, B: 0xb0}
|
||||
gray = color.RGBA{A: 0xff, R: 0xb0, G: 0xb0, B: 0xb0}
|
||||
black = color.RGBA{A: 0xff, R: 0x00, G: 0x00, B: 0x00}
|
||||
|
||||
labchan chan string
|
||||
@@ -34,7 +34,7 @@ func main() {
|
||||
}
|
||||
|
||||
func diffInsets(x, y app.Insets) bool {
|
||||
return x.Top != y.Top ||
|
||||
return x.Top != y.Top ||
|
||||
x.Bottom != y.Bottom ||
|
||||
x.Left != y.Left ||
|
||||
x.Right != y.Right
|
||||
@@ -49,7 +49,9 @@ func eventloop() {
|
||||
var faces shape.Faces
|
||||
|
||||
regular, err := sfnt.Parse(goregular.TTF)
|
||||
if err != nil { log.Fatal("Cannot parse font.") }
|
||||
if err != nil {
|
||||
log.Fatal("Cannot parse font.")
|
||||
}
|
||||
face = faces.For(regular, unit.Sp(16))
|
||||
|
||||
sysinset := &layout.Inset{}
|
||||
@@ -67,7 +69,7 @@ func eventloop() {
|
||||
for {
|
||||
select {
|
||||
case x := <-labchan:
|
||||
labels = append(labels,&text.Label{Face: face, Text: x})
|
||||
labels = append(labels, &text.Label{Face: face, Text: x})
|
||||
case e := <-w.Events():
|
||||
switch e := e.(type) {
|
||||
case app.DestroyEvent:
|
||||
@@ -90,4 +92,3 @@ func eventloop() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user