Android portrait mode and rotation

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Android portrait mode and rotation

ソリューションへジャンプ
7,315件の閲覧回数
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

ラベル(3)
0 件の賞賛
返信
1 解決策
3,090件の閲覧回数
ToxicAvenger
Contributor III

Hi,

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

Best regards,

Toxic

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
3,091件の閲覧回数
ToxicAvenger
Contributor III

Hi,

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

Best regards,

Toxic

0 件の賞賛
返信
3,090件の閲覧回数
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 件の賞賛
返信
3,090件の閲覧回数
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