0

When using ctrl+alt+L in Windows, Android Studio will reformat the code. But when there are some comments inside, things go wrong:

enter image description here

Once I reformat code, there will be more blank space before the contents in blockquote:

enter image description here

How to reformat the code like I expect?

Community
  • 1
  • 1
guo
  • 9,674
  • 9
  • 41
  • 79

1 Answers1

0

I found this link, which could be a workaround for you.
How to disable code formatting for some part of the code using comments?

First, enable this option.
Preferences > Editor > Code Style > Formatter Control
https://i.stack.imgur.com/O5MHL.png

Then, write comments like this.

// @formatter:off
/*
YOUR COMMENTS
/*
// @formatter:on
Community
  • 1
  • 1
Leonard
  • 183
  • 1
  • 11