~beikege


#400 body2 中文编码问题 a month ago

Comment by ~beikege on ~eliasnaur/gio

~whereswaldon Thank you

#446 gesture.Drag nested layout.List to scroll always triggers drag event 3 months ago

Comment by ~beikege on ~eliasnaur/gio

https://imgur.com/a/XJ0mJbM

Look closely at the border, I'm not sure it's expected behavior.

#446 gesture.Drag nested layout.List to scroll always triggers drag event 3 months ago

Ticket created by ~beikege on ~eliasnaur/gio

android demo:

https://go.dev/play/p/Yk0hzgDS30J

gesture.Drag nested layouts.List scrolling always triggers invalid drag events. This causes a slight jitter of a few pixels. Invalid event data should be discarded before valid drag events are confirmed.

https://github.com/gioui/gio/blob/276b7eefdd65bf6eb2326945ef074c827541b8a2/gesture/gesture.go#L411-L413

if diff.X*diff.X+diff.Y*diff.Y > float32(slop*slop) {
	d.grab = true
} else {
	continue
}

#400 body2 中文编码问题 4 months ago

Comment by ~beikege on ~eliasnaur/gio

The problem here is not a garbled code problem, the demo just uses the Japanese font for convenience.

You can drag and zoom the window left and right, you will find that 1 character will be lost at the end of the line.

#409 [Bug] GioView.java:51: error: cannot find symbol import android.view.inputmethod.SurroundingText 7 months ago

Comment by ~beikege on ~eliasnaur/gio

https://gioui.org/doc/install/android

OpenJDK 1.8

Android SDK versions >= 31

#408 [Missing] sysytem.CommandEvent missing 7 months ago

Comment by ~beikege on ~eliasnaur/gio

package main

import (
	"log"
	"os"

	"gioui.org/app"
	"gioui.org/io/key"
	"gioui.org/io/system"
	"gioui.org/layout"
	"gioui.org/op"
	"gioui.org/unit"
)

func main() {
	go func() {
		size := app.Size(unit.Dp(300), unit.Dp(480))
		w := app.NewWindow(size)
		w.Perform(system.ActionCenter)
		err := run(w)
		if err != nil {
			log.Fatal(err)
		}
		os.Exit(0)
	}()
	app.Main()
}

func run(w *app.Window) error {
	var ops op.Ops
	for {
		select {
		case e := <-w.Events():
			switch e := e.(type) {
			case system.DestroyEvent:
				return e.Err
			case system.FrameEvent:
				gtx := layout.NewContext(&ops, e)

				for _, event := range gtx.Events(w) {
					switch e := event.(type) {
					case key.Event:
						log.Printf("%#+v", e)
					}
				}
				key.InputOp{Tag: w, Keys: key.Set(key.NameBack)}.Add(gtx.Ops)

				e.Frame(gtx.Ops)
			}
		}
	}
}

#405 system.ActionCenter is not centered 7 months ago

Comment by ~beikege on ~eliasnaur/gio

Thanks

#405 system.ActionCenter is not centered 7 months ago

Ticket created by ~beikege on ~eliasnaur/gio

go 1.18

Windows 10

package main

import (
	"log"
	"os"

	"gioui.org/app"
	"gioui.org/io/system"
	"gioui.org/layout"
	"gioui.org/op"
	"gioui.org/unit"
)

func main() {
	go func() {
		size := app.Size(unit.Dp(300), unit.Dp(480))
		w := app.NewWindow(size)
		w.Perform(system.ActionCenter)
		err := run(w)
		if err != nil {
			log.Fatal(err)
		}
		os.Exit(0)
	}()
	app.Main()
}

func run(w *app.Window) error {
	var ops op.Ops
	for {
		select {
		case e := <-w.Events():
			switch e := e.(type) {
			case system.DestroyEvent:
				return e.Err
			case system.FrameEvent:
				gtx := layout.NewContext(&ops, e)

				e.Frame(gtx.Ops)
			}
		}
	}
}

#400 body2 中文编码问题 7 months ago

Comment by ~beikege on ~eliasnaur/gio

#389 scroll focus does not scroll to the correct position 8 months ago

Comment by ~beikege on ~eliasnaur/gio

Thank you!👍