Updated on 2026-08-14

This commit is contained in:
Tangem 2026-06-18 18:50:51 +04:00
commit 293fae4d31
2 changed files with 20 additions and 3 deletions

View file

@ -109,7 +109,7 @@
}, },
{ {
"name": "AND_15154_YIELD_PROMO_ENABLED", "name": "AND_15154_YIELD_PROMO_ENABLED",
"version": "undefined" "version": "5.39.2"
}, },
{ {
"name": "TWI_1512_HIDE_STORIES_FOR_REFERRAL_ENABLED", "name": "TWI_1512_HIDE_STORIES_FOR_REFERRAL_ENABLED",

View file

@ -9,16 +9,21 @@ import androidx.compose.foundation.text.BasicTextField
import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.* import androidx.compose.material3.*
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.clip
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.SolidColor import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.VisualTransformation import androidx.compose.ui.text.input.VisualTransformation
import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
import kotlinx.coroutines.delay
import com.tangem.core.ui.R import com.tangem.core.ui.R
import com.tangem.core.ui.components.PrimaryButton import com.tangem.core.ui.components.PrimaryButton
import com.tangem.core.ui.components.SpacerH12 import com.tangem.core.ui.components.SpacerH12
@ -107,6 +112,15 @@ internal fun RatingFeedbackBottomSheet(config: TangemBottomSheetConfig) {
@Composable @Composable
private fun FeedbackTextField(value: String, onValueChange: (String) -> Unit) { private fun FeedbackTextField(value: String, onValueChange: (String) -> Unit) {
val interactionSource = remember { MutableInteractionSource() } val interactionSource = remember { MutableInteractionSource() }
val focusRequester = remember { FocusRequester() }
val keyboardController = LocalSoftwareKeyboardController.current
LaunchedEffect(Unit) {
delay(FOCUS_REQUEST_DELAY_MS)
focusRequester.requestFocus()
keyboardController?.show()
}
val fieldShape = RoundedCornerShape(TangemTheme.dimens.radius14) val fieldShape = RoundedCornerShape(TangemTheme.dimens.radius14)
val colors = TextFieldDefaults.colors().copy( val colors = TextFieldDefaults.colors().copy(
focusedContainerColor = TangemTheme.colors.field.focused, focusedContainerColor = TangemTheme.colors.field.focused,
@ -124,7 +138,8 @@ private fun FeedbackTextField(value: String, onValueChange: (String) -> Unit) {
onValueChange = onValueChange, onValueChange = onValueChange,
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.heightIn(min = TangemTheme.dimens.size48), .heightIn(min = TangemTheme.dimens.size48)
.focusRequester(focusRequester),
textStyle = TangemTheme.typography.body1.copy(color = TangemTheme.colors.text.primary1), textStyle = TangemTheme.typography.body1.copy(color = TangemTheme.colors.text.primary1),
cursorBrush = SolidColor(TangemTheme.colors.icon.primary1), cursorBrush = SolidColor(TangemTheme.colors.icon.primary1),
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done), keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done),
@ -156,4 +171,6 @@ private fun FeedbackTextField(value: String, onValueChange: (String) -> Unit) {
) )
}, },
) )
} }
private const val FOCUS_REQUEST_DELAY_MS = 300L