annotations
Adding a screen to a navigation graph by hand means writing a graph extension for the presenter, registering a destination factory, registering a route binding so the screen survives save and restore, and repeating all of it for the next screen. The work is mechanical and it is easy to get one of the four wrong.
These annotations replace that. Mark the presenter, and the processor in codegen-processor generates the graph and the bindings next to it, in files the IDE can navigate to.
@Inject
@NavDestination(
route = ShowsRoute::class,
parentScope = ActivityScope::class,
kind = DestinationKind.SCREEN,
)
class ShowsPresenter(
componentContext: ComponentContext,
) : ComponentContext by componentContextContent copied to clipboard
Published as io.github.thomaskioko.gradle.plugins:codegen-annotations.