Bug 706835 - Remove the new tab indicator animation on about:home load. r=mfinkle
--- a/mobile/android/base/BrowserToolbar.java
+++ b/mobile/android/base/BrowserToolbar.java
@@ -208,40 +208,45 @@ public class BrowserToolbar extends Line
if (mCount > count) {
mTabsCount.setInAnimation(mSlideDownIn);
mTabsCount.setOutAnimation(mSlideDownOut);
} else if (mCount < count) {
mTabsCount.setInAnimation(mSlideUpIn);
mTabsCount.setOutAnimation(mSlideUpOut);
}
- if (count > 1)
- mTabs.setImageLevel(count);
- else
- mTabs.setImageLevel(0);
-
- mTabsCount.setVisibility(View.VISIBLE);
+ // Always update the count text even if we're not showing it,
+ // since it can appear in a future animation (e.g. 1 -> 2)
mTabsCount.setText(String.valueOf(count));
mCount = count;
+ if (count > 1) {
+ // Show tab count if it is greater than 1
+ mTabsCount.setVisibility(View.VISIBLE);
+ // Set image to more tabs dropdown "v"
+ mTabs.setImageLevel(count);
+ }
+
mHandler.postDelayed(new Runnable() {
public void run() {
((TextView) mTabsCount.getCurrentView()).setTextColor(mColor);
}
}, mDuration);
mHandler.postDelayed(new Runnable() {
public void run() {
+ // This will only happen when we are animating from 2 -> 1.
+ // We're doing this here (as opposed to above) because we want
+ // the count to disappear _after_ the animation.
if (Tabs.getInstance().getCount() == 1) {
+ // Set image to new tab button "+"
mTabs.setImageLevel(1);
mTabsCount.setVisibility(View.GONE);
- ((TextView) mTabsCount.getCurrentView()).setTextColor(mCounterColor);
- } else {
- ((TextView) mTabsCount.getCurrentView()).setTextColor(mCounterColor);
}
+ ((TextView) mTabsCount.getCurrentView()).setTextColor(mCounterColor);
}
}, 2 * mDuration);
}
public void setProgressVisibility(boolean visible) {
if (visible) {
mFavicon.setImageDrawable(mProgressSpinner);
mProgressSpinner.start();