Bug 1350718 - 2. Remove the add animation for the TabsLayout list. r?maliu
Based on what I'm seeing, if you call scrollToPosition and that causes you to
"scroll into view" (remember, scrollToPosition doesn't actually scroll, it just
redraws the new position) one or more positions, then RecyclerView runs the add
animation on all those views "scrolled onto screen", which, for the list view's
slide-in-from-the-right add animation, looks silly (I think). [Caveat:
RecyclerView sometimes keeps one offscreen view ready to go, which doesn't seem
to get the add animation.]
In non open-tab-from-another-app-with-the-tabs-tray-already-open operations this
was never an issue because either those animations are hidden by the panel being
animated into view when the panel opens and we scroll to the selected position
[at least that's my guess], or we only scroll by at most one, as in the case of
a tab close or undo close. But in the
open-a-tab-and-scroll-to-it-while-the-tabs-tray-is-already-open case that we can
get with opening a tab from another app, the add animation runs for however many
tabs "need to be added" between the current position and the new tab; sometimes
the animation still gets hidden if the new tabs get added quickly enough when
fennec reloads [again, my guess], but on my device I always see the animations
if I open a tab in tab queue and then reopen Fennec by hand, whereas on an
emulator I see the animations in additional external-app-open cases as well.
MozReview-Commit-ID: J3x0bBLPNyz
--- a/mobile/android/base/java/org/mozilla/gecko/tabs/TabsListLayoutAnimator.java
+++ b/mobile/android/base/java/org/mozilla/gecko/tabs/TabsListLayoutAnimator.java
@@ -37,29 +37,9 @@ class TabsListLayoutAnimator extends Def
final View itemView = holder.itemView;
ViewCompat.animate(itemView)
.setDuration(getRemoveDuration())
.translationX(itemView.getWidth())
.alpha(0)
.setListener(new DefaultRemoveVpaListener(holder))
.start();
}
-
- @Override
- protected boolean preAnimateAddImpl(RecyclerView.ViewHolder holder) {
- resetAnimation(holder);
- final View itemView = holder.itemView;
- itemView.setTranslationX(itemView.getWidth());
- itemView.setAlpha(0);
- return true;
- }
-
- @Override
- protected void animateAddImpl(final RecyclerView.ViewHolder holder) {
- final View itemView = holder.itemView;
- ViewCompat.animate(itemView)
- .setDuration(getAddDuration())
- .translationX(0)
- .alpha(1)
- .setListener(new DefaultAddVpaListener(holder))
- .start();
- }
}