Skip to content

Commit

Permalink
[ANDROAPP-5800] Parameter Selector item (#185)
Browse files Browse the repository at this point in the history
* [ANDROAPP-5800] Create ParameterSelector

* [ANDROAPP-5800] Rename InputStyle to HelperStyle

* [ANDROAPP-5800] Add InputStyle to InputShell

* [ANDROAPP-5800] Add unfocusedIndicatorColor parameter to InputStyle

* [ANDROAPP-5800] add another label

* [ANDROAPP-5800] Input email button handling

* [ANDROAPP-5800] Rename ParameterSelector.kt sealed classes

* [ANDROAPP-5800] Adapt InputBarCode

* [ANDROAPP-5800] Adapt InputAge

* [ANDROAPP-5800] Adapt InputCheckBox

* [ANDROAPP-5800] Adapt InputCoordinates

* [ANDROAPP-5800] Adapt InputDateTime

* [ANDROAPP-5800] Adapt InputDropdown

* [ANDROAPP-5800] Adapt InputFileResource

* [ANDROAPP-5800] Adapt InputImage and InputSignature

* [ANDROAPP-5800] Adapt inputs extending from BasicTextInput

* [ANDROAPP-5800] Adapt InputMatrix, InputNotSupported, InputOrgUnit, InputRadioButton

* [ANDROAPP-5800] Adapt InputSequential

* [ANDROAPP-5800] Adapt InputYesNoField, InputYesOnlyCheckBox, InputYesOnlySwitch

* [ANDROAPP-5800] Remove default value on InputShell

* [ANDROAPP-5800] Set default value to BasicInputImage

* [ANDROAPP-5800] set configurable disabled background color

* [ANDROAPP-5800] update Enum.values warning

* [ANDROAPP-5800] update to
kotlin.version=1.9.22
agp.version=8.2.2
compose.version=1.5.12

* [ANDROAPP-5800] Add clickable option to EmptyParameterField

* [ANDROAPP-5800] ParameterSelector.kt animated visibility

* [ANDROAPP-5800] handle close parameterItem state

* [ANDROAPP-5800] handle InputLink button enable

* [ANDROAPP-5800] handle InputBarCode, InputQRCode button enable

* [ANDROAPP-5800] Add shape LargeTop

* [ANDROAPP-5800] Add icon as parameter

* [ANDROAPP-5800] change barcode icon

* [ANDROAPP-5800] pixel perfect fix
  • Loading branch information
andresmr authored Feb 7, 2024
1 parent 35c4342 commit 3d5fb91
Show file tree
Hide file tree
Showing 47 changed files with 794 additions and 46 deletions.
5 changes: 3 additions & 2 deletions common/src/commonMain/kotlin/org/hisp/dhis/common/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ import org.hisp.dhis.common.screens.SectionScreen
import org.hisp.dhis.common.screens.SupportingTextScreen
import org.hisp.dhis.common.screens.SwitchScreen
import org.hisp.dhis.common.screens.TagsScreen
import org.hisp.dhis.common.screens.parameter.ParameterSelectorScreen
import org.hisp.dhis.mobile.ui.designsystem.theme.DHIS2Theme
import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing

Expand All @@ -94,8 +95,7 @@ fun App() {

@Composable
fun Main() {
val currentScreen = remember { mutableStateOf(Components.LIST_CARD) }

val currentScreen = remember { mutableStateOf(Components.PARAMETER_SELECTOR) }
var expanded by remember { mutableStateOf(false) }

Column(
Expand Down Expand Up @@ -202,6 +202,7 @@ fun Main() {
Components.FULL_SCREEN_IMAGE -> FullScreenImageScreen()
Components.ORG_TREE_BOTTOM_SHEET -> OrgTreeBottomSheetScreen()
Components.INDICATOR_INPUT -> IndicatorInputScreen()
Components.PARAMETER_SELECTOR -> ParameterSelectorScreen()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ enum class Components(val label: String) {
FULL_SCREEN_IMAGE("Full Screen Image"),
ORG_TREE_BOTTOM_SHEET("Org Tree Bottom Sheet"),
INDICATOR_INPUT("Indicator Input"),
PARAMETER_SELECTOR("Parameter selector"),
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.ui.text.input.TextFieldValue
import org.hisp.dhis.common.screens.previews.InputShellPreview
import org.hisp.dhis.mobile.ui.designsystem.component.BasicTextField
import org.hisp.dhis.mobile.ui.designsystem.component.ColumnComponentContainer
import org.hisp.dhis.mobile.ui.designsystem.component.HelperStyle
import org.hisp.dhis.mobile.ui.designsystem.component.InputShellState
import org.hisp.dhis.mobile.ui.designsystem.component.InputStyle
import org.hisp.dhis.mobile.ui.designsystem.component.SubTitle
Expand All @@ -21,7 +22,7 @@ import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing
fun FormsComponentsScreen() {
ColumnComponentContainer("Input Shell") {
SubTitle("Sample functional Input Shell ")
InputShellPreview("Label", inputField = { BasicTextField("Helper", true, helperStyle = InputStyle.WITH_HELPER_BEFORE, onInputChanged = {}) })
InputShellPreview("Label", inputField = { BasicTextField("Helper", true, helperStyle = HelperStyle.WITH_HELPER_BEFORE, onInputChanged = {}) })
Spacer(Modifier.size(Spacing.Spacing18))
SubTitle("Unfocused Input shell ")
InputShellPreview("Label")
Expand All @@ -40,7 +41,7 @@ fun FormsComponentsScreen() {
InputShellPreview(
title = "Label",
state = InputShellState.UNFOCUSED,
hasTransparentBackground = true,
inputStyle = InputStyle.ParameterInputStyle(),
onInputClear = {
inputField = ""
},
Expand All @@ -49,7 +50,7 @@ fun FormsComponentsScreen() {
helper = "Helper",
inputTextValue = TextFieldValue(inputField),
enabled = true,
helperStyle = InputStyle.WITH_HELPER_BEFORE,
helperStyle = HelperStyle.WITH_HELPER_BEFORE,
onInputChanged = {
inputField = it.text
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.text.input.TextFieldValue
import org.hisp.dhis.mobile.ui.designsystem.component.BasicTextField
import org.hisp.dhis.mobile.ui.designsystem.component.ColumnComponentContainer
import org.hisp.dhis.mobile.ui.designsystem.component.InputStyle
import org.hisp.dhis.mobile.ui.designsystem.component.HelperStyle
import org.hisp.dhis.mobile.ui.designsystem.component.SubTitle
import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing

Expand All @@ -26,11 +26,11 @@ fun InputScreen() {
title = "Input",
content = {
SubTitle("With helper before")
BasicTextField("Helper", helperStyle = InputStyle.WITH_HELPER_BEFORE, inputTextValue = TextFieldValue(inputValue1), onInputChanged = { inputValue1 = it.text })
BasicTextField("Helper", helperStyle = HelperStyle.WITH_HELPER_BEFORE, inputTextValue = TextFieldValue(inputValue1), onInputChanged = { inputValue1 = it.text })
Spacer(Modifier.size(Spacing.Spacing18))

SubTitle("With helper after")
BasicTextField("Helper", helperStyle = InputStyle.WITH_HELPER_AFTER, inputTextValue = TextFieldValue(inputValue2), onInputChanged = { inputValue2 = it.text })
BasicTextField("Helper", helperStyle = HelperStyle.WITH_HELPER_AFTER, inputTextValue = TextFieldValue(inputValue2), onInputChanged = { inputValue2 = it.text })
Spacer(Modifier.size(Spacing.Spacing18))
SubTitle("No helper")
BasicTextField(inputTextValue = TextFieldValue(inputValue3), onInputChanged = {
Expand Down
Loading

0 comments on commit 3d5fb91

Please sign in to comment.