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

Rotation #83

Open
2 tasks done
GregoryNative opened this issue Jun 30, 2024 · 1 comment
Open
2 tasks done

Rotation #83

GregoryNative opened this issue Jun 30, 2024 · 1 comment

Comments

@GregoryNative
Copy link

Prerequisites

Description

I want to start emulator rotated to landscape mode. Looks like its not possible right now. But maybe I can programmatically rotate it once web player is loaded? Same way as user click on rotate button.
Is it possible?

@pgivel
Copy link
Contributor

pgivel commented Jul 10, 2024

Hi :) I'm assuming you're using this specific repo and not one of products that are more consumer-ready like Genymotion SaaS or Genymotion Device Image, and that you are using version 3.x. If that's not the case, then some names will not be the same, but the logic stays.

At device renderer creation, you can keep a reference to the instance:

auto renderer = deviceRendererFactory.setupRenderer();

Then you can send an event like this in order to rotate the emulator:

renderer.sendEvent({type: 'ROTATE'});

Warning though: in the next release, the factory will not return the instance directly, but rather a generated API. We'll probably add a simple call in order to do this, but anyway you'll still be able to access the instance like this:

auto rendererAPI = deviceRendererFactory.setupRenderer();
rendererAPI.instance.sendEvent({type: 'ROTATE'});

Hope that helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants