hide attach record voice and take picture when buttons already visible

This commit is contained in:
12aw 2024-01-15 01:15:05 +01:00
parent df23db2600
commit 79666aa0ab
2 changed files with 6 additions and 4 deletions

View file

@ -1890,12 +1890,12 @@ public class ConversationFragment extends XmppFragment
public void showRecordVoiceButton() {
SharedPreferences p = PreferenceManager.getDefaultSharedPreferences(activity);
final boolean ShowRecordVoiceButton = p.getBoolean("show_record_voice_btn", activity.getResources().getBoolean(R.bool.show_record_voice_btn));
Log.d(Config.LOGTAG, "Recorder " + ShowRecordVoiceButton);
if (!ShowRecordVoiceButton || binding.textinput.getText().length() > 0) {
final boolean hideVoiceAndTakePicture = p.getBoolean("show_record_voice_btn", activity.getResources().getBoolean(R.bool.show_record_voice_btn));
Log.d(Config.LOGTAG, "Recorder " + hideVoiceAndTakePicture);
if (!hideVoiceAndTakePicture || binding.textinput.getText().length() > 0) {
binding.recordVoiceButton.setVisibility(GONE);
binding.takePictureButton.setVisibility(GONE);
} else if (ShowRecordVoiceButton && binding.textinput.getText().length() < 1) {
} else if (hideVoiceAndTakePicture && binding.textinput.getText().length() < 1) {
binding.recordVoiceButton.setVisibility(View.VISIBLE);
binding.takePictureButton.setVisibility(View.VISIBLE);
}

View file

@ -1275,6 +1275,8 @@ public class SettingsActivity extends XmppActivity implements OnSharedPreference
reconnectAccounts();
} else if (name.equals("show_less_avatars")) {
refreshUiReal();
} else if (name.equals("show_record_voice_btn")) {
recreate();
} else if (name.equals(AUTOMATIC_MESSAGE_DELETION)) {
xmppConnectionService.expireOldMessages(true);
} else if (name.equals(THEME) || name.equals(THEME_COLOR) || name.equals("custom_theme_primary") || name.equals("custom_theme_primary_dark") || name.equals("custom_theme_accent") || name.equals("custom_theme_dark")) {