@@ -23,7 +23,6 @@ import org.wordpress.aztec.AztecContentChangeWatcher
2323import org.wordpress.aztec.AztecText
2424import org.wordpress.aztec.Constants
2525import org.wordpress.aztec.Html
26- import org.wordpress.aztec.placeholders.PlaceholderManager.*
2726import org.wordpress.aztec.placeholders.PlaceholderManager.Companion.DEFAULT_HTML_TAG
2827import org.wordpress.aztec.placeholders.PlaceholderManager.Companion.EDITOR_INNER_PADDING
2928import org.wordpress.aztec.placeholders.PlaceholderManager.Companion.TYPE_ATTRIBUTE
@@ -60,7 +59,7 @@ class ViewPlaceholderManager(
6059 IHtmlPreprocessor {
6160 private val adapters = mutableMapOf<String , ViewPlaceholderAdapter >()
6261 private val positionToIdMutex = Mutex ()
63- private val positionToId = mutableSetOf<Placeholder >()
62+ private val positionToId = mutableSetOf<PlaceholderManager . Placeholder >()
6463 private val job = Job ()
6564 override val coroutineContext: CoroutineContext
6665 get() = Dispatchers .Main + job
@@ -97,7 +96,7 @@ class ViewPlaceholderManager(
9796 * @param type placeholder type
9897 * @param attributes other attributes passed to the view. For example a `src` for an image.
9998 */
100- override suspend fun insertItem (type : String , vararg attributes : Pair <String , String >) {
99+ suspend override fun insertItem (type : String , vararg attributes : Pair <String , String >) {
101100 val adapter = adapters[type]
102101 ? : throw IllegalArgumentException (" Adapter for inserted type not found. Register it with `registerAdapter` method" )
103102 val attrs = getAttributesForMedia(type, attributes)
@@ -114,7 +113,7 @@ class ViewPlaceholderManager(
114113 * @param shouldMergeItem this method should return true when the previous type is compatible and should be updated
115114 * @param updateItem function to update current parameters with new params
116115 */
117- override suspend fun insertOrUpdateItem (
116+ suspend override fun insertOrUpdateItem (
118117 type : String ,
119118 shouldMergeItem : (currentItemType: String ) -> Boolean ,
120119 updateItem : (
@@ -187,7 +186,7 @@ class ViewPlaceholderManager(
187186 * @param shouldUpdateItem This function should return true if the span can be updated, false if it should be removed
188187 * @param updateItem Function that updates the selected item
189188 */
190- override suspend fun removeOrUpdate (uuid : String , shouldUpdateItem : (Attributes ) -> Boolean , updateItem : (currentAttributes: Map <String , String >) -> Map <String , String >): Boolean {
189+ suspend override fun removeOrUpdate (uuid : String , shouldUpdateItem : (Attributes ) -> Boolean , updateItem : (currentAttributes: Map <String , String >) -> Map <String , String >): Boolean {
191190 val currentItem = aztecText.editableText.getSpans(0 , aztecText.length(), AztecPlaceholderSpan ::class .java).find {
192191 it.attributes.getValue(UUID_ATTRIBUTE ) == uuid
193192 } ? : return false
@@ -370,7 +369,7 @@ class ViewPlaceholderManager(
370369 }
371370
372371 positionToIdMutex.withLock {
373- positionToId.add(Placeholder (targetPosition, uuid))
372+ positionToId.add(PlaceholderManager . Placeholder (targetPosition, uuid))
374373 }
375374 if (box.parent == null ) {
376375 container.addView(box)
0 commit comments