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

Skip to content
Commit b1af7f3d authored by Chet Haase's avatar Chet Haase
Browse files

add getAlpha() to Drawable

Drawable has setAlpha(int), but no getAlpha() (although some subclasses have added the
method). This makes it more tedious to use the property. For example, animations that wish to
animate this property must explicitly give it a start value since this value cannot be queried
from the object.

The trick is that setAlpha(int) is abstract, only implemented by subclasses. We cannot take this
approach for getAlpha(), as we would break all subclasses of Drawable until they implemented the
method. Instead, we'll add a default method which returns an invalid value, making it easier for
clients of the method to detect whether the value is valid.

All subclasses of Drawble in frameworks have been changed to add an override of getAlpha() when
appropriate.

Issue #7485875 Drawables is missing getAlpha()

Change-Id: I06b6e35f1a56d202838eca44759c85c82595020a
parent 1ccdf0ee
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