Deprecated: this functionality has been merged into Gio
Allows to set the display refresh rate in Gio apps on Android. Some manufacturers limit apps using SurfaceView to 60hz, this library can bring it back and have that scroll be smooth.
Run go get github.com/ilidemi/giorefreshrate
Call giorefreshrate.PreferHighRefreshRate()
or giorefreshrate.PreferLowRefreshRate()
before the event loop and provide giorefreshrate
access to the Window events:
+ giorefreshrate.PreferHighRefreshRate()
for e := range w.Events() { // Gio main event loop
+ giorefreshrate.ListenEvents(e, w)
switch e := e.(type) {
// ...
}
}
That's it! The refresh rate will be the highest or lowest supported for the current display resolution.
Uses the same approach as flutter_displaymode.