Kindle Fire HD auto orientation is upside down
Hi,
Has anyone else had the problem of the kindle fire HD orientation being upside down when auto orientation is turned on for landscape? Is there anyway to fix it?
Hi,
Has anyone else had the problem of the kindle fire HD orientation being upside down when auto orientation is turned on for landscape? Is there anyway to fix it?
Yes. Also, the original Kindle Fire had the same issue, but for a different reason. There are various works arounds to the issue, but most of those have serious possible side effects. Here’s a description of the general problem:
If the user holds the Kindle Fire the correct way up (either the USB connector is to the right if there is no camera, or the camera is at the top or left if there is a camera), everything works ok.
If the user is holding it the other way up (by the way, I’m just describing landscape here), then on the original Kindle Fire it may work, but on the new ones it will be upside down.
If you do a fix for that, the app will be correct, but if the user turns the device at all, the app becomes upside down, and remains that way until they force quit.
So, after a lot of attempted fixes the only way I found to make it predictable was to turn off auto rotation and to also do a work around for the initial incorrectness.
Now, because the original Kindle Fire has the opposite issue to the later ones, I have to work around its issues in the opposite way. Which means finding a way to detect an old Kindle Fire versus a newer one. One way to do that is to check the screen size.
No other Android device has these issues, so you have to tell whether you should be attempting the work around at all. I use a variable that tells me that the app was bought n the Amazon Appstore for that. If it was, I do the Kindle Fire work arounds. If it wasn’t, I don’t.
The final work around code is like this (the timer is used because at first the orientation may return "unknown"):
private var screenwidth: int = Math.max(Capabilities.screenResolutionX, Capabilities.screenResolutionY);
private var screenheight: int = Math.min(Capabilities.screenResolutionX, Capabilities.screenResolutionY);
private var store:String = "amazon";//amazon or empty;
private var fixtimer:Timer = new Timer(10,200);
if(store=="amazon"){
fixtimer.addEventListener(TimerEvent.TIMER,fixrot);
fixtimer.start();
}
private function fixrot(e: TimerEvent) {
if (stage.deviceOrientation != "unknown") {
fixtimer.stop();
fixtimer.removeEventListener(TimerEvent.TIMER, fixrot);
} else {
return;
}
var oldkindle: Boolean = false;
if (screenwidth == 1024 && screenheight == 600) oldkindle = true;
if (!oldkindle) {
if (stage.deviceOrientation == "rotatedLeft") {
stage.setOrientation("rotatedLeft");
}
} else {
if (stage.deviceOrientation == "rotatedRight") {
stage.setOrientation("rotatedLeft");
} else {
if (stage.deviceOrientation == "rotatedLeft") {
stage.setOrientation("rotatedRight");
}
}
}
}
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.