|  |  | @ -13,10 +13,16 @@ public class MainActivity extends AppCompatActivity { | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Override |  |  |  |     @Override | 
			
		
	
		
		
			
				
					
					|  |  |  |     protected void onCreate(Bundle savedInstanceState) { |  |  |  |     protected void onCreate(Bundle savedInstanceState) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         super.onCreate(savedInstanceState); |  |  |  |         super.onCreate(savedInstanceState); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         // 启用全屏显示,内容可以延伸到屏幕边缘
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         EdgeToEdge.enable(this); |  |  |  |         EdgeToEdge.enable(this); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         // 设置主布局
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         setContentView(R.layout.activity_main); |  |  |  |         setContentView(R.layout.activity_main); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |          | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         // 设置窗口插入监听器,处理系统状态栏和导航栏的空间
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> { |  |  |  |         ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             // 获取系统状态栏和导航栏的尺寸
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); |  |  |  |             Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             // 设置视图的内边距,确保内容不会被系统UI遮挡
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); |  |  |  |             v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); | 
			
		
	
		
		
			
				
					
					|  |  |  |             return insets; |  |  |  |             return insets; | 
			
		
	
		
		
			
				
					
					|  |  |  |         }); |  |  |  |         }); | 
			
		
	
	
		
		
			
				
					|  |  | 
 |