~eliasnaur

~eliasnaur/gio

Last active 2 days ago

~eliasnaur/test

Last active a month ago
View more

Recent activity

Re: [PATCH] app: add Handle type and PlatformHandle() 2 days ago

From Elias Naur to ~eliasnaur/gio

Thank you. Merged.

To git.sr.ht:~eliasnaur/gio
   175144f..5ef176a  master -> master

Re: [PATCH 1/2] cmd/gogio: Android: include jar files from package directory 2 days ago

From Elias Naur to ~eliasnaur/gio

On Fri Oct 18, 2019 at 9:47 AM Gregory Pomerantz wrote:
> On 10/18/19 6:25 AM, Elias Naur wrote:
> 
> >> +		classFiles = append(classFiles, extraJars...)
> > That's it? Nice.
> 
> Yup, d8 handles the rest and you will see your smali files in the 
> resulting apk, sorted into the right places in the class hierarchy. So 
> you can mark your calendar for today and say that something was once 
> easy to do in Android development.
> 

:D

Re: [PATCH 2/2] app: Add Handle type and GetHandle() 2 days ago

From Elias Naur to ~eliasnaur/gio

Start commit subject with lowercase:

app: add Handle...

On Fri Oct 18, 2019 at 9:34 AM Greg Pomerantz wrote:
> On Android, allow access to JVM and Activity context.

s/Activity/Application/

> diff --git a/app/app.go b/app/app.go
> index 71bc57b..e6f7443 100644
> --- a/app/app.go
> +++ b/app/app.go
> @@ -9,6 +9,11 @@ import (

Re: [PATCH 1/2] cmd/gogio: Android: include jar files from package directory 2 days ago

From Elias Naur to ~eliasnaur/gio

Thanks!

To git.sr.ht:~eliasnaur/gio
   bf6741f..175144f  master -> master

Re: [PATCH 1/2] cmd/gogio: Android: include jar files from package directory 2 days ago

From Elias Naur to ~eliasnaur/gio

On Thu Oct 17, 2019 at 11:16 PM Greg Pomerantz wrote:
> Look for *.jar files in package directory for inclusion in
> Andorid .apk file.

Android

> diff --git a/cmd/gogio/androidbuild.go b/cmd/gogio/androidbuild.go
> index 156a99c..57324be 100644
> --- a/cmd/gogio/androidbuild.go
> +++ b/cmd/gogio/androidbuild.go
> @@ -220,6 +220,11 @@ func exeAndroid(tmpDir string, tools *androidTools, bi *buildInfo) (err error) {
>  		}
>  		return nil
>  	})

Re: [PATCH 2/2] app: Add Handle type and GetHandle() 2 days ago

From Elias Naur to ~eliasnaur/gio

On Thu Oct 17, 2019 at 11:16 PM Greg Pomerantz wrote:
> On Android, allow access to JVM and Activity context.
> ---
>  app/app.go                        |  7 +++++++
>  app/internal/window/GioView.java  |  4 ++--
>  app/internal/window/os_android.c  |  2 +-
>  app/internal/window/os_android.go | 17 +++++++++++++----
>  4 files changed, 23 insertions(+), 7 deletions(-)
> 
> diff --git a/app/app.go b/app/app.go
> index 71bc57b..dbcdabf 100644
> --- a/app/app.go
> +++ b/app/app.go
> @@ -9,6 +9,13 @@ import (

Re: "hammering" program using gioui with a fixed fps 2 days ago

From Elias Naur to ~eliasnaur/gio

On Fri Oct 18, 2019 at 11:59 AM  wrote:
> I'd like to measure my program's remaining wall-clock time between 2
> frames using gioui on different devices, assuming a fixed fps rate.
> (Similar to pico8 stat(1) https://pico-8.fandom.com/wiki/Stat )
> Assuming the events need to be handled 30/60/120fps, how can I
> create(?) respective events to be read from app.Window.Events().

I'm unsure exactly what you want to measure, so below are a few suggestions.
Let me know if none of them applies to you.

If you want to render as fast as the display can handle, use op.InvalidateOp
or app.Window.Invalidate after each system.FrameEvent.

If you want to draw at a fixed framerate, use a separate goroutine and call

Re: egl.go:239: nil -> nilEGLContext 3 days ago

From Elias Naur to ~eliasnaur/gio

On Thu Oct 17, 2019 at 1:05 PM  wrote:
> app/internal/window/egl.go:239
> change
> 		if eglCtx == nil {
> to
> 		if eglCtx == nilEGLContext {

Done, thanks.

-- elias

layout.Format, like fmt.Printf for layouts 4 days ago

From Elias Naur to ~eliasnaur/gio

Hi,

I just pushed a change that implements layout.Format, which is to layout what
fmt.Printf is to strings.

The examples are converted in the `layout-format` branch:

	https://git.sr.ht/~eliasnaur/gio/tree/layout-format

Details are in the layout.Format documentation:

	$ go doc gioui.org/layout.Format

As always, layout.Format generates no garbage as long as your format

Re: JNI access for Android 4 days ago

From Elias Naur to ~eliasnaur/gio

On Wed Oct 16, 2019 at 9:25 AM Gregory Pomerantz wrote:
> On 10/16/19 4:11 AM, Elias Naur wrote:
> 
> > On Tue Oct 15, 2019 at 8:16 PM Gregory Pomerantz wrote:
> >> Hi, I have a working fork of Gio that allows apps to access JNI and
> >> custom java classes on Android. There are only a few modifications required:
> > Nice.
> >
> > Generally, I'd like to make it easy to interface with the native side,
> > while not turning Gio into a Gomobile variant.
> >
> > So the first question is: what is this for? If it's for something like
> > access to the GPS or sensors, I think a nice cross-platform
> > gioui.org/io/gps package is harder to do in the short run, but more