Пример #1
0
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   setKeyboardVisibility(newConfig);
   super.onConfigurationChanged(newConfig);
   if (actionBarCompat != null) {
     // ActionBar's capacity (width) has probably changed, so work around
     // http://code.google.com/p/android/issues/detail?id=20493
     // (invalidateOptionsMenu() does not help here)
     if (actionBarCompat != null) {
       // Just cautiously fix the common case: if >850dip then force
       // show everything, else let the platform decide
       DisplayMetrics dm = getResources().getDisplayMetrics();
       int screenWidthDIP = (int) Math.round(((double) dm.widthPixels) / dm.density);
       boolean reallyWide = screenWidthDIP > 850;
       int state =
           reallyWide
               ? ActionBarCompat.SHOW_AS_ACTION_ALWAYS
               : ActionBarCompat.SHOW_AS_ACTION_IF_ROOM;
       actionBarCompat.menuItemSetShowAsAction(menu.findItem(R.id.settings), state);
       actionBarCompat.menuItemSetShowAsAction(menu.findItem(R.id.solve), state);
       actionBarCompat.menuItemSetShowAsAction(menu.findItem(R.id.help), state);
       state |= ActionBarCompat.SHOW_AS_ACTION_WITH_TEXT;
       actionBarCompat.menuItemSetShowAsAction(menu.findItem(R.id.game), state);
       actionBarCompat.menuItemSetShowAsAction(menu.findItem(R.id.type), state);
       actionBarCompat.menuItemSetShowAsAction(menu.findItem(R.id.other), state);
     }
   }
 }
Пример #2
0
  @Override
  public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
    AndroidSystem system =
        (AndroidSystem)
            AndroidServiceLocator.GetInstance()
                .GetService(AndroidServiceLocator.SERVICE_TYPE_SYSTEM);
    boolean locked = system.IsOrientationLocked();
    if (locked) {
      int configOrientation;
      DisplayOrientation lockedOrientation = system.GetLockedOrientation();
      if (DisplayOrientation.Portrait.equals(lockedOrientation)) {
        configOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
      } else if (DisplayOrientation.Landscape.equals(lockedOrientation)) {
        configOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
      } else {
        // Portrait as default orientation
        configOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
      }
      if (newConfig.orientation != configOrientation) {
        LOG.Log(
            Module.GUI,
            "Main Activity onConfigurationChanged setting requested orientation: "
                + configOrientation);

        setRequestedOrientation(configOrientation);
      }
    } else {
      activityManager.layoutSplashscreen();
      appView.requestLayout();
    }
  }
Пример #3
0
  @Override
  public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);

    // Checks the orientation of the screen
    if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
      grid.setNumColumns(3);

    } else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
      DisplayMetrics dm = new DisplayMetrics();
      getWindowManager().getDefaultDisplay().getMetrics(dm);
      int width = dm.widthPixels;
      int height = dm.heightPixels;
      int dens = dm.densityDpi;
      double wi = (double) width / (double) dens;
      double hi = (double) height / (double) dens;
      double x = Math.pow(wi, 2);
      double y = Math.pow(hi, 2);
      double screenInches = Math.sqrt(x + y);

      if (screenInches >= 4.0) {
        grid.setNumColumns(3);
      } else {
        grid.setNumColumns(2);
      }
    }
  }
Пример #4
0
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
   if (uiSet) {
     setControls();
   }
 }
Пример #5
0
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   Point displaySize = new Point();
   getWindowManager().getDefaultDisplay().getSize(displaySize);
   vsv.updateDisplaySize(displaySize);
   super.onConfigurationChanged(newConfig);
 }
Пример #6
0
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
   // as most probably a layout change will change the underlying activity, just finish
   // current demo activity's points are not relevant anymore.
   finish();
 }
Пример #7
0
  @Override
  public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);

    // always reset screen orientation to portrait to disable landscape mode
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
  }
Пример #8
0
  @Override
  public void onConfigurationChanged(Configuration newConfig) {
    Logger.T(TAG, "onConfigurationChanged");
    super.onConfigurationChanged(newConfig);
    if (!sScreenAutoRotate) {
      Logger.D(
          TAG,
          "Screen rotation is disabled. Force old orientation: "
              + getScreenProperties().getOrientation());
      setRequestedOrientation(getScreenProperties().getOrientation());
    } else {
      ScreenProperties props = getScreenProperties();
      props.reread(this);

      int rotation = 0;
      switch (props.getOrientation()) {
        case ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE:
          rotation = 90;
          break;
        case ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT:
          rotation = 180;
          break;
        case ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE:
          rotation = 270;
          break;
        case ActivityInfo.SCREEN_ORIENTATION_PORTRAIT:
        default:
          rotation = 0;
          break;
      }

      RhodesService.onScreenOrientationChanged(props.getWidth(), props.getHeight(), rotation);
    }
  }
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   // this prevents StartupActivity recreation on Configuration changes
   // (device orientation changes or hardware keyboard open/close).
   // just do nothing on these changes:
   super.onConfigurationChanged(null);
 }
