TimelineItemPresenterFactories (#1609)

DI infrastructure to allow injection of presenters into the timeline.
Add an `@AssistedFactory` of type `TimelineItemPresenterFactory` to a `Presenter` class and bind this factory into the TimelineItemPresenterFactory map multi binding using:

```
@Binds
@IntoMap
@TimelineItemEventContentKey(MyTimelineItemContent::class)
```

A map multibinding of such factories will be available in the `LocalTimelineItemPresenterFactories` composition local for further use down the UI tree.
This commit is contained in:
Marco Romano 2023-10-19 15:57:34 +02:00 committed by GitHub
parent 33f5c8efb8
commit a814c4a95a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 160 additions and 13 deletions

View file

@ -219,7 +219,7 @@ Compose:
CompositionLocalAllowlist:
active: true
# You can optionally define a list of CompositionLocals that are allowed here
allowedCompositionLocals: LocalCompoundColors, LocalSnackbarDispatcher, LocalCameraPositionState
allowedCompositionLocals: LocalCompoundColors, LocalSnackbarDispatcher, LocalCameraPositionState, LocalTimelineItemPresenterFactories
CompositionLocalNaming:
active: true
ContentEmitterReturningValues: