Fresco with kotlin?

440 Views Asked by At

I am trying to display a image popup in Kotlin and for that I am creating a dilog and set image from url using library fresco but I am getting error with syntax how should I do this below is my implementation. I want to set onclick event too how to do that.

1

There are 1 best solutions below

2
Amit pandey On

Try this Because you are setting image before setting view and try with picaso and Glide its good for getting image with url

val view = inflater.inflate(R.layout.dialog_streak_homepopup, container, false)
val image = view.findViewById(R.id.streak_popup) as SimpleDraweeView
val uri: Uri = Uri.parse("https://raw.githubusercontent.com/facebook/fresco/master/docs/static/logo.png")
image.setImageURI(uri)
return View