mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
Merge pull request #795 from benalbrecht/nocount
Don't show letter count when SMS mode is disabled
This commit is contained in:
commit
d795aa30b3
@ -166,6 +166,7 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi
|
||||
private boolean isEncryptedConversation;
|
||||
private boolean isAuthenticatedConversation;
|
||||
private boolean isMmsEnabled = true;
|
||||
private boolean isCharactersLeftViewEnabled;
|
||||
|
||||
private CharacterCalculator characterCalculator = new CharacterCalculator();
|
||||
private DynamicTheme dynamicTheme = new DynamicTheme();
|
||||
@ -205,6 +206,7 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi
|
||||
initializeEnabledCheck();
|
||||
initializeMmsEnabledCheck();
|
||||
initializeIme();
|
||||
initializeCharactersLeftViewEnabledCheck();
|
||||
calculateCharactersRemaining();
|
||||
|
||||
MessageNotifier.setVisibleThread(threadId);
|
||||
@ -635,6 +637,11 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi
|
||||
sendButton.setEnabled(enabled);
|
||||
}
|
||||
|
||||
private void initializeCharactersLeftViewEnabledCheck() {
|
||||
isCharactersLeftViewEnabled = !(isPushGroupConversation() ||
|
||||
(TextSecurePreferences.isPushRegistered(this) && !TextSecurePreferences.isSmsFallbackEnabled(this)));
|
||||
}
|
||||
|
||||
private void initializeDraftFromDatabase() {
|
||||
new AsyncTask<Void, Void, List<Draft>>() {
|
||||
@Override
|
||||
@ -947,7 +954,7 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi
|
||||
private void calculateCharactersRemaining() {
|
||||
int charactersSpent = composeText.getText().toString().length();
|
||||
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);
|
||||
} else if (characterState.charactersRemaining > 15 && charactersLeft.getVisibility() != View.GONE) {
|
||||
charactersLeft.setVisibility(View.GONE);
|
||||
|
Loading…
Reference in New Issue
Block a user