Пример #10
0
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
   if (mDrawerToggle != null) {
     mDrawerToggle.onConfigurationChanged(newConfig);
   }
 }
 @Override
 public void onConfigurationChanged(Configuration config) {
   super.onConfigurationChanged(config);
   mStateManager.onConfigurationChange(config);
   // workaround for CR 110382(share menu location wrong after rotating screen)
   // invalidateOptionsMenu();
 }
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
   if (mShowingHistoryPanel) {
     toggleHistoryPanel();
   }
 }
 /** Stops the activity from being re-created from */
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
   // wv.loadDataWithBaseURL("http://wufoo.com", asyncResult.replaceAll("width:;", "width:" +
   // getWindowManager().getDefaultDisplay().getWidth()*.9 + ";").replaceAll("height:;", "height:"
   // + getWindowManager().getDefaultDisplay().getHeight()*.6 + ";"), "text/html", "utf-8",
   // "about:blank");
 }
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
   if (null == IOuyaActivity.GetUnityPlayer()) {
     Log.i("Unity", "IOuyaActivity.GetUnityPlayer() is null");
     return;
   }
   IOuyaActivity.GetUnityPlayer().configurationChanged(newConfig);
 }
Пример #15
0
  @Override
  public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);

    orientation = newConfig.orientation;
    String html = String.format(WEB_HTML, getMaxWidth(), imageUrl);
    webViewer.loadDataWithBaseURL("", html, "text/html", "UTF-8", "");
  }
Пример #16
0
 /// M: Code analyze 011, new feature, hide MmsMediaController @{
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   // TODO Auto-generated method stub
   super.onConfigurationChanged(newConfig);
   if ((mSmilPlayer != null) && (mMediaController != null)) {
     mMediaController.hide();
   }
 }
Пример #17
0
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   // TODO Auto-generated method stub
   super.onConfigurationChanged(newConfig);
   WindowManager windowManager = getWindowManager();
   absolute_screen_width = windowManager.getDefaultDisplay().getWidth();
   absolute_screen_height = windowManager.getDefaultDisplay().getHeight();
 }
Пример #18
0
  @Override
  public void onConfigurationChanged(Configuration newConfig) {
    if (isInitialized()) {
      setVideoLayout();
      attachMediaController();
    }

    super.onConfigurationChanged(newConfig);
  }
Пример #19
0
  @Override
  public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);

    Locale.setDefault(locale);
    Configuration config = new Configuration();
    config.locale = locale;
    getBaseContext().getResources().updateConfiguration(config, null);
  }
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
   if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
     mCamera.setDisplayOrientation(90);
   } else if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
     mCamera.setDisplayOrientation(0);
   }
 }
Пример #21
0
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
   if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
     Toast.makeText(this, "landscape", Toast.LENGTH_SHORT).show();
   } else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
     Toast.makeText(this, "portrait", Toast.LENGTH_SHORT).show();
   }
 }
Пример #22
0
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
   int intrinsicWidth = getResources().getDrawable(R.drawable.text_field).getIntrinsicWidth() - 33;
   mAutoCompleteTextView.setDropDownWidth(intrinsicWidth);
   requestFullScreen();
   mIsPortrait = (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT);
   if (!mIsPortrait) mQuickBar.setVisibility(View.INVISIBLE);
 }
Пример #23
0
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   Log.i(TAG, "onConfigurationChanged");
   super.onConfigurationChanged(newConfig);
   if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
     updateSystemUiVisibility();
   }
   updateDisplayMetrics(null);
 }
Пример #24
0
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
   if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
     // land do nothing is ok
   } else if (this.getResources().getConfiguration().orientation
       == Configuration.ORIENTATION_PORTRAIT) {
     // port do nothing is ok
   }
 }
 public void onConfigurationChanged(android.content.res.Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
   if (useCommonInterface) {
     if (mBaiduNaviCommonModule != null) {
       mBaiduNaviCommonModule.onConfigurationChanged(newConfig);
     }
   } else {
     BNRouteGuideManager.getInstance().onConfigurationChanged(newConfig);
   }
 };
 @Override
 public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
   if (mVideoWidth > 0 && mVideoHeight > 0)
     mVideoSurface.adjustSize(
         getDeviceWidth(this),
         getDeviceHeight(this),
         mVideoSurface.getWidth(),
         mVideoSurface.getHeight());
 }
Пример #27
0
  @Override
  public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);

    for (WeakReference<TiContext> contextRef : contexts) {
      if (contextRef.get() != null) {
        contextRef.get().dispatchOnConfigurationChanged(newConfig);
      }
    }
  }
  @Override
  public void onConfigurationChanged(Configuration newConfig) {
    Log.v(tag, "configuration changed");
    uiInitialization();
    getTempBarParameters();
    // TODO handle situation when
    bridge.reloadState();

    super.onConfigurationChanged(newConfig);
  }
  @Override
  public void onConfigurationChanged(final Configuration newConfig) {
    super.onConfigurationChanged(newConfig);

    mNavigationHelper.onConfigurationChanged(newConfig);

    Log.d("configuration changed...restoring...reset idleTimer");
    mIitcWebView.loadUrl("javascript: window.idleTime = 0");
    mIitcWebView.loadUrl("javascript: window.renderUpdateStatus()");
  }
Пример #30
0
 @Override
 /**
  * Called by the system when the device configuration changes while your activity is running.
  *
  * @param Configuration newConfig
  */
 public void onConfigurationChanged(Configuration newConfig) {
   // don't reload the current page when the orientation is changed
   super.onConfigurationChanged(newConfig);
 }