Added multiple (recording) icons and change them on recording

This commit is contained in:
delvh 2020-07-06 22:35:06 +02:00
parent a16f8966fb
commit 8a42e2f049
7 changed files with 7 additions and 2 deletions

View File

@ -111,6 +111,7 @@ public final class ChatScene implements Restorable {
userList.setCellFactory(ContactListCellFactory::new);
settingsButton.setGraphic(new ImageView(IconUtil.loadDefault("settings", 16)));
voiceButton.setGraphic(new ImageView(IconUtil.loadDefaultThemeSensitive("", 24)));
// Listen to received messages
eventBus.register(MessageCreationEvent.class, e -> {
@ -262,13 +263,17 @@ public final class ChatScene implements Restorable {
try {
if (!recording) {
recording = true;
Platform.runLater(() -> voiceButton.setText("Recording..."));
Platform.runLater(() -> {
voiceButton.setText("Recording");
voiceButton.setGraphic(new ImageView(IconUtil.loadDefault("microphone_recording", 24)));
});
recorder.start();
} else {
pendingAttachment = new Attachment(recorder.finish(), AttachmentType.VOICE);
recording = false;
Platform.runLater(() -> {
voiceButton.setText("Record Voice Message");
voiceButton.setGraphic(new ImageView(IconUtil.loadDefaultThemeSensitive("microphone_", 24)));
voiceButton.setText(null);
checkPostConditions(false);
attachmentView.setImage(IconUtil.loadDefaultThemeSensitive("attachment_present_", 20));
attachmentView.setVisible(true);

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB