List of usage examples for android.content.pm ActivityInfo SCREEN_ORIENTATION_UNSPECIFIED
int SCREEN_ORIENTATION_UNSPECIFIED
To view the source code for android.content.pm ActivityInfo SCREEN_ORIENTATION_UNSPECIFIED.
Click Source Link
unspecified
in the android.R.attr#screenOrientation attribute. From source file:com.mantz_it.rfanalyzer.SettingsFragment.java
/** * Will set the screen orientation of the hosting activity * * @param orientation auto, landscape, portrait, reverse_landscape or reverse_portrait *///from ww w . j av a 2 s . co m public void setScreenOrientation(String orientation) { if (orientation.equals("auto")) getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); else if (orientation.equals("landscape")) getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); else if (orientation.equals("portrait")) getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); else if (orientation.equals("reverse_landscape")) getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE); else if (orientation.equals("reverse_portrait")) getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT); }
From source file:org.wso2.iot.agent.activities.AlreadyRegisteredActivity.java
@Override protected void onDestroy() { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); super.onDestroy(); if (progressDialog != null && progressDialog.isShowing()) { progressDialog.dismiss();/*from w ww .j a v a 2 s . c o m*/ progressDialog = null; } }
From source file:org.wso2.iot.agent.activities.AuthenticationActivity.java
@Override protected void onDestroy() { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); super.onDestroy(); CommonDialogUtils.stopProgressDialog(progressDialog); progressDialog = null;/*w ww.j a v a 2s .c o m*/ }
From source file:com.github.guwenk.smuradio.SignInDialog.java
@Override public void onDetach() { super.onDetach(); getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); }
From source file:com.tweetlanes.android.core.view.DirectMessageFeedFragment.java
private void resetScreenRotation() { if (getActivity() != null) { getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } }
From source file:uk.co.pjmobile.mobile_apps.page_turner_reader.ReadingActivity.java
private void updateFromPrefs() { // this.progressService.setConfig(this.config); bookView.setTextSize(config.getTextSize()); int marginH = config.getHorizontalMargin(); int marginV = config.getVerticalMargin(); bookView.setFontFamily(config.getFontFamily()); bookView.setHorizontalMargin(marginH); bookView.setVerticalMargin(marginV); if (!isAnimating()) { bookView.setEnableScrolling(config.isScrollingEnabled()); }/*from w w w . j a va 2s.c o m*/ bookView.setStripWhiteSpace(config.isStripWhiteSpaceEnabled()); bookView.setLineSpacing(config.getLineSpacing()); if (config.isFullScreenEnabled()) { getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); } else { getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); } restoreColorProfile(); // Check if we need a restart if (config.isBrightnessControlEnabled() != oldBrightness || config.isStripWhiteSpaceEnabled() != oldStripWhiteSpace || !this.oldFontName.equalsIgnoreCase(config.getFontFamily().getName())) { restartReader(); } Configuration.OrientationLock orientation = config.getScreenOrientation(); switch (orientation) { case PORTRAIT: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); break; case LANDSCAPE: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); break; case REVERSE_LANDSCAPE: setRequestedOrientation(8); // Android 2.3+ value break; case REVERSE_PORTRAIT: setRequestedOrientation(9); // Android 2.3+ value break; default: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } }
From source file:com.slushpupie.deskclock.DeskClock.java
private void loadPrefs() { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); boolean b = false; int i = 0;// w w w .j av a2 s . c o m String s = null; i = prefs.getInt("pref_version", 1); if (i != PREF_VERSION) { upgradePrefs(prefs); } lastChangelog = prefs.getString("last_changelog", ""); s = prefs.getString("pref_keep_screen_on", "no"); if ("auto".equals(s)) prefsKeepSreenOn = 1; else if ("manual".equals(s)) prefsKeepSreenOn = 2; else prefsKeepSreenOn = 0; prefsScreenBrightness = prefs.getInt("pref_screen_brightness", 50); prefsTempScreenBrightness = prefs.getInt("pref_screen_temp_brightness", 70); prefsButtonBrightness = prefs.getInt("pref_button_brightness", 50); setScreenLock(prefsKeepSreenOn, prefsScreenBrightness, prefsButtonBrightness); s = prefs.getString("pref_screen_orientation", "auto"); if ("portrait".equals(s)) prefsScreenOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; else if ("landscape".equals(s)) prefsScreenOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE; else prefsScreenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; setRequestedOrientation(prefsScreenOrientation); b = prefs.getBoolean("pref_military_time", false); if (b != prefsMilitaryTime) { prefsMilitaryTime = b; needsResizing = true; } b = prefs.getBoolean("pref_leading_zero", false); if (b != prefsLeadingZero) { prefsLeadingZero = b; needsResizing = true; } b = prefs.getBoolean("pref_meridiem", false); if (b != prefsShowMeridiem) { prefsShowMeridiem = b; needsResizing = true; } try { prefsFontColor = prefs.getInt("pref_color", Color.WHITE); } catch (NumberFormatException e) { prefsFontColor = Color.WHITE; } display.setColor(prefsFontColor); try { prefsBackgroundColor = prefs.getInt("pref_background_color", Color.BLACK); } catch (NumberFormatException e) { prefsBackgroundColor = Color.BLACK; } //layout.setBackgroundColor(prefsBackgroundColor); display.setBackgroundColor(prefsBackgroundColor); b = prefs.getBoolean("pref_show_seconds", false); if (b != prefsShowSeconds) { prefsShowSeconds = b; needsResizing = true; } prefsBlinkColon = prefs.getBoolean("pref_blink_seconds", false); try { i = Integer.valueOf(prefs.getString("pref_font", getString(R.string.pref_default_font))); if (i != prefsFont) { prefsFont = i; needsResizing = true; } } catch (NumberFormatException e) { if (prefsFont != Integer.valueOf(getString(R.string.pref_default_font))) { prefsFont = Integer.valueOf(getString(R.string.pref_default_font)); needsResizing = true; } } prefsScreenSaverSpeed = prefs.getInt("pref_screensaver_speed", 500); if (prefsScreenSaverSpeed < 500) prefsScreenSaverSpeed = 500; if (prefsScreenSaverSpeed > 10000) prefsScreenSaverSpeed = 10000; b = prefs.getBoolean("pref_screensaver", false); if (b != prefsScreenSaver) { prefsScreenSaver = b; display.setScreenSaver(prefsScreenSaver); handler.removeCallbacks(runMoveDisplay); handler.postDelayed(runMoveDisplay, prefsScreenSaverSpeed); needsResizing = true; } i = prefs.getInt("pref_scale", 100); if (i != prefsScale) { prefsScale = i; needsResizing = true; } prefsShowHints = prefs.getBoolean("pref_hints", true); prefsUndockExit = prefs.getBoolean("pref_undock_exit", false); }
From source file:com.nbplus.vbroadlauncher.fragment.LauncherFragment.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); getActivity().setTitle("LauncherFragment"); mLastNetworkStatus = NetworkUtils.isConnected(getActivity()); if (!LauncherSettings.getInstance(getActivity()).isCheckedTTSEngine()) { Intent checkIntent = new Intent(); checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA); getActivity().startActivityForResult(checkIntent, Constants.START_ACTIVITY_REQUEST_CHECK_TTS_DATA); }//from w ww. ja va 2 s . co m Log.d(TAG, "PushConstants.ACTION_GET_STATUS send"); // check push agent status Intent intent = new Intent(getActivity(), PushService.class); intent.setAction(PushConstants.ACTION_GET_STATUS); getActivity().startService(intent); }
From source file:com.tweetlanes.android.core.view.ComposeBaseFragment.java
protected void resetScreenRotation() { if (getActivity() != null) { getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } }
From source file:org.woltage.irssiconnectbot.ConsoleActivity.java
/** * */// www. j a v a2 s. co m private void configureOrientation() { String rotateDefault; if (getResources().getConfiguration().keyboard == Configuration.KEYBOARD_NOKEYS) rotateDefault = PreferenceConstants.ROTATION_PORTRAIT; else rotateDefault = PreferenceConstants.ROTATION_LANDSCAPE; String rotate = prefs.getString(PreferenceConstants.ROTATION, rotateDefault); if (PreferenceConstants.ROTATION_DEFAULT.equals(rotate)) rotate = rotateDefault; // request a forced orientation if requested by user if (PreferenceConstants.ROTATION_LANDSCAPE.equals(rotate)) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); forcedOrientation = true; } else if (PreferenceConstants.ROTATION_PORTRAIT.equals(rotate)) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); forcedOrientation = true; } else if (PreferenceConstants.ROTATION_SENSOR.equals(rotate)) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); forcedOrientation = false; } else { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); forcedOrientation = false; } }