Skip to content

Commit

Permalink
refactor: support Android 15 edge-to-edge system bars
Browse files Browse the repository at this point in the history
  • Loading branch information
fankes committed Nov 25, 2024
1 parent 0facd0b commit d7c2618
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
*
* This file is created by fankes on 2022/5/10.
*/
@file:Suppress("DEPRECATION")

package com.fankes.apperrorsdemo.ui.activity.base

import android.os.Build
Expand All @@ -44,6 +46,7 @@ abstract class BaseActivity<VB : ViewBinding> : AppCompatActivity() {
name = "inflate"
param(LayoutInflaterClass)
}?.get()?.invoke<VB>(layoutInflater) ?: error("binding failed")
if (Build.VERSION.SDK_INT >= 35) binding.root.fitsSystemWindows = true
setContentView(binding.root)
/** 隐藏系统的标题栏 */
supportActionBar?.hide()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
*
* This file is created by fankes on 2022/5/7.
*/
@file:Suppress("DEPRECATION")

package com.fankes.apperrorstracking.ui.activity.base

import android.app.ActivityManager
Expand Down Expand Up @@ -47,6 +49,7 @@ abstract class BaseActivity<VB : ViewBinding> : AppCompatActivity() {
name = "inflate"
param(LayoutInflaterClass)
}?.get()?.invoke<VB>(layoutInflater) ?: error("binding failed")
if (Build.VERSION.SDK_INT >= 35) binding.root.fitsSystemWindows = true
setContentView(binding.root)
/** 隐藏系统的标题栏 */
supportActionBar?.hide()
Expand Down

0 comments on commit d7c2618

Please sign in to comment.