title: Android RealViewSwitcher shows view partially
body: <p>I've got the following problem. I'm using the RealViewSwitcher class (which extends ViewGroup and can be founded <a href="http://marcreichelt.blogspot.com/2010/09/android-use-realviewswitcher-to-switch.html" rel="nofollow">here</a> ). I've got three views and swiping between them works well in both orientatons. However, when I change orientation dynamically (for example, I'm on the screen 1 in vertical view and change the orientation to horizontal) - the view is showing only partially (one third of the screen is first view, other two third - second view). </p>
  
  <p>The code:</p>
  
  <pre><code>// my activity method
  @Override
  public void onConfigurationChanged(Configuration newConfig)
  {
  // ...
  realViewSwitcher.setCurrentScreen(1);
  // ...
  }
  
  // realViewSwitcher method
  public void setCurrentScreen(int currentScreen) {
      mCurrentScreen = Math.max(0, Math.min(currentScreen, getChildCount() - 1));
      scrollTo(mCurrentScreen * getWidth(), 0);
      invalidate();
  }
  </code></pre>
  
  <p>UPD(10.09.2012): Added some code</p>