bug 723305 - Tabs menu uses smoothScrollToPosition(), which doesn't exist in eclair r=mfinkle a=akeybl
authorBrad Lassey <blassey@mozilla.com>
Wed, 01 Feb 2012 19:05:06 -0500
changeset 88330 ed8a492bca0a48482aa56f52b6d5d414f389fdf2
parent 88329 49f5c924b7a55b422d7cc4c634e9fb24146a7f3a
child 88331 1f3329e303fe0676950a1430467427361e4fbb5a
push idunknown
push userunknown
push dateunknown
reviewersmfinkle, akeybl
bugs723305
milestone12.0a2
bug 723305 - Tabs menu uses smoothScrollToPosition(), which doesn't exist in eclair r=mfinkle a=akeybl
mobile/android/base/TabsTray.java
--- a/mobile/android/base/TabsTray.java
+++ b/mobile/android/base/TabsTray.java
@@ -114,18 +114,23 @@ public class TabsTray extends Activity i
     }
 
     @Override
     public void onWindowFocusChanged(boolean hasFocus) {
         // This function is called after the initial list is populated
         // Scrolling to the selected tab can happen here
         if (hasFocus) {
             int position = mTabsAdapter.getPositionForTab(Tabs.getInstance().getSelectedTab());
-            if (position != -1) 
+            if (position == -1)
+                return;
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) {
                 mList.smoothScrollToPosition(position);
+            } else {
+                /* To Do: Find a way to scroll with Eclair's APIs */
+            }
         }
     } 
    
     public void onTabsChanged(Tab tab) {
         if (Tabs.getInstance().getCount() == 1)
             finishActivity();
 
         if (mTabsAdapter == null) {