From 3a33746b74b1e0ea2ebc4c365bd8c9c57b6780b4 Mon Sep 17 00:00:00 2001 From: pq6nu3g9e <3143116863@qq.com> Date: Sat, 9 Mar 2024 22:09:39 +0800 Subject: [PATCH] ADD file via upload --- MainActivity.java | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 MainActivity.java diff --git a/MainActivity.java b/MainActivity.java new file mode 100644 index 0000000..4e0a352 --- /dev/null +++ b/MainActivity.java @@ -0,0 +1,24 @@ +package com.example.finefood; + +import android.os.Bundle; + +import androidx.activity.EdgeToEdge; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.graphics.Insets; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowInsetsCompat; + +public class MainActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + EdgeToEdge.enable(this); + setContentView(R.layout.activity_main); + ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> { + Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); + v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); + return insets; + }); + } +} \ No newline at end of file