Skip to content

Commit 03f325d

Browse files
committed
UTF-8 char limit check
1 parent eee17e0 commit 03f325d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1426,7 +1426,7 @@ class ConversationViewModel(
14261426
fun onTextChanged(text: CharSequence) {
14271427
// check the character limit
14281428
val maxChars = proStatusManager.getCharacterLimit()
1429-
val charsLeft = maxChars - text.length
1429+
val charsLeft = maxChars - text.toString().toByteArray(Charsets.UTF_8).size // using utf-8 to match libsession and iOS
14301430

14311431
// update the char limit state based on characters left
14321432
val charLimitState = if(charsLeft <= CHARACTER_LIMIT_THRESHOLD){

app/src/main/java/org/thoughtcrime/securesms/ui/Modifiers.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ fun Modifier.verticalScrollbar(
201201
*/
202202
fun Modifier.shimmerOverlay(
203203
color: Color = Color.White.copy(alpha = 0.0f),
204-
highlightColor: Color = Color.White.copy(alpha = 0.6f),
204+
highlightColor: Color = Color.White.copy(alpha = 0.4f),
205205
animationDuration: Int = 1200,
206206
delayBetweenCycles: Int = 3000,
207207
initialDelay: Int = 0

0 commit comments

Comments
 (0)