1. 所有应用竖屏显示:

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_90;    mLandscapeRotation = Surface.ROTATION_0;    mUpsideDownRotation = Surface.ROTATION_270;    mSeascapeRotation = Surface.ROTATION_180;    } else {    mPortraitRotation = Surface.ROTATION_0;    mLandscapeRotation = Surface.ROTATION_90;    mUpsideDownRotation = Surface.ROTATION_180;    mSeascapeRotation = Surface.ROTATION_270;    }    .......  

2.  所有应用横屏屏显示

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;  //jeff. ROTATION_90;                  mLandscapeRotation = Surface.ROTATION_0;                  mUpsideDownRotation = Surface.ROTATION_90;  //jeff. 270;                  mSeascapeRotation = Surface.ROTATION_180;              }  


更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. 基于PHP实现生成随机水印图片
  2. jsp form表单方法示例
  3. PHP sdk实现在线打包代码示例
  4. JSP request(return String)用法详例
  5. PHP sdk文档处理常用代码示例解析
  6. 插画用PS怎么画?ps画插画的步骤
  7. JSP request(return String)用法详例
  8. PHP如何解决微信文章图片防盗链
  9. JSP request(return String)用法详例
  10. 常用函数类型与常用数据类型的学习