Backed out changeset b68c721a1462 (bug 863828) for robocop failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Sat, 27 Apr 2013 18:21:15 -0400
changeset 130160 9d8977cbbfc6822dae559f314fc3822fe5bc2bee
parent 130159 d2eed4b2408e3908ec67064ea04abb3fd96558f4
child 130162 3ef2e90a0f33767f46a79d2d36b61898a5210493
child 130184 9d3d0552005c2c4a89186d1c89f9d21a2157fea4
push id24599
push userryanvm@gmail.com
push dateSun, 28 Apr 2013 01:24:06 +0000
treeherdermozilla-central@9d8977cbbfc6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs863828
milestone23.0a1
backs outb68c721a1462b79c95696cd47e03dabd35e4a8fa
first release with
nightly linux32
9d8977cbbfc6 / 23.0a1 / 20130428031010 / files
nightly linux64
9d8977cbbfc6 / 23.0a1 / 20130428031010 / files
nightly mac
9d8977cbbfc6 / 23.0a1 / 20130428031010 / files
nightly win32
9d8977cbbfc6 / 23.0a1 / 20130428031010 / files
nightly win64
9d8977cbbfc6 / 23.0a1 / 20130428031010 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset b68c721a1462 (bug 863828) for robocop failures.
mobile/android/base/BrowserToolbar.java
mobile/android/base/Makefile.in
mobile/android/base/Rotate3DAnimation.java
mobile/android/base/TabCounter.java
mobile/android/base/resources/drawable-hdpi/tabs_count.png
mobile/android/base/resources/drawable-hdpi/tabs_count_foreground.png
mobile/android/base/resources/drawable-mdpi/tabs_count_foreground.png
mobile/android/base/resources/drawable-xhdpi/tabs_count.png
mobile/android/base/resources/drawable-xhdpi/tabs_count_foreground.png
mobile/android/base/resources/layout-large-v11/browser_toolbar.xml
mobile/android/base/resources/layout/browser_toolbar.xml
mobile/android/base/resources/layout/tabs_counter.xml
mobile/android/base/resources/values/styles.xml
--- a/mobile/android/base/BrowserToolbar.java
+++ b/mobile/android/base/BrowserToolbar.java
@@ -28,40 +28,42 @@ import android.os.Handler;
 import android.os.SystemClock;
 import android.text.style.ForegroundColorSpan;
 import android.text.Spannable;
 import android.text.SpannableStringBuilder;
 import android.text.TextUtils;
 import android.util.AttributeSet;
 import android.util.Log;
 import android.view.ContextMenu;
+import android.view.LayoutInflater;
 import android.view.MenuInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.ViewGroup.MarginLayoutParams;
 import android.view.Window;
 import android.view.accessibility.AccessibilityNodeInfo;
+import android.view.animation.AlphaAnimation;
 import android.view.animation.Animation;
