mirror of
https://github.com/KitsunePie/AppErrorsTracking.git
synced 2025-09-04 02:05:16 +08:00
refactor: support Android 15 edge-to-edge system bars
This commit is contained in:
@@ -19,6 +19,8 @@
|
|||||||
*
|
*
|
||||||
* This file is created by fankes on 2022/5/10.
|
* This file is created by fankes on 2022/5/10.
|
||||||
*/
|
*/
|
||||||
|
@file:Suppress("DEPRECATION")
|
||||||
|
|
||||||
package com.fankes.apperrorsdemo.ui.activity.base
|
package com.fankes.apperrorsdemo.ui.activity.base
|
||||||
|
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
@@ -44,6 +46,7 @@ abstract class BaseActivity<VB : ViewBinding> : AppCompatActivity() {
|
|||||||
name = "inflate"
|
name = "inflate"
|
||||||
param(LayoutInflaterClass)
|
param(LayoutInflaterClass)
|
||||||
}?.get()?.invoke<VB>(layoutInflater) ?: error("binding failed")
|
}?.get()?.invoke<VB>(layoutInflater) ?: error("binding failed")
|
||||||
|
if (Build.VERSION.SDK_INT >= 35) binding.root.fitsSystemWindows = true
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
/** 隐藏系统的标题栏 */
|
/** 隐藏系统的标题栏 */
|
||||||
supportActionBar?.hide()
|
supportActionBar?.hide()
|
||||||
|
@@ -19,6 +19,8 @@
|
|||||||
*
|
*
|
||||||
* This file is created by fankes on 2022/5/7.
|
* This file is created by fankes on 2022/5/7.
|
||||||
*/
|
*/
|
||||||
|
@file:Suppress("DEPRECATION")
|
||||||
|
|
||||||
package com.fankes.apperrorstracking.ui.activity.base
|
package com.fankes.apperrorstracking.ui.activity.base
|
||||||
|
|
||||||
import android.app.ActivityManager
|
import android.app.ActivityManager
|
||||||
@@ -47,6 +49,7 @@ abstract class BaseActivity<VB : ViewBinding> : AppCompatActivity() {
|
|||||||
name = "inflate"
|
name = "inflate"
|
||||||
param(LayoutInflaterClass)
|
param(LayoutInflaterClass)
|
||||||
}?.get()?.invoke<VB>(layoutInflater) ?: error("binding failed")
|
}?.get()?.invoke<VB>(layoutInflater) ?: error("binding failed")
|
||||||
|
if (Build.VERSION.SDK_INT >= 35) binding.root.fitsSystemWindows = true
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
/** 隐藏系统的标题栏 */
|
/** 隐藏系统的标题栏 */
|
||||||
supportActionBar?.hide()
|
supportActionBar?.hide()
|
||||||
|
Reference in New Issue
Block a user