Miha-x64 / Mikes_IDEA_extensions

IntelliJ IDEA: missing parts.
Apache License 2.0
34 stars 7 forks source link

Bug: inspection to remove/merge margins/padding doesn't seem to work #30

Closed AndroidDeveloperLB closed 2 years ago

AndroidDeveloperLB commented 2 years ago

v0.24

I'm talking about this inspection: https://github.com/Miha-x64/Mikes_IDEA_extensions/issues/16

Example for this:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" tools:context=".MainActivity">

    <TextView
        android:layout_width="wrap_content" android:layout_height="wrap_content"
        android:layout_marginLeft="12dp" android:layout_marginRight="12dp"
        android:text="Hello World!" />

</FrameLayout>

image

My Application.zip

Miha-x64 commented 2 years ago

Merging suggestion appears on minSdk 22+. On earlier versions aapt creates two versions of the same layout which is not good.

AndroidDeveloperLB commented 2 years ago

What do you mean " creates two versions of the same layout " ? Are you talking about the desugaring ?

Miha-x64 commented 2 years ago

Sort of. Just click the link from my previous message and look at the screenshot.

AndroidDeveloperLB commented 2 years ago

@Miha-x64 Oh we talked about this? Can you please add an option to still offer it, in case desugaring is turned on?

Miha-x64 commented 2 years ago

Not planned, but you can contribute it.

AndroidDeveloperLB commented 2 years ago

@Miha-x64 I hope it will have it

Miha-x64 commented 2 years ago

Merging quickfix works with Alt+Enter/Option+Enter but without highlighting for SDK<22.

AndroidDeveloperLB commented 2 years ago

Thanks