package com.casic.br.extensions

import android.content.Context
import android.view.ViewGroup
import com.casic.br.base.BaseApplication
import com.pengxh.kt.lite.extensions.dp2px
import com.qmuiteam.qmui.util.QMUIDisplayHelper

fun Context.initLayoutImmersionBar(rootView: ViewGroup) {
    //根据不同设备状态栏高度设置"跳过"按钮的Margin值
    var statusBarHeight = QMUIDisplayHelper.getStatusBarHeight(this)
    if (statusBarHeight == 0) {
        statusBarHeight = 44f.dp2px(BaseApplication.obtainInstance())
    }
    rootView.setPadding(0, statusBarHeight, 0, 0)
    rootView.requestLayout()
}