File tree 2 files changed +10
-1
lines changed
java/com/protonvpn/android/ui/promooffers
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ private fun RateMeScreen(
146
146
var selectedRating by rememberSaveable { mutableStateOf<Int ?>(null ) }
147
147
var additionalDetails by rememberSaveable(stateSaver = TextFieldValue .Saver ) { mutableStateOf(TextFieldValue ()) }
148
148
var showAdditionalDetails by rememberSaveable { mutableStateOf(false ) }
149
+ var inputLimitReached by rememberSaveable { mutableStateOf(false ) }
149
150
val scrollState = rememberScrollState()
150
151
val isScrolled = remember { derivedStateOf { scrollState.value > 0 } }
151
152
val topAppBarColor = animateColorAsState(
@@ -219,8 +220,15 @@ private fun RateMeScreen(
219
220
ProtonOutlinedTextField (
220
221
value = additionalDetails,
221
222
onValueChange = {
222
- additionalDetails = it
223
+ if (it.text.codePoints().count() <= 250 ) {
224
+ additionalDetails = it
225
+ inputLimitReached = false
226
+ } else {
227
+ inputLimitReached = true
228
+ }
223
229
},
230
+ errorText = stringResource(R .string.nps_submit_error_char_limit),
231
+ isError = inputLimitReached,
224
232
assistiveText = stringResource(R .string.nps_additional_comment_optional),
225
233
textStyle = ProtonTheme .typography.defaultNorm,
226
234
backgroundColor = ProtonTheme .colors.backgroundSecondary,
Original file line number Diff line number Diff line change 1468
1468
<string name =" nps_rating_low_values_explain" >0 is very unlikely</string >
1469
1469
<string name =" nps_rating_high_values_explain" >10 is very likely</string >
1470
1470
<string name =" nps_toast_submit_message" >Thanks for sharing. Your feedback helps us improve Proton VPN.</string >
1471
+ <string name =" nps_submit_error_char_limit" >Your answer should be 250 characters or shorter</string >
1471
1472
<string name =" nps_button_submit_title" >Share anonymously</string >
1472
1473
</resources >
You can’t perform that action at this time.
0 commit comments