當前位置: 首頁>>代碼示例>>Java>>正文


Java ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED屬性代碼示例

本文整理匯總了Java中android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED屬性的典型用法代碼示例。如果您正苦於以下問題:Java ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED屬性的具體用法?Java ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED怎麽用?Java ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.content.pm.ActivityInfo的用法示例。


在下文中一共展示了ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED屬性的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: callActivityOnCreate

@Override
public void callActivityOnCreate(Activity activity, Bundle icicle) {
       VirtualCore.get().getComponentDelegate().beforeActivityCreate(activity);
	IBinder token = mirror.android.app.Activity.mToken.get(activity);
	ActivityClientRecord r = VActivityManager.get().getActivityRecord(token);
	if (r != null) {
           r.activity = activity;
       }
	ContextFixer.fixContext(activity);
	ActivityFixer.fixActivity(activity);
	ActivityInfo info = null;
	if (r != null) {
           info = r.info;
       }
	if (info != null) {
           if (info.theme != 0) {
               activity.setTheme(info.theme);
           }
           if (activity.getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
                   && info.screenOrientation != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
               activity.setRequestedOrientation(info.screenOrientation);
           }
       }
	super.callActivityOnCreate(activity, icicle);
	VirtualCore.get().getComponentDelegate().afterActivityCreate(activity);
}
 
開發者ID:codehz,項目名稱:container,代碼行數:26,代碼來源:AppInstrumentation.java

示例2: setScreenOrientation

@SuppressWarnings("WrongConstant")
@Override
public void setScreenOrientation(int orientation) {
    // if the orientation is unspecified we set it to activity default
    if (orientation == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
        setRequestedOrientation(getDefaultOrientation());
    } else {
        setRequestedOrientation(orientation);
    }
}
 
開發者ID:Fueled,項目名稱:flowr,代碼行數:10,代碼來源:AbstractFlowrActivity.java

示例3: VanGoghBuilder

/**
 * Constructs a new specification builder on the context.
 *
 * @param vanGogh  a requester context wrapper.
 * @param vanMediaType MIME type set to select.
 */
VanGoghBuilder(VanGogh vanGogh, @NonNull Set<VanMediaType> vanMediaType) {
    this.vanGogh = vanGogh;
    mVanMediaType = vanMediaType;
    vanConfig = VanConfig.getCleanInstance();
    mOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
}
 
開發者ID:GitPhoenix,項目名稱:VanGogh,代碼行數:12,代碼來源:VanGoghBuilder.java

示例4: callActivityOnCreate

@Override
public void callActivityOnCreate(Activity activity, Bundle icicle) {
    if (icicle != null) {
        BundleCompat.clearParcelledData(icicle);
    }
    VirtualCore.get().getComponentDelegate().beforeActivityCreate(activity);
    IBinder token = mirror.android.app.Activity.mToken.get(activity);
    ActivityClientRecord r = VActivityManager.get().getActivityRecord(token);
    if (r != null) {
        r.activity = activity;
    }
    ContextFixer.fixContext(activity);
    ActivityFixer.fixActivity(activity);
    ActivityInfo info = null;
    if (r != null) {
        info = r.info;
    }
    if (info != null) {
        if (info.theme != 0) {
            activity.setTheme(info.theme);
        }
        if (activity.getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
                && info.screenOrientation != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
            activity.setRequestedOrientation(info.screenOrientation);
        }
    }
    super.callActivityOnCreate(activity, icicle);
    VirtualCore.get().getComponentDelegate().afterActivityCreate(activity);
}
 
開發者ID:coding-dream,項目名稱:TPlayer,代碼行數:29,代碼來源:AppInstrumentation.java

示例5: getRequestedOrientation

/**
 * Return the current requested orientation of the activity.  This will
 * either be the orientation requested in its component's manifest, or
 * the last requested orientation given to
 * {@link #setRequestedOrientation(int)}.
 *
 * @return Returns an orientation constant as used in
 * {@link ActivityInfo#screenOrientation ActivityInfo.screenOrientation}.
 */
@ActivityInfo.ScreenOrientation
public int getRequestedOrientation() {
    if (mParent == null) {
        try {
            return ActivityManagerNative.getDefault()
                    .getRequestedOrientation(mToken);
        } catch (RemoteException e) {
            // Empty
        }
    } else {
        return mParent.getRequestedOrientation();
    }
    return ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
}
 
開發者ID:JessYanCoding,項目名稱:ProgressManager,代碼行數:23,代碼來源:a.java

示例6: getCameraPictureOrientation

private int getCameraPictureOrientation() {
  if (getActivity().getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
    outputOrientation = getCameraPictureRotation(getActivity().getWindowManager()
                                                              .getDefaultDisplay()
                                                              .getOrientation());
  } else if (getCameraInfo().facing == CameraInfo.CAMERA_FACING_FRONT) {
    outputOrientation = (360 - displayOrientation) % 360;
  } else {
    outputOrientation = displayOrientation;
  }

  return outputOrientation;
}
 
開發者ID:XecureIT,項目名稱:PeSanKita-android,代碼行數:13,代碼來源:CameraView.java

示例7: setOrientation

/**
 * 設置橫豎屏
 * <p>
 * 參數:
 * orientation:1表示豎屏,0表示橫屏,其他表示跟隨係統
 */
public static void setOrientation(IQuickFragment webLoader, WebView wv, JSONObject param, Callback callback) {
    int orientation = param.optInt("orientation", ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    if (orientation >= ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED && orientation <= ActivityInfo.SCREEN_ORIENTATION_LOCKED) {
        webLoader.getPageControl().getActivity().setRequestedOrientation(orientation);
        callback.applySuccess();
    } else {
        callback.applyFail("orientation值超出範圍,請設置-1到14");
    }
}
 
開發者ID:quickhybrid,項目名稱:quickhybrid-android,代碼行數:15,代碼來源:DeviceApi.java

示例8: 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

示例9: needOrientationRestriction

public boolean needOrientationRestriction() {
    return orientation != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
}
 
開發者ID:zhihu,項目名稱:Matisse,代碼行數:3,代碼來源:SelectionSpec.java

示例10: getDefaultRequestedOrientation

@Override
public int getDefaultRequestedOrientation() {
    return ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
}
 
開發者ID:angcyo,項目名稱:RLibrary,代碼行數:4,代碼來源:UIIDialogImpl.java

示例11: getDefaultOrientation

protected int getDefaultOrientation() {
    return ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
}
 
開發者ID:Fueled,項目名稱:flowr,代碼行數:3,代碼來源:AbstractFlowrActivity.java


注:本文中的android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。