Android portrait mode and rotation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Android portrait mode and rotation

Jump to solution
6,899 Views
ToxicAvenger
Contributor III

Hello,

In my project screen should be in portrait mode, not in landscape like in default i.MX53 with seiko 4.3 screen.

To get this mode i set in init.rc:

setprop ro.FSL_LANDSCAPE_MODE 0
setprop ro.sf.hwrotation 270

Now orientation is ok, but I have problems with automatic rotation.

When I turn on automatic rotation, my screen is rotated 90 anti clockwise.

How to get proper screen rotation and working automatic rotation?

Best regards,

Toxic

Labels (3)
0 Kudos
Reply
1 Solution
2,674 Views
ToxicAvenger
Contributor III

Hi,

Problem solved. Axis was wrong, X and Y was mismatched and X was reverted.

Best regards,

Toxic

View solution in original post

0 Kudos
Reply
3 Replies
2,675 Views
ToxicAvenger
Contributor III

Hi,

Problem solved. Axis was wrong, X and Y was mismatched and X was reverted.

Best regards,

Toxic

0 Kudos
Reply
2,674 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello,Toxic,

      If you want screen to be rotated automatically during it's working, A g-sensor(such as,MMA7660,MMA8451,MMA8452) should be desined on your board.

    

Regards,

Weidong

0 Kudos
Reply
2,674 Views
ToxicAvenger
Contributor III

Hello,

The problem is that I have working sensor. Screen is rotating, but rotation angle is wrong for 90 degress anti clockwise (270 degrees clockwise). I set default orientation in init.rc:

setprop ro.FSL_LANDSCAPE_MODE 0

setprop ro.sf.hwrotation 270

And i have portrait mode. The problem is that sensor is rotating my device on some angle + 270 degrees.

I would like to have portrait screen and normal rotation. I dont know where to add such functionality.

Maybe I should change SurfaceFlinger or WindowManagerService, or mayby there is some option to rotate framebuffer?

Regards,

Toxic