Skip to content

joyfill/kotlin-samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 

Repository files navigation

joyfill_logo

Joyfill

Install Dependency

Add the following maven coordinates to your dependencies in your build.gradle.kts file.

  implementation("io.joyfill:compose:<version>")

Select the SDK version that you want to use.

Note: We recommend using the default (latest) SDK version, but you can choose an older version if needed. Choose the Joyfill libraries you want to use.

Getting Started

Show a Joyfill Document with the Form Composable

import joyfill.Form

Form(
    editor = rememberEditor(document = getJoyDoc()),
    mode = JoyMode.readonly, // or JoyMode.fill,
)

Descriptive Samples

// Fetch your document
val document = service.getEmployeeDocument()

// Give it to a Document Editor
val editor = rememberEditor(document)

// Render the form with the editor
Column(modifier = Modifier.padding(8.dp)) {
    Form(editor = editor)
    OutlinedButton(
        onClick = {
            // get the updated document
            val updated = editor.toDocument()

            // Save your newly updated document
            service.save(editor.toDocument())
        }
    ) {
        Text("Save")
    }
}

About

A repository for how one can use the joyfill sdk on their kotlin projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages