List of usage examples for android.content.pm ActivityInfo SCREEN_ORIENTATION_PORTRAIT
int SCREEN_ORIENTATION_PORTRAIT
To view the source code for android.content.pm ActivityInfo SCREEN_ORIENTATION_PORTRAIT.
Click Source Link
portrait
in the android.R.attr#screenOrientation attribute. From source file:Main.java
public static void setPortrait(Activity activity) { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); }
From source file:Main.java
public static void setOrientacaoVertical(Activity context) { context.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); }
From source file:Main.java
public static void setOrientationVertical(Activity context) { context.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); }
From source file:Main.java
public static void setRequestedOrientationPORTRAIT(Activity act) { act.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); }
From source file:Main.java
public static boolean isPortrait(Activity activity) { return activity.getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; }
From source file:Main.java
public static void setFragmentOrientationToPortrait(FragmentActivity fragmentActivity) { fragmentActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); }
From source file:Main.java
public static void setPortraitOrientation(final Activity activity, final boolean portrait) { if (portrait) { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } else {//from w ww. j a v a 2 s . c o m activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } }
From source file:Main.java
public static void toggleOrientation(Context context, boolean enable) { if (!enable) { ((Activity) context).setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } else {/*from w w w . j av a2 s .c o m*/ ((Activity) context).setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); } }
From source file:Main.java
public static void rotateScreen(Activity activity) { if (activity.getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); } else {// ww w . j a v a 2 s. c o m activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } }
From source file:Main.java
/** * Sets the orientation enabled to true or false in this case true if tablet false if mobile device * @param activity/*from www .j a va2 s .co m*/ */ public static void setProtraitOrientationEnabled(Activity activity) { if (!(isScreenXLarge(activity))) { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } }