当前位置: 首页>>代码示例>>Java>>正文


Java ActivityInfo.SCREEN_ORIENTATION_USER属性代码示例

本文整理汇总了Java中android.content.pm.ActivityInfo.SCREEN_ORIENTATION_USER属性的典型用法代码示例。如果您正苦于以下问题:Java ActivityInfo.SCREEN_ORIENTATION_USER属性的具体用法?Java ActivityInfo.SCREEN_ORIENTATION_USER怎么用?Java ActivityInfo.SCREEN_ORIENTATION_USER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.content.pm.ActivityInfo的用法示例。


在下文中一共展示了ActivityInfo.SCREEN_ORIENTATION_USER属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onConfigurationChanged

@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
    //如果旋转了就全屏
    if (mIsPlay && !mIsPause) {
        if (newConfig.orientation == ActivityInfo.SCREEN_ORIENTATION_USER) {
            if (!mPlayer.isIfCurrentIsFullscreen()) {
                mPlayer.startWindowFullscreen(MovieDetailActivity.this, true, true);
            }
        } else {
            //新版本isIfCurrentIsFullscreen的标志位内部提前设置了,所以不会和手动点击冲突
            if (mPlayer.isIfCurrentIsFullscreen()) {
                StandardGSYVideoPlayer.backFromWindowFull(this);
            }
            if (mOrientationUtils != null) {
                mOrientationUtils.setEnable(true);
            }
        }
    }
}
 
开发者ID:KnowledgeBegger,项目名称:MyEyepetizer,代码行数:20,代码来源:MovieDetailActivity.java

示例2: onCreate

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_gallery);

    int orientation;
    if (Build.VERSION.SDK_INT < 18) {
        orientation = ActivityInfo.SCREEN_ORIENTATION_USER;
    } else {
        orientation = ActivityInfo.SCREEN_ORIENTATION_LOCKED;
    }

    setRequestedOrientation(orientation);
    changeFragment(FRAGMENT_GRID);
}
 
开发者ID:ficklerobot,项目名称:grid-video-viewer,代码行数:15,代码来源:GalleryActivity.java

示例3: unspecified

/**
 * The requested screen orientation. Commonly used values are
    unspecified (-1), landscape (0), portrait (1), sensor (4), and user (2).  " +
    "See the Android developer documentation for ActivityInfo.Screen_Orientation for the " +
    "complete list of possible settings.
 *
 * ScreenOrientation property getter method.
 *
 * @return  screen orientation
 */
@SimpleProperty(category = PropertyCategory.APPEARANCE,
    description = "The requested screen orientation, specified as a text value.  " +
    "Commonly used values are " +
    "landscape, portrait, sensor, user and unspecified.  " +
    "See the Android developer documentation for ActivityInfo.Screen_Orientation for the " +
    "complete list of possible settings.")
public String ScreenOrientation() {
  switch (getRequestedOrientation()) {
    case ActivityInfo.SCREEN_ORIENTATION_BEHIND:
      return "behind";
    case ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE:
      return "landscape";
    case ActivityInfo.SCREEN_ORIENTATION_NOSENSOR:
      return "nosensor";
    case ActivityInfo.SCREEN_ORIENTATION_PORTRAIT:
      return "portrait";
    case ActivityInfo.SCREEN_ORIENTATION_SENSOR:
      return "sensor";
    case ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED:
      return "unspecified";
    case ActivityInfo.SCREEN_ORIENTATION_USER:
      return "user";
    case 10: // ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR
      return "fullSensor";
    case 8: // ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE
      return "reverseLandscape";
    case 9: // ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT
      return "reversePortrait";
    case 6: // ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
      return "sensorLandscape";
    case 7: // ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT
      return "sensorPortrait";
  }

  return "unspecified";
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:46,代码来源:Form.java


注:本文中的android.content.pm.ActivityInfo.SCREEN_ORIENTATION_USER属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。