@@ -21,10 +21,12 @@ class ImageWithCaptionAdapter(
2121 override fun getHeight (attrs : AztecAttributes ): Proportion {
2222 return Proportion .Ratio (0.5f )
2323 }
24- override suspend fun createView (context : Context , placeholderUuid : String , attrs : AztecAttributes ): View {
25- val imageWithCaptionObject = media[placeholderUuid] ? : ImageWithCaptionObject (placeholderUuid, attrs.getValue(SRC_ATTRIBUTE ), View .generateViewId()).apply {
26- media[placeholderUuid] = this
27- }
24+
25+ suspend override fun createView (context : Context , placeholderUuid : String , attrs : AztecAttributes ): View {
26+ val imageWithCaptionObject = media[placeholderUuid]
27+ ? : ImageWithCaptionObject (placeholderUuid, attrs.getValue(SRC_ATTRIBUTE ), View .generateViewId()).apply {
28+ media[placeholderUuid] = this
29+ }
2830 val captionLayoutId = View .generateViewId()
2931 val imageLayoutId = imageWithCaptionObject.layoutId
3032 val linearLayout = LinearLayout (context)
@@ -61,7 +63,7 @@ class ImageWithCaptionAdapter(
6163 return linearLayout
6264 }
6365
64- override suspend fun onViewCreated (view : View , placeholderUuid : String ) {
66+ suspend override fun onViewCreated (view : View , placeholderUuid : String ) {
6567 val image = media[placeholderUuid]!!
6668 val imageView = view.findViewById<ImageView >(image.layoutId)
6769 Glide .with (view).load(image.src).into(imageView)
0 commit comments