diff --git a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/components/AutoCompleteDropDown.kt b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/components/AutoCompleteDropDown.kt
index 2ad4893a..91d06cd6 100644
--- a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/components/AutoCompleteDropDown.kt
+++ b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/components/AutoCompleteDropDown.kt
@@ -45,6 +45,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.soujunior.domain.model.request.PetRaceItemModel
+import ir.kaaveh.sdpcompose.sdp
@Composable
fun AutoCompleteDropDown(
@@ -59,7 +60,7 @@ fun AutoCompleteDropDown(
onDropdownItemSelected: (String) -> Unit = {},
onFocusChange: (Boolean) -> Unit = {}
) {
-
+ val colorBorder = MaterialTheme.colorScheme.outline
var expanded by remember {
mutableStateOf(false)
}
@@ -99,11 +100,11 @@ fun AutoCompleteDropDown(
val stroke = Stroke(
width = 1.dp.toPx(),
pathEffect = PathEffect.dashPathEffect(
- intervals = floatArrayOf(8.dp.toPx(), 8.dp.toPx(), 0f)
+ intervals = floatArrayOf(12.dp.toPx(), 12.dp.toPx(), 0f)
)
)
drawRoundRect(
- color = if (isError) Color.Transparent else if (expanded) Color.Transparent else Color.Black,
+ color = if (isError) Color.Transparent else colorBorder,
style = stroke,
cornerRadius = CornerRadius(10.dp.toPx())
)
@@ -111,12 +112,10 @@ fun AutoCompleteDropDown(
}
.border(
2.dp,
- if (isError) MaterialTheme.colorScheme.error
- else if (expanded) MaterialTheme.colorScheme.primary
- else Color.Transparent,
- shape = RoundedCornerShape(10.dp)
+ if (isError) MaterialTheme.colorScheme.error else Color.Transparent,
+ shape = RoundedCornerShape(10.sdp)
)
- .clip(RoundedCornerShape(10.dp)),
+ .clip(RoundedCornerShape(10.sdp)),
value = textValue,
diff --git a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/components/CreateTitleAndImageLogo.kt b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/components/CreateTitleAndImageLogo.kt
index 42683f86..a43da3bb 100644
--- a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/components/CreateTitleAndImageLogo.kt
+++ b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/components/CreateTitleAndImageLogo.kt
@@ -37,7 +37,7 @@ import ir.kaaveh.sdpcompose.ssp
@Composable
fun CreateTitleAndImageLogo(
title: String? = "",
- titleSecundary: String,
+ titleSecundary: String? = "",
breadcrumbEnable: Boolean? = false,
breadcrumbIndex: Int? = 0,
modifierImage: Modifier = Modifier,
@@ -106,11 +106,11 @@ fun CreateTitleAndImageLogo(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.fillMaxWidth()
- .padding(start = 10.sdp, end = 10.sdp),
+ .padding(horizontal = 8.sdp),
) {
Text(
text = title,
- style = MaterialTheme.typography.titleMedium,
+ style = MaterialTheme.typography.bodyLarge,
modifier = modifierTextTitle,
color = MaterialTheme.colorScheme.primary,
textAlign = textAlign,
@@ -119,22 +119,24 @@ fun CreateTitleAndImageLogo(
)
}
}
- Spacer(modifier = Modifier.height(spaceBetween))
- Row(
- verticalAlignment = Alignment.CenterVertically,
- modifier = Modifier
- .fillMaxWidth()
- .padding(start = 10.sdp, end = 10.sdp),
- ) {
- Text(
- text = titleSecundary,
- style = styleTitle,
- modifier = modifierTextTitle,
- color = MaterialTheme.colorScheme.primary,
- textAlign = textAlign,
- fontWeight = FontWeight(10),
- fontSize = 16.ssp
- )
+ if (!titleSecundary.isNullOrEmpty()) {
+ Spacer(modifier = Modifier.height(spaceBetween))
+ Row(
+ verticalAlignment = Alignment.CenterVertically,
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(start = 10.sdp, end = 10.sdp),
+ ) {
+ Text(
+ text = titleSecundary,
+ style = styleTitle,
+ modifier = modifierTextTitle,
+ color = MaterialTheme.colorScheme.primary,
+ textAlign = textAlign,
+ fontWeight = FontWeight(10),
+ fontSize = 16.ssp
+ )
+ }
}
}
}
diff --git a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/components/DashedInputText.kt b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/components/DashedInputText.kt
index a883f93a..0a58f600 100644
--- a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/components/DashedInputText.kt
+++ b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/components/DashedInputText.kt
@@ -67,7 +67,7 @@ fun DashedInputText(
textAlign = TextAlign.Start,
color = MaterialTheme.colorScheme.onBackground,
style = MaterialTheme.typography.bodyMedium,
- fontSize = 12.ssp,
+ fontSize = 14.ssp,
modifier = Modifier
.fillMaxWidth()
.padding(start = 10.sdp, bottom = 5.sdp, top = 15.sdp)
@@ -105,7 +105,7 @@ fun DashedInputText(
onValueChange = { text -> onEvent(text) },
singleLine = true,
textStyle = TextStyle(
- fontSize = 15.ssp,
+ fontSize = 12.ssp,
color = if (isSystemInDarkTheme()) Color.Black else MaterialTheme.colorScheme.onSurface
),
maxLines = 1,
@@ -131,7 +131,7 @@ fun DashedInputText(
text = placeholderText,
style = MaterialTheme.typography.bodyLarge,
color = MaterialTheme.colorScheme.outline,
- fontSize = 15.ssp
+ fontSize = 14.ssp
)
}
it()
diff --git a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/components/DateInputText.kt b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/components/DateInputText.kt
index 0148fbee..dd1527d5 100644
--- a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/components/DateInputText.kt
+++ b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/components/DateInputText.kt
@@ -2,6 +2,7 @@ package com.soujunior.petjournal.ui.components
import android.util.Log
import androidx.compose.foundation.border
+import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
@@ -34,8 +35,9 @@ import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.VisualTransformation
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
-import androidx.compose.ui.unit.sp
import com.soujunior.petjournal.R
+import ir.kaaveh.sdpcompose.sdp
+import ir.kaaveh.sdpcompose.ssp
@Composable
fun DateInputText(
@@ -51,7 +53,7 @@ fun DateInputText(
) {
var inFocus by remember { mutableStateOf(false) }
-
+ val colorBorder = MaterialTheme.colorScheme.outline
Column(modifier = modifier) {
Row {
Text(
@@ -59,10 +61,10 @@ fun DateInputText(
textAlign = TextAlign.Start,
color = MaterialTheme.colorScheme.onBackground,
style = MaterialTheme.typography.bodyMedium,
- fontSize = 15.sp,
+ fontSize = 14.ssp,
modifier = Modifier
.fillMaxWidth()
- .padding(start = 10.dp, bottom = 5.dp)
+ .padding(start = 10.sdp, bottom = 5.sdp)
)
}
Row {
@@ -72,8 +74,8 @@ fun DateInputText(
OutlinedTextField(
modifier = textInputModifier
.fillMaxWidth()
- .padding(5.dp)
- .height(50.dp)
+ .padding(5.sdp)
+ .height(45.sdp)
.onFocusChanged {
inFocus = if (it.hasFocus)
it.hasFocus
@@ -85,23 +87,22 @@ fun DateInputText(
val stroke = Stroke(
width = 1.dp.toPx(),
pathEffect = PathEffect.dashPathEffect(
- intervals = floatArrayOf(8.dp.toPx(), 8.dp.toPx(), 8.dp.toPx())
+ intervals = floatArrayOf(12.dp.toPx(), 12.dp.toPx(), 0f)
)
)
drawRoundRect(
- color = if (isError) Color.Transparent else if (inFocus) Color.Transparent else Color.Black,
+ color = if (isError) Color.Transparent else colorBorder,
style = stroke,
cornerRadius = CornerRadius(10.dp.toPx())
)
+
}
.border(
2.dp,
- if (isError) MaterialTheme.colorScheme.error
- else if (inFocus) MaterialTheme.colorScheme.primary
- else Color.Transparent,
- shape = RoundedCornerShape(10.dp)
+ if (isError) MaterialTheme.colorScheme.error else Color.Transparent,
+ shape = RoundedCornerShape(10.sdp)
)
- .clip(RoundedCornerShape(10.dp)),
+ .clip(RoundedCornerShape(10.sdp)),
value = textValue,
onValueChange = { newValue ->
@@ -112,7 +113,7 @@ fun DateInputText(
}
},
textStyle = TextStyle(
- fontSize = 15.sp,
+ fontSize = 14.ssp,
color = MaterialTheme.colorScheme.onSurface
),
placeholder = { Text(text = placeholderText) },
@@ -135,7 +136,7 @@ fun DateInputText(
painter = painterResource(id = iconResource),
contentDescription = contentDescription,
tint = Color.Unspecified,
- modifier = Modifier.padding(10.dp)
+ modifier = Modifier.padding(10.sdp)
)
} else if (textValue.length >= 7) {
val iconResource = R.drawable.icone_verificado_ok
@@ -145,7 +146,7 @@ fun DateInputText(
painter = painterResource(id = iconResource),
contentDescription = contentDescription,
tint = Color.Unspecified,
- modifier = Modifier.padding(10.dp)
+ modifier = Modifier.padding(10.sdp)
)
}
}
@@ -158,14 +159,14 @@ fun DateInputText(
Row {
if (textError != null) {
textError.forEach {
- AlertText(textMessage = it, modifier = Modifier.padding(10.dp))
+ AlertText(textMessage = it, modifier = Modifier.padding(10.sdp))
}
} else {
Text(
"*Campo Obrigatório.",
- color = MaterialTheme.colorScheme.outline,
- modifier = Modifier.padding(10.dp),
- fontSize = 15.sp
+ color = if (isSystemInDarkTheme()) Color.White else MaterialTheme.colorScheme.outline,
+ modifier = Modifier.padding(10.sdp),
+ fontSize = 12.ssp
)
}
}
diff --git a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/components/DropDown.kt b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/components/DropDown.kt
index 2fa322cc..4ddffcec 100644
--- a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/components/DropDown.kt
+++ b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/components/DropDown.kt
@@ -37,6 +37,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.soujunior.domain.model.request.PetSizeItemModel
+import ir.kaaveh.sdpcompose.sdp
@Composable
fun DropDown(
@@ -51,7 +52,7 @@ fun DropDown(
textValue: String
) {
var isDropdownExpanded by remember { mutableStateOf(false) }
-
+ val colorBorder = MaterialTheme.colorScheme.outline
Column(modifier = modifier) {
Row {
@@ -78,13 +79,11 @@ fun DropDown(
val stroke = Stroke(
width = 1.dp.toPx(),
pathEffect = PathEffect.dashPathEffect(
- intervals = floatArrayOf(8.dp.toPx(), 8.dp.toPx(), 0f)
+ intervals = floatArrayOf(12.dp.toPx(), 12.dp.toPx(), 0f)
)
)
-
-
drawRoundRect(
- color = if (isError) Color.Transparent else if (isDropdownExpanded) Color.Transparent else Color.Black,
+ color = if (isError) Color.Transparent else colorBorder,
style = stroke,
cornerRadius = CornerRadius(10.dp.toPx())
)
@@ -92,12 +91,10 @@ fun DropDown(
}
.border(
2.dp,
- if (isError) MaterialTheme.colorScheme.error
- else if (isDropdownExpanded) MaterialTheme.colorScheme.primary
- else Color.Transparent,
- shape = RoundedCornerShape(10.dp)
+ if (isError) MaterialTheme.colorScheme.error else Color.Transparent,
+ shape = RoundedCornerShape(10.sdp)
)
- .clip(RoundedCornerShape(10.dp))
+ .clip(RoundedCornerShape(10.sdp))
.clickable { isDropdownExpanded = true }
) {
Text(
diff --git a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petBirthDateScreen/components/CastrationSelector.kt b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petBirthDateScreen/components/CastrationSelector.kt
index 0c97771c..a94b7ec0 100644
--- a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petBirthDateScreen/components/CastrationSelector.kt
+++ b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petBirthDateScreen/components/CastrationSelector.kt
@@ -1,5 +1,6 @@
package com.soujunior.petjournal.ui.screens_app.screens_pets.petBirthDateScreen.components
+import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
@@ -21,11 +22,11 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
-import androidx.compose.ui.unit.dp
-import androidx.compose.ui.unit.sp
import com.soujunior.petjournal.R
import com.soujunior.petjournal.ui.components.AlertText
import com.soujunior.petjournal.ui.components.RoundedSquare
+import ir.kaaveh.sdpcompose.sdp
+import ir.kaaveh.sdpcompose.ssp
@Composable
@@ -37,7 +38,7 @@ fun CastrationSelector(
) {
Column(modifier = Modifier
.fillMaxWidth()
- .padding(16.dp),
+ .padding(16.sdp),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally,
content = {
@@ -45,7 +46,7 @@ fun CastrationSelector(
Text(
modifier = Modifier.fillMaxWidth(),
text = stringResource(id = R.string.pet_castration, textNamePet),
- fontSize = 17.sp,
+ fontSize = 17.ssp,
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.primary,
textAlign = TextAlign.Center
@@ -53,7 +54,7 @@ fun CastrationSelector(
Spacer(
modifier = Modifier
.fillMaxWidth()
- .padding(25.dp)
+ .padding(25.sdp)
)
}
@@ -76,19 +77,19 @@ private fun CastrationButtons(
Row(
modifier = Modifier
- .padding(horizontal = 2.dp)
+ .padding(horizontal = 2.sdp)
.testTag("genderButtons_test"),
- horizontalArrangement = Arrangement.spacedBy(16.dp)
+ horizontalArrangement = Arrangement.spacedBy(16.sdp)
) {
RoundedSquare(
text = stringResource(id = R.string.text_yes),
colorText = if (selectedItem == "S") MaterialTheme.colorScheme.tertiary else MaterialTheme.colorScheme.onSurfaceVariant,
isSelected = selectedItem == "S",
- size = 120.dp,
- topLeftRadius = 32.dp,
- topRightRadius = 32.dp,
- bottomLeftRadius = 32.dp,
- bottomRightRadius = 32.dp,
+ size = 95.sdp,
+ topLeftRadius = 32.sdp,
+ topRightRadius = 32.sdp,
+ bottomLeftRadius = 32.sdp,
+ bottomRightRadius = 32.sdp,
image = if (selectedItem == "S") painterResource(id = R.drawable.icon_solid_check_enable) else painterResource(
id = R.drawable.icon_check
),
@@ -106,11 +107,11 @@ private fun CastrationButtons(
text = stringResource(id = R.string.text_no),
colorText = if (selectedItem == "N") MaterialTheme.colorScheme.error else MaterialTheme.colorScheme.onSurfaceVariant,
isSelected = selectedItem == "N",
- size = 120.dp,
- topLeftRadius = 32.dp,
- topRightRadius = 32.dp,
- bottomLeftRadius = 32.dp,
- bottomRightRadius = 32.dp,
+ size = 95.sdp,
+ topLeftRadius = 32.sdp,
+ topRightRadius = 32.sdp,
+ bottomLeftRadius = 32.sdp,
+ bottomRightRadius = 32.sdp,
image = if (selectedItem == "N") painterResource(id = R.drawable.icon_solid_close_enable) else painterResource(
id = R.drawable.icon_close
),
@@ -125,13 +126,14 @@ private fun CastrationButtons(
Row(modifier = Modifier.fillMaxWidth()) {
if (textError != null) {
textError.forEach {
- AlertText(textMessage = it, modifier = Modifier.padding(10.dp))
+ AlertText(textMessage = it, modifier = Modifier.padding(10.sdp))
}
} else {
Text(
text = stringResource(id = R.string.required_field),
- modifier = Modifier.padding(start = 2.dp, top = 10.dp),
- fontSize = 15.sp,
+ modifier = Modifier.padding(start = 2.sdp, top = 10.sdp),
+ fontSize = 12.ssp,
+ color = if (isSystemInDarkTheme()) Color.White else MaterialTheme.colorScheme.outline,
textAlign = TextAlign.Start
)
}
@@ -145,6 +147,6 @@ fun CastrationSelectorPreview() {
CastrationSelector(
selectedCastration = {},
clearSelection = { true },
- textError = null
+ textError = null,
)
}
\ No newline at end of file
diff --git a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petBirthDateScreen/components/Header.kt b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petBirthDateScreen/components/Header.kt
index 06d0a4f5..b96c2173 100644
--- a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petBirthDateScreen/components/Header.kt
+++ b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petBirthDateScreen/components/Header.kt
@@ -1,21 +1,27 @@
package com.soujunior.petjournal.ui.screens_app.screens_pets.petBirthDateScreen.components
+import androidx.compose.foundation.isSystemInDarkTheme
+import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
-import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.withStyle
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
-import androidx.compose.ui.unit.sp
import com.soujunior.petjournal.R
+import com.soujunior.petjournal.ui.components.CreateTitleAndImageLogo
+import com.soujunior.petjournal.ui.theme.ColorCustom
+import ir.kaaveh.sdpcompose.sdp
+import ir.kaaveh.sdpcompose.ssp
@Composable
fun Header(
@@ -23,37 +29,40 @@ fun Header(
petName: String = "Bolinha",
petGender: String = "Adotada"
) {
- Spacer(modifier = Modifier.padding(20.dp))
+ Column(modifier = modifier) {
- val text = buildAnnotatedString {
- append("\n")
- withStyle(style = SpanStyle(color = MaterialTheme.colorScheme.primary)) {
- append(stringResource(id = R.string.info_menssage_pet_birth_date, petName))
- }
- append("\n")
- append("\n")
- val textStyle = MaterialTheme.typography.bodyMedium.toSpanStyle().copy(
- color = MaterialTheme.colorScheme.onSurface,
- fontSize = 16.sp,
+ CreateTitleAndImageLogo(
+ spaceBetween = 15.sdp,
+ spaceBetweenbreadcrumbAndTitle = 10.sdp,
+ title = stringResource(id = R.string.info_menssage_pet_birth_date, petName),
+ breadcrumbEnable = true,
+ breadcrumbIndex = 3,
+ styleTitle = MaterialTheme.typography.headlineLarge
+ )
+
+ Spacer(modifier = Modifier.height(16.dp))
+ val text = buildAnnotatedString {
+ val textStyle = MaterialTheme.typography.bodyMedium.toSpanStyle().copy(
+ fontSize = 12.ssp,
)
- withStyle(style = textStyle) {
- append(stringResource(id = R.string.adoption_info_message, petName, petGender))
+ withStyle(style = textStyle) {
+ append(stringResource(id = R.string.adoption_info_message, petName, petGender))
+ }
}
- append("\n")
+
+ Text(
+ modifier = Modifier.padding(horizontal = 16.sdp),
+ text = text,
+ style = MaterialTheme.typography.headlineMedium,
+ textAlign = TextAlign.Start,
+ color = if(isSystemInDarkTheme()) Color.White else ColorCustom.gray_200,
+ fontSize = 12.ssp,
+ fontWeight = FontWeight(400)
+ )
}
- Text(
- modifier = modifier,
- text = text,
- style = MaterialTheme.typography.headlineMedium,
- textAlign = TextAlign.Start,
- color = MaterialTheme.colorScheme.primary,
- fontSize = 20.sp,
- fontWeight = FontWeight.Bold
- )
-
- Spacer(modifier = Modifier.padding(bottom = 20.dp))
+
}
@Preview(showBackground = true)
diff --git a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petBirthDateScreen/components/Screen.kt b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petBirthDateScreen/components/Screen.kt
index fb142446..1506d738 100644
--- a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petBirthDateScreen/components/Screen.kt
+++ b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petBirthDateScreen/components/Screen.kt
@@ -1,15 +1,19 @@
package com.soujunior.petjournal.ui.screens_app.screens_pets.petBirthDateScreen.components
import android.annotation.SuppressLint
+import androidx.compose.foundation.Image
+import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.navigationBarsPadding
+import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
@@ -21,16 +25,17 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
+import androidx.compose.ui.AbsoluteAlignment
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.platform.LocalInspectionMode
+import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
-import androidx.compose.ui.unit.dp
import androidx.navigation.NavController
import androidx.navigation.compose.rememberNavController
import com.soujunior.petjournal.R
-import com.soujunior.petjournal.ui.components.Breadcrumb
import com.soujunior.petjournal.ui.components.Button3
import com.soujunior.petjournal.ui.components.DateInputText
import com.soujunior.petjournal.ui.components.IndeterminateCircularIndicator
@@ -43,6 +48,7 @@ import com.soujunior.petjournal.ui.screens_app.screens_pets.petBirthDateScreen.F
import com.soujunior.petjournal.ui.screens_app.screens_pets.petRaceAndSizeScreen.RaceSizeFormEvent
import com.soujunior.petjournal.ui.states.TaskState
import com.soujunior.petjournal.ui.theme.PetJournalTheme
+import ir.kaaveh.sdpcompose.sdp
import org.koin.androidx.compose.getViewModel
@Composable
@@ -64,7 +70,9 @@ fun Screen(idPetInformation: String?, navController: NavController) {
viewModel.getPetInformation(idPetInformation.toLong())
RaceSizeFormEvent.IdPetInformation(idPetInformation = idPetInformation.toLong())
}
+
Column(modifier = Modifier.navigationBarsPadding()) {
+
ScaffoldCustom(
modifier = Modifier,
navigationUp = navController,
@@ -74,116 +82,128 @@ fun Screen(idPetInformation: String?, navController: NavController) {
contentToUse = { it ->
if (taskState is TaskState.Loading)
IndeterminateCircularIndicator(modifier = Modifier.align(Alignment.CenterHorizontally))
- else Box(modifier = Modifier.padding(it)) {
- LazyColumn(
- horizontalAlignment = Alignment.CenterHorizontally,
- verticalArrangement = Arrangement.Top,
+ else {
+ Image(
+ painter = painterResource(R.drawable.rastro_back),
+ contentDescription = null,
modifier = Modifier
.fillMaxSize()
- .padding(start = 12.dp, end = 12.dp),
- content = {
- item {
- Breadcrumb(index = 3)
- }
- item {
- Box(
- modifier = Modifier
- .fillMaxWidth()
- .padding(5.dp, 0.dp),
- contentAlignment = Alignment.TopStart
- ) {
- Header(
- petName = viewModel.state.name,
- modifier = Modifier.padding(5.dp, 0.dp),
- petGender = if (viewModel.state.gender.uppercase() == stringResource(
- R.string.pet_gender_letter_M
- )
- ) stringResource(R.string.pet_he_adopted)
- else stringResource(R.string.pet_she_adopted)
- )
- }
+ .background(MaterialTheme.colorScheme.background)
+ .offset(y = 80.sdp)
+ .align(AbsoluteAlignment.Left)
+ .graphicsLayer(alpha = 0.5f)
+ )
+ Column(
+ modifier = Modifier
+ .fillMaxSize(),
+ horizontalAlignment = Alignment.CenterHorizontally,
+ verticalArrangement = Arrangement.Top,
+ ) {
- }
- item {
- DateInputText(
- titleText = stringResource(R.string.pet_birth_date),
- placeholderText = stringResource(R.string.placeholder_text_DD_MM_YYYY),
- textValue = viewModel.state.birth,
- textError = viewModel.state.birthError,
- isError = !viewModel.state.birthError.isNullOrEmpty(),
- modifier = Modifier
- .fillMaxWidth(),
- onEvent = { value: String ->
- viewModel.onEvent(BirthDateFormEvent.PetBirthDate(value))
- },
- visualTransformation = { formatDate(it) }
- )
- }
- item {
- CastrationSelector(
- textNamePet = viewModel.state.name,
- selectedCastration = { selectedCastration ->
- if (selectedCastration != null) {
- isClearCastration = false
- }
- viewModel.onEvent(
- BirthDateFormEvent.PetCastration(
- selectedCastration
- )
- )
- },
- clearSelection = {
- isClearCastration
- },
- textError = viewModel.state.castrationError
+ Header(
+ petName = viewModel.state.name,
+ petGender = if (viewModel.state.gender.uppercase() == stringResource(
+ R.string.pet_gender_letter_M
)
- }
- item {
- Row(
- Modifier.padding(top = 80.dp)
- ) {
+ ) stringResource(R.string.pet_he_adopted)
+ else stringResource(R.string.pet_she_adopted)
+ )
+ Spacer(modifier = Modifier.padding(12.sdp))
- Button3(
- submit = { navController.popBackStack() },
- enableButton = true,
+ LazyColumn(
+ horizontalAlignment = Alignment.CenterHorizontally,
+ verticalArrangement = Arrangement.Top,
+ modifier = Modifier
+ .fillMaxWidth()
+ .fillMaxHeight()
+ .padding(
+ start = 16.sdp,
+ end = 16.sdp,
+ bottom = it.calculateBottomPadding() + 1.sdp
+ ),
+ content = {
+ item {
+ DateInputText(
+ titleText = stringResource(R.string.pet_birth_date),
+ placeholderText = stringResource(R.string.placeholder_text_DD_MM_YYYY),
+ textValue = viewModel.state.birth,
+ textError = viewModel.state.birthError,
+ isError = !viewModel.state.birthError.isNullOrEmpty(),
modifier = Modifier
- .width(150.dp)
- .height(50.dp),
- text = stringResource(R.string.back),
- buttonColor = ButtonDefaults.buttonColors(
- MaterialTheme.colorScheme.surface
- ),
- textColor = MaterialTheme.colorScheme.primary
+ .fillMaxWidth(),
+ onEvent = { value: String ->
+ viewModel.onEvent(BirthDateFormEvent.PetBirthDate(value))
+ },
+ visualTransformation = { formatDate(it) }
)
- Spacer(modifier = Modifier.width(16.dp))
- Button3(
- submit = {
+ }
+ item {
+ CastrationSelector(
+ textNamePet = viewModel.state.name,
+ selectedCastration = { selectedCastration ->
+ if (selectedCastration != null) {
+ isClearCastration = false
+ }
viewModel.onEvent(
- BirthDateFormEvent.NextButton
+ BirthDateFormEvent.PetCastration(
+ selectedCastration
+ )
)
-
- if (viewModel.enableButton() &&
- viewModel.state.birth.isNotEmpty() &&
- viewModel.state.castration != null
- ) {
- viewModel.updatePetInformation()
- viewModel.createPetInformation()
- //navController.navigate("pets/birth/$it")
- }
},
- enableButton = viewModel.enableButton(),
- modifier = Modifier
- .width(150.dp)
- .height(50.dp),
- text = stringResource(R.string.text_continue),
- buttonColor = ButtonDefaults.buttonColors(
- MaterialTheme.colorScheme.primary
- ),
- textColor = MaterialTheme.colorScheme.surface,
+ clearSelection = {
+ isClearCastration
+ },
+ textError = viewModel.state.castrationError
)
}
- }
- })
+ item {
+ Spacer(modifier = Modifier.height(25.sdp))
+ Row(
+ verticalAlignment = Alignment.Bottom
+ ) {
+
+ Button3(
+ submit = { navController.popBackStack() },
+ enableButton = true,
+ modifier = Modifier
+ .weight(1f)
+ .padding(end = 5.sdp),
+ text = stringResource(R.string.back),
+ buttonColor = ButtonDefaults.buttonColors(
+ MaterialTheme.colorScheme.surface
+ ),
+ textColor = MaterialTheme.colorScheme.primary
+ )
+ Spacer(modifier = Modifier.width(10.sdp))
+ Button3(
+ submit = {
+ viewModel.onEvent(
+ BirthDateFormEvent.NextButton
+ )
+
+ if (viewModel.enableButton() &&
+ viewModel.state.birth.isNotEmpty() &&
+ viewModel.state.castration != null
+ ) {
+ viewModel.updatePetInformation()
+ viewModel.createPetInformation()
+ //navController.navigate("pets/birth/$it")
+ }
+ },
+ enableButton = viewModel.enableButton(),
+ modifier = Modifier
+ .weight(1f)
+ .padding(start = 5.sdp),
+ text = stringResource(R.string.text_continue),
+ buttonColor = ButtonDefaults.buttonColors(
+ MaterialTheme.colorScheme.primary
+ ),
+ textColor = MaterialTheme.colorScheme.surface,
+ )
+ }
+ }
+ })
+ }
}
})
}
diff --git a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petNameAndGenderScreen/components/Screen.kt b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petNameAndGenderScreen/components/Screen.kt
index e2a1003b..c4249448 100644
--- a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petNameAndGenderScreen/components/Screen.kt
+++ b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petNameAndGenderScreen/components/Screen.kt
@@ -204,7 +204,7 @@ fun Screen(idPetInformation: String?, navController: NavController) {
text = stringResource(R.string.text_continue),
buttonColor = if (isDarkMode) ButtonDefaults.buttonColors(MaterialTheme.colorScheme.onSecondary)
else ButtonDefaults.buttonColors(MaterialTheme.colorScheme.primary),
- textColor = if (isDarkMode) MaterialTheme.colorScheme.primary else Color.White,
+ textColor = if (isDarkMode) MaterialTheme.colorScheme.surface else Color.White,
)
}
}
diff --git a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petRaceAndSizeScreen/components/Header.kt b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petRaceAndSizeScreen/components/Header.kt
index e223f4af..fa9e6572 100644
--- a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petRaceAndSizeScreen/components/Header.kt
+++ b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petRaceAndSizeScreen/components/Header.kt
@@ -3,49 +3,42 @@ package com.soujunior.petjournal.ui.screens_app.screens_pets.petRaceAndSizeScree
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
-import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
-import androidx.compose.ui.text.SpanStyle
-import androidx.compose.ui.text.buildAnnotatedString
-import androidx.compose.ui.text.font.FontWeight
-import androidx.compose.ui.text.style.TextAlign
-import androidx.compose.ui.text.withStyle
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
-import androidx.compose.ui.unit.sp
import com.soujunior.petjournal.R
+import com.soujunior.petjournal.ui.components.CreateTitleAndImageLogo
+import ir.kaaveh.sdpcompose.sdp
@Composable
fun Header(modifier: Modifier = Modifier, petName: String = "Bolinha") {
- Spacer(modifier = Modifier.padding(20.dp))
+ if (petName.isNotEmpty()) {
+ CreateTitleAndImageLogo(
+ spaceBetween = 15.sdp,
+ spaceBetweenbreadcrumbAndTitle = 10.sdp,
+ title = stringResource(R.string.register_message_race, petName),
+ breadcrumbEnable = true,
+ breadcrumbIndex = 2,
+ styleTitle = MaterialTheme.typography.headlineLarge,
+ )
- val text = buildAnnotatedString {
- withStyle(style = SpanStyle(color = MaterialTheme.colorScheme.primary)) {
-
- }
- append("\n")
- withStyle(style = SpanStyle(color = MaterialTheme.colorScheme.primary)) {
- append(stringResource(id = R.string.register_message_race, petName))
- }
- append("\n")
+ } else {
+ CreateTitleAndImageLogo(
+ spaceBetween = 20.sdp,
+ spaceBetweenbreadcrumbAndTitle = 15.sdp,
+ title = stringResource(id = R.string.register_message_race_empity),
+ breadcrumbEnable = true,
+ breadcrumbIndex = 2,
+ styleTitle = MaterialTheme.typography.headlineLarge,
+ )
}
- Text(
- modifier = modifier,
- text = text,
- style = MaterialTheme.typography.bodyMedium,
- textAlign = TextAlign.Start,
- color = MaterialTheme.colorScheme.primary,
- fontSize = 20.sp,
- fontWeight = FontWeight.Bold
- )
-
Spacer(modifier = Modifier.padding(bottom = 20.dp))
}
-@Preview
+@Preview(showBackground = true)
@Composable
private fun PreviewHeader() {
Header()
diff --git a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petRaceAndSizeScreen/components/Screen.kt b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petRaceAndSizeScreen/components/Screen.kt
index c1f95e1c..b26f3d29 100644
--- a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petRaceAndSizeScreen/components/Screen.kt
+++ b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/screens_app/screens_pets/petRaceAndSizeScreen/components/Screen.kt
@@ -5,7 +5,6 @@ import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.gestures.animateScrollBy
import androidx.compose.foundation.layout.Arrangement
-import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
@@ -24,19 +23,20 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
+import androidx.compose.ui.AbsoluteAlignment
import androidx.compose.ui.Alignment
+import androidx.compose.ui.Alignment.Companion.CenterHorizontally
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalInspectionMode
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
-import androidx.compose.ui.unit.dp
import androidx.navigation.NavController
import androidx.navigation.compose.rememberNavController
import com.soujunior.petjournal.R
import com.soujunior.petjournal.ui.components.AutoCompleteDropDown
-import com.soujunior.petjournal.ui.components.Breadcrumb
+import com.soujunior.petjournal.ui.components.Button2
import com.soujunior.petjournal.ui.components.Button3
import com.soujunior.petjournal.ui.components.DashedInputText
import com.soujunior.petjournal.ui.components.DropDown
@@ -49,6 +49,7 @@ import com.soujunior.petjournal.ui.screens_app.screens_pets.petRaceAndSizeScreen
import com.soujunior.petjournal.ui.states.TaskState
import com.soujunior.petjournal.ui.theme.PetJournalTheme
import com.soujunior.petjournal.ui.util.getScreenHeightInch
+import ir.kaaveh.sdpcompose.sdp
import org.koin.androidx.compose.getViewModel
@Composable
@@ -87,205 +88,196 @@ fun Screen(idPetInformation: String?, navController: NavController) {
showBottomBarNavigation = true,
bottomNavigationBar = { NavigationBar(navController) },
contentToUse = {
- if (taskState is TaskState.Loading)
- IndeterminateCircularIndicator(modifier = Modifier.align(Alignment.CenterHorizontally))
- else Box(modifier = Modifier.padding(it)) {
+ if (taskState is TaskState.Loading) {
+ IndeterminateCircularIndicator(modifier = Modifier.align(CenterHorizontally))
+ } else {
Image(
painter = painterResource(R.drawable.rastro),
contentDescription = null,
modifier = Modifier
.fillMaxSize()
.background(MaterialTheme.colorScheme.background)
- .offset(y = 120.dp)
- .align(Alignment.BottomEnd)
+ .offset(y = 120.sdp)
+ .align(AbsoluteAlignment.Left)
)
-
- LazyColumn(
- state = scrollState,
- horizontalAlignment = Alignment.CenterHorizontally,
- verticalArrangement = Arrangement.Top,
+ Column(
modifier = Modifier
- .fillMaxSize()
- .padding(start = 12.dp, end = 12.dp),
- content = {
- item {
- Breadcrumb(index = 2)
- }
- item {
-
- Box(
- modifier = Modifier
- .fillMaxWidth()
- .padding(5.dp, 0.dp),
- contentAlignment = Alignment.TopStart
- ) {
- Header(
- petName = viewModel.state.name,
- modifier = Modifier.padding(5.dp, 0.dp)
- )
-
- }
-
- }
-
+ .fillMaxSize(),
+ horizontalAlignment = CenterHorizontally,
+ verticalArrangement = Arrangement.Top,
+ )
+ {
+ Header(
+ petName = viewModel.state.name,
+ modifier = Modifier
+ .padding(start = 16.sdp, end = 16.sdp)
+ .align(Alignment.Start)
- item {
- DropDown(
- modifier = Modifier,
- textInputModifier = Modifier,
- placeholderText = "Porte do seu pet",
- textValue = viewModel.state.size,
- textError = viewModel.state.sizeError,
- isError = !viewModel.state.sizeError.isNullOrEmpty(),
- titleText = "Porte: ",
- dropdownItems = viewModel.state.listSizes,
- onEvent = { it: String ->
- viewModel.onEvent(
- RaceSizeFormEvent.PetSize(it)
- )
- }
- )
- }
+ )
- item {
- if (viewModel.enableRace()) {
- AutoCompleteDropDown(
+ LazyColumn(
+ state = scrollState,
+ horizontalAlignment = CenterHorizontally,
+ verticalArrangement = Arrangement.Top,
+ modifier = Modifier
+ .fillMaxSize()
+ .padding(
+ start = 16.sdp,
+ end = 16.sdp,
+ bottom = it.calculateBottomPadding() + 1.sdp
+ ),
+ content = {
+ item {
+ DropDown(
modifier = Modifier,
- placeholderText = "Raça do seu pet",
- textValue = viewModel.state.race,
- textError = viewModel.state.raceError,
- isError = !viewModel.state.raceError.isNullOrEmpty(),
- titleText = "Raça: ",
- dropdownItems = viewModel.state.listRace,
+ textInputModifier = Modifier,
+ placeholderText = "Porte do seu pet",
+ textValue = viewModel.state.size,
+ textError = viewModel.state.sizeError,
+ isError = !viewModel.state.sizeError.isNullOrEmpty(),
+ titleText = "Porte: ",
+ dropdownItems = viewModel.state.listSizes,
onEvent = { it: String ->
viewModel.onEvent(
- RaceSizeFormEvent.PetRace(it)
+ RaceSizeFormEvent.PetSize(it)
)
- viewModel.onEvent(RaceSizeFormEvent.ScrollToTop(true))
- },
- onFocusChange = { isFocus ->
- if (!isFocus) {
- viewModel.onEvent(
- RaceSizeFormEvent.ScrollToTop(
- false
- )
- )
- }
}
)
}
- }
-
- if (viewModel.enableRaceOthers()) {
item {
- DashedInputText(
- modifier = Modifier,
- textInputModifier = Modifier.height(50.dp),
- placeholderText = "Digite aqui...",
- textValue = viewModel.state.raceOthers,
- textError = viewModel.state.raceOthersError,
- isError = !viewModel.state.raceOthersError.isNullOrEmpty(),
- titleText = "Raça do seu pet",
- onEvent = { it: String ->
- viewModel.onEvent(
- RaceSizeFormEvent.PetRaceOthers(it)
- )
- }
- )
- }
- }
+ if (viewModel.enableRace()) {
+ AutoCompleteDropDown(
+ modifier = Modifier,
+ placeholderText = "Raça do seu pet",
+ textValue = viewModel.state.race,
+ textError = viewModel.state.raceError,
+ isError = !viewModel.state.raceError.isNullOrEmpty(),
+ titleText = "Raça: ",
+ dropdownItems = viewModel.state.listRace,
+ onEvent = { it: String ->
+ viewModel.onEvent(
+ RaceSizeFormEvent.PetRace(it)
+ )
+ viewModel.onEvent(RaceSizeFormEvent.ScrollToTop(true))
+ },
+ onFocusChange = { isFocus ->
+ if (!isFocus) {
+ viewModel.onEvent(
+ RaceSizeFormEvent.ScrollToTop(
+ false
+ )
+ )
+ }
+ }
+ )
+ }
- item {
- Row(
- modifier = Modifier
- .fillMaxWidth()
- .width(250.dp)
- .height(250.dp)
- .offset(y = (-60).dp)
- ) {
- Image(
- painter = painterResource(R.drawable.pet_heart),
- contentDescription = null,
- modifier = Modifier
- .fillMaxSize()
- .background(Color.Transparent)
- )
}
- Row(
- modifier = Modifier
- .fillMaxWidth()
- .padding(start = 30.dp)
- .offset(y = (-30).dp)
- ) {
+ if (viewModel.enableRaceOthers()) {
+ item {
+ DashedInputText(
+ modifier = Modifier,
+ placeholderText = "Digite aqui...",
+ textValue = viewModel.state.raceOthers,
+ textError = viewModel.state.raceOthersError,
+ isError = !viewModel.state.raceOthersError.isNullOrEmpty(),
+ titleText = "Raça do seu pet",
+ onEvent = { it: String ->
+ viewModel.onEvent(
+ RaceSizeFormEvent.PetRaceOthers(it)
+ )
+ }
+ )
+ }
+ }
- Button3(
- submit = { navController.popBackStack() },
- enableButton = true,
+ item {
+ Row(
modifier = Modifier
- .width(150.dp)
- .height(50.dp),
-
- text = stringResource(R.string.back),
- buttonColor = ButtonDefaults.buttonColors(
- MaterialTheme.colorScheme.surface
- ),
- textColor = MaterialTheme.colorScheme.primary
- )
- Spacer(modifier = Modifier.width(16.dp))
- Button3(
- submit = {
- viewModel.onEvent(
- RaceSizeFormEvent.NextButton
- )
- if (!viewModel.enableRace()) {
- if (viewModel.enableButton() &&
- viewModel.state.size.isNotEmpty()
- ) {
- viewModel.updatePetInformation()
- navController.navigate("pets/birth/$idPetInformation")
- }
- } else {
- if (isTextFiledOthersVisible) {
+ .fillMaxWidth()
+ .width(200.sdp)
+ .height(200.sdp)
+ ) {
+ Image(
+ painter = painterResource(R.drawable.pet_heart),
+ contentDescription = null,
+ modifier = Modifier
+ .fillMaxSize()
+ .background(Color.Transparent)
+ )
+ }
+ }
+ item{
+ Row(
+ verticalAlignment = Alignment.Bottom
+ ) {
+ Button3(
+ submit = { navController.popBackStack() },
+ enableButton = true,
+ modifier = Modifier
+ .weight(1f)
+ .padding(end = 5.sdp),
+ text = stringResource(R.string.back),
+ buttonColor = ButtonDefaults.buttonColors(
+ MaterialTheme.colorScheme.surface
+ ),
+ textColor = MaterialTheme.colorScheme.primary
+ )
+ Spacer(modifier = Modifier.width(16.sdp))
+ Button2(
+ submit = {
+ viewModel.onEvent(
+ RaceSizeFormEvent.NextButton
+ )
+ if (!viewModel.enableRace()) {
if (viewModel.enableButton() &&
- viewModel.state.raceOthers.isNotEmpty() &&
viewModel.state.size.isNotEmpty()
-
) {
viewModel.updatePetInformation()
navController.navigate("pets/birth/$idPetInformation")
}
} else {
- if (viewModel.enableButton() &&
- viewModel.state.race.isNotEmpty() &&
- viewModel.state.size.isNotEmpty() &&
- viewModel.state.race.lowercase() != "outro"
- ) {
- viewModel.updatePetInformation()
- navController.navigate("pets/birth/$idPetInformation")
+ if (isTextFiledOthersVisible) {
+ if (viewModel.enableButton() &&
+ viewModel.state.raceOthers.isNotEmpty() &&
+ viewModel.state.size.isNotEmpty()
+
+ ) {
+ viewModel.updatePetInformation()
+ navController.navigate("pets/birth/$idPetInformation")
+ }
+ } else {
+ if (viewModel.enableButton() &&
+ viewModel.state.race.isNotEmpty() &&
+ viewModel.state.size.isNotEmpty() &&
+ viewModel.state.race.lowercase() != "outro"
+ ) {
+ viewModel.updatePetInformation()
+ navController.navigate("pets/birth/$idPetInformation")
+ }
}
}
- }
- },
- enableButton = viewModel.enableButton(),
- modifier = Modifier
- .width(150.dp)
- .height(50.dp),
-
- text = stringResource(R.string.text_continue),
- buttonColor = ButtonDefaults.buttonColors(
- MaterialTheme.colorScheme.primary
- ),
- textColor = MaterialTheme.colorScheme.surface,
- )
+ },
+ enableButton = viewModel.enableButton(),
+ modifier = Modifier
+ .weight(1f)
+ .padding(start = 5.sdp),
+ text = stringResource(R.string.text_continue),
+ isLoading = taskState is TaskState.Loading,
+ buttonColor = ButtonDefaults.buttonColors(
+ MaterialTheme.colorScheme.primary
+ ),
+ textColor = MaterialTheme.colorScheme.surface,
+ )
+ }
}
- }
- })
-
+ })
+ }
}
})
diff --git a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/theme/Color.kt b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/theme/Color.kt
index dd2fc99e..d54a9eca 100644
--- a/petJournal/app/src/main/java/com/soujunior/petjournal/ui/theme/Color.kt
+++ b/petJournal/app/src/main/java/com/soujunior/petjournal/ui/theme/Color.kt
@@ -74,6 +74,7 @@ object ColorGrid {
object ColorCustom {
val dark_texts_variant = Color(0xFF686767)
+ val gray_200 = Color(0xFF2C2B2B)
val link_200 = Color(0xFFA5EFFB)
val green_confirm = Color(0xFF50C24E)
}
diff --git a/petJournal/app/src/main/res/drawable/rastro_back.png b/petJournal/app/src/main/res/drawable/rastro_back.png
new file mode 100644
index 00000000..466d5a1d
Binary files /dev/null and b/petJournal/app/src/main/res/drawable/rastro_back.png differ
diff --git a/petJournal/app/src/main/res/values/strings.xml b/petJournal/app/src/main/res/values/strings.xml
index 09001326..821838ae 100644
--- a/petJournal/app/src/main/res/values/strings.xml
+++ b/petJournal/app/src/main/res/values/strings.xml
@@ -58,6 +58,7 @@
Ficamos felizes em receber mais um %s em nossa comunidade!
Ficamos felizes em receber seu pet em nossa comunidade!
Nos conte mais!\nQual a raça de %s?
+ Nos conte mais!\nQual a raça do seu pet?
Pequeno (até 10kg)
Médio (11 à 24kg)
Grande (a cima de 25kg)
@@ -74,7 +75,7 @@
Outro
Icone de genero do animal
Qual a data de nascimento de %s?
- Caso %s tenha sido %s, e você \nnão saiba a data certa, não se preocupe! \n \nVocê pode adicionar apenas a data \naproximada que você se lembra!
+ Caso %s tenha sido %s, e você não saiba a data certa, não se preocupe! \n\nVocê pode adicionar apenas a data \naproximada que você se lembra!
Adotado
Adotada
Data de nascimento