MetadataHandoff.kt
19 lines · 733 bytes
Changed in: 0.5.0
| 1 | package dev.stave.ui.metadata |
| 2 | |
| 3 | import dev.stave.domain.model.DidlItem |
| 4 | import javax.inject.Inject |
| 5 | import javax.inject.Singleton |
| 6 | |
| 7 | /** |
| 8 | * Single-item "handoff" slot for MetadataScreen. A callsite sets [pending] with the target |
| 9 | * track just before navigating to the metadata destination; the destination's ViewModel |
| 10 | * reads it on first load and then clears it. |
| 11 | * |
| 12 | * Using this rather than passing the track through the navigation route because [DidlItem] |
| 13 | * isn't Parcelable and adding kotlin-parcelize for a single transient handoff isn't worth |
| 14 | * the build-config cost. Single-threaded TV app → no real risk of racing writers. |
| 15 | */ |
| 16 | @Singleton |
| 17 | class MetadataHandoff @Inject constructor() { |
| 18 | var pending: DidlItem.Track? = null |
| 19 | } |


