diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-05-26 05:34:58 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-05-26 05:34:58 +0200 |
commit | 997b11dbecc6023ad0679843d8a267d843a2951c (patch) | |
tree | 16e29dc99150d8a8a0c4d54ab9216e75d08d4d41 /src | |
parent | dc91ff8f291d4b142d28e77137a74dc8e7205149 (diff) |
added choose picture as another quick action. fixes #1221
Diffstat (limited to 'src')
23 files changed, 25 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index d9f56c5db..c48b5865c 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -479,6 +479,9 @@ public class ConversationActivity extends XmppActivity case ATTACHMENT_CHOICE_TAKE_PHOTO: getPreferences().edit().putString("recently_used_quick_action","photo").apply(); break; + case ATTACHMENT_CHOICE_CHOOSE_IMAGE: + getPreferences().edit().putString("recently_used_quick_action","picture").apply(); + break; } final Conversation conversation = getSelectedConversation(); final int encryption = conversation.getNextEncryption(forceEncryption()); diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 02f664db5..a817b27bf 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -256,6 +256,9 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa case RECORD_VOICE: activity.attachFile(ConversationActivity.ATTACHMENT_CHOICE_RECORD_VOICE); break; + case CHOOSE_PICTURE: + activity.attachFile(ConversationActivity.ATTACHMENT_CHOICE_CHOOSE_IMAGE); + break; case CANCEL: if (conversation != null && conversation.getMode() == Conversation.MODE_MULTI) { conversation.setNextCounterpart(null); @@ -818,7 +821,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa updateChatMsgHint(); } - enum SendButtonAction {TEXT, TAKE_PHOTO, SEND_LOCATION, RECORD_VOICE, CANCEL} + enum SendButtonAction {TEXT, TAKE_PHOTO, SEND_LOCATION, RECORD_VOICE, CANCEL, CHOOSE_PICTURE} private int getSendButtonImageResource(SendButtonAction action, int status) { switch (action) { @@ -887,6 +890,19 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa default: return R.drawable.ic_send_cancel_offline; } + case CHOOSE_PICTURE: + switch (status) { + case Presences.CHAT: + case Presences.ONLINE: + return R.drawable.ic_send_picture_online; + case Presences.AWAY: + return R.drawable.ic_send_picture_away; + case Presences.XA: + case Presences.DND: + return R.drawable.ic_send_picture_dnd; + default: + return R.drawable.ic_send_picture_offline; + } } return R.drawable.ic_send_text_offline; } @@ -920,6 +936,9 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa case "voice": action = SendButtonAction.RECORD_VOICE; break; + case "picture": + action = SendButtonAction.CHOOSE_PICTURE; + break; default: action = SendButtonAction.TEXT; break; diff --git a/src/main/res/drawable-hdpi/ic_send_picture_away.png b/src/main/res/drawable-hdpi/ic_send_picture_away.png Binary files differnew file mode 100644 index 000000000..09d1c7b7a --- /dev/null +++ b/src/main/res/drawable-hdpi/ic_send_picture_away.png diff --git a/src/main/res/drawable-hdpi/ic_send_picture_dnd.png b/src/main/res/drawable-hdpi/ic_send_picture_dnd.png Binary files differnew file mode 100644 index 000000000..77964b5b5 --- /dev/null +++ b/src/main/res/drawable-hdpi/ic_send_picture_dnd.png diff --git a/src/main/res/drawable-hdpi/ic_send_picture_offline.png b/src/main/res/drawable-hdpi/ic_send_picture_offline.png Binary files differnew file mode 100644 index 000000000..28135e25b --- /dev/null +++ b/src/main/res/drawable-hdpi/ic_send_picture_offline.png diff --git a/src/main/res/drawable-hdpi/ic_send_picture_online.png b/src/main/res/drawable-hdpi/ic_send_picture_online.png Binary files differnew file mode 100644 index 000000000..feb926c6f --- /dev/null +++ b/src/main/res/drawable-hdpi/ic_send_picture_online.png diff --git a/src/main/res/drawable-mdpi/ic_send_picture_away.png b/src/main/res/drawable-mdpi/ic_send_picture_away.png Binary files differnew file mode 100644 index 000000000..d3ebca535 --- /dev/null +++ b/src/main/res/drawable-mdpi/ic_send_picture_away.png diff --git a/src/main/res/drawable-mdpi/ic_send_picture_dnd.png b/src/main/res/drawable-mdpi/ic_send_picture_dnd.png Binary files differnew file mode 100644 index 000000000..1d293f20d --- /dev/null +++ b/src/main/res/drawable-mdpi/ic_send_picture_dnd.png diff --git a/src/main/res/drawable-mdpi/ic_send_picture_offline.png b/src/main/res/drawable-mdpi/ic_send_picture_offline.png Binary files differnew file mode 100644 index 000000000..95d5621e6 --- /dev/null +++ b/src/main/res/drawable-mdpi/ic_send_picture_offline.png diff --git a/src/main/res/drawable-mdpi/ic_send_picture_online.png b/src/main/res/drawable-mdpi/ic_send_picture_online.png Binary files differnew file mode 100644 index 000000000..be4194d34 --- /dev/null +++ b/src/main/res/drawable-mdpi/ic_send_picture_online.png diff --git a/src/main/res/drawable-xhdpi/ic_send_picture_away.png b/src/main/res/drawable-xhdpi/ic_send_picture_away.png Binary files differnew file mode 100644 index 000000000..f9aa21dc8 --- /dev/null +++ b/src/main/res/drawable-xhdpi/ic_send_picture_away.png diff --git a/src/main/res/drawable-xhdpi/ic_send_picture_dnd.png b/src/main/res/drawable-xhdpi/ic_send_picture_dnd.png Binary files differnew file mode 100644 index 000000000..95e4acce7 --- /dev/null +++ b/src/main/res/drawable-xhdpi/ic_send_picture_dnd.png diff --git a/src/main/res/drawable-xhdpi/ic_send_picture_offline.png b/src/main/res/drawable-xhdpi/ic_send_picture_offline.png Binary files differnew file mode 100644 index 000000000..75ff2fc4e --- /dev/null +++ b/src/main/res/drawable-xhdpi/ic_send_picture_offline.png diff --git a/src/main/res/drawable-xhdpi/ic_send_picture_online.png b/src/main/res/drawable-xhdpi/ic_send_picture_online.png Binary files differnew file mode 100644 index 000000000..0f68d5f52 --- /dev/null +++ b/src/main/res/drawable-xhdpi/ic_send_picture_online.png diff --git a/src/main/res/drawable-xxhdpi/ic_send_picture_away.png b/src/main/res/drawable-xxhdpi/ic_send_picture_away.png Binary files differnew file mode 100644 index 000000000..7898ed4fb --- /dev/null +++ b/src/main/res/drawable-xxhdpi/ic_send_picture_away.png diff --git a/src/main/res/drawable-xxhdpi/ic_send_picture_dnd.png b/src/main/res/drawable-xxhdpi/ic_send_picture_dnd.png Binary files differnew file mode 100644 index 000000000..ccffabbef --- /dev/null +++ b/src/main/res/drawable-xxhdpi/ic_send_picture_dnd.png diff --git a/src/main/res/drawable-xxhdpi/ic_send_picture_offline.png b/src/main/res/drawable-xxhdpi/ic_send_picture_offline.png Binary files differnew file mode 100644 index 000000000..7b5687e42 --- /dev/null +++ b/src/main/res/drawable-xxhdpi/ic_send_picture_offline.png diff --git a/src/main/res/drawable-xxhdpi/ic_send_picture_online.png b/src/main/res/drawable-xxhdpi/ic_send_picture_online.png Binary files differnew file mode 100644 index 000000000..82eab70c0 --- /dev/null +++ b/src/main/res/drawable-xxhdpi/ic_send_picture_online.png diff --git a/src/main/res/drawable-xxxhdpi/ic_send_picture_away.png b/src/main/res/drawable-xxxhdpi/ic_send_picture_away.png Binary files differnew file mode 100644 index 000000000..1daa8ecce --- /dev/null +++ b/src/main/res/drawable-xxxhdpi/ic_send_picture_away.png diff --git a/src/main/res/drawable-xxxhdpi/ic_send_picture_dnd.png b/src/main/res/drawable-xxxhdpi/ic_send_picture_dnd.png Binary files differnew file mode 100644 index 000000000..d8257aad0 --- /dev/null +++ b/src/main/res/drawable-xxxhdpi/ic_send_picture_dnd.png diff --git a/src/main/res/drawable-xxxhdpi/ic_send_picture_offline.png b/src/main/res/drawable-xxxhdpi/ic_send_picture_offline.png Binary files differnew file mode 100644 index 000000000..d487709be --- /dev/null +++ b/src/main/res/drawable-xxxhdpi/ic_send_picture_offline.png diff --git a/src/main/res/drawable-xxxhdpi/ic_send_picture_online.png b/src/main/res/drawable-xxxhdpi/ic_send_picture_online.png Binary files differnew file mode 100644 index 000000000..c095d7959 --- /dev/null +++ b/src/main/res/drawable-xxxhdpi/ic_send_picture_online.png diff --git a/src/main/res/values/arrays.xml b/src/main/res/values/arrays.xml index fec077ccc..5be352d1c 100644 --- a/src/main/res/values/arrays.xml +++ b/src/main/res/values/arrays.xml @@ -44,6 +44,7 @@ <item>@string/none</item> <item>@string/recently_used</item> <item>@string/attach_take_picture</item> + <item>@string/attach_choose_picture</item> <item>@string/attach_record_voice</item> <item>@string/send_location</item> </string-array> @@ -52,6 +53,7 @@ <item>none</item> <item>recent</item> <item>photo</item> + <item>picture</item> <item>voice</item> <item>location</item> </string-array> |