Skip to content

Instantly share code, notes, and snippets.

@codeforfun-jp
Last active May 13, 2024 23:38
Show Gist options
  • Save codeforfun-jp/9bf8e78facf6310e6d351ba2af42da18 to your computer and use it in GitHub Desktop.
Save codeforfun-jp/9bf8e78facf6310e6d351ba2af42da18 to your computer and use it in GitHub Desktop.
Kotlin Intro #7-2
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContentView(R.layout.activity_main)
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
insets
}
val textView: TextView = findViewById(R.id.textView)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment