Backed out changeset d6fc2a5a92f2 (bug 1371217) on suspicion of causing bug 1557661
authorDaniel Varga <dvarga@mozilla.com>
Fri, 07 Jun 2019 12:32:29 +0300
changeset 536742 498f86658eaa6a95b828d4c6d85abb66b64a2fcf
parent 536741 f95b376afc899c800f799f6e70809c727c3262e8
child 536743 731c7c63efb408648c94977c5b89bc3fc429f049
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1371217, 1557661
milestone68.0
backs outd6fc2a5a92f24c730c2d033de7a3c692c2d01da0
Backed out changeset d6fc2a5a92f2 (bug 1371217) on suspicion of causing bug 1557661
mobile/android/base/java/org/mozilla/gecko/home/TabMenuStrip.java
--- a/mobile/android/base/java/org/mozilla/gecko/home/TabMenuStrip.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/TabMenuStrip.java
@@ -1,27 +1,25 @@
 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko.home;
 
-import android.content.res.Configuration;
 import android.support.v4.content.ContextCompat;
 import org.mozilla.gecko.R;
 
 import android.content.Context;
 import android.content.res.Resources;
 import android.content.res.TypedArray;
 import android.graphics.Canvas;
 import android.graphics.Paint;
 import android.graphics.drawable.Drawable;
 import android.util.AttributeSet;
-import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewTreeObserver;
 import android.view.accessibility.AccessibilityEvent;
 import android.widget.HorizontalScrollView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
 
@@ -37,17 +35,16 @@ public class TabMenuStrip extends Horizo
     // except for the first and last tab in the tab strip.
     private static final int TITLE_OFFSET_DIPS = 24;
 
     private final int titleOffset;
     private final TabMenuStripLayout layout;
 
     private final Paint shadowPaint;
     private final int shadowSize;
-    private int stripPosition;
 
     public interface OnTitleClickListener {
         void onTitleClicked(int index);
     }
 
     public TabMenuStrip(Context context, AttributeSet attrs) {
         super(context, attrs);
 
@@ -56,17 +53,16 @@ public class TabMenuStrip extends Horizo
         setFillViewport(true);
 
         final Resources res = getResources();
 
         titleOffset = (int) (TITLE_OFFSET_DIPS * res.getDisplayMetrics().density);
 
         layout = new TabMenuStripLayout(context, attrs);
         addView(layout, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
-        layout.setGravity(Gravity.CENTER);
 
         shadowSize = res.getDimensionPixelSize(R.dimen.tabs_strip_shadow_size);
 
         shadowPaint = new Paint();
         shadowPaint.setColor(ContextCompat.getColor(context, R.color.url_bar_shadow));
         shadowPaint.setStrokeWidth(0.0f);
     }
 
@@ -85,17 +81,16 @@ public class TabMenuStrip extends Horizo
 
     @Override
     public void removeAllPagerViews() {
         layout.removeAllViews();
     }
 
     @Override
     public void onPageSelected(final int position) {
-        stripPosition = position;
         layout.onPageSelected(position);
     }
 
     @Override
     public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
         layout.onPageScrolled(position, positionOffset, positionOffsetPixels);
 
         final View selectedTitle = layout.getChildAt(position);
@@ -124,14 +119,9 @@ public class TabMenuStrip extends Horizo
             scrollTo(titleRight - getWidth(), 0);
         }
     }
 
     @Override
     public void setOnTitleClickListener(OnTitleClickListener onTitleClickListener) {
         layout.setOnTitleClickListener(onTitleClickListener);
     }
-
-    @Override
-    protected void onConfigurationChanged(Configuration newConfig) {
-        layout.onPageSelected(stripPosition);
-    }
 }