List of usage examples for android.content.pm ActivityInfo SCREEN_ORIENTATION_LANDSCAPE
int SCREEN_ORIENTATION_LANDSCAPE
To view the source code for android.content.pm ActivityInfo SCREEN_ORIENTATION_LANDSCAPE.
Click Source Link
landscape
in the android.R.attr#screenOrientation attribute. From source file:com.shreymalhotra.crazyflieserver.MainActivity.java
@Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); }
From source file:com.mozilla.SUTAgentAndroid.SUTAgentAndroid.java
public void fixScreenOrientation() { setRequestedOrientation(//from w w w . j av a 2s . c o m (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) ? ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); }
From source file:com.Beat.RingdroidEditActivity.java
/** * Called when the orientation changes and/or the keyboard is shown * or hidden. We don't need to recreate the whole activity in this * case, but we do need to redo our layout somewhat. */// w w w .ja v a 2 s. c om @Override public void onConfigurationChanged(Configuration newConfig) { final int saveZoomLevel = mWaveformView.getZoomLevel(); super.onConfigurationChanged(newConfig); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); loadGui(); enableZoomButtons(); mHandler.postDelayed(new Runnable() { public void run() { mStartMarker.requestFocus(); markerFocus(mStartMarker); mWaveformView.setZoomLevel(saveZoomLevel); mWaveformView.recomputeHeights(mDensity); updateDisplay(); } }, 500); }
From source file:com.example.administrator.mywebviewdrawsign.SysWebView.java
public void showCustomView(View view, WebChromeClient.CustomViewCallback callback) { // This code is adapted from the original Android Browser code, licensed under the Apache License, Version 2.0 LogUtils.d("showing Custom View"); // if a view already exists then immediately terminate the new one if (mCustomView != null) { callback.onCustomViewHidden();//from www. ja va 2 s . com return; } // Store the view and its callback for later (to kill it properly) mCustomView = view; mCustomViewCallback = callback; // Add the custom view to its container. ViewGroup parent = (ViewGroup) this.getParent(); background = parent.getBackground(); parent.setBackground(new ColorDrawable(Color.BLACK)); parent.addView(view, COVER_SCREEN_GRAVITY_CENTER); // Hide the content view. this.setVisibility(View.GONE); // Finally show the custom view container. parent.setVisibility(View.VISIBLE); parent.bringToFront(); if (objects != null && objects.length > 0) { for (Object obj : objects) { if (obj instanceof View) { ((View) obj).setVisibility(View.GONE); } else if (obj instanceof Fragment) { ((Fragment) obj).getView().setVisibility(View.GONE); } } } ((Activity) mContext).setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); ((Activity) mContext).getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); }
From source file:kr.wdream.storyshop.AndroidUtilities.java
public static void lockOrientation(Activity activity) { if (activity == null || prevOrientation != -10) { return;/* w ww . jav a 2 s . c o m*/ } try { prevOrientation = activity.getRequestedOrientation(); WindowManager manager = (WindowManager) activity.getSystemService(Activity.WINDOW_SERVICE); if (manager != null && manager.getDefaultDisplay() != null) { int rotation = manager.getDefaultDisplay().getRotation(); int orientation = activity.getResources().getConfiguration().orientation; if (rotation == Surface.ROTATION_270) { if (orientation == Configuration.ORIENTATION_PORTRAIT) { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } else { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE); } } else if (rotation == Surface.ROTATION_90) { if (orientation == Configuration.ORIENTATION_PORTRAIT) { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT); } else { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); } } else if (rotation == Surface.ROTATION_0) { if (orientation == Configuration.ORIENTATION_LANDSCAPE) { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); } else { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } } else { if (orientation == Configuration.ORIENTATION_LANDSCAPE) { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE); } else { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT); } } } } catch (Exception e) { FileLog.e("tmessages", e); } }
From source file:com.Beat.RingdroidEditActivity.java
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); MenuItem item;/*from w w w . j av a 2s .c o m*/ item = menu.add(0, CMD_SAVE, 0, R.string.menu_save); item.setIcon(R.drawable.menu_save); item = menu.add(0, CMD_RESET, 0, R.string.menu_reset); item.setIcon(R.drawable.menu_reset); item = menu.add(0, CMD_ABOUT, 0, R.string.menu_about); item.setIcon(R.drawable.menu_about); return true; }
From source file:com.nbplus.vbroadlauncher.BroadcastWebViewActivity.java
@Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); Log.d(TAG, "BroadcastWebViewActivity onConfigurationChanged()"); if (Constants.OPEN_BETA_PHONE && LauncherSettings.getInstance(this).isSmartPhone()) { this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); return;//from w ww .j a v a2 s .c o m } setContentViewByOrientation(); }
From source file:com.esri.arcgisruntime.sample.findroute.MainActivity.java
@Override public void onConfigurationChanged(Configuration newConfig) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); super.onConfigurationChanged(newConfig); mDrawerToggle.onConfigurationChanged(newConfig); }
From source file:com.ferdi2005.secondgram.AndroidUtilities.java
public static void lockOrientation(Activity activity) { if (activity == null || prevOrientation != -10) { return;/*from w w w . j a v a 2 s. c o m*/ } try { prevOrientation = activity.getRequestedOrientation(); WindowManager manager = (WindowManager) activity.getSystemService(Activity.WINDOW_SERVICE); if (manager != null && manager.getDefaultDisplay() != null) { int rotation = manager.getDefaultDisplay().getRotation(); int orientation = activity.getResources().getConfiguration().orientation; if (rotation == Surface.ROTATION_270) { if (orientation == Configuration.ORIENTATION_PORTRAIT) { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } else { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE); } } else if (rotation == Surface.ROTATION_90) { if (orientation == Configuration.ORIENTATION_PORTRAIT) { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT); } else { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); } } else if (rotation == Surface.ROTATION_0) { if (orientation == Configuration.ORIENTATION_LANDSCAPE) { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); } else { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } } else { if (orientation == Configuration.ORIENTATION_LANDSCAPE) { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE); } else { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT); } } } } catch (Exception e) { FileLog.e(e); } }
From source file:com.Beat.RingdroidEditActivity.java
@Override public boolean onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); menu.findItem(CMD_SAVE).setVisible(true); menu.findItem(CMD_RESET).setVisible(true); menu.findItem(CMD_ABOUT).setVisible(true); return true;/*from w w w.ja v a 2 s . c o m*/ }