package com.lukouguoji.module_base.ui.weight

import android.content.Context
import android.util.AttributeSet
import android.view.View
import dev.utils.app.BarUtils
import dev.utils.app.ViewUtils

class StatusView : View {

    constructor(context: Context?) : super(context) {
        setHeight()
    }

    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) {
        setHeight()
    }

    constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
        context,
        attrs,
        defStyleAttr
    ) {
        setHeight()
    }

    constructor(
        context: Context?,
        attrs: AttributeSet?,
        defStyleAttr: Int,
        defStyleRes: Int
    ) : super(context, attrs, defStyleAttr, defStyleRes)

    private fun setHeight() {
        post {
            ViewUtils.setHeight(this, BarUtils.getStatusBarHeight())
        }
    }
}
