package com.example.base.extensions

import android.content.Context
import android.widget.ImageView
import com.example.base.utils.L

fun ImageView.setImageResourceByName(context: Context, resourceName: String) {
    val resourceId = context.resources.getIdentifier(resourceName, "mipmap", context.packageName)
    if (resourceId != 0) {
        setImageResource(resourceId)
    } else {
        L.e("setImageResourceByName", "Resource not found: $resourceName")
//         setImageResource(R.drawable.default_image)
    }
}
