Skip to content

Commit

Permalink
docs: [ANDROAPP-6451] Initial documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
andresmr committed Sep 23, 2024
1 parent 44d056d commit adf4d15
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 48 deletions.
9 changes: 6 additions & 3 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ title: Api
sidebar_position: 5
---

# API docs
# API documentation

> Add the link to the API docs. https://dhis2.github.io/dhis2-mobile-ui/api/index.html).
> Explain how to navigate it (Functions section in Components package).
**DHIS2 Mobile UI library** API documentation is hosted
in [Github repository](https://dhis2.github.io/dhis2-mobile-ui/api/-mobile%20-u-i/org.hisp.dhis.mobile.ui.designsystem.component/index.html).

It is split in *types*, *functions* and *properties*. As in Compose, the components are considered
as functions, you will have all them in the *functions* section.
4 changes: 2 additions & 2 deletions docs/demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ sidebar_position: 3

# Demo application

> Give a description of the demo application (purpose, content,...)
> Add the link to the artifacts, probably in the releases page.
In the [Release page](https://github.com/dhis2/dhis2-mobile-ui/releases) there is a list of demo
applications to showcase all the components.
3 changes: 2 additions & 1 deletion docs/design-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ sidebar_position: 4

# Design system

> Explain the figma design system, add the link and explain how to navigate it.
**DHIS2 Mobile UI library** is based in
the [DHIS2 Mobile Design System Figma library](https://www.figma.com/file/eRk6bt0B8BJlTO9PZXirHN/DHIS2-Mobile-Design-System).
70 changes: 37 additions & 33 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,65 @@ title: Getting started
sidebar_position: 2
---

# DHIS2 Mobile UI
# Getting started

> **@dhis2/dhis2-mobile-ui** is
> a [Compose Multiplatform](https://www.jetbrains.com/lp/compose-multiplatform/) DHIS2 design system
> library for [Kotlin Multiplatform](https://kotlinlang.org/docs/multiplatform.html) applications.
This library currently supports **desktop** and **Android** targets, in the next versions it will
support **iOS**.
## DHIS2 UI Library Principles

## 1. Getting started
**DHIS2 Mobile UI library** is an open source design system for building DHIS2 Android and more
mobile targets in the future. The system is based on a foundation of principles, patterns, and
guidelines for designing user-friendly apps. A reusable component library provides the building
blocks to develop DHIS2 apps with consistent user experience.

### DHIS2 UI Library Principles
The UI library more than just a collection of components, there also are principles, such as
predefined colors, layout, typography, icons and patterns. You can find all of these in
the [DHIS2 UI documentation](https://ui.dhis2.nu/).

The UI library more than just a collection of components, there also are principles, such as predefined colors, layout, typography, icons and patterns. You can find all of these in the [DHIS2 UI documentation](https://ui.dhis2.nu/).
## 1. Installation

### Live demos documentation
### Android

//TODO link to github releases artifact maybe?
In the module **build.gradle.kts**:

### Installation
```kotlin
dependencies {
implementation("org.hisp.dhis.mobile:designsystem-android:0.3.0")
}
```

### Desktop

In the module **build.gradle.kts**:

```kotlin
dependencies {
implementation("org.hisp.dhis.mobile:designsystem:0.2")
implementation("org.hisp.dhis.mobile:designsystem-desktop:0.3.0")
}
```

## 2. Usage

```kotlin
```kotlin
setContent {
DHIS2Theme {
// A surface container using the 'background' color from the theme
Surface(
modifier = Modifier.fillMaxSize(),
color = SurfaceColor.Container
) {
Components()
DHIS2Theme {
Surface(
modifier = Modifier.fillMaxSize(),
color = SurfaceColor.Container
) {
Button(
text = provideStringResource("show_more"),
icon = {
Icon(
painter = provideDHIS2Icon(resourceName = "dhis2_blood_a_n_positive"),
contentDescription = ""
)
},
style = ButtonStyle.KEYBOARDKEY
) {}
}
}
}
}
```

### Add a Button
```kotlin
Button(
text = provideStringResource("show_more"),
icon = {
Icon(
painter = provideDHIS2Icon(resourceName = "dhis2_blood_a_n_positive"),
contentDescription = ""
)
},
style = ButtonStyle.KEYBOARDKEY
) {}
```
32 changes: 23 additions & 9 deletions docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,29 @@ title: Overview
sidebar_position: 1
---

# DHIS2 Mobile UI
# Overview

> Overview
> Give a general overview of the library.
**DHIS2 Mobile UI library** is an open source design system, it's based on [Compose multiplatform](https://www.jetbrains.com/lp/compose-multiplatform/), is a
modern UI toolkit that enables building user interfaces across multiple platforms, including Android
and desktop, using a single codebase. This library simplifies the development process by allowing
developers to write Compose UI code once and target both Android and desktop platforms with minimal
changes.

> Targets:
> - Android
> - Desktop
## Targets

> For each target, explain the kind of projects it can be used for. The requirements (Kotlin, compose,...).
> For example, in Android the library can be used in any project that has Kotlin and Compose (it is not required to be multiplatform).
> In Desktop, the project must be multiplatform, or at least to be a Kotlin project with the Desktop target.
This library currently supports **desktop** and **Android** targets, in the next versions it will
support **iOS** and **web**.

### Android

**DHIS2 Mobile UI library** provides native support for Android. When targeting Android, you can
leverage the full power of Jetpack Compose, Google's modern UI toolkit for Android. The Compose
Multiplatform library seamlessly integrates with Android Studio and the Android build system.

### Desktop

**DHIS2 Mobile UI library** also supports desktop applications. When targeting desktop, you use a
similar set of Compose APIs, but with desktop-specific configuration.

This library is part of Compose Multiplatform, which means it is designed to work exclusively with
Kotlin Multiplatform (KMP) projects.

0 comments on commit adf4d15

Please sign in to comment.