[x] KSP processor
Art Gallery is based on Server Driven UI, only provide a JSON and UI definition.
The SDUI allows you send new features and create reusable componentes as possible.
Each JSON component must follow the following definition:
render
is an enum of RenderType and is the record of each component in the list.index
is the component's position in the list and must not be duplicated.resource
is a JSON object and therefore can be converted to some data class.
You must create a model capable of containing all these components, for example DataContentModel
, here the header and body of our JSON are specified.
To create a new UI component you must follow the following steps:
In the RenderType class you must register the name of the new component
Create a model specific to the resource
you need to convert
Add the @RenderModel
annotation to the model and pass the new render type you created as a parameter
Create a render factory class that extends DynamicListFactory
and that will take care of managing the component
hasShowCaseConfigured = true
CreateComponent
function add your composable elementCreateSkeleton
function create a plain copy of your composable element, this is a skeleton!@ComponentFactory
On the main screen add the ContextView
component as follows
title
is the title of the screenviewModel
you must create a ViewModel that extends from ContextViewModel
that contains the screen informationdestinationsNavigator
is a navigation instance
dynamicListRequestModel
here goes a DynamicListRequestModel
object or via rememberDynamicListRequestState