From fcbd82352dec19c7101613b0965a47f2d184fc1f Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sun, 23 Sep 2018 21:16:19 +0200 Subject: use different menu items for record video and take photo --- .../de/pixart/messenger/ui/util/SendButtonAction.java | 17 +++++++++++------ .../de/pixart/messenger/ui/util/SendButtonTool.java | 15 ++++++++++++++- 2 files changed, 25 insertions(+), 7 deletions(-) (limited to 'src/main/java/de/pixart/messenger/ui/util') diff --git a/src/main/java/de/pixart/messenger/ui/util/SendButtonAction.java b/src/main/java/de/pixart/messenger/ui/util/SendButtonAction.java index 9f9fabc5a..c7feb2105 100644 --- a/src/main/java/de/pixart/messenger/ui/util/SendButtonAction.java +++ b/src/main/java/de/pixart/messenger/ui/util/SendButtonAction.java @@ -33,10 +33,11 @@ import static de.pixart.messenger.ui.ConversationFragment.ATTACHMENT_CHOICE; import static de.pixart.messenger.ui.ConversationFragment.ATTACHMENT_CHOICE_CHOOSE_IMAGE; import static de.pixart.messenger.ui.ConversationFragment.ATTACHMENT_CHOICE_LOCATION; import static de.pixart.messenger.ui.ConversationFragment.ATTACHMENT_CHOICE_RECORD_VOICE; -import static de.pixart.messenger.ui.ConversationFragment.ATTACHMENT_CHOICE_TAKE_FROM_CAMERA; +import static de.pixart.messenger.ui.ConversationFragment.ATTACHMENT_CHOICE_RECORD_VIDEO; +import static de.pixart.messenger.ui.ConversationFragment.ATTACHMENT_CHOICE_TAKE_PHOTO; public enum SendButtonAction { - TEXT, TAKE_FROM_CAMERA, SEND_LOCATION, RECORD_VOICE, CANCEL, CHOOSE_PICTURE, CHOOSE_ATTACHMENT; + TEXT, TAKE_PHOTO, SEND_LOCATION, RECORD_VOICE, CANCEL, CHOOSE_PICTURE, RECORD_VIDEO, CHOOSE_ATTACHMENT; public static SendButtonAction valueOfOrDefault(String setting, SendButtonAction text) { try { @@ -52,8 +53,10 @@ public enum SendButtonAction { return SEND_LOCATION; case ATTACHMENT_CHOICE_RECORD_VOICE: return RECORD_VOICE; - case ATTACHMENT_CHOICE_TAKE_FROM_CAMERA: - return TAKE_FROM_CAMERA; + case ATTACHMENT_CHOICE_RECORD_VIDEO: + return RECORD_VIDEO; + case ATTACHMENT_CHOICE_TAKE_PHOTO: + return TAKE_PHOTO; case ATTACHMENT_CHOICE_CHOOSE_IMAGE: return CHOOSE_PICTURE; case ATTACHMENT_CHOICE: @@ -65,8 +68,10 @@ public enum SendButtonAction { public int toChoice() { switch (this) { - case TAKE_FROM_CAMERA: - return ATTACHMENT_CHOICE_TAKE_FROM_CAMERA; + case TAKE_PHOTO: + return ATTACHMENT_CHOICE_TAKE_PHOTO; + case RECORD_VIDEO: + return ATTACHMENT_CHOICE_RECORD_VIDEO; case SEND_LOCATION: return ATTACHMENT_CHOICE_LOCATION; case RECORD_VOICE: diff --git a/src/main/java/de/pixart/messenger/ui/util/SendButtonTool.java b/src/main/java/de/pixart/messenger/ui/util/SendButtonTool.java index 67cd48b6a..96bcad183 100644 --- a/src/main/java/de/pixart/messenger/ui/util/SendButtonTool.java +++ b/src/main/java/de/pixart/messenger/ui/util/SendButtonTool.java @@ -105,7 +105,20 @@ public class SendButtonTool { default: return getThemeResource(activity, R.attr.ic_send_text_offline, R.drawable.ic_send_text_offline); } - case TAKE_FROM_CAMERA: + case RECORD_VIDEO: + switch (status) { + case CHAT: + case ONLINE: + return R.drawable.ic_send_videocam_online; + case AWAY: + return R.drawable.ic_send_videocam_away; + case XA: + case DND: + return R.drawable.ic_send_videocam_dnd; + default: + return getThemeResource(activity, R.attr.ic_send_videocam_offline, R.drawable.ic_send_videocam_offline); + } + case TAKE_PHOTO: switch (status) { case CHAT: case ONLINE: -- cgit v1.2.3