0

How can I get rid of empty lines between imports of different 'Import-groups' with code formatting in Android-Studio? (want delete line 9 and 12)

enter image description here

With File ->Settings -> Default Settings -> Editor -> Code Style -> Java: set Blank Lines to 0 it doesn't work.

Both not work:
How to remove unnecessary blank line on code formatting in Android Studio
How to remove unnecessary blank line on code formatting in IntelliJ?

Using Android Studio 3.4.

SJX
  • 1,071
  • 14
  • 15

1 Answers1

1

The "Blank" lines section is for spaces in the code file, but the Imports section has a dedicated tab in Android studio.

Have you played around with these? Does it do what you need?

Import Screen

It's worth noting that the "default convention" consists of separating packages like so, so unless you have a very valid reason (spacing is not a good one, because you can collapse them by default), I wouldn't bother with that.

Martin Marconcini
  • 26,875
  • 19
  • 106
  • 144