diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-08-05 12:36:18 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-08-05 12:36:18 +0200 |
commit | 3f55a61c250c5b9dd81dd4dcfd4c9531369d2152 (patch) | |
tree | 91cd1cb9076fe04a5a063938d8584c99bdc91649 /src/main | |
parent | 7414a4e5a2567b312099e82f818d46608d8bbdfb (diff) |
introduced config flag to show attachment button instead of quick actions
Diffstat (limited to 'src/main')
35 files changed, 142 insertions, 27 deletions
diff --git a/src/main/java/de/pixart/messenger/Config.java b/src/main/java/de/pixart/messenger/Config.java index dc7262135..ac99b1709 100644 --- a/src/main/java/de/pixart/messenger/Config.java +++ b/src/main/java/de/pixart/messenger/Config.java @@ -86,6 +86,8 @@ public final class Config { public static final Bitmap.CompressFormat IMAGE_FORMAT = Bitmap.CompressFormat.JPEG; public static final int IMAGE_QUALITY = 75; + public static final boolean QUICK_SHARE_ATTACHMENT_CHOICE = true; // set to true to use attachment choice instead of quick share for send button + public static final int DEFAULT_ZOOM = 15; //for locations public final static long LOCATION_FIX_TIME_DELTA = 1000 * 10; // ms public final static float LOCATION_FIX_SPACE_DELTA = 10; // m diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index f1ebb0d63..dfc1d4d78 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -30,6 +30,9 @@ import android.support.media.ExifInterface; import android.support.v13.view.inputmethod.InputConnectionCompat; import android.support.v13.view.inputmethod.InputContentInfoCompat; import android.support.v7.app.AlertDialog; +import android.support.v7.view.menu.MenuBuilder; +import android.support.v7.view.menu.MenuPopupHelper; +import android.support.v7.widget.PopupMenu; import android.text.Editable; import android.util.Log; import android.view.ContextMenu; @@ -53,7 +56,6 @@ import android.widget.CheckBox; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ListView; -import android.widget.PopupMenu; import android.widget.TextView.OnEditorActionListener; import android.widget.Toast; @@ -136,6 +138,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke public static final int REQUEST_TRUST_KEYS_MENU = 0x0209; public static final int REQUEST_START_DOWNLOAD = 0x0210; public static final int REQUEST_ADD_EDITOR_CONTENT = 0x0211; + public static final int ATTACHMENT_CHOICE = 0x0300; public static final int ATTACHMENT_CHOICE_CHOOSE_IMAGE = 0x0301; public static final int ATTACHMENT_CHOICE_TAKE_FROM_CAMERA = 0x0302; public static final int ATTACHMENT_CHOICE_CHOOSE_FILE = 0x0303; @@ -449,6 +452,8 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke if (tag instanceof SendButtonAction) { SendButtonAction action = (SendButtonAction) tag; switch (action) { + case CHOOSE_ATTACHMENT: + choose_attachment(v); case TAKE_FROM_CAMERA: case SEND_LOCATION: case RECORD_VOICE: @@ -477,6 +482,31 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke } } }; + + @SuppressLint("RestrictedApi") + private void choose_attachment(View v) { + PopupMenu popup = new PopupMenu(activity, v); + popup.inflate(R.menu.choose_attachment); + Menu menu = popup.getMenu(); + ConversationMenuConfigurator.configureQuickShareAttachmentMenu(conversation, menu); + popup.setOnMenuItemClickListener(attachmentItem -> { + switch (attachmentItem.getItemId()) { + case R.id.attach_choose_picture: + case R.id.attach_take_picture: + case R.id.attach_choose_file: + case R.id.attach_record_voice: + case R.id.attach_location: + Log.d(Config.LOGTAG, "ATTACHMENT: " + attachmentItem.getTitle()); + handleAttachmentSelection(attachmentItem); + default: + return false; + } + }); + MenuPopupHelper menuHelper = new MenuPopupHelper(getActivity(), (MenuBuilder) menu, v); + menuHelper.setForceShowIcon(true); + menuHelper.show(); + } + private View.OnLongClickListener mSendButtonLongListener = new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { @@ -1147,7 +1177,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke } menuNeedHelp.setVisible(true); menuSearchUpdates.setVisible(false); - ConversationMenuConfigurator.configureAttachmentMenu(conversation, menu); + ConversationMenuConfigurator.configureAttachmentMenu(conversation, menu, Config.QUICK_SHARE_ATTACHMENT_CHOICE); ConversationMenuConfigurator.configureEncryptionMenu(conversation, menu); } else { menuNeedHelp.setVisible(false); diff --git a/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java index f2e4dc2b6..6067d03f9 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationsActivity.java @@ -842,22 +842,19 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio } PopupMenu popup = new PopupMenu(this, view); popup.inflate(R.menu.verification_choices); - popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { - @Override - public boolean onMenuItemClick(MenuItem menuItem) { - Intent intent = new Intent(ConversationsActivity.this, VerifyOTRActivity.class); - intent.setAction(VerifyOTRActivity.ACTION_VERIFY_CONTACT); - intent.putExtra("contact", conversation.getContact().getJid().asBareJid().toString()); - intent.putExtra(EXTRA_ACCOUNT, conversation.getAccount().getJid().asBareJid().toString()); - switch (menuItem.getItemId()) { - case R.id.ask_question: - intent.putExtra("mode", VerifyOTRActivity.MODE_ASK_QUESTION); - break; - } - startActivity(intent); - overridePendingTransition(R.animator.fade_in, R.animator.fade_out); - return true; + popup.setOnMenuItemClickListener(menuItem -> { + Intent intent = new Intent(ConversationsActivity.this, VerifyOTRActivity.class); + intent.setAction(VerifyOTRActivity.ACTION_VERIFY_CONTACT); + intent.putExtra("contact", conversation.getContact().getJid().asBareJid().toString()); + intent.putExtra(EXTRA_ACCOUNT, conversation.getAccount().getJid().asBareJid().toString()); + switch (menuItem.getItemId()) { + case R.id.ask_question: + intent.putExtra("mode", VerifyOTRActivity.MODE_ASK_QUESTION); + break; } + startActivity(intent); + overridePendingTransition(R.animator.fade_in, R.animator.fade_out); + return true; }); popup.show(); } diff --git a/src/main/java/de/pixart/messenger/ui/SettingsActivity.java b/src/main/java/de/pixart/messenger/ui/SettingsActivity.java index 5f10ceea6..9ee11bd0b 100644 --- a/src/main/java/de/pixart/messenger/ui/SettingsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/SettingsActivity.java @@ -116,6 +116,7 @@ public class SettingsActivity extends XmppActivity implements } PreferenceScreen mainPreferenceScreen = (PreferenceScreen) mSettingsFragment.findPreference("main_screen"); + PreferenceScreen UIPreferenceScreen = (PreferenceScreen) mSettingsFragment.findPreference("userinterface"); //this feature is only available on Huawei Android 6. PreferenceScreen huaweiPreferenceScreen = (PreferenceScreen) mSettingsFragment.findPreference("huawei"); @@ -172,6 +173,12 @@ public class SettingsActivity extends XmppActivity implements quickAction.setEntryValues(entryValues.toArray(new CharSequence[entryValues.size()])); } + if (Config.QUICK_SHARE_ATTACHMENT_CHOICE) { + if (UIPreferenceScreen != null && quickAction != null) { + UIPreferenceScreen.removePreference(quickAction); + } + } + final Preference removeCertsPreference = mSettingsFragment.findPreference("remove_trusted_certificates"); if (removeCertsPreference != null) { removeCertsPreference.setOnPreferenceClickListener(preference -> { diff --git a/src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java b/src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java index 03f7638e3..98a73addc 100644 --- a/src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java +++ b/src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java @@ -53,9 +53,21 @@ public class ConversationMenuConfigurator { locationAvailable = context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS) || context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LOCATION_NETWORK); } - public static void configureAttachmentMenu(@NonNull Conversation conversation, Menu menu) { - final MenuItem menuAttach = menu.findItem(R.id.action_attach_file); + public static void configureQuickShareAttachmentMenu(@NonNull Conversation conversation, Menu menu) { + final boolean visible = SendButtonTool.AttachmentsVisible(conversation); + if (!visible) { + return; + } + menu.findItem(R.id.attach_record_voice).setVisible(microphoneAvailable); + menu.findItem(R.id.attach_location).setVisible(locationAvailable); + } + public static void configureAttachmentMenu(@NonNull Conversation conversation, Menu menu, Boolean Quick_share_attachment_choice) { + final MenuItem menuAttach = menu.findItem(R.id.action_attach_file); + if (Quick_share_attachment_choice) { + menuAttach.setVisible(false); + return; + } final boolean visible; if (conversation.getMode() == Conversation.MODE_MULTI) { visible = conversation.getAccount().httpUploadAvailable() && conversation.getMucOptions().participating(); 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 6258b49c6..9f9fabc5a 100644 --- a/src/main/java/de/pixart/messenger/ui/util/SendButtonAction.java +++ b/src/main/java/de/pixart/messenger/ui/util/SendButtonAction.java @@ -29,13 +29,14 @@ package de.pixart.messenger.ui.util; +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; public enum SendButtonAction { - TEXT, TAKE_FROM_CAMERA, SEND_LOCATION, RECORD_VOICE, CANCEL, CHOOSE_PICTURE; + TEXT, TAKE_FROM_CAMERA, SEND_LOCATION, RECORD_VOICE, CANCEL, CHOOSE_PICTURE, CHOOSE_ATTACHMENT; public static SendButtonAction valueOfOrDefault(String setting, SendButtonAction text) { try { @@ -55,6 +56,8 @@ public enum SendButtonAction { return TAKE_FROM_CAMERA; case ATTACHMENT_CHOICE_CHOOSE_IMAGE: return CHOOSE_PICTURE; + case ATTACHMENT_CHOICE: + return CHOOSE_ATTACHMENT; default: throw new IllegalArgumentException("Not a known attachment choice"); } @@ -70,6 +73,8 @@ public enum SendButtonAction { return ATTACHMENT_CHOICE_RECORD_VOICE; case CHOOSE_PICTURE: return ATTACHMENT_CHOICE_CHOOSE_IMAGE; + case CHOOSE_ATTACHMENT: + return ATTACHMENT_CHOICE; default: return 0; } 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 fdff0b4dc..291edb822 100644 --- a/src/main/java/de/pixart/messenger/ui/util/SendButtonTool.java +++ b/src/main/java/de/pixart/messenger/ui/util/SendButtonTool.java @@ -40,6 +40,8 @@ import de.pixart.messenger.entities.Presence; import de.pixart.messenger.ui.ConversationFragment; import de.pixart.messenger.utils.UIHelper; +import static de.pixart.messenger.Config.QUICK_SHARE_ATTACHMENT_CHOICE; + public class SendButtonTool { public static SendButtonAction getAction(Activity activity, Conversation c, String text) { @@ -59,15 +61,21 @@ public class SendButtonTool { if (conference && c.getNextCounterpart() != null) { return SendButtonAction.CANCEL; } else { - String setting = preferences.getString("quick_action", activity.getResources().getString(R.string.quick_action)); - if (!setting.equals("none") && UIHelper.receivedLocationQuestion(c.getLatestMessage())) { - return SendButtonAction.SEND_LOCATION; + if (QUICK_SHARE_ATTACHMENT_CHOICE && AttachmentsVisible(c)) { + return SendButtonAction.CHOOSE_ATTACHMENT; + } else if (QUICK_SHARE_ATTACHMENT_CHOICE && !AttachmentsVisible(c)) { + return SendButtonAction.TEXT; } else { - if (setting.equals("recent")) { - setting = preferences.getString(ConversationFragment.RECENTLY_USED_QUICK_ACTION, SendButtonAction.TEXT.toString()); - return SendButtonAction.valueOfOrDefault(setting, SendButtonAction.TEXT); + String setting = preferences.getString("quick_action", activity.getResources().getString(R.string.quick_action)); + if (!setting.equals("none") && UIHelper.receivedLocationQuestion(c.getLatestMessage())) { + return SendButtonAction.SEND_LOCATION; } else { - return SendButtonAction.valueOfOrDefault(setting, SendButtonAction.TEXT); + if (setting.equals("recent")) { + setting = preferences.getString(ConversationFragment.RECENTLY_USED_QUICK_ACTION, SendButtonAction.TEXT.toString()); + return SendButtonAction.valueOfOrDefault(setting, SendButtonAction.TEXT); + } else { + return SendButtonAction.valueOfOrDefault(setting, SendButtonAction.TEXT); + } } } } @@ -77,6 +85,12 @@ public class SendButtonTool { } } + public static boolean AttachmentsVisible(Conversation conversation) { + final boolean visible; + visible = conversation.getMode() != Conversation.MODE_MULTI || conversation.getAccount().httpUploadAvailable() && conversation.getMucOptions().participating(); + return visible; + } + public static int getSendButtonImageResource(Activity activity, SendButtonAction action, Presence.Status status) { switch (action) { case TEXT: @@ -157,6 +171,20 @@ public class SendButtonTool { default: return getThemeResource(activity, R.attr.ic_send_picture_offline, R.drawable.ic_send_picture_offline); } + + case CHOOSE_ATTACHMENT: + switch (status) { + case CHAT: + case ONLINE: + return R.drawable.ic_send_attachment_online; + case AWAY: + return R.drawable.ic_send_attachment_away; + case XA: + case DND: + return R.drawable.ic_send_attachment_dnd; + default: + return getThemeResource(activity, R.attr.ic_send_attachment_offline, R.drawable.ic_send_attachment_offline); + } } return getThemeResource(activity, R.attr.ic_send_text_offline, R.drawable.ic_send_text_offline); } diff --git a/src/main/res/drawable-hdpi/ic_send_attachment_away.png b/src/main/res/drawable-hdpi/ic_send_attachment_away.png Binary files differnew file mode 100644 index 000000000..9bed3051a --- /dev/null +++ b/src/main/res/drawable-hdpi/ic_send_attachment_away.png diff --git a/src/main/res/drawable-hdpi/ic_send_attachment_dnd.png b/src/main/res/drawable-hdpi/ic_send_attachment_dnd.png Binary files differnew file mode 100644 index 000000000..b1218fa97 --- /dev/null +++ b/src/main/res/drawable-hdpi/ic_send_attachment_dnd.png diff --git a/src/main/res/drawable-hdpi/ic_send_attachment_offline.png b/src/main/res/drawable-hdpi/ic_send_attachment_offline.png Binary files differnew file mode 100644 index 000000000..903507c25 --- /dev/null +++ b/src/main/res/drawable-hdpi/ic_send_attachment_offline.png diff --git a/src/main/res/drawable-hdpi/ic_send_attachment_offline_white.png b/src/main/res/drawable-hdpi/ic_send_attachment_offline_white.png Binary files differnew file mode 100644 index 000000000..1da306908 --- /dev/null +++ b/src/main/res/drawable-hdpi/ic_send_attachment_offline_white.png diff --git a/src/main/res/drawable-hdpi/ic_send_attachment_online.png b/src/main/res/drawable-hdpi/ic_send_attachment_online.png Binary files differnew file mode 100644 index 000000000..c6c00dfa9 --- /dev/null +++ b/src/main/res/drawable-hdpi/ic_send_attachment_online.png diff --git a/src/main/res/drawable-mdpi/ic_send_attachment_away.png b/src/main/res/drawable-mdpi/ic_send_attachment_away.png Binary files differnew file mode 100644 index 000000000..0d32152e7 --- /dev/null +++ b/src/main/res/drawable-mdpi/ic_send_attachment_away.png diff --git a/src/main/res/drawable-mdpi/ic_send_attachment_dnd.png b/src/main/res/drawable-mdpi/ic_send_attachment_dnd.png Binary files differnew file mode 100644 index 000000000..166b1693a --- /dev/null +++ b/src/main/res/drawable-mdpi/ic_send_attachment_dnd.png diff --git a/src/main/res/drawable-mdpi/ic_send_attachment_offline.png b/src/main/res/drawable-mdpi/ic_send_attachment_offline.png Binary files differnew file mode 100644 index 000000000..15664d26c --- /dev/null +++ b/src/main/res/drawable-mdpi/ic_send_attachment_offline.png diff --git a/src/main/res/drawable-mdpi/ic_send_attachment_offline_white.png b/src/main/res/drawable-mdpi/ic_send_attachment_offline_white.png Binary files differnew file mode 100644 index 000000000..4a41d0b99 --- /dev/null +++ b/src/main/res/drawable-mdpi/ic_send_attachment_offline_white.png diff --git a/src/main/res/drawable-mdpi/ic_send_attachment_online.png b/src/main/res/drawable-mdpi/ic_send_attachment_online.png Binary files differnew file mode 100644 index 000000000..7b2157825 --- /dev/null +++ b/src/main/res/drawable-mdpi/ic_send_attachment_online.png diff --git a/src/main/res/drawable-xhdpi/ic_send_attachment_away.png b/src/main/res/drawable-xhdpi/ic_send_attachment_away.png Binary files differnew file mode 100644 index 000000000..977fe67a7 --- /dev/null +++ b/src/main/res/drawable-xhdpi/ic_send_attachment_away.png diff --git a/src/main/res/drawable-xhdpi/ic_send_attachment_dnd.png b/src/main/res/drawable-xhdpi/ic_send_attachment_dnd.png Binary files differnew file mode 100644 index 000000000..33e8e5528 --- /dev/null +++ b/src/main/res/drawable-xhdpi/ic_send_attachment_dnd.png diff --git a/src/main/res/drawable-xhdpi/ic_send_attachment_offline.png b/src/main/res/drawable-xhdpi/ic_send_attachment_offline.png Binary files differnew file mode 100644 index 000000000..51290ddca --- /dev/null +++ b/src/main/res/drawable-xhdpi/ic_send_attachment_offline.png diff --git a/src/main/res/drawable-xhdpi/ic_send_attachment_offline_white.png b/src/main/res/drawable-xhdpi/ic_send_attachment_offline_white.png Binary files differnew file mode 100644 index 000000000..8196f9356 --- /dev/null +++ b/src/main/res/drawable-xhdpi/ic_send_attachment_offline_white.png diff --git a/src/main/res/drawable-xhdpi/ic_send_attachment_online.png b/src/main/res/drawable-xhdpi/ic_send_attachment_online.png Binary files differnew file mode 100644 index 000000000..5ec947bf6 --- /dev/null +++ b/src/main/res/drawable-xhdpi/ic_send_attachment_online.png diff --git a/src/main/res/drawable-xxhdpi/ic_send_attachment_away.png b/src/main/res/drawable-xxhdpi/ic_send_attachment_away.png Binary files differnew file mode 100644 index 000000000..f777b433b --- /dev/null +++ b/src/main/res/drawable-xxhdpi/ic_send_attachment_away.png diff --git a/src/main/res/drawable-xxhdpi/ic_send_attachment_dnd.png b/src/main/res/drawable-xxhdpi/ic_send_attachment_dnd.png Binary files differnew file mode 100644 index 000000000..a887fc795 --- /dev/null +++ b/src/main/res/drawable-xxhdpi/ic_send_attachment_dnd.png diff --git a/src/main/res/drawable-xxhdpi/ic_send_attachment_offline.png b/src/main/res/drawable-xxhdpi/ic_send_attachment_offline.png Binary files differnew file mode 100644 index 000000000..97d5dd587 --- /dev/null +++ b/src/main/res/drawable-xxhdpi/ic_send_attachment_offline.png diff --git a/src/main/res/drawable-xxhdpi/ic_send_attachment_offline_white.png b/src/main/res/drawable-xxhdpi/ic_send_attachment_offline_white.png Binary files differnew file mode 100644 index 000000000..6c54ec600 --- /dev/null +++ b/src/main/res/drawable-xxhdpi/ic_send_attachment_offline_white.png diff --git a/src/main/res/drawable-xxhdpi/ic_send_attachment_online.png b/src/main/res/drawable-xxhdpi/ic_send_attachment_online.png Binary files differnew file mode 100644 index 000000000..34791812f --- /dev/null +++ b/src/main/res/drawable-xxhdpi/ic_send_attachment_online.png diff --git a/src/main/res/drawable-xxxhdpi/ic_send_attachment_away.png b/src/main/res/drawable-xxxhdpi/ic_send_attachment_away.png Binary files differnew file mode 100644 index 000000000..6d4db066e --- /dev/null +++ b/src/main/res/drawable-xxxhdpi/ic_send_attachment_away.png diff --git a/src/main/res/drawable-xxxhdpi/ic_send_attachment_dnd.png b/src/main/res/drawable-xxxhdpi/ic_send_attachment_dnd.png Binary files differnew file mode 100644 index 000000000..cd794df43 --- /dev/null +++ b/src/main/res/drawable-xxxhdpi/ic_send_attachment_dnd.png diff --git a/src/main/res/drawable-xxxhdpi/ic_send_attachment_offline.png b/src/main/res/drawable-xxxhdpi/ic_send_attachment_offline.png Binary files differnew file mode 100644 index 000000000..33ab03551 --- /dev/null +++ b/src/main/res/drawable-xxxhdpi/ic_send_attachment_offline.png diff --git a/src/main/res/drawable-xxxhdpi/ic_send_attachment_offline_white.png b/src/main/res/drawable-xxxhdpi/ic_send_attachment_offline_white.png Binary files differnew file mode 100644 index 000000000..931168ec6 --- /dev/null +++ b/src/main/res/drawable-xxxhdpi/ic_send_attachment_offline_white.png diff --git a/src/main/res/drawable-xxxhdpi/ic_send_attachment_online.png b/src/main/res/drawable-xxxhdpi/ic_send_attachment_online.png Binary files differnew file mode 100644 index 000000000..50764c450 --- /dev/null +++ b/src/main/res/drawable-xxxhdpi/ic_send_attachment_online.png diff --git a/src/main/res/menu/choose_attachment.xml b/src/main/res/menu/choose_attachment.xml new file mode 100644 index 000000000..ae6f47a95 --- /dev/null +++ b/src/main/res/menu/choose_attachment.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + + <item + android:id="@+id/attach_choose_file" + android:icon="?attr/ic_attach_document" + android:title="@string/choose_file" /> + + <item + android:id="@+id/attach_choose_picture" + android:icon="?attr/ic_attach_photo" + android:title="@string/attach_choose_picture" /> + + <item + android:id="@+id/attach_take_picture" + android:icon="?attr/ic_attach_camera" + android:title="@string/attach_take_from_camera" /> + <item + android:id="@+id/attach_record_voice" + android:icon="?attr/ic_attach_record" + android:title="@string/attach_record_voice" /> + + <item + android:id="@+id/attach_location" + android:icon="?attr/ic_attach_location" + android:title="@string/send_location" /> +</menu> diff --git a/src/main/res/values/attrs.xml b/src/main/res/values/attrs.xml index b261ea28a..e89ed2944 100644 --- a/src/main/res/values/attrs.xml +++ b/src/main/res/values/attrs.xml @@ -36,6 +36,7 @@ <attr name="ic_send_photo_offline" format="reference" /> <attr name="ic_send_picture_offline" format="reference" /> <attr name="ic_send_text_offline" format="reference" /> + <attr name="ic_send_attachment_offline" format="reference" /> <attr name="ic_send_videocam_offline" format="reference" /> <attr name="ic_send_voice_offline" format="reference" /> diff --git a/src/main/res/values/themes.xml b/src/main/res/values/themes.xml index f1b66319f..c8a0a97a1 100644 --- a/src/main/res/values/themes.xml +++ b/src/main/res/values/themes.xml @@ -58,6 +58,9 @@ <item name="ic_send_picture_offline" type="reference">@drawable/ic_send_picture_offline </item> <item name="ic_send_text_offline" type="reference">@drawable/ic_send_text_offline</item> + <item name="ic_send_attachment_offline" type="reference"> + @drawable/ic_send_attachment_offline + </item> <item name="ic_send_videocam_offline" type="reference">@drawable/ic_send_videocam_offline </item> <item name="ic_send_voice_offline" type="reference">@drawable/ic_send_voice_offline</item> @@ -197,6 +200,9 @@ </item> <item name="ic_send_text_offline" type="reference">@drawable/ic_send_text_offline_white </item> + <item name="ic_send_attachment_offline" type="reference"> + @drawable/ic_send_attachment_offline_white + </item> <item name="ic_send_videocam_offline" type="reference"> @drawable/ic_send_videocam_offline_white </item> |