fix record and send button visibility issue
@@ -516,13 +516,6 @@ public abstract class MobiComConversationFragment extends Fragment implements Vi
recordLayout = list.findViewById(R.id.kmRecordLayout);
- if (alCustomizationSettings != null
- && alCustomizationSettings.getAttachmentOptions() != null
- && alCustomizationSettings.getAttachmentOptions().get(AUDIO_RECORD_OPTION) != null
- && alCustomizationSettings.getAttachmentOptions().get(AUDIO_RECORD_OPTION)) {
- recordLayout.setVisibility(VISIBLE);
- }
-
recordView = list.findViewById(R.id.km_record_view);
recordView.setOnBasketAnimationEndListener(this);
recordView.setOnRecordListener(this);
@@ -613,10 +606,12 @@ public abstract class MobiComConversationFragment extends Fragment implements Vi
awayMessageDivider = list.findViewById(R.id.awayMessageDivider);
awayMessageTv = list.findViewById(R.id.awayMessageTV);
- boolean isRecordOptionEnabled = alCustomizationSettings != null && alCustomizationSettings.getAttachmentOptions() != null
+ boolean isRecordOptionEnabled = (alCustomizationSettings != null
+ && alCustomizationSettings.getAttachmentOptions() != null
&& alCustomizationSettings.getAttachmentOptions().get(AUDIO_RECORD_OPTION) != null
- && alCustomizationSettings.getAttachmentOptions().get(AUDIO_RECORD_OPTION);
+ && alCustomizationSettings.getAttachmentOptions().get(AUDIO_RECORD_OPTION)) || isSpeechToTextEnabled;
+ recordLayout.setVisibility(isRecordOptionEnabled ? View.VISIBLE : View.GONE);
recordButton.setVisibility(isRecordOptionEnabled ? View.VISIBLE : View.GONE);
sendButton.setVisibility(isRecordOptionEnabled ? View.GONE : View.VISIBLE);
KmUtils.setGradientSolidColor(sendButton, themeHelper.getSendButtonBackgroundColor());
@@ -957,7 +952,8 @@ public abstract class MobiComConversationFragment extends Fragment implements Vi
dialogFlowCharLimitTextWatcher = new TextWatcher() {
@Override
- public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { }
+ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+ }
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
@@ -965,16 +961,18 @@ public abstract class MobiComConversationFragment extends Fragment implements Vi
}
@Override
- public void afterTextChanged(Editable editable) { }
+ public void afterTextChanged(Editable editable) {
+ }
};
return list;
}
public void handleSendAndRecordButtonView(boolean isSendButtonVisible) {
- boolean showRecordButton = alCustomizationSettings != null
+ boolean showRecordButton = (alCustomizationSettings != null
&& alCustomizationSettings.getAttachmentOptions() != null
- && alCustomizationSettings.getAttachmentOptions().get(AUDIO_RECORD_OPTION) != null;
+ && alCustomizationSettings.getAttachmentOptions().get(AUDIO_RECORD_OPTION) != null
+ && alCustomizationSettings.getAttachmentOptions().get(AUDIO_RECORD_OPTION)) || isSpeechToTextEnabled;
sendButton.setVisibility(showRecordButton ? (isSendButtonVisible ? View.VISIBLE : View.GONE) : View.VISIBLE);
recordButton.setVisibility(showRecordButton ? (isSendButtonVisible ? View.GONE : View.VISIBLE) : View.GONE);
@@ -1782,7 +1780,8 @@ public abstract class MobiComConversationFragment extends Fragment implements Vi
}
@Override
- public void onFailure(Object error) { }
+ public void onFailure(Object error) {
+ }
});
}
}
