Clean. Nice. Neat.
Android Developers often work with code, and lots of it. When writing lots of code, it's important for it to be understandable by humans. After all, we're all humans, and chances are that someone else will at some point look at your code. And you want it to look well-formatted. How can we do that?
Windows & Linux: Control+Alt+L
Take code from this:
package com.example.listoffriends
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
setSupportActionBar(toolbar)
val friends = mutableListOf<Friend>()
for (i in 1..100) {
friends.add(Friend("Daniel", "Malone", 25))
}
}
}
...to this:
package com.example.listoffriends
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
setSupportActionBar(toolbar)
val friends = mutableListOf<Friend>()
for (i in 1..100) {
friends.add(Friend("Daniel", "Malone", 25))
}
}
}
This keyboard shortcut manages spacing and indentation. Make use of it!
Alert tutorial.
Material Design.
Stroke it.
Create beautiful buttons in XML.
Built with Android Studio and Kotlin.
Getting started is sometimes the hardest part.
Add a click listener in Kotlin.
Let users sign in.
It always begins with registration.