Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compose placeholders #1095

Merged
merged 11 commits into from
Jan 23, 2025
Prev Previous commit
Next Next commit
Revert change to reoder operators
planarvoid committed Jan 23, 2025
commit 0b84d748710163ec77f2ed681101a8d941061fd3
Original file line number Diff line number Diff line change
@@ -141,7 +141,7 @@ class ComposePlaceholderManager(
* @param type placeholder type
* @param attributes other attributes passed to the view. For example a `src` for an image.
*/
override suspend fun insertItem(type: String, vararg attributes: Pair<String, String>) {
suspend override fun insertItem(type: String, vararg attributes: Pair<String, String>) {
val adapter = adapters[type]
?: throw IllegalArgumentException("Adapter for inserted type not found. Register it with `registerAdapter` method")
val attrs = getAttributesForMedia(type, attributes)
@@ -162,7 +162,7 @@ class ComposePlaceholderManager(
* @param shouldMergeItem this method should return true when the previous type is compatible and should be updated
* @param updateItem function to update current parameters with new params
*/
override suspend fun insertOrUpdateItem(
suspend override fun insertOrUpdateItem(
type: String,
shouldMergeItem: (currentItemType: String) -> Boolean,
updateItem: (
@@ -237,7 +237,7 @@ class ComposePlaceholderManager(
* @param shouldUpdateItem This function should return true if the span can be updated, false if it should be removed
* @param updateItem Function that updates the selected item
*/
override suspend fun removeOrUpdate(
suspend override fun removeOrUpdate(
uuid: String,
shouldUpdateItem: (Attributes) -> Boolean,
updateItem: (currentAttributes: Map<String, String>) -> Map<String, String>