美文网首页
android让所有应用都横屏显示

android让所有应用都横屏显示

作者: 辉色投像 | 来源:发表于2020-03-12 10:07 被阅读0次

frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java    

  public int rotationForOrientationLw(int orientation, int lastRotation,  

            boolean displayEnabled) {  

            // Initialize the rotation angles for each orientation once.  

            Display d = ((WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE))  

                    .getDefaultDisplay();  

            if (d.getWidth() > d.getHeight()) {  

                mPortraitRotation = Surface.ROTATION_0; 

                mLandscapeRotation = Surface.ROTATION_0;  

                mUpsideDownRotation = Surface.ROTATION_90;   

                mSeascapeRotation = Surface.ROTATION_180;  

            }  

相关文章

网友评论

      本文标题:android让所有应用都横屏显示

      本文链接:https://www.haomeiwen.com/subject/wbkyjhtx.html