How can I make code beautiful in Android Studio as like as VSCode?
Solution 1
You can also use following command to make more beautiful and easy
(1) Search Everywhere (Press Shift Twice / Press Shift Twice)
(2) Recently Opened Files (CTRL+E/Command+E)
(3) Find Action (CTRL+Shift+A/Command+Shift+A)
(4) Generate Code (ALT+INS/Command+N)
(5) Override Methods(CTRL+O/Command+O)
(6) Delete Line at Caret/Cursor (CTRL+Y/Command+Y)
(7) Collapse/Expand Code Blocks (CTRL+- / Command+-)
(8) Collapse/Expand Whole activity code (CTRL ALT - /CTRL ALT +)
(9) Reformat Code (CTRL+ALT+L / Command+Option+L)
Solution 2
Just Press CTRL+ALT+L on Windows or Command+Option+L on Mac. The android studio will reformat all the code for you. And the good part is that it works for XML layouts as well.
Solution 3
Use CTRL+ALT+L
to reformat your code.
Use CTRL+ALT+O
to optimize imports.
Use CTRL+ space
to complete code.
jepbura
SOMETIMES IT IS THE PEOPLE NO ONE IMAGINES ANYTHING OF WHO DO THE THINGS THAT NO ONE CAN IMAGINE. #مخترع #إن_مع_العسر_یسرا
Updated on December 14, 2022Comments
-
jepbura over 1 year
VSCode have a great option what helps developer to make code more beautiful. I mentioned in the given picture. It indicates each brackets related to which case. I've worked on flutter in VSCode but now I've decided to work on Android Studio for some reasons and unfortunately I don't know where I can find it. Did you guys know how I can fix it? I have to apologize for Title because I don't know what this option is?