Android reusable layouts with background causing lint overdraw error

110 views Asked by At

Our android application has a theme applied at application level and this theme contains the android:windowBackground attribute (white color).

Now I am creating a reusable layout for a widget which will used in multiple screens. This widget also has a background (blue color) and will be used in activities which may or may not have a background applied (we have some activities with @null background).

Here, lint is throwing the following error/warning in this layout:

Possible overdraw: Root element paints background with a theme that also paints a background

It might be showing this error assuming application's theme for the reusable layout. Is there any way to avoid this?

0

There are 0 answers