Bug 1565488 - Wrong panel from welcome screen is highlighted after clearing data. r=VladBaicu, a=RyanVM
authorBrad Arant <brad.arant@softvision.com>
Tue, 30 Jul 2019 16:22:11 +0000
changeset 541914 6b61417a79440bb7793c5dab1afcd607ba8491fe
parent 541913 5db9809ede169c313b0f967b6d9b53794eab7e80
child 541915 51205fa6172c7bd71dbb33c52a01bf2e47943e81
push id11778
push userryanvm@gmail.com
push dateWed, 14 Aug 2019 03:07:29 +0000
treeherdermozilla-beta@6b61417a7944 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersVladBaicu, RyanVM
bugs1565488
milestone69.0
Bug 1565488 - Wrong panel from welcome screen is highlighted after clearing data. r=VladBaicu, a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D39797
mobile/android/base/java/org/mozilla/gecko/home/TabMenuStripLayout.java
--- a/mobile/android/base/java/org/mozilla/gecko/home/TabMenuStripLayout.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/TabMenuStripLayout.java
@@ -118,34 +118,33 @@ class TabMenuStripLayout extends ThemedL
         }
 
         addView(button);
         button.setOnClickListener(new ViewClickListener(getChildCount() - 1));
         button.setOnFocusChangeListener(this);
     }
 
     void onPageSelected(final int position) {
+        if (selectedView != null) {
+            selectedView.setTextColor(inactiveTextColor);
+        }
+        selectedView = (TextView) getChildAt(position);
+        selectedView.setTextColor(activeTextColor);
         // Callback to measure and draw the strip after the view is visible.
         ViewTreeObserver vto = getViewTreeObserver();
         if (vto.isAlive()) {
             vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
                 @Override
                 public void onGlobalLayout() {
                     ViewTreeObserver vto = getViewTreeObserver();
                     if (!vto.isAlive()) {
                         return;
                     }
                     // let's ensure that we are calling this only once
                     vto.removeOnGlobalLayoutListener(this);
-                    if (selectedView != null) {
-                        selectedView.setTextColor(inactiveTextColor);
-                    }
-
-                    selectedView = (TextView) getChildAt(position);
-                    selectedView.setTextColor(activeTextColor);
 
                     if (strip != null) {
                         boolean isLayoutRtl = ViewCompat.getLayoutDirection(selectedView) == ViewCompat.LAYOUT_DIRECTION_RTL;
                         final int startPaddingOffset;
                         final int endPaddingOffset;
                         if (position != 0) {
                             startPaddingOffset = 0;
                             endPaddingOffset = 0;