Skip to content

Commit 71f2112

Browse files
committed
Fix lint issues
1 parent 726dd24 commit 71f2112

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ import org.wordpress.aztec.AztecAttributes
66
interface ComposePlaceholderAdapter : PlaceholderManager.PlaceholderAdapter {
77
/**
88
* Use this method to draw the placeholder using Jetpack Compose.
9+
* @param placeholderUuid the placeholder UUID
10+
* @param attrs aztec attributes of the view
911
*/
1012
@Composable
1113
fun Placeholder(
1214
placeholderUuid: String,
1315
attrs: AztecAttributes,
14-
) {}
16+
)
1517
}

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import org.wordpress.aztec.AztecContentChangeWatcher
2323
import org.wordpress.aztec.AztecText
2424
import org.wordpress.aztec.Constants
2525
import org.wordpress.aztec.Html
26-
import org.wordpress.aztec.placeholders.PlaceholderManager.*
2726
import org.wordpress.aztec.placeholders.PlaceholderManager.Companion.DEFAULT_HTML_TAG
2827
import org.wordpress.aztec.placeholders.PlaceholderManager.Companion.EDITOR_INNER_PADDING
2928
import 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

Comments
 (0)