Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds lots of enhancements and fixes to IconDrawable: - Adds spin animation functionality. - Adds constant state in order to work around bugs in the framework and support library where this is expected. - Handle the case where the width of the icon is not the same as it's height by returning the correct intrinsic width, and changing the drawing logic to always fit the icon within it's bounds. - Adds support for color state lists. - Adds support for tint, and sets the default to implement the half translucency on disabled state, and removed the custom logic to do it by changing the alpha. - Modulates the existing alpha from the color instead of replacing it. - Removes the changing of the bounds upon size change, as that should only be done by the view. - Adds a public method to get the icon. - Adds missing implementations of base methods. Note that because we need to be able to generate the drawable without a Context from the constant state, the methods that resolved resources (i.e. colors, dimensions) now have to take a Context as a parameter. This unfortunately makes the change backwards-incompatible. The spin animation logic is also slightly changed in CustomTypefaceSpan to initialize the start time upon first draw instead of upon instantiation, since that is the actual start time of the animation. This matches it with the implementation in IconDrawable.
- Loading branch information