Android: Quick Fix using compound drawables

How to do quick fix in such situation in IntelliJ IDEA 12.1.1

Here's example layout

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
    >

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/app_name"
        />

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/imageView"
        android:layout_gravity="center"
        android:contentDescription="@string/app_name"/>
</LinearLayout>


Lint check:
2013-04-16_145405.jpg

       Checks whether the current node can be replaced by a TextView using     compound drawables.

A `LinearLayout` which contains an `ImageView`     and a `TextView` can be more efficiently handled as a compound drawable (a     single TextView, using the `drawableTop`, `drawableLeft`, `drawableRight`     and/or `drawableBottom` attributes to draw one or more images adjacent to     the text). If the two widgets are offset from each other with margins,     this can be replaced with a `drawablePadding` attribute. There's a lint     quickfix to perform this conversion in the Eclipse plugin.   

Alt+Enter doesn't suggest to quick fix
2013-04-16_150229.jpg
In Eclipse quick fix works fine. Should I do it manually all the time or there is a way to fix it like in Eclipse?

Thanks in advance!

2 comments

Unfortunatelly this quick fix is not yet implemented in IntelliJ. I've created an issue for this

0

Please sign in to leave a comment.