Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/mobile/app: config.Event delivery is not reliable (android) #11741

Closed
hyangah opened this issue Jul 16, 2015 · 4 comments
Closed

x/mobile/app: config.Event delivery is not reliable (android) #11741

hyangah opened this issue Jul 16, 2015 · 4 comments

Comments

@hyangah
Copy link
Contributor

@hyangah hyangah commented Jul 16, 2015

I slightly modified the basic app https://go-review.googlesource.com/#/c/12330/
to demonstrate this problem.

Background color is red if Width > Height.
Background color is white otherwise.

Keep rotating and touching the device. It's somewhat non-deterministic.
This prevents correct screen geometry computation.

go version devel +adb1e03 Thu Jul 16 20:56:23 2015 +0000 darwin/amd64
golang.org/x/mobile: 136fa9bb
test devices: android nexus 7 (android 4.4.4 cyanogenMod), moto X (android 4.4.4)

@crawshaw @nigeltao

@crawshaw
Copy link
Contributor

@crawshaw crawshaw commented Jul 17, 2015

The documentation is not clear on what we should be using.

Non-NativeActivity users talk about listening for onSurfaceChanged, which seems to translate into onNativeWindowResized, onNativeWindowCreated, and onNativeWindowDestroyed.

Right now we listen for onNativeWindowRedrawNeeded, which is onSurfaceRedrawNeeded.

Tomorrow I'll try to replicate the missing events, and see if switching to listening for onNativeWindowResized helps.

@crawshaw
Copy link
Contributor

@crawshaw crawshaw commented Jul 17, 2015

I put some logging into example/basic, and what I'm seeing (on a Galaxy Nexus) is reliable event delivery, but sometimes the width/height are not updated.

Also following the NativeActivity source through to the platform docs suggests onNativeWindowRedrawNeeded should be called for orientation changes, so it's a safe place to listen. Not sure yet what's wrong with querySurfaceWidthAndHeight.

@crawshaw
Copy link
Contributor

@crawshaw crawshaw commented Jul 17, 2015

onNativeWindowResized is flaky. Not a safe source of rotation events.

@gopherbot
Copy link

@gopherbot gopherbot commented Jul 20, 2015

CL https://golang.org/cl/12381 mentions this issue.

@golang golang locked and limited conversation to collaborators Aug 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.