@@ -31,7 +31,7 @@ class ImageWithCaptionAdapter(
3131 private val media = mutableMapOf<String , StateFlow <ImageWithCaptionObject >>()
3232 private val scope = CoroutineScope (Dispatchers .Main )
3333 suspend override fun getHeight (attrs : AztecAttributes ): Proportion {
34- return Proportion .Ratio (attrs.getValue( HEIGHT ).toFloatOrNull() ? : 0.5f )
34+ return Proportion .Ratio (0.5f )
3535 }
3636
3737 suspend override fun createView (context : Context , placeholderUuid : String , viewParamsUpdate : StateFlow <PlaceholderManager .Placeholder .ViewParams >): View {
@@ -126,22 +126,21 @@ class ImageWithCaptionAdapter(
126126 private const val ADAPTER_TYPE = " image_with_caption"
127127 private const val CAPTION_ATTRIBUTE = " caption"
128128 private const val SRC_ATTRIBUTE = " src"
129- private const val HEIGHT = " height"
130129
131- suspend fun insertImageWithCaption (placeholderManager : PlaceholderManager , src : String , caption : String , height : Float = 0.5f, shouldMergePlaceholders : Boolean = true) {
130+ suspend fun insertImageWithCaption (placeholderManager : PlaceholderManager , src : String , caption : String , shouldMergePlaceholders : Boolean = true) {
132131 placeholderManager.insertOrUpdateItem(ADAPTER_TYPE , {
133132 shouldMergePlaceholders
134133 }) { currentAttributes, type, placeAtStart ->
135134 if (currentAttributes == null || type != ADAPTER_TYPE ) {
136- mapOf (SRC_ATTRIBUTE to src, CAPTION_ATTRIBUTE to caption, HEIGHT to height.toString() )
135+ mapOf (SRC_ATTRIBUTE to src, CAPTION_ATTRIBUTE to caption)
137136 } else {
138137 val currentCaption = currentAttributes[CAPTION_ATTRIBUTE ]
139138 val newCaption = if (placeAtStart) {
140139 " $caption - $currentCaption "
141140 } else {
142141 " $currentCaption - $caption "
143142 }
144- mapOf (SRC_ATTRIBUTE to src, CAPTION_ATTRIBUTE to newCaption, HEIGHT to height.toString() )
143+ mapOf (SRC_ATTRIBUTE to src, CAPTION_ATTRIBUTE to newCaption)
145144 }
146145 }
147146 }
0 commit comments