Skip to content

Commit

Permalink
update version code (#191)
Browse files Browse the repository at this point in the history
* update version code

* downgrade AGP to 8.2.0
  • Loading branch information
andresmr authored Feb 8, 2024
1 parent c5b82c4 commit b61ce4a
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 128 deletions.
2 changes: 0 additions & 2 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ android {
applicationId = "org.hisp.dhis.android"
minSdk = (findProperty("android.minSdk") as String).toInt()
targetSdk = (findProperty("android.targetSdk") as String).toInt()
versionCode = 1
versionName = "1.0.1-SNAPSHOT"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,81 +32,90 @@ import org.hisp.dhis.mobile.ui.designsystem.component.InputOrgUnit
import org.hisp.dhis.mobile.ui.designsystem.component.InputPhoneNumber
import org.hisp.dhis.mobile.ui.designsystem.component.InputQRCode
import org.hisp.dhis.mobile.ui.designsystem.component.InputRadioButton
import org.hisp.dhis.mobile.ui.designsystem.component.InputSequential
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.InputText
import org.hisp.dhis.mobile.ui.designsystem.component.InputYesNoField
import org.hisp.dhis.mobile.ui.designsystem.component.InputYesOnlyCheckBox
import org.hisp.dhis.mobile.ui.designsystem.component.InputYesOnlySwitch
import org.hisp.dhis.mobile.ui.designsystem.component.RadioButtonData
import org.hisp.dhis.mobile.ui.designsystem.component.internal.IconCardData
import org.hisp.dhis.mobile.ui.designsystem.component.parameter.ParameterSelectorItem
import org.hisp.dhis.mobile.ui.designsystem.component.parameter.model.ParameterSelectorItemModel
import org.hisp.dhis.mobile.ui.designsystem.component.parameter.model.ParameterSelectorItemModel.Status.CLOSED
import org.hisp.dhis.mobile.ui.designsystem.component.parameter.model.ParameterSelectorItemModel.Status.OPENED
import org.hisp.dhis.mobile.ui.designsystem.component.parameter.model.ParameterSelectorItemModel.Status.FOCUSED
import org.hisp.dhis.mobile.ui.designsystem.component.parameter.model.ParameterSelectorItemModel.Status.UNFOCUSED

@Composable
fun ParameterSelectorScreen() {
var inputTextValue by rememberSaveable(stateSaver = TextFieldValue.Saver) {
mutableStateOf(TextFieldValue(""))
}
var ageInputType by remember {
mutableStateOf<AgeInputType>(AgeInputType.None)
}
var inputBarcodeValue by rememberSaveable(stateSaver = TextFieldValue.Saver) {
var inputTextStatus by remember(inputTextValue.text) {
mutableStateOf(
TextFieldValue("889026a1-d01e-4d34-8209-81e8ed5c614b"),
if (inputTextValue.text.isEmpty()) {
CLOSED
} else {
UNFOCUSED
},
)
}

var inputQRCodeValue by rememberSaveable(stateSaver = TextFieldValue.Saver) {
mutableStateOf(
TextFieldValue("889026a1-d01e-4d34-8209-81e8ed5c614b"),
)
}
var checkBoxSelected: Boolean by remember { mutableStateOf(false) }
var inputQRStatus by remember(inputQRCodeValue.text) {
mutableStateOf(
if (inputQRCodeValue.text.isEmpty()) {
CLOSED
} else {
UNFOCUSED
},
)
}

var ageInputType by remember {
mutableStateOf<AgeInputType>(AgeInputType.None)
}

val items = listOf(
ParameterSelectorItemModel(
icon = Icons.Outlined.QrCode2,
label = "QRCode parameter",
label = "Text parameter",
helper = "Optional",
inputField = {
InputQRCode(
title = "QRCode parameter",
InputText(
title = "Text parameter",
state = InputShellState.UNFOCUSED,
inputTextFieldValue = inputQRCodeValue,
inputTextFieldValue = inputTextValue,
inputStyle = InputStyle.ParameterInputStyle(),
onQRButtonClicked = {},
onValueChanged = {
inputQRCodeValue = it ?: TextFieldValue()
inputTextValue = it ?: TextFieldValue()
},
)
},
status = if (inputQRCodeValue.text.isEmpty()) {
CLOSED
} else {
OPENED
status = inputTextStatus,
onExpand = {
inputTextStatus = FOCUSED
},
),
ParameterSelectorItemModel(
label = "Text parameter",
icon = Icons.Outlined.QrCode2,
label = "QRCode parameter",
helper = "Optional",
inputField = {
InputText(
title = "Text parameter",
InputQRCode(
title = "QRCode parameter",
state = InputShellState.UNFOCUSED,
inputTextFieldValue = inputTextValue,
inputTextFieldValue = inputQRCodeValue,
inputStyle = InputStyle.ParameterInputStyle(),
onQRButtonClicked = {},
onValueChanged = {
inputTextValue = it ?: TextFieldValue()
inputQRCodeValue = it ?: TextFieldValue()
},
)
},
status = if (inputTextValue.text.isEmpty()) {
CLOSED
} else {
OPENED
status = inputQRStatus,
onExpand = {
inputQRStatus = FOCUSED
},
),
ParameterSelectorItemModel(
Expand All @@ -125,28 +134,23 @@ fun ParameterSelectorScreen() {
},
status = when (ageInputType) {
AgeInputType.None -> CLOSED
else -> OPENED
else -> UNFOCUSED
},
onExpand = {},
),
ParameterSelectorItemModel(
label = "Barcode parameter",
helper = "Optional",
inputField = {
InputBarCode(
title = "Barcode parameter",
inputTextFieldValue = inputBarcodeValue,
inputTextFieldValue = TextFieldValue("12345678900"),
inputStyle = InputStyle.ParameterInputStyle(),
onActionButtonClicked = {},
onValueChanged = {
inputBarcodeValue = it ?: TextFieldValue()
},
onValueChanged = {},
)
},
status = if (inputBarcodeValue.text.isEmpty()) {
CLOSED
} else {
OPENED
},
onExpand = {},
),
ParameterSelectorItemModel(
label = "CheckBox parameter",
Expand All @@ -170,19 +174,11 @@ fun ParameterSelectorScreen() {
textInput = "option 2",
),
),
onClearSelection = {
checkBoxSelected = false
},
onItemChange = {
checkBoxSelected = true
},
onClearSelection = {},
onItemChange = {},
)
},
status = if (checkBoxSelected) {
OPENED
} else {
CLOSED
},
onExpand = {},
),
ParameterSelectorItemModel(
label = "DateTime parameter",
Expand All @@ -196,6 +192,7 @@ fun ParameterSelectorScreen() {
onValueChanged = {},
)
},
onExpand = {},
),
ParameterSelectorItemModel(
label = "DropDown parameter",
Expand All @@ -213,6 +210,7 @@ fun ParameterSelectorScreen() {
onResetButtonClicked = {},
)
},
onExpand = {},
),
ParameterSelectorItemModel(
label = "Email parameter",
Expand All @@ -226,6 +224,7 @@ fun ParameterSelectorScreen() {
onEmailActionCLicked = {},
)
},
onExpand = {},
),
ParameterSelectorItemModel(
label = "Link parameter",
Expand All @@ -239,6 +238,7 @@ fun ParameterSelectorScreen() {
onLinkActionCLicked = {},
)
},
onExpand = {},
),
ParameterSelectorItemModel(
label = "Integer parameter",
Expand All @@ -251,6 +251,7 @@ fun ParameterSelectorScreen() {
inputStyle = InputStyle.ParameterInputStyle(),
)
},
onExpand = {},
),
ParameterSelectorItemModel(
label = "Long text parameter",
Expand All @@ -263,6 +264,7 @@ fun ParameterSelectorScreen() {
inputStyle = InputStyle.ParameterInputStyle(),
)
},
onExpand = {},
),
ParameterSelectorItemModel(
label = "Matrix parameter",
Expand All @@ -289,6 +291,7 @@ fun ParameterSelectorScreen() {
onSelectionChanged = {},
)
},
onExpand = {},
),
ParameterSelectorItemModel(
label = "Not supported parameter",
Expand All @@ -300,6 +303,7 @@ fun ParameterSelectorScreen() {
inputStyle = InputStyle.ParameterInputStyle(),
)
},
onExpand = {},
),
ParameterSelectorItemModel(
label = "Org unit parameter",
Expand All @@ -311,6 +315,7 @@ fun ParameterSelectorScreen() {
onOrgUnitActionCLicked = {},
)
},
onExpand = {},
),
ParameterSelectorItemModel(
label = "Phone number parameter",
Expand All @@ -324,6 +329,7 @@ fun ParameterSelectorScreen() {
onCallActionClicked = {},
)
},
onExpand = {},
),
ParameterSelectorItemModel(
label = "Radio button parameter",
Expand All @@ -350,74 +356,7 @@ fun ParameterSelectorScreen() {
onItemChange = {},
)
},
),
ParameterSelectorItemModel(
label = "Sequential parameter",
helper = "Optional",
inputField = {
InputSequential(
title = "Sequential parameter",
state = InputShellState.UNFOCUSED,
inputStyle = InputStyle.ParameterInputStyle(),
data = listOf(
IconCardData(
uid = "7e0cb105-c276-4f12-9f56-a26af8314121",
label = "Stethoscope",
iconRes = "dhis2_stethoscope_positive",
iconTint = Color(0xFFFF8400),
),
IconCardData(
uid = "72269f6b-6b99-4d2e-a667-09f20c2097e0",
label = "Medicines",
iconRes = "dhis2_medicines_positive",
iconTint = Color(0xFFEB0085),
),
),
onSelectionChanged = {},
)
},
),
ParameterSelectorItemModel(
label = "Yes No parameter",
helper = "Optional",
inputField = {
InputYesNoField(
title = "Yes No parameter",
state = InputShellState.UNFOCUSED,
inputStyle = InputStyle.ParameterInputStyle(),
onItemChange = {},
)
},
),
ParameterSelectorItemModel(
label = "Yes only check box parameter",
helper = "Optional",
inputField = {
InputYesOnlyCheckBox(
state = InputShellState.UNFOCUSED,
inputStyle = InputStyle.ParameterInputStyle(),
checkBoxData = CheckBoxData(
uid = "uid1",
checked = true,
enabled = true,
textInput = "option 1",
),
onClick = {},
)
},
),
ParameterSelectorItemModel(
label = "Yes only switch parameter",
helper = "Optional",
inputField = {
InputYesOnlySwitch(
title = "Yes only switch parameter",
state = InputShellState.UNFOCUSED,
inputStyle = InputStyle.ParameterInputStyle(),
isChecked = true,
onClick = {},
)
},
onExpand = {},
),
)

Expand Down
2 changes: 1 addition & 1 deletion designsystem/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group = "org.hisp.dhis.mobile"
version = "1.0.1-SNAPSHOT"
version = "0.2-SNAPSHOT"

plugins {
kotlin("multiplatform")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import androidx.compose.ui.semantics.Role
import org.hisp.dhis.mobile.ui.designsystem.component.IconButton
import org.hisp.dhis.mobile.ui.designsystem.component.parameter.model.ParameterSelectorItemModel
import org.hisp.dhis.mobile.ui.designsystem.component.parameter.model.ParameterSelectorItemModel.Status.CLOSED
import org.hisp.dhis.mobile.ui.designsystem.component.parameter.model.ParameterSelectorItemModel.Status.OPENED
import org.hisp.dhis.mobile.ui.designsystem.component.parameter.model.ParameterSelectorItemModel.Status.FOCUSED
import org.hisp.dhis.mobile.ui.designsystem.theme.Border
import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing
import org.hisp.dhis.mobile.ui.designsystem.theme.SurfaceColor
Expand All @@ -53,12 +53,13 @@ fun ParameterSelectorItem(
EmptyParameterField(
model = model,
) {
status = OPENED
status = FOCUSED
model.onExpand()
}
}

AnimatedVisibility(
visible = status == OPENED,
visible = status != CLOSED,
enter = fadeIn() + expandVertically(),
exit = shrinkVertically() + fadeOut(),
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ data class ParameterSelectorItemModel(
val helper: String,
val inputField: @Composable () -> Unit,
val status: Status = Status.CLOSED,
val onExpand: () -> Unit,
) {
enum class Status {
OPENED,
FOCUSED,
UNFOCUSED,
CLOSED,
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ android.minSdk=21

#Versions
kotlin.version=1.9.22
agp.version=8.2.2
agp.version=8.2.0
compose.version=1.5.12

0 comments on commit b61ce4a

Please sign in to comment.