Open Bug 1895645 Opened 6 months ago Updated 6 months ago

consider alternative solution to debouncing around invalidateActions call

Categories

(Fenix :: Toolbar, enhancement)

All
Android
enhancement

Tracking

(Not tracked)

People

(Reporter: mavduevskiy, Unassigned)

References

Details

We were experiencing a number of visual glitches in the toolbar when having more than one action item present in the addressbar. They were caused by various features calling Toolbar.invalidateActions multiple times in a quick succession when navigating to a page/reloading/pressing an action button. Here is a log of the functions calls while navigating to a wiki page with translation function and reader mode enabled for the page:

2024-04-19 15:01:30.476 12913-12913 System.out org.mozilla.fenix.debug I DisplayToolbar.invalidateActions()
2024-04-19 15:01:31.169 12913-12913 System.out org.mozilla.fenix.debug I DisplayToolbar.invalidateActions()
2024-04-19 15:01:31.175 12913-12913 System.out org.mozilla.fenix.debug I DisplayToolbar.invalidateActions()
2024-04-19 15:01:31.187 12913-12913 System.out org.mozilla.fenix.debug I DisplayToolbar.invalidateActions()
2024-04-19 15:01:31.188 12913-12913 System.out org.mozilla.fenix.debug I DisplayToolbar.invalidateActions()
2024-04-19 15:01:31.659 12913-12913 System.out org.mozilla.fenix.debug I DisplayToolbar.invalidateActions()
2024-04-19 15:01:31.662 12913-12913 System.out org.mozilla.fenix.debug I DisplayToolbar.invalidateActions()
2024-04-19 15:01:31.668 12913-12913 System.out org.mozilla.fenix.debug I DisplayToolbar.invalidateActions()
2024-04-19 15:01:31.671 12913-12913 System.out org.mozilla.fenix.debug I DisplayToolbar.invalidateActions()
2024-04-19 15:01:31.708 12913-12913 System.out org.mozilla.fenix.debug I DisplayToolbar.invalidateActions()
2024-04-19 15:01:31.710 12913-12913 System.out org.mozilla.fenix.debug I DisplayToolbar.invalidateActions()
2024-04-19 15:01:31.818 12913-12913 System.out org.mozilla.fenix.debug I DisplayToolbar.invalidateActions()
2024-04-19 15:01:31.820 12913-12913 System.out org.mozilla.fenix.debug I DisplayToolbar.invalidateActions()
2024-04-19 15:01:31.825 12913-12913 System.out org.mozilla.fenix.debug I DisplayToolbar.invalidateActions()
2024-04-19 15:01:31.827 12913-12913 System.out org.mozilla.fenix.debug I DisplayToolbar.invalidateActions()
2024-04-19 15:01:31.863 12913-12913 System.out org.mozilla.fenix.debug I DisplayToolbar.invalidateActions()
2024-04-19 15:01:31.865 12913-12913 System.out org.mozilla.fenix.debug I DisplayToolbar.invalidateActions()
2024-04-19 15:01:31.886 12913-12913 System.out org.mozilla.fenix.debug I DisplayToolbar.invalidateActions()
2024-04-19 15:01:31.887 12913-12913 System.out org.mozilla.fenix.debug I DisplayToolbar.invalidateActions()
2024-04-19 15:01:32.021 12913-12913 System.out org.mozilla.fenix.debug I DisplayToolbar.invalidateActions()

We have a variety of features (translations, reader mode) that are listening to the GeckoEngine and are updating actions in the toolbar once they know that the feature is enabled. Those features work asynchronously and are not aware of each other. invalidateActions is calling TransitionManager.beginDelayedTransition internally, that is trying to orchestrate the animations.

It does a good job where there is a single action item, but when we have two or more TransitionManager starts glitching while trying to orchestrate the combined animation of ChangeBounds and Fade.

I was trying to find a way to get a listener for TransitionManager to finish it's job, so we could launch a second call only when the previous has finished, but API seems doesn't support it. Possible, synchronizing features accessing the invalidateActions call?..

On my device, glitches happen when there is less then 0.004 between the calls to TransitionManager.

See Also: → 1889240, 1891192, 1885161
Severity: -- → S2
See Also: → 1896347
You need to log in before you can comment on or make changes to this bug.