當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。