package com.base.browserwhite.ui.views

import android.content.Context
import android.widget.TextView
import androidx.core.content.ContextCompat
import com.base.browserwhite.R
import com.base.browserwhite.bean.ConstObject

object ViewObject {
    fun setEditPrivacy(context: Context, view: TextView) {
        if (ConstObject.webPrivacy) {
            val padding = context.resources.getDimensionPixelOffset(R.dimen.dp_5)
            val drawable = ContextCompat.getDrawable(context, R.mipmap.x_wuhen)
            drawable?.setBounds(-padding, 0, drawable.intrinsicWidth - padding, drawable.intrinsicHeight)
            view.setCompoundDrawables(drawable, null, null, null)
        } else {
            view.setCompoundDrawables(null, null, null, null)
        }
    }

}