Hacker48

Code

Mar 28th, 2025
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.67 KB | None | 0 0
  1. package com.example.myapplication1
  2. import android.os.Bundle
  3. import androidx.activity.enableEdgeToEdge
  4. import
  5. androidx.appcompat.app.AppCompatActivity
  6. import androidx.core.view.ViewCompat
  7. import androidx.core.view.WindowInsetsCompat
  8. class MainActivity : AppCompatActivity() {
  9. override fun onCreate(savedInstanceState: Bundle?)
  10. { super.onCreate(savedInstanceState)
  11. enableEdgeToEdge()
  12. setContentView(R.layout.activity_main)
  13. ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
  14. val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
  15. v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
  16. insets
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment