From 3e654bea0e26616b11166a37bbf7822aef25d2f0 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 12 Apr 2016 18:30:02 +0200 Subject: [PATCH] added share uri button to conference details --- .../ui/ConferenceDetailsActivity.java | 17 +++++++++ .../res/drawable-hdpi/ic_action_share.png | Bin 0 -> 513 bytes .../res/drawable-hdpi/ic_share_white_24dp.png | Bin 0 -> 506 bytes .../res/drawable-mdpi/ic_action_share.png | Bin 0 -> 383 bytes .../res/drawable-mdpi/ic_share_white_24dp.png | Bin 0 -> 361 bytes .../res/drawable-xhdpi/ic_action_share.png | Bin 0 -> 666 bytes .../drawable-xhdpi/ic_share_white_24dp.png | Bin 0 -> 625 bytes .../res/drawable-xxhdpi/ic_action_share.png | Bin 0 -> 969 bytes .../drawable-xxhdpi/ic_share_white_24dp.png | Bin 0 -> 857 bytes .../drawable-xxxhdpi/ic_share_white_24dp.png | Bin 0 -> 1115 bytes src/main/res/menu/muc_details.xml | 35 +++++++++++------- src/main/res/values-v21/themes.xml | 1 + src/main/res/values/attrs.xml | 1 + src/main/res/values/strings.xml | 2 + src/main/res/values/themes.xml | 1 + 15 files changed, 43 insertions(+), 14 deletions(-) create mode 100644 src/main/res/drawable-hdpi/ic_action_share.png create mode 100644 src/main/res/drawable-hdpi/ic_share_white_24dp.png create mode 100644 src/main/res/drawable-mdpi/ic_action_share.png create mode 100644 src/main/res/drawable-mdpi/ic_share_white_24dp.png create mode 100644 src/main/res/drawable-xhdpi/ic_action_share.png create mode 100644 src/main/res/drawable-xhdpi/ic_share_white_24dp.png create mode 100644 src/main/res/drawable-xxhdpi/ic_action_share.png create mode 100644 src/main/res/drawable-xxhdpi/ic_share_white_24dp.png create mode 100644 src/main/res/drawable-xxxhdpi/ic_share_white_24dp.png 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 0000000000000000000000000000000000000000..a36464b8be84a614d4028bc961946d97dd034153 GIT binary patch literal 513 zcmV+c0{;DpP)kD}CM1E~S9+A?v^KPd>Kxvry zq{o0E>6?oso=gDc{MqtZnBRxFh}(8zmvvjtO+FMa^eX`_%U(vyD6c(n&_%q6Wig-tEji(P!B500000NkvXXu0mjf DWWe0) literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..93b3c219c61edca29f27448b44abcadd19d150f5 GIT binary patch literal 506 zcmV004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00DAIL_t(Y$KBSwOF~f?$MGvhEfLnz%Mg(uv4b?voL8;W-V5<<8v;}RYmW0*)ww&bRG3Y!w`JDZ8I4{rd z91E*C!)gI2%oPXSt&)I$kx73r2iQR-_&25o83rUde_r$Ni+ki(6} zybv&h1~|b5pu~sg)D}!mt%D890Jt2|i$jJtUP&`He4o#bhxO*PvAyG@(IxW@W*a zX|UPngv_A;=^AiGf+_%25_FkIt-~7YjA3CB;zF@cL`^PaqcO*w!m^4NhkrY96|gSH z^b;h>J$aH0n}>fNM=D0jp42X4OTynKtDR{9zbtCEH7eY!S0o~XrZs3v2DR}}*F=8l wlWkM1G0)!cHUC5maX^k7`wX_)|LB+T4Qk>8==b5JP5=M^07*qoM6N<$g5_(>C;$Ke literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..7362f0d7b0feeaf36ad4fe0c3786318dff2c3bfe GIT binary patch literal 383 zcmV-_0f7FAP)F4>9Wc_u(EtDcO93e# zDEB!dBjaYeIRI$6FOaH76TSt+=|G2krl|vfmh%FsO+d_xMS2U+0S&ZvfCG@~!5Q3) zj3($}OjM2mUQ#tMQ916@@F+P;lSBx#*cfWDF)Y;su_T(Z&(K78i)s!4TC4`7ijgb^ z`EVA{lC#jz@Ii9WGHjOPbpSL)gA8$i8nPK`xD?dK$QI1Pm)A)yh@ifki6v1TfI0{k ztbOEKOvnK}NER_*iO=OAjICgymIKb<(bGt&uPM!jpQ%}J4B99d*hGkw4I`oXoW9wR z$_3G9sQ4|aI$*$yVmy_RB(BN`=zw%uw+FDbhUnTJ_)L$2h=D+zkINBThJT}!oM!nb d7zF?U1^|S5kOI@4ht>c9002ovPDHLkV1k^Vo*@7L literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..4d01972233f0368a60ae8bf0c41d6b09246ab81a GIT binary patch literal 361 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_*1g=CK)Uj~LMH3o);76yi2K%s^g z3=E|P3=FRl7#OT(FffQ0%-I!a1C(G&@^*J&_}|`tWO=~G=WkMH z(9^{+#NzbYE2p^_6D5v)l;qZtnRX&qPS>I}=|_b$&o;IO zecnF7aQ4i~so$gjzpCV~-u>DvF*){ehfu{^<7w~jwexD z!_|(6O+=Ux*Z_M?@(N0<#N_5P$G!gmmyO}H0OoCd*#VD3&vRXXmF2vJF9IxwUchw$ zipdIqNzc}Dx^@_xJ4!t2NP4=EkrMzz-ZR*`=dChGguclLfW)JgcweJ8YfOl`plX8D zWc~Sw#1~lD>{`NB4tDtSCXBC8gk_shF!n&A7y>epF7cK#B5WLZ1&pspsRr?Ze!b9D zgkXvqwRo{W;>A6kAuUMnq#0#PP)#yHQ$@S6+P4DNAvSw}rF{ zJ$@7;LJmM)r)F2gGvNTF0eR)k50gTpC8TAx2i6cU34@y+FddOg;>9BE+dM7eibQyVej<(dLazL!^fYrY*5+ zuMw@5SVM?gH$@Xt0yKoURa-nICqUyJ@B3loN%z};bH$K~0$?%b5tZd_cI2x;42QN! zQb1k+L^$*Ut_x62U4XA11(z2BoQ9s~v;Y{&a>Hq*Nrg$FCzuNTwwl`diBD&Mz#=CW z-Tw=z12gvSSJ?|$;!S^+W-u5G27|$vEPezS0Ffm2y!BjF4FCWD07*qoM6N<$g0})1 A$p8QV literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..dd536bca2db25dbc5ac58808858f540db25b2901 GIT binary patch literal 625 zcmV-%0*?KOP)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00HSqL_t(o!|j(bXcJKw$1la^5}|YwThWSxf}1#G5D@~+ zATExbibJ;sY&CImbJD4EOHwJJ&DNz|Iy#t`gm`I5MWKTfT5u4JwOT^^b7(oL&yXB_ucf9+*|M&kKoM<2C91uMq$qQO^>Ee+iAq}|BC)8?lO%jk~lW=X|$^mld zYFZA^)B+lEfWKP6pQr)*Qh@vX)B-+80Isr#sj{{JmzV4r+c)XA13YHSZ+6HmA4Bbj zZ7$kv)|6)NxPwESELHaC@Se%w*PjhA$P8V-`8H#=W*1Z5`ebHm22M?&_sPKhJMD@X0-L4vkXem|Jvg6+V0ZfJhU9G4^}n%*71b609) z>dou7+)R!f&@dcPN(%7Q@RN^t%a8=XrDc?9hdgonTyzC5hm(p+pOh5*dl` z`;gB8`7Q-SQ4Yu7UbNj$&Jb7t7G=WkWr~V?gO!#FUMaq60Y$m!=xG7Z zg{%|+000000000000000070NZ!C#zCr#rgLF8G01_+>#n_u6On+vc8iPx7CniZVI@;+GZ+ zEGB+;Swu0(xlM=Bz#%6WW5mK)9VzjpA-=Tet?Z}w-??qmWqZOcINcr2in~xa2oA%sWt1G>ghjDAOfH9FxZArYi ze~wZBae(JO|-If z89CVs(6i_FSpeM(DPzM_fc!E5`McDJ7ZX6a?J!F!qzo>AhkZ6thm=E%fXc%&9f>tn$M0c;}{56@Ilc>7{f(8*7^`Z@bSE zMR|{6Vq3~cgb2Mc>r?Vzj_3urm}f$6O>B&f1_Jy`95&~UL`_DrwP*VC(S)SFFq05D`2(AL|4dam9@>0IsVt-PW+tW>9X6ImHD^(rC3motQhrva_D@;ZtM(~&T r000000000000000000mOe*_o+wkw8z3EcqJ00000NkvXXu0mjfg|(hV literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..9963c6a056186240454290d419181c9bc3ddbbd8 GIT binary patch literal 857 zcmV-f1E&0mP)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00PlTL_t(&-tC${OcP-k#%W{ApinwEF!~3iVRJD~h9H6s z>TV1Wg;@t9CL~Qri~}0n%hI#mbufmS5X1<7DNGt@O2_rBlvJkMPnb=7s$)qrY1HK2nZ0pes>roa|Ur0MY&sGavz);ux4fI8Vg zRqJ&40o3k+vx^jy1_~%%R(Z`y1I5u*w=7Ub3*^WGEo*^tvOonb(55WVcC`V0)dDTb z0fo7@&l*&$loU{}!P5cgk^nlxOU&x6{e`iS#|E>tTX|aT0tL9q57%wq@yi3}g5Aya zJRe*){mu;noaT+f{Eaht9~CC+DQA;=)Bin%#! z*9Lis^EE!X&VA#$ZC}=IurU_L`vFI78%3Qs->YYwkZ`VXBbd)zl(NzpgN^a_|Bm-T zfb`;gK{jmoCvk2QXsg!D{oBL?2CUp5v_X@MqWfu^-USy`Z|Y6Eh#KuKAkAuUj!EKpQ4XTNEb z{^mNmFVKkmN8qqR1{Z5a9aq@?Odj>vTxV$V>qmkR3Gx-aGvXcQ$o$a}p`Qt|WJ%Je jYUSGBF*TqXklgVXi6sx9(T=+a00000NkvXXu0mjfFsOg; literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..bb521c141bfc1d6ca7aba0f34ab4638f86b0bbe0 GIT binary patch literal 1115 zcmV-h1f=_kP)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00YxWL_t(|+U=T6NK{c2$0tLAs7!;*Ce4rNgBERSQ>&y% zT9k{ZML7~wv?wGi`j8;q^dTX(X_JXjW+YOXktu>MYEvtr(vmRBzOXViQ=9pu_vF6Z$$zu~_BJ?GrN51+f2&jauPJOB^C0~oVnh;b*tG74#-8-Q+FIL%V` z04(7)A;w3D8q(bWu$v#KqMv|tfD=TDW0C=Ki6(YR1xTkqDu6x~%LJ$<+NhEUkRC>P zR1qXq9zX#maakFqcw>4bvaSF9RTkeSF3|%4L)i>v)Ql_{sw30sK^AEka~FT~5!SfIdZfA0m`= zLH0Y{&}7r0NN#{aW|GYpW%^&(>TFB7f``iFsz=+DB+A0*(h!$Pbh4?BqeLl}t*jsS zbP{>orGs92c*$)J>ONfi0b~J@OQ#A3BAR#`{#K{S5_7+}g<#D0IS({)ndR}smxS(tgTgi0#e&A@tN~L>hBAPev;uI`Lh`oB zr8z(vLBr$+D6&s3%>hmtrf;)cngcW#rQaa$nzd_k22aibn9VMS+zv1(58#~ispHUuOP?%WD9em<_Q~sHzATo*%I(%gz#e&>>=!0dru^(5v&J2^ z%QZY!YF2qPGk@o8m(vI+8=@YLOs2frrw=-LZDVtoA;KOmQbi@D>?KWx@l_|Ubz`ip zn`oZ!drNd@i2aAXPF~M5o4MRlLe`KV!8fXt*Z0by{7AHuBEvVTlUIGT5ii9zs+L!M z+>&E_)ybf}`wP1207I(ZF$f+x$foD~@%^(Rqzz0E}Fx%Lq7af2-n hzyt6AJb?cK;5XZ0#A>dCZ#Dn`002ovPDHLkV1hi5?Gyk2 literal 0 HcmV?d00001 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 @@ - + + + + android:showAsAction="never" + android:title="@string/show_qr_code"/> + android:showAsAction="never" + android:title="@string/save_as_bookmark"/> - + android:showAsAction="never" + android:title="@string/delete_bookmark"/> + @drawable/ic_lock_open_white_24dp @drawable/ic_settings_grey600_24dp @drawable/ic_import_export_white_24dp + @drawable/ic_share_white_24dp diff --git a/src/main/res/values/attrs.xml b/src/main/res/values/attrs.xml index d471e54ac..901ea7547 100644 --- a/src/main/res/values/attrs.xml +++ b/src/main/res/values/attrs.xml @@ -24,6 +24,7 @@ + \ No newline at end of file diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index e9e997305..97ba18afc 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -612,4 +612,6 @@ Select image and crop You have disabled this account Security error: Invalid file access + No application found to share URI + Share URI with… diff --git a/src/main/res/values/themes.xml b/src/main/res/values/themes.xml index 0f8b95bb1..424db4c92 100644 --- a/src/main/res/values/themes.xml +++ b/src/main/res/values/themes.xml @@ -30,6 +30,7 @@ @drawable/ic_action_secure @drawable/ic_action_settings @drawable/ic_stat_communication_import_export + @drawable/ic_action_share