mirror of
https://github.com/fankes/ColorOSNotifyIcon.git
synced 2025-09-04 01:35:22 +08:00
refactor: support Android 15 edge-to-edge system bars
This commit is contained in:
@@ -20,10 +20,11 @@
|
|||||||
*
|
*
|
||||||
* This file is created by fankes on 2022/1/30.
|
* This file is created by fankes on 2022/1/30.
|
||||||
*/
|
*/
|
||||||
@file:Suppress("UNCHECKED_CAST")
|
@file:Suppress("DEPRECATION")
|
||||||
|
|
||||||
package com.fankes.coloros.notify.ui.activity.base
|
package com.fankes.coloros.notify.ui.activity.base
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.content.res.ResourcesCompat
|
import androidx.core.content.res.ResourcesCompat
|
||||||
@@ -53,6 +54,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