From c3420aa74804a4f023562c72726d67a7991a57cb Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 9 Jul 2016 21:15:05 +0200 Subject: [PATCH] add a button to open the Camera, closes #4 - added it only to the main screen with the directories, as adding it in the specific album might be confusing. People could think that the photo will be saved in that album --- .../gallery/activities/MainActivity.java | 12 +++++++++--- .../{directories_menu.xml => directories_cab.xml} | 0 app/src/main/res/menu/{menu.xml => menu_main.xml} | 5 +++++ app/src/main/res/mipmap-hdpi/camera.png | Bin 0 -> 364 bytes app/src/main/res/mipmap-mdpi/camera.png | Bin 0 -> 240 bytes app/src/main/res/mipmap-xhdpi/camera.png | Bin 0 -> 446 bytes app/src/main/res/mipmap-xxhdpi/camera.png | Bin 0 -> 666 bytes app/src/main/res/mipmap-xxxhdpi/camera.png | Bin 0 -> 894 bytes app/src/main/res/values/strings.xml | 1 + 9 files changed, 15 insertions(+), 3 deletions(-) rename app/src/main/res/menu/{directories_menu.xml => directories_cab.xml} (100%) rename app/src/main/res/menu/{menu.xml => menu_main.xml} (63%) create mode 100644 app/src/main/res/mipmap-hdpi/camera.png create mode 100644 app/src/main/res/mipmap-mdpi/camera.png create mode 100644 app/src/main/res/mipmap-xhdpi/camera.png create mode 100644 app/src/main/res/mipmap-xxhdpi/camera.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/camera.png diff --git a/app/src/main/java/com/simplemobiletools/gallery/activities/MainActivity.java b/app/src/main/java/com/simplemobiletools/gallery/activities/MainActivity.java index d33e9446e..06062033c 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/activities/MainActivity.java +++ b/app/src/main/java/com/simplemobiletools/gallery/activities/MainActivity.java @@ -90,17 +90,23 @@ public class MainActivity extends AppCompatActivity if (mIsThirdPartyIntent) return false; - getMenuInflater().inflate(R.menu.menu, menu); + getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { - case R.id.about: + case R.id.camera: { + final Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); + startActivity(intent); + return true; + } + case R.id.about: { final Intent intent = new Intent(getApplicationContext(), AboutActivity.class); startActivity(intent); return true; + } default: return super.onOptionsItemSelected(item); } @@ -473,7 +479,7 @@ public class MainActivity extends AppCompatActivity @Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { final MenuInflater inflater = mode.getMenuInflater(); - inflater.inflate(R.menu.directories_menu, menu); + inflater.inflate(R.menu.directories_cab, menu); mActionMode = mode; return true; } diff --git a/app/src/main/res/menu/directories_menu.xml b/app/src/main/res/menu/directories_cab.xml similarity index 100% rename from app/src/main/res/menu/directories_menu.xml rename to app/src/main/res/menu/directories_cab.xml diff --git a/app/src/main/res/menu/menu.xml b/app/src/main/res/menu/menu_main.xml similarity index 63% rename from app/src/main/res/menu/menu.xml rename to app/src/main/res/menu/menu_main.xml index 0cce6d24e..d7f577285 100644 --- a/app/src/main/res/menu/menu.xml +++ b/app/src/main/res/menu/menu_main.xml @@ -1,6 +1,11 @@ + S{uX;NkkS)#&21u+#OWT?<*8xnfup2(UyYu`|TWayHRle3^B=LUseC>Hz3 z2?03L6F2Y)Y1vJelVK0EWmn2Ql$Ly?Q}HYJ&`ey8O(uTi9vWT@jom{_aSLoF;#2pK zl4W-|8up!*EPLl3g1*=uhfkRYaWVLWw$#P9nUaw)p(W=g$}a?K8bsDKc?-L=1LM-h zsPJb*v0}uSlpQ7f(8IPT6#ZR~|J)2!gMLSvx$!&t+WdOxKlA~ZoD~H=l;~Ih0000< KMNUMnLSTYiKb+YB literal 0 HcmV?d00001 diff --git a/app/src/main/res/mipmap-mdpi/camera.png b/app/src/main/res/mipmap-mdpi/camera.png new file mode 100644 index 0000000000000000000000000000000000000000..e830522008b0a1b1f39fdde1156ff1bae3f955e5 GIT binary patch literal 240 zcmVHkAXPXi!ebT=lL4K1x)6Wg_MY91 zzt7rrmFO;X_oUmq$FIPH+E8b!7Su|rTTt3JU}I)<+1$1SJPXOxL=vhYuo3Q@z)==< z{b1(CNz*~H=m#TH*Ja}&F!>pnOOBdeCCh%W6|%$U`K_?;2UJ3mWl4Bp2(Ys-zHDi) q+wWiFtfaRVtkebP_bn*je*_=o)*|^)1w=Uj0000S3bFt5nS?tU*5U+ zuRv$a3fXL!qPq!nmZ-`S-6wEv!Im}!G@?dn#;*=rm4ZHT$3Hy5 zK#ky=d(UOmFsQV^o<2gJx=}eIwnA3W7xau83lN!8vECcV2)4w<^v@2~67MD11sAjh ztGUt}LA${P1=0J3E1eNGc`3L+Gf5t=WKEt5E{OV^X;qWQ4p$&rl*20-lc(iB^4yia zijQ0lF6anWaiv8;dol|xA!y6No&?ck78<-*{Fa&B9E#TSq3mYYuttQ*QZ*_=*n0M$ zV!JjJ9`z`_U5gAzIwsc`sys4xbSaS{W>lIoJ$6TM=qna%_I>f1qB5iXUVh&=cfY<* oSSx7G$evyZ)YnOH5*(G_7e~OF#v^w+0000007*qoM6N<$g3E)#tN;K2 literal 0 HcmV?d00001 diff --git a/app/src/main/res/mipmap-xxhdpi/camera.png b/app/src/main/res/mipmap-xxhdpi/camera.png new file mode 100644 index 0000000000000000000000000000000000000000..c8e69dcebb98d43695027fcc7e39a339c84dda51 GIT binary patch literal 666 zcmV;L0%iS)P)y zDuP#FBS9M!QcYr?x(Xj5^OKhEOrZ0;%Xt?M^PS1$oUvkJVg?bG2*VOq|FP&lUkJx< zKARBwK%20%c&{z=j$iacgSVPOZ>ZBRKY6Vs^pYxn!v)X(MaU+{KDTId#}NxSK|*6x zFv$sHenK`COmmFwEtDe)3f@BdM8ToA&@EBW@D_@SSjd>rJ=jul4hPAn$ZYd zQ(^?GM-r@1H!ZY@i{+CPWphGpzG8()mbM9@HXpGBsG>9Ms~`YLf6Qp{EBmWamEC4dDr!XN=Tg=UR*LRnyXqu_l$^Po#V$T zj`&?_>IiL%W{Dt*qP?plloe0b6+u)P>h$wELg`L#hA>QZ`WYP|H+WzkLrdxi*`3}7 zVOSR<9(Dx^Vxd?l7V1BL0REY1s|}3R@&Et;07*qoM6N<$f_%9k Avj6}9 literal 0 HcmV?d00001 diff --git a/app/src/main/res/mipmap-xxxhdpi/camera.png b/app/src/main/res/mipmap-xxxhdpi/camera.png new file mode 100644 index 0000000000000000000000000000000000000000..777658e95515ca47c9852d00621e2e6d45abc5c7 GIT binary patch literal 894 zcmV-^1A+XBP)zI9LJx5Cecy~F=}h8lwKtS@9n)MRxm2`AkqpItJs@p>)C(tu-V-#=CId=UD(s^ z#Zy@d`v;fOn~Tzu?OJHHNtIePI-lk`KN@Bx3G-g)`+Uz|m=FBkykXu`7K_DVu`~_~ z1Z4r$j3}CsFA0vr7p4ddb45K=_{;=>kNJmsIpZVU0%^)LLWz`4fe-nOMmgjIT>|g$ zGtFS1ZXE(|^ApYDN8W0_z#v8Txj;7;?6E~Um_R#sF$;$xalZoX{D6r(A?{D$E~c{O zM_>?haY%a$6fv1Q-U9oW%qwq!3ryzRTflV87q9|W;F{;GFv0){qSYiAAj>K*xHezl zfJJ&yHS#`7{A#YiA58NG$|F%`I5JV-9to7sbaLM;flIzZ1Lw!X3#^Fu{wYByi=R|$;R}qoTB8JI$kiVUUtqx1 zx=B!Su6`5*yii_yR9b4GhtSXus6)G54OU*Fzb<9Fuf)`*nQG!IEfB;+M}w za~X69{6e&@G0KTnj6*#FFeADVZuofoh-l4&E`cLDWuFO3wP#-rPc_|?^a;Rylnh;L z@)wd48zfOOJOnKQa*Rac43Xn8&v?osa%9ANUyhGPfeM+%FRSSkfU`OkhV}j2l~kBT z1bVSYwP7Nn+I` zNiohkFLCTaw-vAgjq*RZ@U(}??0O4qVKTS91=2W}ibKjn!0?Ng1(Y9wI8QKExtension File deleted Setting wallpaper + Open camera 1 folder deleted