|
|
@ -166,6 +166,7 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi
|
|
|
|
private boolean isEncryptedConversation;
|
|
|
|
private boolean isEncryptedConversation;
|
|
|
|
private boolean isAuthenticatedConversation;
|
|
|
|
private boolean isAuthenticatedConversation;
|
|
|
|
private boolean isMmsEnabled = true;
|
|
|
|
private boolean isMmsEnabled = true;
|
|
|
|
|
|
|
|
private boolean isCharactersLeftViewEnabled;
|
|
|
|
|
|
|
|
|
|
|
|
private CharacterCalculator characterCalculator = new CharacterCalculator();
|
|
|
|
private CharacterCalculator characterCalculator = new CharacterCalculator();
|
|
|
|
private DynamicTheme dynamicTheme = new DynamicTheme();
|
|
|
|
private DynamicTheme dynamicTheme = new DynamicTheme();
|
|
|
@ -205,6 +206,7 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi
|
|
|
|
initializeEnabledCheck();
|
|
|
|
initializeEnabledCheck();
|
|
|
|
initializeMmsEnabledCheck();
|
|
|
|
initializeMmsEnabledCheck();
|
|
|
|
initializeIme();
|
|
|
|
initializeIme();
|
|
|
|
|
|
|
|
initializeCharactersLeftViewEnabledCheck();
|
|
|
|
calculateCharactersRemaining();
|
|
|
|
calculateCharactersRemaining();
|
|
|
|
|
|
|
|
|
|
|
|
MessageNotifier.setVisibleThread(threadId);
|
|
|
|
MessageNotifier.setVisibleThread(threadId);
|
|
|
@ -635,6 +637,11 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi
|
|
|
|
sendButton.setEnabled(enabled);
|
|
|
|
sendButton.setEnabled(enabled);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initializeCharactersLeftViewEnabledCheck() {
|
|
|
|
|
|
|
|
isCharactersLeftViewEnabled = !(isPushGroupConversation() ||
|
|
|
|
|
|
|
|
(TextSecurePreferences.isPushRegistered(this) && !TextSecurePreferences.isSmsFallbackEnabled(this)));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void initializeDraftFromDatabase() {
|
|
|
|
private void initializeDraftFromDatabase() {
|
|
|
|
new AsyncTask<Void, Void, List<Draft>>() {
|
|
|
|
new AsyncTask<Void, Void, List<Draft>>() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -947,7 +954,7 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi
|
|
|
|
private void calculateCharactersRemaining() {
|
|
|
|
private void calculateCharactersRemaining() {
|
|
|
|
int charactersSpent = composeText.getText().toString().length();
|
|
|
|
int charactersSpent = composeText.getText().toString().length();
|
|
|
|
CharacterCalculator.CharacterState characterState = characterCalculator.calculateCharacters(charactersSpent);
|
|
|
|
CharacterCalculator.CharacterState characterState = characterCalculator.calculateCharacters(charactersSpent);
|
|
|
|
if (characterState.charactersRemaining <= 15 && charactersLeft.getVisibility() != View.VISIBLE) {
|
|
|
|
if (characterState.charactersRemaining <= 15 && charactersLeft.getVisibility() != View.VISIBLE && isCharactersLeftViewEnabled) {
|
|
|
|
charactersLeft.setVisibility(View.VISIBLE);
|
|
|
|
charactersLeft.setVisibility(View.VISIBLE);
|
|
|
|
} else if (characterState.charactersRemaining > 15 && charactersLeft.getVisibility() != View.GONE) {
|
|
|
|
} else if (characterState.charactersRemaining > 15 && charactersLeft.getVisibility() != View.GONE) {
|
|
|
|
charactersLeft.setVisibility(View.GONE);
|
|
|
|
charactersLeft.setVisibility(View.GONE);
|
|
|
|