Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set font size of dialog inputs to be title medium #7633

Merged
merged 2 commits into from
Feb 17, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ private fun EnterVoucherBody(
keyboardType = KeyboardType.Password,
placeholderText = stringResource(id = R.string.voucher_hint),
visualTransformation = vouchersVisualTransformation(),
textStyle = MaterialTheme.typography.titleMedium,
isDigitsOnlyAllowed = false,
modifier = Modifier.testTag(VOUCHER_INPUT_TEST_TAG),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ fun CustomListNameTextField(
}
},
capitalization = KeyboardCapitalization.Words,
textStyle = MaterialTheme.typography.titleMedium,
modifier =
modifier.focusRequester(focusRequester).onFocusChanged { focusState ->
if (focusState.hasFocus) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.mullvad.mullvadvpn.compose.textfield

import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
Expand All @@ -26,5 +27,6 @@ fun CustomPortTextField(
isEnabled = true,
isValidValue = isValidValue,
maxCharLength = maxCharLength,
textStyle = MaterialTheme.typography.titleMedium,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Error
import androidx.compose.material3.Icon
import androidx.compose.material3.LocalTextStyle
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TextField
Expand All @@ -23,6 +24,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.text.TextRange
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardCapitalization
import androidx.compose.ui.text.input.KeyboardType
Expand All @@ -48,6 +50,7 @@ fun CustomTextField(
visualTransformation: VisualTransformation = VisualTransformation.None,
supportingText: @Composable (() -> Unit)? = null,
colors: TextFieldColors = mullvadDarkTextFieldColors(),
textStyle: TextStyle = LocalTextStyle.current,
capitalization: KeyboardCapitalization = KeyboardCapitalization.None,
keyboardOptions: KeyboardOptions =
KeyboardOptions(
Expand Down Expand Up @@ -96,11 +99,12 @@ fun CustomTextField(
},
enabled = isEnabled,
singleLine = true,
placeholder = placeholderText?.let { { Text(text = it) } },
placeholder = placeholderText?.let { { Text(text = it, style = textStyle) } },
keyboardOptions = keyboardOptions,
keyboardActions = KeyboardActions(onDone = { onSubmit(value) }),
visualTransformation = visualTransformation,
colors = colors,
textStyle = textStyle,
isError = !isValidValue,
modifier = modifier.clip(MaterialTheme.shapes.small).fillMaxWidth(),
supportingText = supportingText,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.mullvad.mullvadvpn.compose.textfield

import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
Expand Down Expand Up @@ -28,5 +29,6 @@ fun DnsTextField(
maxCharLength = Int.MAX_VALUE,
isDigitsOnlyAllowed = false,
isValidValue = isValidValue,
textStyle = MaterialTheme.typography.titleMedium,
)
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.mullvad.mullvadvpn.compose.textfield

import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.input.KeyboardType
Expand All @@ -26,5 +27,6 @@ fun MtuTextField(
maxCharLength = maxCharLength,
isValidValue = isValidValue,
isDigitsOnlyAllowed = true,
textStyle = MaterialTheme.typography.titleMedium,
)
}
Loading