jwisniewski / android-developer-assistant

A tool for Android developers, testers and designers. Allows to inspect elements, layout, style, even translations directly on mobile devices.
http://appsisle.com/project/developer-assistant/
72 stars 32 forks source link

The application does not detect backgroungTint #6

Closed igorlb-yt closed 3 years ago

igorlb-yt commented 3 years ago

The application is detecting the textColor of the button text, but does not detect the backgroungTint

jwisniewski commented 3 years ago

Hi. There are two sources of information, which influence what we see in Developer Assistant:

  1. A given android View needs to implement View.onProvideStructure(ViewStructure) method. Native Views do that for us, but sometimes in a different way than we would imagine;) The plain android.widget.Button I checked on random Android API version, doesn't use backgroundTint color to fill the test background color via the ViewStructure.setTextStyle method. The TextView being a superclass of the Button also doesn't do so. The only think I can suggest, is to extend View.onProvideStructure method of your custom View class and fill according your needs, for example to provide backgroundTint to the ViewStructure.setTextStyle method as a text background.

  2. A second source of information is way to complicated to even start a discussion here ;) there is a lot of heuristics implemented which cross-check information provided by views to the ViewStructure described above, with resources and layouts from the inspected application, to match as much extra information as possible. I'm improving these algorithms over time, but they won't be perfect. They are just the "best effort", as there is no any official API to do more.

I hope I could help a bit. Please notify me if I can close issue or do something more for you.