Skip to content

Commit

Permalink
release/0.4.1-SNAPSHOT
Browse files Browse the repository at this point in the history
  • Loading branch information
mmmateos authored Jan 23, 2025
2 parents 164553d + 8120d41 commit 06905b4
Show file tree
Hide file tree
Showing 971 changed files with 418 additions and 412 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DHIS2 Mobile UI

Dhis2 Mobile UI library documentation, installation and usage is explained in [DHIS2 Developer portal](https://developers.dhis2.org/mobile/mobile-ui/overview)
Dhis2 Mobile UI library documentation, installation and usage is explained in [DHIS2 Developer portal](https://developers.dhis2.org/docs/mobile/mobile-ui/overview)

## Compose Compiler Reports

Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ kotlin {
sourceSets {
androidMain.dependencies {
implementation(project(":common"))
implementation("androidx.activity:activity-compose:1.8.2")
implementation("androidx.activity:activity-compose:1.9.3")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ fun SetStatusBarColor() {
WindowCompat.getInsetsController(it, it.decorView).apply {
isAppearanceLightStatusBars = true
}
it.statusBarColor = 0xFFE2F2FF.toInt()
}
}
}
12 changes: 7 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
version = "0.4.0.1-SNAPSHOT"

version = "0.4.1-SNAPSHOT"
group = "org.hisp.dhis.mobile"

plugins {
kotlin("multiplatform") apply false
id("com.android.application") apply false
id("com.android.library") apply false
id("org.jetbrains.compose") apply false
id("org.jlleitschuh.gradle.ktlint") version "11.5.1"
id("org.jlleitschuh.gradle.ktlint") version "12.1.2"
id("org.jetbrains.dokka") version "1.9.20"
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
alias(libs.plugins.compose.compiler)
Expand All @@ -33,8 +33,10 @@ allprojects {
}
}

tasks.withType<KotlinCompile>().all {
kotlinOptions { freeCompilerArgs += "-Xexpect-actual-classes" }
tasks.withType<KotlinCompilationTask<*>>().all {
compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}
}
}

Expand Down
8 changes: 4 additions & 4 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ kotlin {
implementation(kotlin("test"))
}
androidMain.dependencies {
api("androidx.appcompat:appcompat:1.6.1")
api("androidx.core:core-ktx:1.12.0")
api("androidx.appcompat:appcompat:1.7.0")
api("androidx.core:core-ktx:1.15.0")
}
val androidUnitTest by getting {
dependencies {
Expand All @@ -46,8 +46,8 @@ android {
namespace = "org.hisp.dhis.mobile.ui.common"

sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
sourceSets["main"].res.srcDirs("src/androidMain/res", "src/commonMain/resources")
sourceSets["main"].resources.srcDirs("src/commonMain/resources")
sourceSets["main"].res.srcDirs("src/androidMain/res", "src/commonMain/composeResources")
sourceSets["main"].resources.srcDirs("src/commonMain/composeResources")

defaultConfig {
minSdk = (findProperty("android.minSdk") as String).toInt()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package org.hisp.dhis.common.screens.bottomSheets

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.requiredWidth
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
Expand Down Expand Up @@ -34,6 +36,7 @@ import org.hisp.dhis.mobile.ui.designsystem.component.ColorStyle
import org.hisp.dhis.mobile.ui.designsystem.component.ColumnComponentContainer
import org.hisp.dhis.mobile.ui.designsystem.component.ColumnScreenContainer
import org.hisp.dhis.mobile.ui.designsystem.component.LegendRange
import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing
import org.hisp.dhis.mobile.ui.designsystem.theme.SurfaceColor

@Composable
Expand Down Expand Up @@ -191,41 +194,45 @@ fun BottomSheetScreen() {
subtitle = "Subtitle",
description = lorem,
buttonBlock = {
ButtonBlock(
primaryButton = {
Button(
style = ButtonStyle.OUTLINED,
icon = {
Icon(
imageVector = Icons.Filled.Add,
contentDescription = "Button",
)
},
enabled = true,
text = "Label",
onClick = {
showBottomSheetShellTwoButtons = false
},
modifier = Modifier.fillMaxWidth(),
)
},
secondaryButton = {
Button(
style = ButtonStyle.FILLED,
icon = {
Icon(
imageVector = Icons.Filled.Add,
contentDescription = "Button",
)
},
enabled = true,
text = "Label",
onClick = {
},
modifier = Modifier.fillMaxWidth(),
)
},
)
Row(
modifier = Modifier.padding(Spacing.Spacing24),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween,
) {
Button(
modifier = Modifier.weight(0.5f),
style = ButtonStyle.OUTLINED,
icon = {
Icon(
imageVector = Icons.Filled.Add,
contentDescription = "Button",
)
},
enabled = true,
text = "Label",
onClick = {
showBottomSheetShellTwoButtons = false
},

)

Spacer(Modifier.size(Spacing.Spacing8))
Button(
modifier = Modifier.weight(0.5f),

style = ButtonStyle.FILLED,
icon = {
Icon(
imageVector = Icons.Filled.Add,
contentDescription = "Button",
)
},
enabled = true,
text = "Label",
onClick = {
},
)
}
},
icon = {
Icon(
Expand Down
12 changes: 6 additions & 6 deletions designsystem/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
id("org.jetbrains.compose")
id("com.android.library")
id("convention.publication")
id("app.cash.paparazzi").version("1.3.3")
id("app.cash.paparazzi").version("1.3.5")
alias(libs.plugins.compose.compiler)
}

Expand All @@ -34,9 +34,9 @@ kotlin {

val androidMain by getting {
dependencies {
api("androidx.activity:activity-compose:1.8.2")
api("androidx.appcompat:appcompat:1.6.1")
api("androidx.core:core-ktx:1.12.0")
api("androidx.activity:activity-compose:1.9.3")
api("androidx.appcompat:appcompat:1.7.0")
api("androidx.core:core-ktx:1.15.0")
implementation("com.google.zxing:core:3.5.2")
implementation("se.warting.signature:signature-pad:0.1.2")
}
Expand Down Expand Up @@ -69,8 +69,8 @@ android {
namespace = "org.hisp.dhis.mobile.ui.designsystem"

sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
sourceSets["main"].res.srcDirs("src/androidMain/res", "src/commonMain/resources")
sourceSets["main"].resources.srcDirs("src/commonMain/resources")
sourceSets["main"].res.srcDirs("src/androidMain/res", "src/commonMain/composeResources")
sourceSets["main"].resources.srcDirs("src/commonMain/composeResources")

defaultConfig {
minSdk = (findProperty("android.minSdk") as String).toInt()
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Sync
import androidx.compose.material.icons.outlined.SyncDisabled
import androidx.compose.material3.Icon
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.platform.LocalInspectionMode
import org.hisp.dhis.mobile.ui.designsystem.component.AdditionalInfoItem
import org.hisp.dhis.mobile.ui.designsystem.component.Avatar
import org.hisp.dhis.mobile.ui.designsystem.component.AvatarStyleData
Expand All @@ -23,21 +25,35 @@ import org.hisp.dhis.mobile.ui.designsystem.component.state.rememberAdditionalIn
import org.hisp.dhis.mobile.ui.designsystem.component.state.rememberListCardState
import org.hisp.dhis.mobile.ui.designsystem.theme.SurfaceColor
import org.hisp.dhis.mobile.ui.designsystem.theme.TextColor
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.PreviewContextConfigurationEffect
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test

class ExpandableItemColumnSnapshotTest {
@get:Rule
val paparazzi = paparazzi()

@Ignore(
"This screen is performing layout calculations and does an 'animation effect'" +
"causing the screenshot to be taken before the final layout is displayed." +
"Paparazzi has an issue but as of version 1.3.5 it is not fixed." +
"https://github.com/cashapp/paparazzi/issues/1757",
)
@OptIn(ExperimentalResourceApi::class)
@Test
fun launchAvatarTest() {
paparazzi.snapshot {
CompositionLocalProvider(LocalInspectionMode provides true) {
PreviewContextConfigurationEffect()
}
val items = listOf("Program number 1", "Program number 2")
ExpandableItemColumn(
modifier = Modifier.fillMaxSize().graphicsLayer { clip = false },
itemList = items,
) { item, verticalPadding, onSizeChanged ->
print("itemVerticalPadding: $verticalPadding")
val index = items.indexOf(item)
VerticalInfoListCard(
listCardState = rememberListCardState(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.hisp.dhis.mobile.ui.designsystem

import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.platform.LocalInspectionMode
import androidx.compose.ui.text.input.TextFieldValue
import org.hisp.dhis.mobile.ui.designsystem.component.AgeInputType
import org.hisp.dhis.mobile.ui.designsystem.component.ColumnScreenContainer
Expand All @@ -9,6 +11,8 @@ import org.hisp.dhis.mobile.ui.designsystem.component.SubTitle
import org.hisp.dhis.mobile.ui.designsystem.component.TimeUnitValues
import org.hisp.dhis.mobile.ui.designsystem.component.state.InputAgeData
import org.hisp.dhis.mobile.ui.designsystem.component.state.rememberInputAgeState
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.PreviewContextConfigurationEffect
import org.junit.Rule
import org.junit.Test

Expand All @@ -17,9 +21,13 @@ class InputAgeSnapshotTest {
@get:Rule
val paparazzi = paparazzi()

@OptIn(ExperimentalResourceApi::class)
@Test
fun launchInputAgeSnapshot() {
paparazzi.snapshot {
CompositionLocalProvider(LocalInspectionMode provides true) {
PreviewContextConfigurationEffect()
}
ColumnScreenContainer {
SubTitle("Input Age Component - Idle")
InputAge(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package org.hisp.dhis.mobile.ui.designsystem

import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
Expand All @@ -10,6 +11,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.platform.LocalInspectionMode
import org.hisp.dhis.mobile.ui.designsystem.component.ColumnScreenContainer
import org.hisp.dhis.mobile.ui.designsystem.component.DropdownItem
import org.hisp.dhis.mobile.ui.designsystem.component.InputDropDown
Expand All @@ -19,6 +21,8 @@ import org.hisp.dhis.mobile.ui.designsystem.component.SubTitle
import org.hisp.dhis.mobile.ui.designsystem.component.Title
import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing
import org.hisp.dhis.mobile.ui.designsystem.theme.TextColor
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.PreviewContextConfigurationEffect
import org.junit.Rule
import org.junit.Test

Expand All @@ -27,9 +31,13 @@ class InputDropDownSnapshotTest {
@get:Rule
val paparazzi = paparazzi()

@OptIn(ExperimentalResourceApi::class)
@Test
fun launchInputDropDown() {
paparazzi.snapshot {
CompositionLocalProvider(LocalInspectionMode provides true) {
PreviewContextConfigurationEffect()
}
ColumnScreenContainer {
val options = listOf(
DropdownItem("Option 1"),
Expand Down
Loading

0 comments on commit 06905b4

Please sign in to comment.