diff --git a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java index adbb09537..a27570704 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java @@ -3,8 +3,10 @@ package eu.siacs.conversations.ui; import android.annotation.TargetApi; import android.app.AlertDialog; import android.app.PendingIntent; +import android.content.ActivityNotFoundException; import android.content.Context; import android.content.DialogInterface; +import android.content.Intent; import android.content.IntentSender.SendIntentException; import android.os.Build; import android.os.Bundle; @@ -281,6 +283,9 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers quickEdit(mConversation.getName(),this.onSubjectEdited); } break; + case R.id.action_share: + share(); + break; case R.id.action_save_as_bookmark: saveAsBookmark(); break; @@ -308,6 +313,18 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers } } + private void share() { + Intent shareIntent = new Intent(); + shareIntent.setAction(Intent.ACTION_SEND); + shareIntent.putExtra(Intent.EXTRA_TEXT, getShareableUri()); + shareIntent.setType("text/plain"); + try { + startActivity(Intent.createChooser(shareIntent, getText(R.string.share_uri_with))); + } catch (ActivityNotFoundException e) { + Toast.makeText(this, R.string.no_application_to_share_uri, Toast.LENGTH_SHORT).show(); + } + } + @Override public boolean onPrepareOptionsMenu(Menu menu) { MenuItem menuItemSaveBookmark = menu.findItem(R.id.action_save_as_bookmark); diff --git a/src/main/res/drawable-hdpi/ic_action_share.png b/src/main/res/drawable-hdpi/ic_action_share.png new file mode 100644 index 000000000..a36464b8b Binary files /dev/null and b/src/main/res/drawable-hdpi/ic_action_share.png differ diff --git a/src/main/res/drawable-hdpi/ic_share_white_24dp.png b/src/main/res/drawable-hdpi/ic_share_white_24dp.png new file mode 100644 index 000000000..93b3c219c Binary files /dev/null and b/src/main/res/drawable-hdpi/ic_share_white_24dp.png differ diff --git a/src/main/res/drawable-mdpi/ic_action_share.png b/src/main/res/drawable-mdpi/ic_action_share.png new file mode 100644 index 000000000..7362f0d7b Binary files /dev/null and b/src/main/res/drawable-mdpi/ic_action_share.png differ diff --git a/src/main/res/drawable-mdpi/ic_share_white_24dp.png b/src/main/res/drawable-mdpi/ic_share_white_24dp.png new file mode 100644 index 000000000..4d0197223 Binary files /dev/null and b/src/main/res/drawable-mdpi/ic_share_white_24dp.png differ diff --git a/src/main/res/drawable-xhdpi/ic_action_share.png b/src/main/res/drawable-xhdpi/ic_action_share.png new file mode 100644 index 000000000..40771e480 Binary files /dev/null and b/src/main/res/drawable-xhdpi/ic_action_share.png differ diff --git a/src/main/res/drawable-xhdpi/ic_share_white_24dp.png b/src/main/res/drawable-xhdpi/ic_share_white_24dp.png new file mode 100644 index 000000000..dd536bca2 Binary files /dev/null and b/src/main/res/drawable-xhdpi/ic_share_white_24dp.png differ diff --git a/src/main/res/drawable-xxhdpi/ic_action_share.png b/src/main/res/drawable-xxhdpi/ic_action_share.png new file mode 100644 index 000000000..22ed428fc Binary files /dev/null and b/src/main/res/drawable-xxhdpi/ic_action_share.png differ diff --git a/src/main/res/drawable-xxhdpi/ic_share_white_24dp.png b/src/main/res/drawable-xxhdpi/ic_share_white_24dp.png new file mode 100644 index 000000000..9963c6a05 Binary files /dev/null and b/src/main/res/drawable-xxhdpi/ic_share_white_24dp.png differ diff --git a/src/main/res/drawable-xxxhdpi/ic_share_white_24dp.png b/src/main/res/drawable-xxxhdpi/ic_share_white_24dp.png new file mode 100644 index 000000000..bb521c141 Binary files /dev/null and b/src/main/res/drawable-xxxhdpi/ic_share_white_24dp.png differ diff --git a/src/main/res/menu/muc_details.xml b/src/main/res/menu/muc_details.xml index 51de4e753..ad79f5778 100644 --- a/src/main/res/menu/muc_details.xml +++ b/src/main/res/menu/muc_details.xml @@ -1,5 +1,5 @@ -