bug 723305 - Tabs menu uses smoothScrollToPosition(), which doesn't exist in eclair r=mfinkle
authorBrad Lassey <blassey@mozilla.com>
Wed, 01 Feb 2012 19:05:06 -0500
changeset 85998 cf7de01ea99486c7fde564b57254a6dded99911f
parent 85997 1aeba59aa111a68f8856e5b158e0c58e9289385a
child 85999 d711befe903772c814a6284700c8efe4a78e9d9f
push id21982
push userbmo@edmorley.co.uk
push dateThu, 02 Feb 2012 10:23:53 +0000
treeherdermozilla-central@005980552224 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs723305
milestone13.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 723305 - Tabs menu uses smoothScrollToPosition(), which doesn't exist in eclair r=mfinkle
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) {