-import android.view.animation.AlphaAnimation;
 import android.view.animation.TranslateAnimation;
 import android.view.inputmethod.InputMethodManager;
 import android.widget.Button;
 import android.widget.ImageButton;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.PopupWindow;
 import android.widget.RelativeLayout;
 import android.widget.RelativeLayout.LayoutParams;
 import android.widget.ViewSwitcher;
 
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
-public class BrowserToolbar implements Tabs.OnTabsChangedListener,
+public class BrowserToolbar implements ViewSwitcher.ViewFactory,
+                                       Tabs.OnTabsChangedListener,
                                        GeckoMenu.ActionItemBarPresenter,
                                        Animation.AnimationListener,
                                        SharedPreferences.OnSharedPreferenceChangeListener {
     private static final String LOGTAG = "GeckoToolbar";
     public static final String PREFS_NAME = "BrowserToolbar";
     public static final String PREFS_SHOW_URL = "ShowUrl";
     private GeckoRelativeLayout mLayout;
     private LayoutParams mAwesomeBarParams;
@@ -77,42 +79,50 @@ public class BrowserToolbar implements T
     private int mTabsPaneWidth;
     private ImageButton mBack;
     private ImageButton mForward;
     public ImageButton mFavicon;
     public ImageButton mStop;
     public ImageButton mSiteSecurity;
     public ImageButton mReader;
     private AnimationDrawable mProgressSpinner;
-    private TabCounter mTabsCounter;
+    private GeckoTextSwitcher mTabsCount;
     private ImageView mShadow;
     private GeckoImageButton mMenu;
     private LinearLayout mActionItemBar;
     private MenuPopup mMenuPopup;
     private List<View> mFocusOrder;
 
     final private BrowserApp mActivity;
+    private LayoutInflater mInflater;
     private Handler mHandler;
     private boolean mHasSoftMenuButton;
 
     private boolean mShowSiteSecurity;
     private boolean mShowReader;
 
     private static List<View> sActionItems;
 
     private boolean mAnimatingEntry;
 
+    private int mDuration;
+    private TranslateAnimation mSlideUpIn;
+    private TranslateAnimation mSlideUpOut;
+    private TranslateAnimation mSlideDownIn;
+    private TranslateAnimation mSlideDownOut;
+
     private AlphaAnimation mLockFadeIn;
     private TranslateAnimation mTitleSlideLeft;
     private TranslateAnimation mTitleSlideRight;
 
     private int mAddressBarViewOffset;
     private int mDefaultForwardMargin;
     private PropertyAnimator mForwardAnim = null;
 
+    private int mCount;
     private int mFaviconSize;
 
     private PropertyAnimator mVisibilityAnimator;
 
     private static final int TABS_CONTRACTED = 1;
     private static final int TABS_EXPANDED = 2;
 
     private static final int FORWARD_ANIMATION_DURATION = 450;
@@ -120,16 +130,17 @@ public class BrowserToolbar implements T
     private final ForegroundColorSpan mDomainColor;
     private final ForegroundColorSpan mPrivateDomainColor;
 
     private boolean mShowUrl;
 
     public BrowserToolbar(BrowserApp activity) {
         // BrowserToolbar is attached to BrowserApp only.
         mActivity = activity;
+        mInflater = LayoutInflater.from(activity);
 
         sActionItems = new ArrayList<View>();
         Tabs.registerOnTabsChangedListener(this);
         mAnimateSiteSecurity = true;
 
         mAnimatingEntry = false;
         mShowUrl = false;
 
@@ -235,17 +246,33 @@ public class BrowserToolbar implements T
         mTabs.setOnClickListener(new Button.OnClickListener() {
             @Override
             public void onClick(View v) {
                 toggleTabs();
             }
         });
         mTabs.setImageLevel(0);
 
-        mTabsCounter = (TabCounter) mLayout.findViewById(R.id.tabs_counter);
+        mTabsCount = (GeckoTextSwitcher) mLayout.findViewById(R.id.tabs_count);
+        mTabsCount.removeAllViews();
+        mTabsCount.setFactory(this);
+        mTabsCount.setText("");
+        mCount = 0;
+        if (Build.VERSION.SDK_INT >= 16) {
+            // This adds the TextSwitcher to the a11y node tree, where we in turn
+            // could make it return an empty info node. If we don't do this the
+            // TextSwitcher's child TextViews get picked up, and we don't want
+            // that since the tabs ImageButton is already properly labeled for
+            // accessibility.
+            mTabsCount.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
+            mTabsCount.setAccessibilityDelegate(new View.AccessibilityDelegate() {
+                    @Override
+                    public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {}
+                });
+        }
 
         mBack = (ImageButton) mLayout.findViewById(R.id.back);
         mBack.setOnClickListener(new Button.OnClickListener() {
             @Override
             public void onClick(View view) {
                 Tabs.getInstance().getSelectedTab().doBack();
             }
         });
@@ -334,16 +361,26 @@ public class BrowserToolbar implements T
         mShadow = (ImageView) mLayout.findViewById(R.id.shadow);
         mShadow.setOnClickListener(new Button.OnClickListener() {
             @Override
             public void onClick(View v) {
             }
         });
 
         mHandler = new Handler();
+        mSlideUpIn = new TranslateAnimation(0, 0, 40, 0);
+        mSlideUpOut = new TranslateAnimation(0, 0, 0, -40);
+        mSlideDownIn = new TranslateAnimation(0, 0, -40, 0);
+        mSlideDownOut = new TranslateAnimation(0, 0, 0, 40);
+
+        mDuration = 750;
+        mSlideUpIn.setDuration(mDuration);
+        mSlideUpOut.setDuration(mDuration);
+        mSlideDownIn.setDuration(mDuration);
+        mSlideDownOut.setDuration(mDuration);
 
         float slideWidth = mActivity.getResources().getDimension(R.dimen.browser_toolbar_lock_width);
 
         LinearLayout.LayoutParams siteSecParams = (LinearLayout.LayoutParams) mSiteSecurity.getLayoutParams();
         final float scale = mActivity.getResources().getDisplayMetrics().density;
         slideWidth += (siteSecParams.leftMargin + siteSecParams.rightMargin) * scale + 0.5f;
 
         mLockFadeIn = new AlphaAnimation(0.0f, 1.0f);
@@ -537,16 +574,22 @@ public class BrowserToolbar implements T
 
     @Override
     public void onAnimationEnd(Animation animation) {
         if (animation.equals(mTitleSlideRight)) {
             mSiteSecurity.startAnimation(mLockFadeIn);
         }
     }
 
+    @Override
+    public View makeView() {
+        // This returns a TextView for the TextSwitcher.
+        return mInflater.inflate(R.layout.tabs_counter, null);
+    }
+
     private int getAwesomeBarAnimTranslation() {
         return mLayout.getWidth() - mAwesomeBarEntry.getRight();
     }
 
     public void fromAwesomeBarSearch(String url) {
         // Update the title with the url that was just entered. Don't update the title if
         // the AwesomeBar activity was cancelled, or if the user entered an empty string.
         if (url != null && url.length() > 0) {
@@ -569,17 +612,17 @@ public class BrowserToolbar implements T
             mLayout.setSelected(true);
 
             final int translation = getAwesomeBarAnimTranslation();
 
             proxy = AnimatorProxy.create(mAwesomeBarRightEdge);
             proxy.setTranslationX(translation);
             proxy = AnimatorProxy.create(mTabs);
             proxy.setTranslationX(translation);
-            proxy = AnimatorProxy.create(mTabsCounter);
+            proxy = AnimatorProxy.create(mTabsCount);
             proxy.setTranslationX(translation);
             proxy = AnimatorProxy.create(mActionItemBar);
             proxy.setTranslationX(translation);
 
             if (mHasSoftMenuButton) {
                 proxy = AnimatorProxy.create(mMenu);
                 proxy.setTranslationX(translation);
             }
@@ -604,17 +647,17 @@ public class BrowserToolbar implements T
 
         // Shrink the awesome entry back to its original size
         contentAnimator.attach(mAwesomeBarRightEdge,
                                PropertyAnimator.Property.TRANSLATION_X,
                                0);
         contentAnimator.attach(mTabs,
                                PropertyAnimator.Property.TRANSLATION_X,
                                0);
-        contentAnimator.attach(mTabsCounter,
+        contentAnimator.attach(mTabsCount,
                                PropertyAnimator.Property.TRANSLATION_X,
                                0);
         contentAnimator.attach(mActionItemBar,
                                PropertyAnimator.Property.TRANSLATION_X,
                                0);
 
         if (mHasSoftMenuButton)
             contentAnimator.attach(mMenu,
@@ -705,17 +748,17 @@ public class BrowserToolbar implements T
 
         // Slide the right side elements of the toolbar
         contentAnimator.attach(mAwesomeBarRightEdge,
                                PropertyAnimator.Property.TRANSLATION_X,
                                translation);
         contentAnimator.attach(mTabs,
                                PropertyAnimator.Property.TRANSLATION_X,
                                translation);
-        contentAnimator.attach(mTabsCounter,
+        contentAnimator.attach(mTabsCount,
                                PropertyAnimator.Property.TRANSLATION_X,
                                translation);
         contentAnimator.attach(mActionItemBar,
                                PropertyAnimator.Property.TRANSLATION_X,
                                translation);
 
         if (mHasSoftMenuButton)
             contentAnimator.attach(mMenu,
@@ -767,42 +810,53 @@ public class BrowserToolbar implements T
 
     public void updateTabCountAndAnimate(int count) {
         // Don't animate if the toolbar is hidden.
         if (!isVisible()) {
             updateTabCount(count);
             return;
         }
 
-        mTabsCounter.setCount(count);
+        if (mCount > count) {
+            mTabsCount.setInAnimation(mSlideDownIn);
+            mTabsCount.setOutAnimation(mSlideDownOut);
+        } else if (mCount < count) {
+            mTabsCount.setInAnimation(mSlideUpIn);
+            mTabsCount.setOutAnimation(mSlideUpOut);
+        } else {
+            return;
+        }
 
+        mTabsCount.setText(String.valueOf(count));
         mTabs.setContentDescription((count > 1) ?
                                     mActivity.getString(R.string.num_tabs, count) :
                                     mActivity.getString(R.string.one_tab));
+        mCount = count;
     }
 
     public void updateTabCount(int count) {
-        mTabsCounter.setCurrentText(String.valueOf(count));
+        mTabsCount.setCurrentText(String.valueOf(count));
         mTabs.setContentDescription((count > 1) ?
                                     mActivity.getString(R.string.num_tabs, count) :
                                     mActivity.getString(R.string.one_tab));
+        mCount = count;
         updateTabs(mActivity.areTabsShown());
     }
 
     public void prepareTabsAnimation(PropertyAnimator animator, int width) {
         animator.attach(mAwesomeBarEntry,
                         PropertyAnimator.Property.TRANSLATION_X,
                         width);
         animator.attach(mAddressBarBg,
                         PropertyAnimator.Property.TRANSLATION_X,
                         width);
         animator.attach(mTabs,
                         PropertyAnimator.Property.TRANSLATION_X,
                         width);
-        animator.attach(mTabsCounter,
+        animator.attach(mTabsCount,
                         PropertyAnimator.Property.TRANSLATION_X,
                         width);
         animator.attach(mBack,
                         PropertyAnimator.Property.TRANSLATION_X,
                         width);
         animator.attach(mForward,
                         PropertyAnimator.Property.TRANSLATION_X,
                         width);
@@ -828,17 +882,17 @@ public class BrowserToolbar implements T
             setPageActionVisibility(mStop.getVisibility() == View.VISIBLE);
     }
 
     public void adjustTabsAnimation(boolean reset) {
         int width = reset ? 0 : mTabsPaneWidth;
         mAwesomeBarEntry.setTranslationX(width);
         mAddressBarBg.setTranslationX(width);
         mTabs.setTranslationX(width);
-        mTabsCounter.setTranslationX(width);
+        mTabsCount.setTranslationX(width);
         mBack.setTranslationX(width);
         mForward.setTranslationX(width);
         mTitle.setTranslationX(width);
         mFavicon.setTranslationX(width);
         mSiteSecurity.setTranslationX(width);
 
         ((ViewGroup.MarginLayoutParams) mLayout.getLayoutParams()).leftMargin = reset ? mTabsPaneWidth : 0;
     }
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -138,27 +138,25 @@ FENNEC_JAVA_FILES = \
   Restarter.java \
   sqlite/ByteBufferInputStream.java \
   sqlite/MatrixBlobCursor.java \
   sqlite/SQLiteBridge.java \
   sqlite/SQLiteBridgeException.java \
   ReaderModeUtils.java \
   RemoteTabs.java \
   RobocopAPI.java \
-  Rotate3DAnimation.java \
   ServiceNotificationClient.java \
   SessionParser.java \
   SetupScreen.java \
   ShapedButton.java \
   SiteIdentityPopup.java \
   SmsManager.java \
   SuggestClient.java \
   SurfaceBits.java \
   Tab.java \
-  TabCounter.java \
   Tabs.java \
   TabsPanel.java \
   TabsTray.java \
   TabsAccessor.java \
   TailTouchDelegate.java \
   Telemetry.java \
   TextSelection.java \
   TextSelectionHandle.java \
@@ -596,17 +594,16 @@ RES_DRAWABLE_MDPI = \
   res/drawable-mdpi/spinner_focused.9.png \
   res/drawable-mdpi/spinner_pressed.9.png \
   res/drawable-mdpi/tab_new.png \
   res/drawable-mdpi/tab_new_pb.png \
   res/drawable-mdpi/tab_close.png \
   res/drawable-mdpi/tab_thumbnail_default.png \
   res/drawable-mdpi/tab_thumbnail_shadow.png \
   res/drawable-mdpi/tabs_count.png \
-  res/drawable-mdpi/tabs_count_foreground.png \
   res/drawable-mdpi/address_bar_url_default.9.png \
   res/drawable-mdpi/address_bar_url_default_pb.9.png \
   res/drawable-mdpi/address_bar_url_pressed.9.png \
   res/drawable-mdpi/address_bar_url_pressed_pb.9.png \
   res/drawable-mdpi/doorhanger_popup_bg.9.png \
   res/drawable-mdpi/find_close.png \
   res/drawable-mdpi/find_next.png \
   res/drawable-mdpi/find_prev.png \
@@ -695,17 +692,16 @@ RES_DRAWABLE_HDPI = \
   res/drawable-hdpi/spinner_focused.9.png \
   res/drawable-hdpi/spinner_pressed.9.png \
   res/drawable-hdpi/tab_new.png \
   res/drawable-hdpi/tab_new_pb.png \
   res/drawable-hdpi/tab_close.png \
   res/drawable-hdpi/tab_thumbnail_default.png \
   res/drawable-hdpi/tab_thumbnail_shadow.png \
   res/drawable-hdpi/tabs_count.png \
-  res/drawable-hdpi/tabs_count_foreground.png \
   res/drawable-hdpi/address_bar_url_default.9.png \
   res/drawable-hdpi/address_bar_url_default_pb.9.png \
   res/drawable-hdpi/address_bar_url_pressed.9.png \
   res/drawable-hdpi/address_bar_url_pressed_pb.9.png \
   res/drawable-hdpi/doorhanger_popup_bg.9.png \
   res/drawable-hdpi/find_close.png \
   res/drawable-hdpi/find_next.png \
   res/drawable-hdpi/find_prev.png \
@@ -783,17 +779,16 @@ RES_DRAWABLE_XHDPI = \
   res/drawable-xhdpi/spinner_focused.9.png \
   res/drawable-xhdpi/spinner_pressed.9.png \
   res/drawable-xhdpi/tab_new.png \
   res/drawable-xhdpi/tab_new_pb.png \
   res/drawable-xhdpi/tab_close.png \
   res/drawable-xhdpi/tab_thumbnail_default.png \
   res/drawable-xhdpi/tab_thumbnail_shadow.png \
   res/drawable-xhdpi/tabs_count.png \
-  res/drawable-xhdpi/tabs_count_foreground.png \
   res/drawable-xhdpi/doorhanger_popup_bg.9.png \
   res/drawable-xhdpi/find_close.png \
   res/drawable-xhdpi/find_next.png \
   res/drawable-xhdpi/find_prev.png \
   res/drawable-xhdpi/urlbar_stop.png \
   res/drawable-xhdpi/reader.png \
   res/drawable-xhdpi/reader_active.png \
   res/drawable-xhdpi/reading_list.png \
deleted file mode 100644
--- a/mobile/android/base/Rotate3DAnimation.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.mozilla.gecko;
-
-import android.view.animation.Animation;
-import android.view.animation.Transformation;
-
-import android.graphics.Camera;
-import android.graphics.Matrix;
-
-/**
- * An animation that rotates the view on the Y axis between two specified angles.
- * This animation also adds a translation on the Z axis (depth) to improve the effect.
- */
-public class Rotate3DAnimation extends Animation {
-    private final float mFromDegrees;
-    private final float mToDegrees;
-
-    private final float mCenterX;
-    private final float mCenterY;
-
-    private final float mDepthZ;
-    private final boolean mReverse;
-    private Camera mCamera;
-
-    private int mWidth = 1;
-    private int mHeight = 1;
-
-    /**
-     * Creates a new 3D rotation on the Y axis. The rotation is defined by its
-     * start angle and its end angle. Both angles are in degrees. The rotation
-     * is performed around a center point on the 2D space, definied by a pair
-     * of X and Y coordinates, called centerX and centerY. When the animation
-     * starts, a translation on the Z axis (depth) is performed. The length
-     * of the translation can be specified, as well as whether the translation
-     * should be reversed in time.
-     *
-     * @param fromDegrees the start angle of the 3D rotation
-     * @param toDegrees the end angle of the 3D rotation
-     * @param centerX the X center of the 3D rotation
-     * @param centerY the Y center of the 3D rotation
-     * @param reverse true if the translation should be reversed, false otherwise
-     */
-    public Rotate3DAnimation(float fromDegrees, float toDegrees,
-            float centerX, float centerY, float depthZ, boolean reverse) {
-        mFromDegrees = fromDegrees;
-        mToDegrees = toDegrees;
-        mCenterX = centerX;
-        mCenterY = centerY;
-        mDepthZ = depthZ;
-        mReverse = reverse;
-    }
-
-   @Override
-    public void initialize(int width, int height, int parentWidth, int parentHeight) {
-        super.initialize(width, height, parentWidth, parentHeight);
-        mCamera = new Camera();
-        mWidth = width;
-        mHeight = height;
-    }
-
-    @Override
-    protected void applyTransformation(float interpolatedTime, Transformation t) {
-        final float fromDegrees = mFromDegrees;
-        float degrees = fromDegrees + ((mToDegrees - fromDegrees) * interpolatedTime);
-
-        final Camera camera = mCamera;
-        final Matrix matrix = t.getMatrix();
-
-        camera.save();
-        if (mReverse) {
-            camera.translate(0.0f, 0.0f, mDepthZ * interpolatedTime);
-        } else {
-            camera.translate(0.0f, 0.0f, mDepthZ * (1.0f - interpolatedTime));
-        }
-        camera.rotateX(degrees);
-        camera.getMatrix(matrix);
-        camera.restore();
-
-        matrix.preTranslate(-mCenterX * mWidth, -mCenterY * mHeight);
-        matrix.postTranslate(mCenterX * mWidth, mCenterY * mHeight);
-    }
-}
deleted file mode 100644
--- a/mobile/android/base/TabCounter.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; 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;
-
-import android.content.Context;
-import android.os.Build;
-import android.view.accessibility.AccessibilityNodeInfo;
-import android.view.animation.Animation;
-import android.view.animation.AnimationSet;
-import android.view.animation.AlphaAnimation;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.util.AttributeSet;
-import android.widget.ViewSwitcher;
-
-public class TabCounter extends GeckoTextSwitcher
-                        implements ViewSwitcher.ViewFactory {
-
-    private static final float CENTER_X = 0.5f;
-    private static final float CENTER_Y = 1.25f;
-    private static final int DURATION = 500;
-    private static final float Z_DISTANCE = 200;
-
-    private final AnimationSet mFlipInForward;
-    private final AnimationSet mFlipInBackward;
-    private final AnimationSet mFlipOutForward;
-    private final AnimationSet mFlipOutBackward;
-    private final LayoutInflater mInflater;
-
-    private int mCount = 0;
-
-    private enum FadeMode {
-        FADE_IN,
-        FADE_OUT
-    }
-
-    public TabCounter(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        mInflater = LayoutInflater.from(context);
-
-        mFlipInForward = createAnimation(-90, 0, FadeMode.FADE_IN, -1 * Z_DISTANCE, false);
-        mFlipInBackward = createAnimation(90, 0, FadeMode.FADE_IN, Z_DISTANCE, false);
-        mFlipOutForward = createAnimation(0, -90, FadeMode.FADE_OUT, -1 * Z_DISTANCE, true);
-        mFlipOutBackward = createAnimation(0, 90, FadeMode.FADE_OUT, Z_DISTANCE, true);
-
-        removeAllViews();
-        setFactory(this);
-        setCount(0);
-
-        if (Build.VERSION.SDK_INT >= 16) {
-            // This adds the TextSwitcher to the a11y node tree, where we in turn
-            // could make it return an empty info node. If we don't do this the
-            // TextSwitcher's child TextViews get picked up, and we don't want
-            // that since the tabs ImageButton is already properly labeled for
-            // accessibility.
-            setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
-            setAccessibilityDelegate(new View.AccessibilityDelegate() {
-                    @Override
-                    public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {}
-                });
-        }
-    }
-
-    public void setCount(int count) {
-        if (mCount > count) {
-            setInAnimation(mFlipInBackward);
-            setOutAnimation(mFlipOutForward);
-        } else if (mCount < count) {
-            setInAnimation(mFlipInForward);
-            setOutAnimation(mFlipOutBackward);
-        } else {
-            return;
-        }
-
-        setText(String.valueOf(count));
-        mCount = count;
-    }
-
-    private AnimationSet createAnimation(float startAngle, float endAngle,
-                                         FadeMode fadeMode,
-                                         float zEnd, boolean reverse) {
-        final Context context = getContext();
-        AnimationSet set = new AnimationSet(context, null);
-        set.addAnimation(new Rotate3DAnimation(startAngle, endAngle, CENTER_X, CENTER_Y, zEnd, reverse));
-        set.addAnimation(fadeMode == FadeMode.FADE_IN ? new AlphaAnimation(0.0f, 1.0f) :
-                                                        new AlphaAnimation(1.0f, 0.0f));
-        set.setDuration(DURATION);
-        set.setInterpolator(context, android.R.anim.accelerate_interpolator);
-        return set;
-    }
-
-    @Override
-    public View makeView() {
-        return mInflater.inflate(R.layout.tabs_counter, null);
-    }
-
-}
index f81e047e34ae3d97d477ff030a106e879b60cce0..c81712cec96ae28ce1eeea8e240ebf5aa4222e2f
GIT binary patch
literal 1235
zc$}S7U1%It6rOfV6H2p2(W0^9by}^3?9NYiXJ^Jtva>U@&0;rAHw!NK;Lgt6WQJsZ
zGIQf@f)7U8LPSMDp+0B}ZG$f@M1)cVr6e>hh~yzsQHfMa$b--~MJcX#;%<~u^5A98
z+<VTP@0@eb&&-buAM4uJvyUK%uELO7!u#QfI``uD9pda+ygh}q3L5psP+booA)8(e
zf`X%u!xGfZnW<Z_pCDqEU9O-?@wjMsPEwC_k`2cvqSZgx@O5JXB2a_lwkwhMzWka5
zwkeUXq>FUXSD<AN%?5CEcDQWJP8fno4i13+hKLO~5b2=dOuC`ikjO2&B0fiAiUeCK
zXhI_Y393>Y0g4wukWTg`44Pp8$0eCmn&X&Wz|ss$(fHvKOiE01BAWrNMPhG(IVP6W
ze9IT+B+^327b&V<uP5t$NiP_u7(oys8!Vf^8i{bmMS3IQhKJe~R2Uk8?IYWBLB#7d
zZyHG?*}j6~7mM45-LRD?oHDAR`xKL;DaWDO+94{zv7NQU@{A9u5)8fRz`*qwJM<q{
zJ3}Ky9F2G)uyIlJN!2r^9q6KhDv|h0(zH!6&u8)slS$DTmgabd;c31vpJN4CP&Ah9
zW7;+zhRw-oT1gACOlK5^(O6!|<Yg@<YbvkiXf4ym7Tgf&t^wOv`(LcEBUV%bs3R{Z
zd){Qb14b+ld7<U`KpEx0i$&eA-AHgWDo`s{7}&2vGaq;k*vhbIKO_QL;OPf%t}-mo
zXL7tIC^@o)HUCf6C>#v+K)bX>xCf)-cJpIqdwigaXC}bI5np|2KSAu;RZ!(}<A>V)
zW^-_<y8E3AadJuiDf?^Jaz5Kjl$5zY&b`@qw%a>$TLvp1#uoXHr1jYH)%lY*Pu=)^
zVa~{AKd7AUwcbz;|JDx%x|W-pAD>xOhKTuMeWe<9v(2Bgci98vcbAAo=D;KG$FkQp
zW8LRszg*7Vf8w>yJG<9{{jo2ed~{E3+<I^0g%$aD>h0&ItZx^tX%~s5>l<JW(*mY5
zCp+F1tu^^Vyyu(vpThSCk#qi;Q|sAR<I@*!RHs&tfls-|A4?~GyxqJtwc61mZc0L2
zJfU=aa%4q5zkdDY9)9EbwaL%(gP)~4=dM1T5(iRu5ANx%68BCIEbdkQ`YQU(6trRW
IO0N3W-??m;qyPW_
deleted file mode 100644
index 8b20b5eb3cd56eb7d6c135522cc08c1f37b1bb42..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index b3c15996628758c4f490087502864e47b3a43398..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
index 74eef827b1a74854637437ff9e34ef63efb063b5..763d0eec4dd4011a05c0a7337d3f491738263c77
GIT binary patch
literal 1319
zc%17D@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC$r9IylHmNblJdl&R0hYC{G?O`
z&)mfH)S%SFl*+=BsWuD@%o&*>5hW46K32*3xq68pHF_1f1q>iyV_#8_n4FzjqL7rD
zo|$K>^nUk#C56lsTcvPQUjyF)=hTc$kE){7;3~h6<f`ms%M>MhI|Z8xE1&_nsU?XD
z6}dTi#a0!zN?>!XfNYSkzLEl1NlCV?62wsvz5xo(`9-M;rh3M@$p(go3T9?{h9;(F
zW`;TnMh1pP`UXH`rfX<oWol++WUc@ON<iC+Qqrt~T-=~`0eQAc86_nJR{Hwo<>h+i
z#(Mch>H3D2mX;thjEr=FDs+o0^GXscbn}XpVJ5hw7AF^F7L;V>=P7{riAnjTCALaR
zFfZg5`1-;P&MSrn6fns2D-sLz4fPE4b941!s*6j4Qq%COE)J<INYxKYEzU13N(RP9
znlh4A__cx*0$pR}Uz7=ql*AmD{N&Qy)VvZ;7h5Huj9yA+ij|v%xtpP(xru?fk%5_o
zp`nF=g|VBHk)@-hv#XJju_4S1Y<gYY94#G<jh!3~%$*GlU5zZ9&D|Vbog7_VEL@xn
zT+Ly6J@bl767!N%VR|zWdL8lVwQ?>>O)SYT3dzsUfu(?ejQo=P;*9(P1?ONh1r6WC
z<jg#ffF>w{pl(eq$}CGwaVyHtRRD*uRVEe}7+6{up!?j#(8$8V+{wb#(%DG~syBt4
zP}2uGMjtJ?z=VKl5X6Khejo>)eNyv)d8P=MIbvfOe=smGhI+a<hE&{oGwWd1AqRmr
zb61ffqXqM7IDRt(dGP--*ysD=p!o+zmkj}|@(X@(IoYmYKiV9``gs42IH$|bGUdib
z%=Z&NZuoq3X6&37M+?_j9Pdt&d&A20zvfx9z@8>84Z-)dY}y8l$`e*j+dD;WMKd3V
zj_nCKiQuUd@+~W6^QYJfMES+Jw{BvW>inuM(ZD=iZJp}1+7G8+O8Cw*+v)r7<@?4h
z8I9X4*UCx$njPP~a;N&Y5GJ!p`==J&y}%;)W1)uPeaEF!&fa}e{I2o9oxnA-cN~me
za4dF#ihYKQ0}C9@i+OM)HsN4w!U`k5uFpyzcy}e7TR7*^F|FX{IZl-#7FK7zdnj%w
z(b%v=V1}j0j6jYTj<1h7ezM;D{Vr3L*B{1hVw0~|yT0n@+**Eoc9m^LZTR)V`SWIo
v%3s)^9c&h_mAdEM$#`C%MHR<g8yFe5kJ@(bjEve1D!M#f{an^LB{Ts5XC1|T
deleted file mode 100644
index bad3253310d1e4c3c7350a81803a359e147261ce..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
--- a/mobile/android/base/resources/layout-large-v11/browser_toolbar.xml
+++ b/mobile/android/base/resources/layout-large-v11/browser_toolbar.xml
@@ -26,24 +26,25 @@
                         android:paddingRight="38dip"/>
 
     <!-- The TextSwitcher should be shifted 28dp on the right, to avoid
          the curve. On a 56dp space, centering 24dp image will leave
          16dp on all sides. However this image has a perception of
          2 layers. Hence to center this, an additional 4dp is added to the right.
          The margins will be 12dp on left, 48dp on right, instead of ideal 16dp
          and 44dp. -->
-    <org.mozilla.gecko.TabCounter android:id="@+id/tabs_counter"
-                        style="@style/AddressBar.ImageButton.TabCount"
+    <Gecko.TextSwitcher android:id="@+id/tabs_count"
+                        style="@style/AddressBar.ImageButton"
                         android:layout_width="24dip"
                         android:layout_height="24dip"
                         android:layout_marginLeft="12dip"
                         android:layout_marginRight="48dip"
                         android:layout_marginTop="16dp"
-                        android:layout_alignLeft="@id/tabs"/>
+                        android:layout_alignLeft="@id/tabs"
+                        android:gravity="center_horizontal"/>
 
     <FrameLayout android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  android:layout_toRightOf="@id/tabs"
                  android:layout_toLeftOf="@id/menu_items"
                  android:layout_marginLeft="-18dp"
                  android:paddingRight="18dp"
                  android:layout_marginTop="7dp"
--- a/mobile/android/base/resources/layout/browser_toolbar.xml
+++ b/mobile/android/base/resources/layout/browser_toolbar.xml
@@ -3,18 +3,16 @@
    - 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/. -->
 
 <org.mozilla.gecko.BrowserToolbarLayout xmlns:android="http://schemas.android.com/apk/res/android"
               xmlns:gecko="http://schemas.android.com/apk/res-auto"
               android:id="@+id/browser_toolbar"
               style="@style/BrowserToolbar"
               android:layout_centerVertical="true"
-              android:clipChildren="false"
-              android:clipToPadding="false"
               android:clickable="true"
               android:focusable="true">
 
     <ImageButton android:id="@+id/back"
                  style="@style/AddressBar.ImageButton.Back"/>
 
     <ImageButton android:id="@+id/forward"
                  style="@style/AddressBar.ImageButton.Forward"/>
@@ -77,24 +75,25 @@
                         android:paddingRight="11dip"/>
 
     <!-- The TextSwitcher should be shifted 24dp on the left, to avoid
          the curve. On a 48dp space, centering 24dp image will leave
          12dp on all sides. However this image has a perception of
          2 layers. Hence to center this, an additional 4dp is added to the left.
          The margins will be 40dp on left, 8dp on right, instead of ideal 30dp
          and 12dp. -->
-    <org.mozilla.gecko.TabCounter android:id="@+id/tabs_counter"
-                        style="@style/AddressBar.ImageButton.TabCount"
+    <Gecko.TextSwitcher android:id="@+id/tabs_count"
+                        style="@style/AddressBar.ImageButton"
                         android:layout_width="24dip"
                         android:layout_height="24dip"
                         android:layout_marginLeft="40dip"
                         android:layout_marginRight="8dip"
                         android:layout_marginTop="12dip"
-                        android:layout_alignRight="@id/tabs"/>
+                        android:layout_alignRight="@id/tabs"
+                        android:gravity="center_horizontal"/>
 
     <LinearLayout android:id="@+id/awesome_bar_content"
                   style="@style/AddressBar.Button"
                   android:layout_toLeftOf="@id/tabs"
                   android:layout_marginRight="-24dp"
                   android:orientation="horizontal">
 
         <ImageButton android:id="@+id/favicon"
--- a/mobile/android/base/resources/layout/tabs_counter.xml
+++ b/mobile/android/base/resources/layout/tabs_counter.xml
@@ -4,14 +4,14 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <Gecko.TextView xmlns:android="http://schemas.android.com/apk/res/android"
                 android:layout_width="24dip"
                 android:layout_height="24dip"
                 android:layout_margin="12dip"
                 android:paddingTop="2dip"
                 android:paddingLeft="4dip"
-                android:background="@drawable/tabs_count_foreground"
+                android:background="@drawable/tabs_count"
                 android:textAppearance="@style/TextAppearance.Micro"
                 android:textColor="#FF43484E"
                 android:textStyle="bold"
                 android:duplicateParentState="true"
                 android:gravity="center"/>
--- a/mobile/android/base/resources/values/styles.xml
+++ b/mobile/android/base/resources/values/styles.xml
@@ -156,23 +156,16 @@
 
     <!-- BrowserToolbar -->
     <style name="BrowserToolbar">
         <item name="android:layout_width">fill_parent</item>
         <item name="android:layout_height">@dimen/browser_toolbar_height</item>
         <item name="android:orientation">horizontal</item>
     </style>
 
-    <style name="AddressBar.ImageButton.TabCount">
-        <item name="android:background">@drawable/tabs_count</item>
-        <item name="android:gravity">center_horizontal</item>
-        <item name="android:clipChildren">false</item>
-        <item name="android:clipToPadding">false</item>
-    </style>
-
     <!-- Address bar -->
     <style name="AddressBar">
         <item name="android:layout_width">fill_parent</item>
         <item name="android:layout_height">fill_parent</item>
         <item name="android:orientation">horizontal</item>
     </style>
 
     <!-- Address bar - Button -->