-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into ANDROAPP-5575-mobile-ui-Create-InputFileReso…
…urce-component
- Loading branch information
Showing
35 changed files
with
2,798 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
common/src/commonMain/kotlin/org/hisp/dhis/common/screens/ButtonCarouselScreen.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package org.hisp.dhis.common.screens | ||
|
||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.outlined.FileDownload | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import org.hisp.dhis.common.screens.previews.fiveButtonCarousel | ||
import org.hisp.dhis.common.screens.previews.overflowButtonCarousel | ||
import org.hisp.dhis.common.screens.previews.threeButtonCarousel | ||
import org.hisp.dhis.mobile.ui.designsystem.component.ButtonCarousel | ||
import org.hisp.dhis.mobile.ui.designsystem.component.CarouselButtonData | ||
import org.hisp.dhis.mobile.ui.designsystem.component.ColumnComponentContainer | ||
import org.hisp.dhis.mobile.ui.designsystem.component.RowComponentContainer | ||
import org.hisp.dhis.mobile.ui.designsystem.component.SubTitle | ||
import org.hisp.dhis.mobile.ui.designsystem.component.Title | ||
|
||
@Composable | ||
fun ButtonCarouselScreen() { | ||
ColumnComponentContainer { | ||
Title("Carousel Buttons") | ||
RowComponentContainer( | ||
title = "Simple Carousel Button", | ||
) { | ||
ButtonCarousel( | ||
carouselButtonList = listOf( | ||
CarouselButtonData( | ||
enabled = true, | ||
text = "Label", | ||
icon = { | ||
Icon( | ||
imageVector = Icons.Outlined.FileDownload, | ||
contentDescription = "Carousel Button", | ||
) | ||
}, | ||
onClick = {}, | ||
), | ||
), | ||
) | ||
} | ||
RowComponentContainer( | ||
title = "Buttons Carousel", | ||
) { | ||
Column( | ||
Modifier.fillMaxWidth(), | ||
) { | ||
ButtonCarousel( | ||
carouselButtonList = threeButtonCarousel, | ||
) | ||
|
||
ButtonCarousel( | ||
carouselButtonList = fiveButtonCarousel, | ||
) | ||
|
||
SubTitle("Overflow case") | ||
ButtonCarousel( | ||
carouselButtonList = overflowButtonCarousel, | ||
) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputEmailScreen.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
package org.hisp.dhis.common.screens | ||
|
||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.saveable.rememberSaveable | ||
import androidx.compose.runtime.setValue | ||
import androidx.compose.ui.Modifier | ||
import org.hisp.dhis.mobile.ui.designsystem.component.ColumnComponentContainer | ||
import org.hisp.dhis.mobile.ui.designsystem.component.InputEmail | ||
import org.hisp.dhis.mobile.ui.designsystem.component.InputShellState | ||
import org.hisp.dhis.mobile.ui.designsystem.component.SubTitle | ||
import org.hisp.dhis.mobile.ui.designsystem.component.SupportingTextData | ||
import org.hisp.dhis.mobile.ui.designsystem.component.SupportingTextState | ||
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 | ||
|
||
@Composable | ||
fun InputEmailScreen() { | ||
ColumnComponentContainer { | ||
Title("Input Email component", textColor = TextColor.OnSurfaceVariant) | ||
SubTitle("Basic Email ", textColor = TextColor.OnSurfaceVariant) | ||
var inputText1 by rememberSaveable { mutableStateOf("") } | ||
|
||
InputEmail( | ||
title = "Label", | ||
supportingText = listOf(SupportingTextData("Example: [email protected]")), | ||
inputText = inputText1, | ||
onValueChanged = { | ||
if (it != null) { | ||
inputText1 = it | ||
} | ||
}, | ||
onEmailActionCLicked = {}, | ||
) | ||
Spacer(Modifier.size(Spacing.Spacing18)) | ||
|
||
SubTitle("Basic Email with content ", textColor = TextColor.OnSurfaceVariant) | ||
var inputText2 by rememberSaveable { mutableStateOf("[email protected]") } | ||
|
||
InputEmail( | ||
title = "Label", | ||
supportingText = listOf(SupportingTextData("Example: [email protected]")), | ||
inputText = inputText2, | ||
onValueChanged = { | ||
if (it != null) { | ||
inputText2 = it | ||
} | ||
}, | ||
onEmailActionCLicked = {}, | ||
) | ||
Spacer(Modifier.size(Spacing.Spacing18)) | ||
|
||
SubTitle("Error Email with content ", textColor = TextColor.OnSurfaceVariant) | ||
var inputText3 by rememberSaveable { mutableStateOf("[email protected]") } | ||
|
||
InputEmail( | ||
title = "Label", | ||
state = InputShellState.ERROR, | ||
supportingText = listOf(SupportingTextData("Enter a valid email address", SupportingTextState.ERROR)), | ||
inputText = inputText3, | ||
onValueChanged = { | ||
if (it != null) { | ||
inputText3 = it | ||
} | ||
}, | ||
onEmailActionCLicked = {}, | ||
) | ||
Spacer(Modifier.size(Spacing.Spacing18)) | ||
|
||
SubTitle("Error Email required field ", textColor = TextColor.OnSurfaceVariant) | ||
var inputText4 by rememberSaveable { mutableStateOf("") } | ||
InputEmail( | ||
title = "Label", | ||
state = InputShellState.ERROR, | ||
supportingText = listOf(SupportingTextData("Enter email address", SupportingTextState.ERROR)), | ||
inputText = inputText4, | ||
isRequiredField = true, | ||
onValueChanged = { | ||
if (it != null) { | ||
inputText4 = it | ||
} | ||
}, | ||
onEmailActionCLicked = {}, | ||
) | ||
Spacer(Modifier.size(Spacing.Spacing18)) | ||
|
||
SubTitle("Disabled Email with content ", textColor = TextColor.OnSurfaceVariant) | ||
var inputText5 by rememberSaveable { mutableStateOf("[email protected]") } | ||
InputEmail( | ||
title = "Label", | ||
state = InputShellState.DISABLED, | ||
inputText = inputText5, | ||
onValueChanged = { | ||
if (it != null) { | ||
inputText5 = it | ||
} | ||
}, | ||
onEmailActionCLicked = {}, | ||
) | ||
} | ||
} |
104 changes: 104 additions & 0 deletions
104
common/src/commonMain/kotlin/org/hisp/dhis/common/screens/InputLinkScreen.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
package org.hisp.dhis.common.screens | ||
|
||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.saveable.rememberSaveable | ||
import androidx.compose.runtime.setValue | ||
import androidx.compose.ui.Modifier | ||
import org.hisp.dhis.mobile.ui.designsystem.component.ColumnComponentContainer | ||
import org.hisp.dhis.mobile.ui.designsystem.component.InputLink | ||
import org.hisp.dhis.mobile.ui.designsystem.component.InputShellState | ||
import org.hisp.dhis.mobile.ui.designsystem.component.SubTitle | ||
import org.hisp.dhis.mobile.ui.designsystem.component.SupportingTextData | ||
import org.hisp.dhis.mobile.ui.designsystem.component.SupportingTextState | ||
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 | ||
|
||
@Composable | ||
fun InputLinkScreen() { | ||
ColumnComponentContainer { | ||
Title("Input Link component", textColor = TextColor.OnSurfaceVariant) | ||
SubTitle("Basic Link ", textColor = TextColor.OnSurfaceVariant) | ||
var inputText1 by rememberSaveable { mutableStateOf("") } | ||
|
||
InputLink( | ||
title = "Label", | ||
supportingText = listOf(SupportingTextData("Example: example.com")), | ||
inputText = inputText1, | ||
onValueChanged = { | ||
if (it != null) { | ||
inputText1 = it | ||
} | ||
}, | ||
onLinkActionCLicked = {}, | ||
) | ||
Spacer(Modifier.size(Spacing.Spacing18)) | ||
|
||
SubTitle("Basic Link with invalid link ", textColor = TextColor.OnSurfaceVariant) | ||
var inputText2 by rememberSaveable { mutableStateOf("example.") } | ||
|
||
InputLink( | ||
title = "Label", | ||
supportingText = listOf(SupportingTextData("Example: example.com")), | ||
inputText = inputText2, | ||
onValueChanged = { | ||
if (it != null) { | ||
inputText2 = it | ||
} | ||
}, | ||
onLinkActionCLicked = {}, | ||
) | ||
Spacer(Modifier.size(Spacing.Spacing18)) | ||
|
||
SubTitle("Basic Link with valid link ", textColor = TextColor.OnSurfaceVariant) | ||
var inputText3 by rememberSaveable { mutableStateOf("example.com") } | ||
|
||
InputLink( | ||
title = "Label", | ||
supportingText = listOf(SupportingTextData("Example: example.com")), | ||
inputText = inputText3, | ||
onValueChanged = { | ||
if (it != null) { | ||
inputText3 = it | ||
} | ||
}, | ||
onLinkActionCLicked = {}, | ||
) | ||
Spacer(Modifier.size(Spacing.Spacing18)) | ||
|
||
SubTitle("Error Link required field ", textColor = TextColor.OnSurfaceVariant) | ||
var inputText4 by rememberSaveable { mutableStateOf("") } | ||
InputLink( | ||
title = "Label", | ||
state = InputShellState.ERROR, | ||
supportingText = listOf(SupportingTextData("Required", SupportingTextState.ERROR)), | ||
inputText = inputText4, | ||
isRequiredField = true, | ||
onValueChanged = { | ||
if (it != null) { | ||
inputText4 = it | ||
} | ||
}, | ||
onLinkActionCLicked = {}, | ||
) | ||
Spacer(Modifier.size(Spacing.Spacing18)) | ||
|
||
SubTitle("Disabled Link with content ", textColor = TextColor.OnSurfaceVariant) | ||
var inputText5 by rememberSaveable { mutableStateOf("example.com") } | ||
InputLink( | ||
title = "Label", | ||
state = InputShellState.DISABLED, | ||
inputText = inputText5, | ||
onValueChanged = { | ||
if (it != null) { | ||
inputText5 = it | ||
} | ||
}, | ||
onLinkActionCLicked = {}, | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.