package com.gh.gamecenter.common.view

import android.content.Context
import android.os.Build
import android.util.AttributeSet
import android.view.View
import com.gh.gamecenter.core.utils.DisplayUtils

class StatusBarView @JvmOverloads constructor(context: Context?, attrs: AttributeSet? = null, defStyleAttr: Int = 0) :
    View(context, attrs, defStyleAttr) {
    override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
        val height = if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
            0
        } else {
            DisplayUtils.getStatusBarHeight(resources)
        }
        setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), height)
    }
}
