In the process of updating to android gradle plugin 3.0, lint has suddenly started failing for views where layout_width
and layout_height
are defined in the style, rather than at the parent layout. One of the examples :
<Button
android:id="@+id/btn_positive"
style="@style/rounded_solid_button"
android:textAppearance="@style/TextAppearance.ProximaRegularFont"
android:textSize="@dimen/mini"
android:text="Ok"/>
and my styles.xml
:
<style name="rounded_solid_button">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_gravity">center_horizontal</item>
<item name="android:gravity">center</item>
<item name="android:textColor">@color/button_text_color</item>
<item name="android:textStyle">normal</item>
<item name="android:textAllCaps">false</item>
<item name="android:background">@drawable/rounded_solid_button</item>
<item name="android:layout_marginTop">20dp</item>
<item name="android:textSize">@dimen/title</item>
<item name="android:singleLine">true</item>
</style>
Lint fails here stating :
The required layout_width and layout_height attributes are missing
Anybody else faced this issue?