ofields/sonar-android

android-lint:Overdraw FP?

Opened this issue · 0 comments

I'm getting the following violation:
"Possible overdraw: Root element paints background @color/colorPrimary with a theme that also paints a background (inferred theme is @style/AppTheme_NoActionBar)"

Note: I added "@null" to the theme in the hope that it would fix the issue but it's the same situation with and without this row.

My setup:
Android plugin version 1.1

Relevant part of my code below:

styles.xml:

    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
        <item name="android:background">@null</item>
        <item name="android:textColorSecondary">@color/white</item>
    </style>

AndroidManifest.xml:

        <activity
                android:label=""
                android:name=".accounts.AccountHandlingActivity"
                android:screenOrientation="portrait"
                android:theme="@style/AppTheme.NoActionBar"
                android:windowSoftInputMode="adjustResize|stateHidden"
                >

activity_account_handling.xml:
Note: the violation is on the row which sets "android:background":

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:app="http://schemas.android.com/apk/res-auto"
                xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/colorPrimary"
                android:fitsSystemWindows="true"
        >