Cleanup repeated ViewHelper.set*() calls on PropertyAnimations

NEW
Unassigned

Status

()

Firefox for Android
General
4 years ago
4 years ago

People

(Reporter: lucasr, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
Suggestion from wesj in bug 942862:

> @@ +331,5 @@
> > +            // the animation starts, so we shift these items to the right so that they don't
> > +            // appear to move initially.
> > +            ViewHelper.setTranslationX(mTitle, width);
> > +            ViewHelper.setTranslationX(mFavicon, width);
> > +            ViewHelper.setTranslationX(mSiteSecurity, width);
> 
> Separate bug, but these repeated calls could probably be wrapped in
> something prettier. i.e.
> 
> prepareTranslate(PropertyAnimator anim, Integer start, int end, View
> views...) {
>   for (View v : views) {
>     anim.attach(v, PropertyAnimation.Property.TRANSLATION_X, end);
>     if (start != null)
>       ViewHelper.setTranslationX(v, start);
>   }
> }
(Reporter)

Updated

4 years ago
Depends on: 942862
You need to log in before you can comment on or make changes to this bug.