Merge pull request #324 from Spitfireap/Message-Counter

Added message counter
This commit is contained in:
Tibor Kaputa 2022-03-24 22:20:55 +01:00 committed by GitHub
commit 6ba28dbe70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -12,6 +12,7 @@ import android.os.Bundle
import android.os.Handler import android.os.Handler
import android.provider.ContactsContract import android.provider.ContactsContract
import android.provider.Telephony import android.provider.Telephony
import android.telephony.SmsMessage
import android.telephony.SubscriptionManager import android.telephony.SubscriptionManager
import android.text.TextUtils import android.text.TextUtils
import android.util.TypedValue import android.util.TypedValue
@ -363,7 +364,9 @@ class ThreadActivity : SimpleActivity() {
thread_send_message.isClickable = false thread_send_message.isClickable = false
thread_type_message.onTextChangeListener { thread_type_message.onTextChangeListener {
checkSendMessageAvailability() checkSendMessageAvailability()
thread_character_counter.text = it.length.toString() val messageString = if (config.useSimpleCharacters) it.normalizeString() else it
val messageLength = SmsMessage.calculateLength(messageString, false)
thread_character_counter.text = "${messageLength[2]}/${messageLength[0]}"
} }
confirm_manage_contacts.setOnClickListener { confirm_manage_contacts.setOnClickListener {