Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 914549b4 authored by Sihua Ma's avatar Sihua Ma
Browse files

Set the original drawable for floating widget view

This ensures that the background of the widget will not disappear after cancelling opening the widget activity.

Normally, when opening and closing the widget activity, the following procedures are executed:

tap on widget
-> opening animation initialized -> opening animation finished
-> close the activity
-> closing animation initialized -> closing animation finished

The steps above would work fine. However, a different set of procedures is followed if we try to cancel opening the widget activity:

tap on widget
-> opening animation initialized
-> opening animation started
-> swipe back before opening animation is completed
-> closing animation initialized
-> opening animation finished
-> closing animation started
-> closing animation finished

During the animation initialization process, FloatingWidgetBackgroundView would be initialized. It will then cache the original background and replace with a temporary drawable with alpha set to 0. The background is only restored at the end of the animation.

If two FloatingWidgetBackgroundView is initialized on the same app widget view before one of them is finished, the second floating view will treat the temporary drawable as the original background. At the end of the closing animation, the temporary drawable with an alpha value of 0 will be set for the app widget view, causing the background of the widget view to disappear.

This CL stores the original drawables into the background view so they could be retrieved during the initialization process of the floating background view.

Test: Manual
Fix: 259526083
Change-Id: Iefa29b22b690076a4fc3fc77fe6eea4b6316f852
parent f1a0bd61
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment