|
@@ -1,5 +1,6 @@
|
|
package com.fastest.pass.home.presentation.ui.components
|
|
package com.fastest.pass.home.presentation.ui.components
|
|
|
|
|
|
|
|
+import android.util.Log
|
|
import androidx.compose.foundation.background
|
|
import androidx.compose.foundation.background
|
|
import androidx.compose.foundation.border
|
|
import androidx.compose.foundation.border
|
|
import androidx.compose.foundation.clickable
|
|
import androidx.compose.foundation.clickable
|
|
@@ -14,6 +15,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|
import androidx.compose.foundation.layout.height
|
|
import androidx.compose.foundation.layout.height
|
|
import androidx.compose.foundation.layout.imePadding
|
|
import androidx.compose.foundation.layout.imePadding
|
|
import androidx.compose.foundation.layout.padding
|
|
import androidx.compose.foundation.layout.padding
|
|
|
|
+import androidx.compose.foundation.layout.size
|
|
import androidx.compose.foundation.layout.wrapContentHeight
|
|
import androidx.compose.foundation.layout.wrapContentHeight
|
|
import androidx.compose.foundation.rememberScrollState
|
|
import androidx.compose.foundation.rememberScrollState
|
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
@@ -40,6 +42,7 @@ import androidx.compose.material3.TextFieldDefaults
|
|
import androidx.compose.material3.rememberDatePickerState
|
|
import androidx.compose.material3.rememberDatePickerState
|
|
import androidx.compose.runtime.Composable
|
|
import androidx.compose.runtime.Composable
|
|
import androidx.compose.runtime.getValue
|
|
import androidx.compose.runtime.getValue
|
|
|
|
+import androidx.compose.runtime.mutableStateListOf
|
|
import androidx.compose.runtime.mutableStateOf
|
|
import androidx.compose.runtime.mutableStateOf
|
|
import androidx.compose.runtime.remember
|
|
import androidx.compose.runtime.remember
|
|
import androidx.compose.runtime.setValue
|
|
import androidx.compose.runtime.setValue
|
|
@@ -51,6 +54,7 @@ import androidx.compose.ui.platform.LocalFocusManager
|
|
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
|
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
|
import androidx.compose.ui.platform.SoftwareKeyboardController
|
|
import androidx.compose.ui.platform.SoftwareKeyboardController
|
|
import androidx.compose.ui.res.colorResource
|
|
import androidx.compose.ui.res.colorResource
|
|
|
|
+import androidx.compose.ui.res.painterResource
|
|
import androidx.compose.ui.res.stringResource
|
|
import androidx.compose.ui.res.stringResource
|
|
import androidx.compose.ui.text.input.ImeAction
|
|
import androidx.compose.ui.text.input.ImeAction
|
|
import androidx.compose.ui.text.input.KeyboardType
|
|
import androidx.compose.ui.text.input.KeyboardType
|
|
@@ -58,17 +62,53 @@ import androidx.compose.ui.text.style.TextAlign
|
|
import androidx.compose.ui.unit.dp
|
|
import androidx.compose.ui.unit.dp
|
|
import androidx.compose.ui.unit.sp
|
|
import androidx.compose.ui.unit.sp
|
|
import com.fastest.pass.R
|
|
import com.fastest.pass.R
|
|
|
|
+import com.fastest.pass.helpers.BasePreferenceHelper
|
|
|
|
+import com.fastest.pass.home.data.model.NewItemFormField
|
|
import com.fastest.pass.home.domain.model.CountryInfo
|
|
import com.fastest.pass.home.domain.model.CountryInfo
|
|
|
|
|
|
@Composable
|
|
@Composable
|
|
fun AddDriverLicenseFormScreen(
|
|
fun AddDriverLicenseFormScreen(
|
|
onCountryList: (List<CountryInfo>, String) -> Unit,
|
|
onCountryList: (List<CountryInfo>, String) -> Unit,
|
|
- countryListDisplayed: List<CountryInfo>
|
|
|
|
|
|
+ countryListDisplayed: List<CountryInfo>,
|
|
|
|
+ basePreferenceHelper: BasePreferenceHelper,
|
|
|
|
+ onDriverLicenseFormList: (List<NewItemFormField>, Boolean) -> Unit
|
|
) {
|
|
) {
|
|
val keyboardController = LocalSoftwareKeyboardController.current
|
|
val keyboardController = LocalSoftwareKeyboardController.current
|
|
val focusManager = LocalFocusManager.current
|
|
val focusManager = LocalFocusManager.current
|
|
val gender = listOf("Please Select", "Male", "Female", "Other")
|
|
val gender = listOf("Please Select", "Male", "Female", "Other")
|
|
|
|
|
|
|
|
+ var drivers_license_title by remember { mutableStateOf("") }
|
|
|
|
+ var drivers_license_number by remember { mutableStateOf("") }
|
|
|
|
+ var drivers_license_expiration_date by remember { mutableStateOf("") }
|
|
|
|
+ var drivers_license_license_class by remember { mutableStateOf("") }
|
|
|
|
+ var drivers_license_name by remember { mutableStateOf("") }
|
|
|
|
+ var drivers_license_address by remember { mutableStateOf("") }
|
|
|
|
+ var drivers_license_city_town by remember { mutableStateOf("") }
|
|
|
|
+ var drivers_license_state by remember { mutableStateOf("") }
|
|
|
|
+ var drivers_license_zip_postalcode by remember { mutableStateOf("") }
|
|
|
|
+ var drivers_license_country by remember { mutableStateOf("") }
|
|
|
|
+ var drivers_license_date_of_birth by remember { mutableStateOf("") }
|
|
|
|
+ var drivers_license_gender by remember { mutableStateOf("") }
|
|
|
|
+ var drivers_license_height by remember { mutableStateOf("") }
|
|
|
|
+ var drivers_license_notes by remember { mutableStateOf("") }
|
|
|
|
+
|
|
|
|
+ val driverLicenseFields = mutableListOf(
|
|
|
|
+ NewItemFormField("drivers-license_title", drivers_license_title),
|
|
|
|
+ NewItemFormField("drivers-license_number", drivers_license_number),
|
|
|
|
+ NewItemFormField("drivers-license_expiration_date", drivers_license_expiration_date),
|
|
|
|
+ NewItemFormField("drivers-license_license_class", drivers_license_license_class),
|
|
|
|
+ NewItemFormField("drivers-license_name", drivers_license_name),
|
|
|
|
+ NewItemFormField("drivers-license_address", drivers_license_address),
|
|
|
|
+ NewItemFormField("drivers-license_city_town", drivers_license_city_town),
|
|
|
|
+ NewItemFormField("drivers-license_state", drivers_license_state),
|
|
|
|
+ NewItemFormField("drivers-license_zip_postalcode", drivers_license_zip_postalcode),
|
|
|
|
+ NewItemFormField("drivers-license_country", drivers_license_country),
|
|
|
|
+ NewItemFormField("drivers-license_date_of_birth", drivers_license_date_of_birth),
|
|
|
|
+ NewItemFormField("drivers-license_gender", drivers_license_gender),
|
|
|
|
+ NewItemFormField("drivers-license_height", drivers_license_height),
|
|
|
|
+ NewItemFormField("drivers-license_notes", drivers_license_notes),
|
|
|
|
+ )
|
|
|
|
+
|
|
Box(
|
|
Box(
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
.fillMaxSize()
|
|
.fillMaxSize()
|
|
@@ -77,7 +117,24 @@ fun AddDriverLicenseFormScreen(
|
|
.background(Color.Transparent)
|
|
.background(Color.Transparent)
|
|
.imePadding()
|
|
.imePadding()
|
|
) {
|
|
) {
|
|
- SaveButtonADLFS(buttonText = R.string.save)
|
|
|
|
|
|
+ SaveButtonADLFS(
|
|
|
|
+ buttonText = R.string.save,
|
|
|
|
+ onSaveButtonClick = {
|
|
|
|
+ val saltKey = basePreferenceHelper.getCustomSaltKey()
|
|
|
|
+ val secretKey = basePreferenceHelper.getCustomSecretKey()
|
|
|
|
+ val isTitleEmpty = drivers_license_title.isEmpty()
|
|
|
|
+
|
|
|
|
+ driverLicenseFields.forEachIndexed { index, newItemFormField ->
|
|
|
|
+ driverLicenseFields[index].value = encryptIfNotEmpty(newItemFormField.value, secretKey, saltKey)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ val driverLicenseFormData = driverLicenseFields.map { field ->
|
|
|
|
+ NewItemFormField(field.key, field.value)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ onDriverLicenseFormList.invoke(driverLicenseFormData, isTitleEmpty)
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
|
|
Column(
|
|
Column(
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
@@ -88,25 +145,69 @@ fun AddDriverLicenseFormScreen(
|
|
.verticalScroll(rememberScrollState())
|
|
.verticalScroll(rememberScrollState())
|
|
) {
|
|
) {
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
- NameTextFieldADLFS(keyboardController = keyboardController, focusManager = focusManager, labelText = R.string.title)
|
|
|
|
|
|
+ NameTextFieldADLFS(
|
|
|
|
+ keyboardController = keyboardController,
|
|
|
|
+ focusManager = focusManager,
|
|
|
|
+ labelText = R.string.title,
|
|
|
|
+ onText = { drivers_license_title = it }
|
|
|
|
+ )
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
- TextNumberTextFieldADLFS(keyboardController = keyboardController, focusManager = focusManager, labelText = R.string.number, "L123456789")
|
|
|
|
|
|
+ TextNumberTextFieldADLFS(
|
|
|
|
+ keyboardController = keyboardController,
|
|
|
|
+ focusManager = focusManager,
|
|
|
|
+ labelText = R.string.number,
|
|
|
|
+ "L123456789",
|
|
|
|
+ onText = { drivers_license_number = it }
|
|
|
|
+ )
|
|
|
|
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
- DatePickerADLFS(labelText = R.string.expiration_date) {}
|
|
|
|
|
|
+ DatePickerADLFS(
|
|
|
|
+ labelText = R.string.expiration_date,
|
|
|
|
+ onDateSelected = { drivers_license_expiration_date = it }
|
|
|
|
+ )
|
|
|
|
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
- NameTextFieldADLFS(keyboardController = keyboardController, focusManager = focusManager, labelText = R.string.license_class)
|
|
|
|
|
|
+ NameTextFieldADLFS(
|
|
|
|
+ keyboardController = keyboardController,
|
|
|
|
+ focusManager = focusManager,
|
|
|
|
+ labelText = R.string.license_class,
|
|
|
|
+ onText = { drivers_license_license_class = it }
|
|
|
|
+ )
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
- NameTextFieldADLFS(keyboardController = keyboardController, focusManager = focusManager, labelText = R.string.name)
|
|
|
|
|
|
+ NameTextFieldADLFS(
|
|
|
|
+ keyboardController = keyboardController,
|
|
|
|
+ focusManager = focusManager,
|
|
|
|
+ labelText = R.string.name,
|
|
|
|
+ onText = { drivers_license_name = it }
|
|
|
|
+ )
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
- NameTextFieldADLFS(keyboardController = keyboardController, focusManager = focusManager, labelText = R.string.address)
|
|
|
|
|
|
+ NameTextFieldADLFS(
|
|
|
|
+ keyboardController = keyboardController,
|
|
|
|
+ focusManager = focusManager,
|
|
|
|
+ labelText = R.string.address,
|
|
|
|
+ onText = { drivers_license_address = it }
|
|
|
|
+ )
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
- NameTextFieldADLFS(keyboardController = keyboardController, focusManager = focusManager, labelText = R.string.city_town)
|
|
|
|
|
|
+ NameTextFieldADLFS(
|
|
|
|
+ keyboardController = keyboardController,
|
|
|
|
+ focusManager = focusManager,
|
|
|
|
+ labelText = R.string.city_town,
|
|
|
|
+ onText = { drivers_license_city_town = it }
|
|
|
|
+ )
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
- NameTextFieldADLFS(keyboardController = keyboardController, focusManager = focusManager, labelText = R.string.state)
|
|
|
|
|
|
+ NameTextFieldADLFS(
|
|
|
|
+ keyboardController = keyboardController,
|
|
|
|
+ focusManager = focusManager,
|
|
|
|
+ labelText = R.string.state,
|
|
|
|
+ onText = { drivers_license_state = it }
|
|
|
|
+ )
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
- NameTextFieldADLFS(keyboardController = keyboardController, focusManager = focusManager, labelText = R.string.zip_postal_code)
|
|
|
|
|
|
+ NameTextFieldADLFS(
|
|
|
|
+ keyboardController = keyboardController,
|
|
|
|
+ focusManager = focusManager,
|
|
|
|
+ labelText = R.string.zip_postal_code,
|
|
|
|
+ onText = { drivers_license_zip_postalcode = it }
|
|
|
|
+ )
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
SelectCountryInfoDS(
|
|
SelectCountryInfoDS(
|
|
labelText = R.string.country,
|
|
labelText = R.string.country,
|
|
@@ -115,30 +216,51 @@ fun AddDriverLicenseFormScreen(
|
|
onCountryList = { list, text ->
|
|
onCountryList = { list, text ->
|
|
onCountryList.invoke(list, text)
|
|
onCountryList.invoke(list, text)
|
|
},
|
|
},
|
|
- countryListDisplayed = countryListDisplayed
|
|
|
|
|
|
+ countryListDisplayed = countryListDisplayed,
|
|
|
|
+ onText = { drivers_license_country = it }
|
|
)
|
|
)
|
|
// NameTextFieldADLFS(keyboardController = keyboardController, focusManager = focusManager, labelText = R.string.country)
|
|
// NameTextFieldADLFS(keyboardController = keyboardController, focusManager = focusManager, labelText = R.string.country)
|
|
|
|
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
- DatePickerADLFS(labelText = R.string.date_of_birth) {}
|
|
|
|
|
|
+ DatePickerADLFS(
|
|
|
|
+ labelText = R.string.date_of_birth,
|
|
|
|
+ onDateSelected = { drivers_license_date_of_birth = it }
|
|
|
|
+ )
|
|
|
|
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
- DropDownFieldADLFS(keyboardController = keyboardController, focusManager = focusManager,
|
|
|
|
- labelText = R.string.gender, titles = gender)
|
|
|
|
|
|
+ DropDownFieldADLFS(
|
|
|
|
+ keyboardController = keyboardController,
|
|
|
|
+ focusManager = focusManager,
|
|
|
|
+ labelText = R.string.gender,
|
|
|
|
+ titles = gender,
|
|
|
|
+ onText = { drivers_license_gender = it }
|
|
|
|
+ )
|
|
// NameTextFieldADLFS(keyboardController = keyboardController, focusManager = focusManager, labelText = R.string.sex)
|
|
// NameTextFieldADLFS(keyboardController = keyboardController, focusManager = focusManager, labelText = R.string.sex)
|
|
|
|
|
|
|
|
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
- NameTextFieldADLFS(keyboardController = keyboardController, focusManager = focusManager, labelText = R.string.height)
|
|
|
|
|
|
+ NameTextFieldADLFS(
|
|
|
|
+ keyboardController = keyboardController,
|
|
|
|
+ focusManager = focusManager,
|
|
|
|
+ labelText = R.string.height,
|
|
|
|
+ onText = { drivers_license_height = it }
|
|
|
|
+ )
|
|
|
|
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
Spacer(modifier = Modifier.height(20.dp))
|
|
- NotesTextFieldADLFS(keyboardController = keyboardController, focusManager = focusManager)
|
|
|
|
|
|
+ NotesTextFieldADLFS(
|
|
|
|
+ keyboardController = keyboardController,
|
|
|
|
+ focusManager = focusManager,
|
|
|
|
+ onText = { drivers_license_notes = it }
|
|
|
|
+ )
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@Composable
|
|
@Composable
|
|
-fun BoxScope.SaveButtonADLFS(buttonText: Int) {
|
|
|
|
|
|
+fun BoxScope.SaveButtonADLFS(
|
|
|
|
+ buttonText: Int,
|
|
|
|
+ onSaveButtonClick: () -> Unit
|
|
|
|
+ ) {
|
|
Button(
|
|
Button(
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
.background(colorResource(id = R.color.transparent))
|
|
.background(colorResource(id = R.color.transparent))
|
|
@@ -146,7 +268,9 @@ fun BoxScope.SaveButtonADLFS(buttonText: Int) {
|
|
.height(60.dp)
|
|
.height(60.dp)
|
|
.align(Alignment.BottomCenter)
|
|
.align(Alignment.BottomCenter)
|
|
.clickable() { },
|
|
.clickable() { },
|
|
- onClick = {},
|
|
|
|
|
|
+ onClick = {
|
|
|
|
+ onSaveButtonClick.invoke()
|
|
|
|
+ },
|
|
shape = RoundedCornerShape(15.dp),
|
|
shape = RoundedCornerShape(15.dp),
|
|
// border = BorderStroke(25.dp, colorResource(id = R.color.black)),
|
|
// border = BorderStroke(25.dp, colorResource(id = R.color.black)),
|
|
colors = ButtonDefaults.buttonColors(
|
|
colors = ButtonDefaults.buttonColors(
|
|
@@ -170,7 +294,8 @@ fun BoxScope.SaveButtonADLFS(buttonText: Int) {
|
|
fun ColumnScope.NameTextFieldADLFS(
|
|
fun ColumnScope.NameTextFieldADLFS(
|
|
keyboardController: SoftwareKeyboardController?,
|
|
keyboardController: SoftwareKeyboardController?,
|
|
focusManager: FocusManager,
|
|
focusManager: FocusManager,
|
|
- labelText: Int
|
|
|
|
|
|
+ labelText: Int,
|
|
|
|
+ onText: (String) -> Unit
|
|
) {
|
|
) {
|
|
var text by remember { mutableStateOf("") }
|
|
var text by remember { mutableStateOf("") }
|
|
|
|
|
|
@@ -178,6 +303,7 @@ fun ColumnScope.NameTextFieldADLFS(
|
|
value = text,
|
|
value = text,
|
|
onValueChange = {
|
|
onValueChange = {
|
|
text = it
|
|
text = it
|
|
|
|
+ onText.invoke(text)
|
|
},
|
|
},
|
|
textStyle = MaterialTheme.typography.displayMedium,
|
|
textStyle = MaterialTheme.typography.displayMedium,
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
@@ -241,7 +367,8 @@ fun ColumnScope.TextNumberTextFieldADLFS(
|
|
keyboardController: SoftwareKeyboardController?,
|
|
keyboardController: SoftwareKeyboardController?,
|
|
focusManager: FocusManager,
|
|
focusManager: FocusManager,
|
|
labelText: Int,
|
|
labelText: Int,
|
|
- placeholder: String
|
|
|
|
|
|
+ placeholder: String,
|
|
|
|
+ onText: (String) -> Unit
|
|
) {
|
|
) {
|
|
var text by remember { mutableStateOf("") }
|
|
var text by remember { mutableStateOf("") }
|
|
|
|
|
|
@@ -249,6 +376,7 @@ fun ColumnScope.TextNumberTextFieldADLFS(
|
|
value = text,
|
|
value = text,
|
|
onValueChange = {
|
|
onValueChange = {
|
|
text = it
|
|
text = it
|
|
|
|
+ onText.invoke(text)
|
|
},
|
|
},
|
|
textStyle = MaterialTheme.typography.displayMedium,
|
|
textStyle = MaterialTheme.typography.displayMedium,
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
@@ -343,6 +471,14 @@ fun ColumnScope.DatePickerADLFS(
|
|
tint = colorResource(id = R.color.gray_text)
|
|
tint = colorResource(id = R.color.gray_text)
|
|
)
|
|
)
|
|
},
|
|
},
|
|
|
|
+ trailingIcon = {
|
|
|
|
+ Icon(
|
|
|
|
+ painter = painterResource(id = R.drawable.arrow_right),
|
|
|
|
+ contentDescription = "description",
|
|
|
|
+ modifier = Modifier.size(24.dp),
|
|
|
|
+ tint = colorResource(id = R.color.gray_text)
|
|
|
|
+ )
|
|
|
|
+ },
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
.align(Alignment.Start)
|
|
.align(Alignment.Start)
|
|
.fillMaxWidth()
|
|
.fillMaxWidth()
|
|
@@ -417,7 +553,8 @@ fun ColumnScope.DatePickerADLFS(
|
|
@Composable
|
|
@Composable
|
|
fun ColumnScope.NotesTextFieldADLFS(
|
|
fun ColumnScope.NotesTextFieldADLFS(
|
|
keyboardController: SoftwareKeyboardController?,
|
|
keyboardController: SoftwareKeyboardController?,
|
|
- focusManager: FocusManager
|
|
|
|
|
|
+ focusManager: FocusManager,
|
|
|
|
+ onText: (String) -> Unit
|
|
) {
|
|
) {
|
|
var notesText by remember { mutableStateOf("") }
|
|
var notesText by remember { mutableStateOf("") }
|
|
|
|
|
|
@@ -425,6 +562,7 @@ fun ColumnScope.NotesTextFieldADLFS(
|
|
value = notesText,
|
|
value = notesText,
|
|
onValueChange = {
|
|
onValueChange = {
|
|
notesText = it
|
|
notesText = it
|
|
|
|
+ onText.invoke(notesText)
|
|
},
|
|
},
|
|
textStyle = MaterialTheme.typography.displayMedium,
|
|
textStyle = MaterialTheme.typography.displayMedium,
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
@@ -491,7 +629,8 @@ fun ColumnScope.DropDownFieldADLFS(
|
|
focusManager: FocusManager,
|
|
focusManager: FocusManager,
|
|
labelText: Int,
|
|
labelText: Int,
|
|
titles: List<String>,
|
|
titles: List<String>,
|
|
- topPadding: Int = 0
|
|
|
|
|
|
+ topPadding: Int = 0,
|
|
|
|
+ onText: (String) -> Unit
|
|
) {
|
|
) {
|
|
var isExpanded by remember { mutableStateOf(false) }
|
|
var isExpanded by remember { mutableStateOf(false) }
|
|
var selectedText by remember { mutableStateOf(titles[0]) }
|
|
var selectedText by remember { mutableStateOf(titles[0]) }
|
|
@@ -574,6 +713,7 @@ fun ColumnScope.DropDownFieldADLFS(
|
|
onClick = {
|
|
onClick = {
|
|
selectedText = s
|
|
selectedText = s
|
|
isExpanded = false
|
|
isExpanded = false
|
|
|
|
+ onText.invoke(selectedText)
|
|
},
|
|
},
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
.background(colorResource(id = R.color.white))
|
|
.background(colorResource(id = R.color.white))
|
|
@@ -592,7 +732,8 @@ fun ColumnScope.SelectCountryInfoDS(
|
|
keyboardController: SoftwareKeyboardController?,
|
|
keyboardController: SoftwareKeyboardController?,
|
|
focusManager: FocusManager,
|
|
focusManager: FocusManager,
|
|
onCountryList: (List<CountryInfo>, String) -> Unit,
|
|
onCountryList: (List<CountryInfo>, String) -> Unit,
|
|
- countryListDisplayed: List<CountryInfo>
|
|
|
|
|
|
+ countryListDisplayed: List<CountryInfo>,
|
|
|
|
+ onText: (String) -> Unit
|
|
) {
|
|
) {
|
|
var selectedCountry by remember { mutableStateOf("Please Select") }
|
|
var selectedCountry by remember { mutableStateOf("Please Select") }
|
|
var isSheetOpened by remember { mutableStateOf(false) }
|
|
var isSheetOpened by remember { mutableStateOf(false) }
|
|
@@ -612,6 +753,14 @@ fun ColumnScope.SelectCountryInfoDS(
|
|
color = colorResource(id = R.color.gray_text)
|
|
color = colorResource(id = R.color.gray_text)
|
|
)
|
|
)
|
|
) },
|
|
) },
|
|
|
|
+ trailingIcon = {
|
|
|
|
+ Icon(
|
|
|
|
+ painter = painterResource(id = R.drawable.arrow_right),
|
|
|
|
+ contentDescription = "description",
|
|
|
|
+ modifier = Modifier.size(24.dp),
|
|
|
|
+ tint = colorResource(id = R.color.gray_text)
|
|
|
|
+ )
|
|
|
|
+ },
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
.align(Alignment.Start)
|
|
.align(Alignment.Start)
|
|
.fillMaxWidth()
|
|
.fillMaxWidth()
|
|
@@ -650,6 +799,7 @@ fun ColumnScope.SelectCountryInfoDS(
|
|
isSheetOpened = {isSheetOpened = false},
|
|
isSheetOpened = {isSheetOpened = false},
|
|
onSelectedCountry = { countryName ->
|
|
onSelectedCountry = { countryName ->
|
|
selectedCountry = countryName
|
|
selectedCountry = countryName
|
|
|
|
+ onText.invoke(selectedCountry)
|
|
},
|
|
},
|
|
onSearchTextChanged = {},
|
|
onSearchTextChanged = {},
|
|
onCountryList = { list , text ->
|
|
onCountryList = { list , text ->
|