mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-22 16:07:30 +00:00
Merge pull request #374 from loki-project/voice-messages
Limit Voice Messages to One Minute
This commit is contained in:
commit
2c68cbeaf7
@ -330,6 +330,8 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
private AttachmentTypeSelector attachmentTypeSelector;
|
private AttachmentTypeSelector attachmentTypeSelector;
|
||||||
private AttachmentManager attachmentManager;
|
private AttachmentManager attachmentManager;
|
||||||
private AudioRecorder audioRecorder;
|
private AudioRecorder audioRecorder;
|
||||||
|
private Handler audioHandler;
|
||||||
|
private Runnable stopRecordingTask;
|
||||||
private BroadcastReceiver securityUpdateReceiver;
|
private BroadcastReceiver securityUpdateReceiver;
|
||||||
private Stub<MediaKeyboard> emojiDrawerStub;
|
private Stub<MediaKeyboard> emojiDrawerStub;
|
||||||
protected HidingLinearLayout quickAttachmentToggle;
|
protected HidingLinearLayout quickAttachmentToggle;
|
||||||
@ -2579,6 +2581,10 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||||
|
|
||||||
audioRecorder.startRecording();
|
audioRecorder.startRecording();
|
||||||
|
|
||||||
|
audioHandler = new Handler();
|
||||||
|
stopRecordingTask = () -> inputPanel.onRecordReleased();
|
||||||
|
audioHandler.postDelayed(stopRecordingTask, 60000);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -2588,6 +2594,9 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRecorderFinished() {
|
public void onRecorderFinished() {
|
||||||
|
if (audioHandler != null && stopRecordingTask != null) {
|
||||||
|
audioHandler.removeCallbacks(stopRecordingTask);
|
||||||
|
}
|
||||||
updateToggleButtonState();
|
updateToggleButtonState();
|
||||||
Vibrator vibrator = ServiceUtil.getVibrator(this);
|
Vibrator vibrator = ServiceUtil.getVibrator(this);
|
||||||
vibrator.vibrate(20);
|
vibrator.vibrate(20);
|
||||||
@ -2629,6 +2638,9 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRecorderCanceled() {
|
public void onRecorderCanceled() {
|
||||||
|
if (audioHandler != null && stopRecordingTask != null) {
|
||||||
|
audioHandler.removeCallbacks(stopRecordingTask);
|
||||||
|
}
|
||||||
updateToggleButtonState();
|
updateToggleButtonState();
|
||||||
Vibrator vibrator = ServiceUtil.getVibrator(this);
|
Vibrator vibrator = ServiceUtil.getVibrator(this);
|
||||||
vibrator.vibrate(50);
|
vibrator.vibrate(50);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user