use of org.thoughtcrime.securesms.util.CharacterCalculator.CharacterState in project Signal-Android by WhisperSystems.
the class ConversationActivity method calculateCharactersRemaining.
private void calculateCharactersRemaining() {
String messageBody = composeText.getText().toString();
TransportOption transportOption = sendButton.getSelectedTransport();
CharacterState characterState = transportOption.calculateCharacters(messageBody);
if (characterState.charactersRemaining <= 15 || characterState.messagesSpent > 1) {
charactersLeft.setText(characterState.charactersRemaining + "/" + characterState.maxMessageSize + " (" + characterState.messagesSpent + ")");
charactersLeft.setVisibility(View.VISIBLE);
} else {
charactersLeft.setVisibility(View.GONE);
}
}
use of org.thoughtcrime.securesms.util.CharacterCalculator.CharacterState in project Signal-Android by WhisperSystems.
the class ConversationParentFragment method calculateCharactersRemaining.
private void calculateCharactersRemaining() {
String messageBody = composeText.getTextTrimmed().toString();
TransportOption transportOption = sendButton.getSelectedTransport();
CharacterState characterState = transportOption.calculateCharacters(messageBody);
if (characterState.charactersRemaining <= 15 || characterState.messagesSpent > 1) {
charactersLeft.setText(String.format(Locale.getDefault(), "%d/%d (%d)", characterState.charactersRemaining, characterState.maxTotalMessageSize, characterState.messagesSpent));
charactersLeft.setVisibility(View.VISIBLE);
} else {
charactersLeft.setVisibility(View.GONE);
}
}
use of org.thoughtcrime.securesms.util.CharacterCalculator.CharacterState in project Signal-Android by signalapp.
the class ConversationActivity method calculateCharactersRemaining.
private void calculateCharactersRemaining() {
String messageBody = composeText.getTextTrimmed();
TransportOption transportOption = sendButton.getSelectedTransport();
CharacterState characterState = transportOption.calculateCharacters(messageBody);
if (characterState.charactersRemaining <= 15 || characterState.messagesSpent > 1) {
charactersLeft.setText(String.format(dynamicLanguage.getCurrentLocale(), "%d/%d (%d)", characterState.charactersRemaining, characterState.maxMessageSize, characterState.messagesSpent));
charactersLeft.setVisibility(View.VISIBLE);
} else {
charactersLeft.setVisibility(View.GONE);
}
}
Aggregations