Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -283,4 +283,4 @@ configurations.all {
}
}

apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.gms.google-services'
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardActions
Expand All @@ -40,30 +41,29 @@ import org.greenstand.android.TreeTracker.theme.CustomTheme

@Composable
fun BorderedTextField(
modifier: Modifier = Modifier,
padding: PaddingValues = PaddingValues(0.dp),
value: String,

onValueChange: (String) -> Unit,
placeholder: @Composable (() -> Unit)? = null,
keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
keyboardActions: KeyboardActions = KeyboardActions(),
onFocusChanged: ((FocusState) -> Unit) = {},
focusRequester: FocusRequester = FocusRequester.Default,
autofocusEnabled: Boolean = false
autofocusEnabled: Boolean = false,
) {
Box(
modifier = Modifier
modifier = modifier
.padding(padding)
.border(
BorderStroke(0.5.dp, SolidColor(Color.White)),
RoundedCornerShape(16.dp),
)
.padding(padding)

) {
TextField(
modifier = Modifier
.padding(8.dp)
.fillMaxSize()
.focusRequester(focusRequester)
.onFocusChanged(onFocusChanged),
value = value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material.MaterialTheme
import androidx.compose.material.OutlinedTextField
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
Expand All @@ -17,18 +15,21 @@ fun ProfileField(
label: String,
value: String,
editable: Boolean,
onValueChange: (String) -> Unit
onValueChange: (String) -> Unit,
) {
Column(modifier = Modifier.fillMaxWidth().padding(vertical = 6.dp)) {
Column(modifier = Modifier
.fillMaxWidth()
.padding(vertical = 6.dp)) {
Text(label, style = CustomTheme.typography.medium, color = CustomTheme.textColors.lightText)
if (editable) {
BorderedTextField(
padding = PaddingValues(top = 8.dp, ),
padding = PaddingValues(top = 8.dp),
value = value,
onValueChange = onValueChange,
modifier = Modifier.fillMaxWidth()
)
} else {
Text(value, style = CustomTheme.typography.large)
}
}
}
}