Closed Bug 1199041 Opened 9 years ago Closed 9 years ago

Improve comment in DrawableUtil.tintDrawableWithStateList

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(firefox43 fixed)

RESOLVED FIXED
Firefox 43
Tracking Status
firefox43 --- fixed

People

(Reporter: mcomella, Assigned: mcomella)

Details

Attachments

(1 file)

Chenxia pointed out this was confusing. Currently:

34      * Tints the given drawable with the given tint list and returns it. Note that this
35      * transformation does not occur in place on pre-Lollipop devices (bug 1193950).

"in place" is inaccurate – it really means "mutation" but doesn't really get the point across.

How about:

"Tints the given drawable with the given tint list and returns it. Use the returned Drawable, rather than the argument, because the the argument Drawable is not in a consistent state across Android versions, due to the Support Library implementation across versions."

Chenxia, thoughts?

http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/util/DrawableUtil.java#34
Flags: needinfo?(liuche)
This is better, but could be better.

How about:

"Tints the given drawable with the given tint list and returns it. 'wrap()' is called on the Drawable so that it can be consumed by all API versions because the Drawable implementation is not consistent across versions."
Flags: needinfo?(liuche)
Comment on attachment 8655717 [details]
MozReview Request: Bug 1199041 - Clarify comment in DrawableUtil. r=liuche

https://reviewboard.mozilla.org/r/18003/#review16561
Attachment #8655717 - Flags: review?(liuche) → review+
https://hg.mozilla.org/mozilla-central/rev/8df7dd2d23fd
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 43
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: