Skip to content

Commit

Permalink
keep settings and switch button enabled while recording
Browse files Browse the repository at this point in the history
  • Loading branch information
DevEmperor committed Jul 5, 2024
1 parent b9b2b64 commit 5532791
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ public void run() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) switchButton.setEnabled(false);

settingsButton.setOnClickListener(v -> {
if (isRecording) stopButton.performClick();
infoCl.setVisibility(View.GONE);
openSettingsActivity();
});
Expand Down Expand Up @@ -234,8 +235,6 @@ public void run() {
isRecording = false;
recordButton.setText(R.string.dictate_record);
recordButton.setIcon(AppCompatResources.getDrawable(this, R.drawable.ic_baseline_mic_24));
settingsButton.setEnabled(true);
switchButton.setEnabled(true);
recordButton.setEnabled(true);
pauseButton.setVisibility(View.GONE);
stopButton.setVisibility(View.GONE);
Expand Down Expand Up @@ -304,8 +303,6 @@ private void startRecording() {

recordButton.setText(R.string.dictate_send);
recordButton.setIcon(AppCompatResources.getDrawable(this, R.drawable.ic_baseline_send_24));
settingsButton.setEnabled(false);
switchButton.setEnabled(false);
pauseButton.setVisibility(View.VISIBLE);
stopButton.setVisibility(View.VISIBLE);
isRecording = true;
Expand Down Expand Up @@ -405,8 +402,6 @@ private void stopRecording() {
mainHandler.post(() -> {
recordButton.setText(R.string.dictate_record);
recordButton.setIcon(AppCompatResources.getDrawable(this, R.drawable.ic_baseline_mic_24));
settingsButton.setEnabled(true);
switchButton.setEnabled(true);
recordButton.setEnabled(true);
});
});
Expand Down

0 comments on commit 5532791

Please sign in to comment.