sri404 / mobyfactory-uiwidgets-android

Automatically exported from code.google.com/p/mobyfactory-uiwidgets-android
0 stars 0 forks source link

Active tab changed when screen is rotated #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open the app in portrait mode.
2. switch on the last tab
3. Rotate the screen.

What is the expected output? What do you see instead?
Last tab should be active, but first tab is activated after the screen is 
rotated.

What version of the product are you using? On what operating system?
android 2.1, android 1.5

Please provide any additional information below.

Original issue reported on code.google.com by mannch...@gmail.com on 14 Jun 2010 at 6:59

GoogleCodeExporter commented 9 years ago
This is a somewhat annoying issue. If you scroll to the end and select a tab. 
when you switch to landscape the selected tab is not visible, instead the 
scroll tabs are back to the first position.

Original comment by achraf.t...@gmail.com on 27 Jul 2010 at 8:10

GoogleCodeExporter commented 9 years ago
Hi Again,

I resolved the issue. However its more of a hack :)

1)- on the Scrollable tab activity, you ge the view "HorizontalScrollView". In 
    my case it is called tabBar : 
    HorizontalScrollView tabBar = getViewById(...);
2) in the Scrollable tab activity you implement the onresume:
   public void onResume(){
      tabBar.smoothScroll(tabwidth * getCurrentTab(),0); 
      super.onResume();
  }
here tabWidth is the width of a single tab in the scroll . in my case it's 80

Hope this helps

Original comment by achraf.t...@gmail.com on 27 Jul 2010 at 9:31