mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-24 10:51:27 +01:00
@@ -62,7 +62,6 @@ import org.thoughtcrime.securesms.database.model.MmsMessageRecord;
|
||||
import org.thoughtcrime.securesms.database.model.Quote;
|
||||
import org.thoughtcrime.securesms.database.model.StickerRecord;
|
||||
import org.thoughtcrime.securesms.keyboard.KeyboardPage;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.linkpreview.LinkPreview;
|
||||
import org.thoughtcrime.securesms.linkpreview.LinkPreviewRepository;
|
||||
import org.thoughtcrime.securesms.mms.DecryptableStreamUriLoader;
|
||||
@@ -625,10 +624,21 @@ public class InputPanel extends ConstraintLayout
|
||||
if (listener != null) listener.onRecorderLocked();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecordSaved() {
|
||||
Log.d(TAG, "Recording saved");
|
||||
onRecordHideEvent();
|
||||
if (listener != null) listener.onRecorderSaveDraft();
|
||||
}
|
||||
|
||||
public void onPause() {
|
||||
this.microphoneRecorderView.cancelAction(false);
|
||||
}
|
||||
|
||||
public void onSaveRecordDraft() {
|
||||
this.microphoneRecorderView.saveAction();
|
||||
}
|
||||
|
||||
public @NonNull Observer<VoiceNotePlaybackState> getPlaybackStateObserver() {
|
||||
return voiceNoteDraftView.getPlaybackStateObserver();
|
||||
}
|
||||
@@ -692,7 +702,7 @@ public class InputPanel extends ConstraintLayout
|
||||
return microphoneRecorderView.isRecordingLocked();
|
||||
}
|
||||
|
||||
public void releaseRecordingLock() {
|
||||
public void releaseRecordingLockAndSend() {
|
||||
microphoneRecorderView.unlockAction();
|
||||
}
|
||||
|
||||
@@ -794,6 +804,7 @@ public class InputPanel extends ConstraintLayout
|
||||
public interface Listener extends VoiceNoteDraftView.Listener {
|
||||
void onRecorderStarted();
|
||||
void onRecorderLocked();
|
||||
void onRecorderSaveDraft();
|
||||
void onRecorderFinished();
|
||||
void onRecorderCanceled(boolean byUser);
|
||||
void onRecorderPermissionRequired();
|
||||
|
||||
@@ -70,6 +70,17 @@ public final class MicrophoneRecorderView extends FrameLayout implements View.On
|
||||
}
|
||||
}
|
||||
|
||||
public void saveAction() {
|
||||
if (state != State.NOT_RUNNING) {
|
||||
state = State.NOT_RUNNING;
|
||||
hideUi();
|
||||
|
||||
if (handler != null) {
|
||||
handler.onRecordSaved();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isRecordingLocked() {
|
||||
return state == State.RUNNING_LOCKED;
|
||||
}
|
||||
|
||||
@@ -41,19 +41,11 @@ class SendButton(context: Context, attributeSet: AttributeSet?) : AppCompatImage
|
||||
if (!isEnabled) {
|
||||
return false
|
||||
}
|
||||
|
||||
val scheduleListener = scheduledSendListener
|
||||
|
||||
return if (scheduleListener?.canSchedule() == true) {
|
||||
scheduleListener.onSendScheduled()
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
scheduledSendListener?.onSendScheduled()
|
||||
return true
|
||||
}
|
||||
|
||||
interface ScheduledSendListener {
|
||||
fun onSendScheduled()
|
||||
fun canSchedule(): Boolean
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user