summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorDavid Göransson <david.goransson90@gmail.com>2023-10-24 10:54:22 +0200
committerJonatan Rhodin <jonatan.rhodin@mullvad.net>2023-10-26 14:48:29 +0200
commit57d93a4743b753537ea9523aad959b54904dff55 (patch)
treedb4c2f5ae9da7268b26ce5e2f8a55aeb56beb41a /android
parent780308c5cc660652bb3e5c6b7b0e65c6574279bf (diff)
downloadmullvadvpn-57d93a4743b753537ea9523aad959b54904dff55.tar.xz
mullvadvpn-57d93a4743b753537ea9523aad959b54904dff55.zip
Round textfield unless focused
Diffstat (limited to 'android')
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/LoginScreen.kt9
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/textfield/TextFieldColors.kt14
2 files changed, 18 insertions, 5 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/LoginScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/LoginScreen.kt
index d1c64b6c5a..8f27cf9ebe 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/LoginScreen.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/LoginScreen.kt
@@ -183,7 +183,14 @@ private fun LoginContent(
left = FocusRequester.Cancel
right = FocusRequester.Cancel
}
- .fillMaxWidth(),
+ .fillMaxWidth()
+ .let {
+ if (!expandedDropdown || uiState.lastUsedAccount == null) {
+ it.clip(MaterialTheme.shapes.small)
+ } else {
+ it
+ }
+ },
value = uiState.accountNumberInput,
label = {
Text(
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/textfield/TextFieldColors.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/textfield/TextFieldColors.kt
index b45fe5a38a..b0770632bb 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/textfield/TextFieldColors.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/textfield/TextFieldColors.kt
@@ -17,6 +17,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import net.mullvad.mullvadvpn.lib.theme.AppTheme
import net.mullvad.mullvadvpn.lib.theme.color.Alpha20
+import net.mullvad.mullvadvpn.lib.theme.color.Alpha40
@Composable
fun mullvadWhiteTextFieldColors(): TextFieldColors =
@@ -27,12 +28,15 @@ fun mullvadWhiteTextFieldColors(): TextFieldColors =
errorTextColor = Color.Black,
cursorColor = MaterialTheme.colorScheme.background,
focusedPlaceholderColor = MaterialTheme.colorScheme.background,
- unfocusedPlaceholderColor = MaterialTheme.colorScheme.primary,
+ unfocusedPlaceholderColor = MaterialTheme.colorScheme.primary.copy(alpha = Alpha40),
focusedLabelColor = MaterialTheme.colorScheme.background,
disabledLabelColor = Color.Gray,
- unfocusedLabelColor = MaterialTheme.colorScheme.background,
+ unfocusedLabelColor = MaterialTheme.colorScheme.primary.copy(alpha = Alpha40),
focusedLeadingIconColor = Color.Black,
unfocusedSupportingTextColor = Color.Black,
+ focusedIndicatorColor = MaterialTheme.colorScheme.onPrimary,
+ unfocusedIndicatorColor = MaterialTheme.colorScheme.onPrimary,
+ errorIndicatorColor = MaterialTheme.colorScheme.error
)
@Preview
@@ -49,7 +53,8 @@ private fun PreviewDarkTextField() {
onValueChange = {},
placeholder = { Text(text = "Placeholder") },
label = { Text(text = "Label") },
- colors = mullvadDarkTextFieldColors()
+ colors = mullvadDarkTextFieldColors(),
+ shape = MaterialTheme.shapes.small
)
// Normal empty
@@ -58,7 +63,8 @@ private fun PreviewDarkTextField() {
onValueChange = {},
placeholder = { Text(text = "Placeholder") },
label = { Text(text = "Label") },
- colors = mullvadDarkTextFieldColors()
+ colors = mullvadDarkTextFieldColors(),
+ shape = MaterialTheme.shapes.small
)
// Error