package com.adealink.weparty.room.micseat.decor

import android.content.Context
import android.view.View
import androidx.annotation.IdRes
import androidx.constraintlayout.widget.ConstraintLayout
import com.adealink.weparty.room.micseat.AbsDynamicDecorView
import com.adealink.weparty.room.micseat.DecorDynamicLayers

abstract class BaseDecorView<V : View>(
    @IdRes viewId: Int,
    dynamicLayers: DecorDynamicLayers
) : AbsDynamicDecorView<V>(viewId, dynamicLayers),
    IDecorApi {

    open val autoAttach = false

    var baseSize = 0
    var scale = 1f//缩放比例

    abstract fun createView(context: Context): V

    abstract fun getLayoutParams(): ConstraintLayout.LayoutParams

    companion object {
        //以下的距离比率都是相对与麦位头像尺寸的
        //麦位头像距离顶部的距离比率
        const val AVATAR_MARGIN_TOP_RATIO = 0.25f

        //发言光圈宽度比率
        const val RIPPLE_RATIO = 1.5f

        //静麦标志尺寸比例
        const val MUTE_RATIO = 0.35f
    }

}