赢无翳
赢无翳
  • 发布:2024-10-18 13:03
  • 更新:2024-10-18 13:03
  • 阅读:63

请问这断类的kotlin代码在UTS里面怎么写呢,因第三方库命令行太长无法使用UTS混编

分类:uts
class GlideEngine : ImageEngine {  
  override fun loadImage(context: Context, url: String?, imageView: ImageView) {  
        if (!ActivityCompatHelper.assertValidRequest(context)) {  
            return  
        }  
        Glide.with(context).load(url).into(imageView)  
    }  

    override fun loadImage(  
        context: Context,  
        url: String?,  
        width: Int,  
        height: Int,  
        imageView: ImageView  
    ) {  
        Glide.with(context).load(url).override(width, height).into(imageView)  
    }  

    override fun loadAlbumCover(context: Context, url: String?, imageView: ImageView) {  
        if (!ActivityCompatHelper.assertValidRequest(context)) {  
            return  
        }  
        Glide.with(context).load(url)  
            .override(180, 180)  
            .transform(CenterCrop(), RoundedCorners(8))  
            .placeholder(R.drawable.ps_image_placeholder)  
            .into(imageView)  
    }  
    companion object {  
        fun create() = InstanceHelper.engine  
    }  

    object InstanceHelper {  
        val engine = GlideEngine()  
    }  
}  
}
2024-10-18 13:03 负责人:DCloud_HB_Gml 分享
已邀请:

要回复问题请先登录注册