diff --git a/android/src/main/java/com/tailscale/ipn/ui/view/CustomLogin.kt b/android/src/main/java/com/tailscale/ipn/ui/view/CustomLogin.kt index 9bbe5ab..82d2e37 100644 --- a/android/src/main/java/com/tailscale/ipn/ui/view/CustomLogin.kt +++ b/android/src/main/java/com/tailscale/ipn/ui/view/CustomLogin.kt @@ -9,6 +9,7 @@ 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.foundation.text.KeyboardOptions import androidx.compose.material3.Button import androidx.compose.material3.ListItem import androidx.compose.material3.MaterialTheme @@ -25,6 +26,7 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.input.KeyboardCapitalization import androidx.compose.ui.unit.dp import com.tailscale.ipn.R import com.tailscale.ipn.ui.theme.listItem @@ -137,10 +139,12 @@ fun LoginView( onValueChange = { textVal = it }, placeholder = { Text(strings.placeholder, style = MaterialTheme.typography.bodySmall) - }) + }, + keyboardOptions = KeyboardOptions(capitalization = KeyboardCapitalization.None) + ) }) - ListItem( + ListItem( colors = MaterialTheme.colorScheme.listItem, headlineContent = { Box(modifier = Modifier.fillMaxWidth()) { diff --git a/android/src/main/java/com/tailscale/ipn/ui/viewModel/CustomLoginViewModel.kt b/android/src/main/java/com/tailscale/ipn/ui/viewModel/CustomLoginViewModel.kt index 0e830e6..ed2c581 100644 --- a/android/src/main/java/com/tailscale/ipn/ui/viewModel/CustomLoginViewModel.kt +++ b/android/src/main/java/com/tailscale/ipn/ui/viewModel/CustomLoginViewModel.kt @@ -36,7 +36,9 @@ class LoginWithCustomControlURLViewModel : CustomLoginViewModel() { // localAPIClient will use the default server if we give it a broken URL, // but we can make sure we can construct a URL from the input string and // ensure it has an http/https scheme - when (urlStr.startsWith("http") && urlStr.contains("://") && urlStr.length > 7) { + when (urlStr.startsWith("http", ignoreCase = true) && + urlStr.contains("://") && + urlStr.length > 7) { false -> { errorDialog.set(ErrorDialogType.INVALID_CUSTOM_URL) return