当前位置: 首页>>代码示例>>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;未经允许,请勿转载。