Miha-x64 / Mikes_IDEA_extensions

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

Request: add warning when a padding/margin seem to be used to override, but actually doesn't do anything #46

Closed AndroidDeveloperLB closed 1 year ago

AndroidDeveloperLB commented 1 year ago

If I have in a layout XML a value for "padding", and also for "paddingBottom", sadly the "paddingBottom" doesn't do anything.

I sometimes make this mistake, because I think to myself : "I've created a general rule, and also an exception to the rule".

In this case, the proper way to fix it is to split the "padding" to "paddingHorizontal" and "paddingTop", so that "paddingBottom" would do what it's supposed to do.

I don't remember how it works for margins.

Please offer a warning about such a case and similar cases.

Miha-x64 commented 1 year ago

wait, but we already have this

AndroidDeveloperLB commented 1 year ago

We have? Odd. I didn't see it warn about it. Do I have to enable it , or is it enabled by default? How is it called? I will check if it's enabled or not.

Miha-x64 commented 1 year ago

“Useless resource element” inspection

AndroidDeveloperLB commented 1 year ago

It's manual or automatic? Should just opening the layout file show the warning?

Miha-x64 commented 1 year ago

The inspection is enabled by default and works automatically. Screenshot

It it doesn't work in your case, and Gradle is synced, then there's a bug, please post your code here.

AndroidDeveloperLB commented 1 year ago

Sorry for some reason the plugin wasn't installed anymore. No idea why. Now works fine