Resetting the button background creates a temporary button #21579
Labels
area-controls-button
Button, ImageButton
platform/android 🤖
t/perf
The issue affects performance (runtime speed, memory usage, startup time, etc.)
Milestone
Passing the default drawable has been changed to copy the tints from a temporary button. It is not an operation that happens frequently, set a background and then removing it, but is this perhaps more expensive?
Originally posted by @jsuarezruiz in #20412 (comment)
It is a bit more expensive, but we don't need to add fields to handlers and pass the default drawable around. That requires new APIs and a bunch of old ones not working. It is more expensive, but this is smei-temporary because all I am using is the tint:
A better option is to not do either and just figure out the default tint color. There is probably some theme resource or some API to just get the raw color. However the color goes from android resources to the main color of the button - some primary color thing. If we can do that in our code, it will just be reading a resource color from the android resources.
The text was updated successfully, but these errors were encountered: