本文整理匯總了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);
}
}
}
}
示例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);
}
示例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";
}