Fullscreen user switching dialog with animations.
Instead of freezing the screen during the user switch, with this CL we are introducing a full screen user switcher, which is showing target user's user name and profile photo with an animated spinner around it. Steps of a user switch: 1. 300ms - dialog show animation 2. 500ms - spinner animation around profile picture 3. Do the actual user switch 4. 300ms - dialog dismiss animation 5. End user switch (call UserSwitchObservers.onUserSwitchComplete, and send ACTION_USER_SWITCHED broadcast) Changes: * Step1 was already there. * Step2 is added between 1-3, which shows a nice smooth progress animation around profile picture, but increases the user switch duration by 500ms. * Step5 and Step4 were running at the same time before, now Step5 is postponed after the completion of Step4. Otherwise, dismiss animation becomes jerky. It was also jerky with unfreezing the screen, now that jerkiness is gone. * All animations are disabled for slower devices. see: ActivityManager.isLowRamDeviceStatic() Results: * We're increasing the user switch duration by 800ms. (Step2 + Step4) * We've a full screen user switcher with smooth animations. * There is no more jerkiness in any stage (showing, during, hiding) of the dialog. Notes: * Our intention was to run Step2 and Step3 simultaneously but it makes the spinner animation jerky. * We're disabling the dialog show/hide and spinner animations when running UserLifecycleTests. Bug: 269237775 Bug: 223090747 Test: atest FrameworksServicesTests:UserControllerTest Test: atest UserLifecycleTests Change-Id: I5e0132e19c8da25438c5dbfecdeddf475b18f7d4
Loading
Please register or sign in to comment