Bug 839885 - Update the selected tab style before calling setSelection. r=lucasr, a=lsblakk
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Fri, 21 Feb 2014 11:20:37 -0800
changeset 176373 e15b41883a5bc8fa86f51905dcfd1ba379654e86
parent 176372 dd02eeb751881281fc5354cbaff57c7cacc3eb01
child 176374 c336953de57975d0a68b3f139312d1a654597fc5
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr, lsblakk
bugs839885
milestone28.0
Bug 839885 - Update the selected tab style before calling setSelection. r=lucasr, a=lsblakk
mobile/android/base/TabsTray.java
--- a/mobile/android/base/TabsTray.java
+++ b/mobile/android/base/TabsTray.java
@@ -197,21 +197,21 @@ public class TabsTray extends TwoWayView
 
             notifyDataSetChanged(); // Be sure to call this whenever mTabs changes.
             updateSelectedPosition();
         }
 
         // Updates the selected position in the list so that it will be scrolled to the right place.
         private void updateSelectedPosition() {
             int selected = getPositionForTab(Tabs.getInstance().getSelectedTab());
+            updateSelectedStyle(selected);
+
             if (selected != -1) {
                 TabsTray.this.setSelection(selected);
             }
-
-            updateSelectedStyle(selected);
         }
 
         /**
          * Updates the selected/unselected style for the tabs.
          *
          * @param selected position of the selected tab
          */
         private void updateSelectedStyle(int selected) {