Android Studio: Block comment style
Asked Answered
L

3

6

Block comment style in Eclipse (write /* and press Enter)

/*
 *  Hello World
 */

Block comment style in Android Studio

/*
    Hello World
 */

How can I make my Android Studio block comments look like the one in Eclipse? Couldn't find anything in the settings.

Limousine answered 20/11, 2014 at 8:0 Comment(0)
W
14

You can create a Live Template to do that.

Follow these steps:

  1. Open Settings (File -> Settings) and go to Live Templates (under Editor)
  2. Click the green + (top right) and choose 1. Live Template
  3. Enter /* as abbreviation and add a description (if desired)
  4. Add the following to the Template text:

    /*
     * $END$
     */
    
  5. Set Expand with to ENTER.

  6. Click Define (highlighted in blue at the bottom) and select areas where you would like the template to be applicable (Java, for example).
  7. Save settings by clicking Apply or OK

Now you can type /* followed by ENTER to insert the desired code :)

Waylon answered 20/11, 2014 at 22:38 Comment(1)
That is one stylish answer. Thank you sir.Limousine
M
2

The closet way of reproducing your result would be to type /** and press Enter. This will produce javadocs comments of the form:

/**
 * Hello World
 */

Then you can delete the second asterisk from the beginning.

Monica answered 20/11, 2014 at 9:49 Comment(1)
Works but it's not exactly what I wanted :)Limousine
A
0
/** write your comment here **/

After writing when you hover on left bar, it will show you toggle rendered view, When you click on it.

It will change the comment into below UI Comment look like this when we click on left honor

Anisole answered 2/1, 2023 at 5:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.