File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
media-placeholders/src/main/java/org/wordpress/aztec/placeholders Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -160,22 +160,24 @@ class PlaceholderManager(
160160 aztecText.getLocationOnScreen(parentTextViewLocation)
161161 val parentTextViewTopAndBottomOffset = aztecText.scrollY + aztecText.compoundPaddingTop
162162
163+
164+ val adapter = adapters[type]!!
165+ val height = adapter.calculateHeight(attrs, parentTextViewRect.right - parentTextViewRect.left - 20 )
163166 parentTextViewRect.top + = parentTextViewTopAndBottomOffset
164- parentTextViewRect.bottom + = parentTextViewTopAndBottomOffset
167+ parentTextViewRect.bottom = parentTextViewRect.top + height
165168
166169 positionToId.removeAll {
167170 it.uuid == uuid
168171 }
169172
170173 var box = container.findViewWithTag<View >(uuid)
171174 val exists = box != null
172- val adapter = adapters[type]!!
173175 if (! exists) {
174176 box = adapter.createView(container.context, uuid, attrs)
175177 }
176178 val params = FrameLayout .LayoutParams (
177179 adapter.calculateWidth(attrs, parentTextViewRect.right - parentTextViewRect.left - 20 ),
178- parentTextViewRect.bottom - parentTextViewRect.top - 20
180+ height
179181 )
180182 val padding = 10
181183 params.setMargins(
You can’t perform that action at this time.
0 commit comments