RUVIDEO
Поделитесь видео 🙏

How to Automatically Format Your Code in Android Studio

In this Android Studio Note video you'll learn how to keep your code perfectly formatted without manual changes.

Mac: Command+Option+L
Windows: Ctrl+Alt+L

Tip: turn on subtitles to deal with my accent. A full transcript is also available below.

Watch the playlist with all Notes here: ►https://www.youtube.com/playlist?list=PLpUMhvC6l7APQNFuJaNFhBmMj5ErOpb1d

----------------------------------------

Future Studio is helping 5,000+ users daily to solve Android and Node.js problems with 320+ written tutorials and videos. We’re on a mission to provide new in-depth content every week.

Checkout 320+ technical in-depth tutorials:
►https://futurestud.io

Subscribe for two new videos every week:
►https://www.youtube.com/c/FutureStudio?sub_confirmation=1

----------------------------------------

Follow us on social media to get updates on new content:
►https://twitter.com/futurestud_io
►https://www.facebook.com/FutureStudioUniversity
►https://plus.google.com/+FutureStudioUniversity

----------------------------------------

Full transcript:

Hey, what is up everyone. Norman from futurestud.io University here. Welcome to another video in our Android Studio Note series. In just a few minutes you'll learn a little trick to increase your productivity every single day.

Today we've the reformat code option. Ideally, in your company or in your open source project, you've agreed on code conventions. So, sometimes developers like to have spaces between parameters, sometimes they don't. There is the discussion, should curly brackets be on the same line or on the new line? It doesn't matter to me, just make it consistent.

You can configure all of these preferences in the settings. Once you've started the project, make sure everyone has the settings configured. You can even share them. Then you can use the "reformat code" option.

The reformat code shortcut is command+option+L, for windows it's ctrl+alt+L. Once you've hit that it'll automatically change all the code in your class to the defined pattern.

If your code conventions says there is no spaces and the curly bracket should be on the same line, it'll apply this logic. You don't need to go through it manually. Just one click of a button and it'll automatically do it across the entire file.

What I recommend that you enable this option in the commit dialog. If you see up here you can enable this by default and it'll reformat the code for the commit. This makes sure that the code in the central repository is always perfectly formatted. Ideally, you can convince all of your team mates to enable this option.

That was it. Thank you for watching! If you didn't know this option before, give this video a thumbs up and subscribe for more video. Make it rock!

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «How to Automatically Format Your Code in Android Studio», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.