package com.base.appzxhy.ui.play

import android.content.Context
import android.graphics.Color
import android.graphics.drawable.Drawable
import android.view.Gravity
import androidx.appcompat.widget.AppCompatTextView
import androidx.core.content.ContextCompat
import com.base.appzxhy.R
import com.bytedance.sdk.shortplay.api.PSSDK
import com.bytedance.sdk.shortplay.api.ShortPlay
import com.bytedance.sdk.shortplay.api.ShortPlayFragment

class CustomShareView : AppCompatTextView, PSSDK.IControlView {

    private val TAG = "CustomShareView"

    private var shareDrawable: Drawable?

    constructor(context: Context) : super(context) {
        gravity = Gravity.CENTER_HORIZONTAL
        setTextColor(Color.parseColor("#ffffff"))
        textSize = 12f
        shareDrawable = ContextCompat.getDrawable(context, R.mipmap.fy_share)
        val size = resources.getDimensionPixelSize(R.dimen.dp_32)
        shareDrawable?.setBounds(0, 0, size, size)
        setCompoundDrawables(null, shareDrawable, null, null)
    }

    override fun getControlViewType(): PSSDK.ControlViewType {
        return PSSDK.ControlViewType.Share
    }

    override fun bindItemData(fragment: ShortPlayFragment?, shortPlay: ShortPlay, index: Int) {
    }

}