Skip to content

Commit 2da6e8b

Browse files
committed
Change suspend modifier position based on local rules
1 parent 7aa17c2 commit 2da6e8b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

media-placeholders/src/main/java/org/wordpress/aztec/placeholders/ImageWithCaptionAdapter.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)