From b676bc7ca441eff92a12cc423a05e416fd411dc4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 5 Jun 2016 23:49:57 +0200 Subject: [PATCH] add a play outline on videos --- .../gallery/adapters/MediaAdapter.java | 9 +++++-- .../{medium_item.xml => photo_item.xml} | 1 + app/src/main/res/layout/video_item.xml | 22 ++++++++++++++++++ app/src/main/res/mipmap-hdpi/play_outline.png | Bin 0 -> 1023 bytes app/src/main/res/mipmap-mdpi/play_outline.png | Bin 0 -> 699 bytes .../main/res/mipmap-xhdpi/play_outline.png | Bin 0 -> 1379 bytes .../main/res/mipmap-xxhdpi/play_outline.png | Bin 0 -> 2145 bytes .../main/res/mipmap-xxxhdpi/play_outline.png | Bin 0 -> 2836 bytes app/src/main/res/values/dimens.xml | 1 + 9 files changed, 31 insertions(+), 2 deletions(-) rename app/src/main/res/layout/{medium_item.xml => photo_item.xml} (91%) create mode 100644 app/src/main/res/layout/video_item.xml create mode 100644 app/src/main/res/mipmap-hdpi/play_outline.png create mode 100644 app/src/main/res/mipmap-mdpi/play_outline.png create mode 100644 app/src/main/res/mipmap-xhdpi/play_outline.png create mode 100644 app/src/main/res/mipmap-xxhdpi/play_outline.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/play_outline.png diff --git a/app/src/main/java/com/simplemobiletools/gallery/adapters/MediaAdapter.java b/app/src/main/java/com/simplemobiletools/gallery/adapters/MediaAdapter.java index 6126da209..2677804af 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/adapters/MediaAdapter.java +++ b/app/src/main/java/com/simplemobiletools/gallery/adapters/MediaAdapter.java @@ -26,16 +26,21 @@ public class MediaAdapter extends BaseAdapter { @Override public View getView(int position, View view, ViewGroup parent) { + final Media medium = media.get(position); ViewHolder holder; if (view == null) { - view = inflater.inflate(R.layout.medium_item, parent, false); + int layout = R.layout.photo_item; + if (medium.getIsVideo()) { + layout = R.layout.video_item; + } + view = inflater.inflate(layout, parent, false); holder = new ViewHolder(view); view.setTag(holder); } else { holder = (ViewHolder) view.getTag(); } - final String path = media.get(position).getPath(); + final String path = medium.getPath(); Glide.with(context).load(path).placeholder(R.color.tmb_background).centerCrop().crossFade().into(holder.photoThumbnail); return view; diff --git a/app/src/main/res/layout/medium_item.xml b/app/src/main/res/layout/photo_item.xml similarity index 91% rename from app/src/main/res/layout/medium_item.xml rename to app/src/main/res/layout/photo_item.xml index 3f4b67b5c..d18d298a4 100644 --- a/app/src/main/res/layout/medium_item.xml +++ b/app/src/main/res/layout/photo_item.xml @@ -1,5 +1,6 @@ + + + + + + + diff --git a/app/src/main/res/mipmap-hdpi/play_outline.png b/app/src/main/res/mipmap-hdpi/play_outline.png new file mode 100644 index 0000000000000000000000000000000000000000..6e1b578c54d13ceabffc2d6f49a383bc73605988 GIT binary patch literal 1023 zcmV0zV6u|K(L}#j#NlM5x;x=T{UGWVyM6uO@Y=mavGW`M?Mv;Vk1VIByAc4}n(2A*U z3=>39h#Cx`NLT5qBxa@2VKTTVm^*|2F3)|K+?O-=N$FyK=L`Jd+ugiT!=ubL>nt$F6^>#W8-sqjxydRXVfJ`Mfo~2z=pxJ1h^tDG{(}p;#A_O{ z$_4j9$N8Nk?sLp#&^11hRE0q|L1|{#-wqELCQlEYq)5?84|#@JdAN#x|i1x`yp%S}_Uc5VP2R)C3*p6LyYqFm_Uf z?)X8A*vo2l64Xi&zhC19UBbSUvlvIy!6ttF@q%6>ywE%ATXoV&YKWI{f-d5B2NN>? z@RK@e9KXKkpk>6nh{qtnyz=cZ%MM~GDyW+pqJW7Eg1?ljyN#%l3lF-9D3gg5gmQIl z>>_T22dyF|F)@R*tD8o=2n)*KAx^1+G^;y{_{@>upgdv+qYF~3u7wifa&XWX;(w^yq^WtLsH<1qYQ8o%$ff>bel6 z;2;l?(g!J4mqzUUmqA0xg50ibBl*f)Uet5RFKU;!{ZNA2-uZ)ZL-}BwjrY^Bs1J%< zmCPf=NN~^<#0OQ7tV;jm`a^KgQ9Q(HWzdHE*AK%h#FQ#1dQ~zrh!sp&Pyw;4c!eEO zz2;XC*P~wYtB6}sL5fw$j37L^!h;M&#QX5?U5Zu7wDS@17!wuLkKbKP@F-R#GlAc^ z=pe%?qRI)Ue@dUBW?#^8f-c~N^RHaXc)&Kcffd&*&b zkRi((Y*og|Dj$Or)Uf?Qrs1Q7x+K`)Hf=F~vqt#{bva#04qvi7r`|5poTVk?jylH- z73w`Dlk|8h#U%SH@sI)o^wLF|G+p#EK!Hb;*xx-4yE(ucq(V|DvGR literal 0 HcmV?d00001 diff --git a/app/src/main/res/mipmap-mdpi/play_outline.png b/app/src/main/res/mipmap-mdpi/play_outline.png new file mode 100644 index 0000000000000000000000000000000000000000..615b80d08543f8285c7ac5ffd66435bf0da1b7ff GIT binary patch literal 699 zcmV;s0!00ZP)9ER~}Ocb>nNr>2151>$#LL?rDP#4l7hMYi)F$bWnTZ;s2>AO;FAR7@pi(*JO z#wdzz)U=@XHOb~`;O1G)$1@Y!MZw>_4PNj!84~BgzknDs6sb_7NvFFeH7YEVC5B_0 z?FAF8ae<$6-ZS2NAk8KnY}%Aa^%9up2Vpgtixx=m8Ic>dSR_M|{_av_$g#~WA|>Ks z14Ha%z#$6^;{Ccs>KL%cP?$i1eT@HkOB^R)36{7AlOS#ne8Q;n0>?fkX<(FWfq9H? zq;W!Slmm=cL4hCF$h139M7D5( z0+v(lAO&}zf-D9HET_sNWp|*4WP$^hQ)Q8=JJ3Xu!2!#u(#VxN&_Vix1C~<_AniXD zcpW~_L{gyxwP+`b`cM86^`Bfpa`u2u6ZLJnjBHy2I*s?fB1`T-7P<9)6j)B9J?0L{ zcs=aSgFefy(*zyp)azmA@Byil@CpQ+M(gJoS;6rNjMD*gLDzy#qZN@BPuu~mgxoWU z6LBwTA?rAPffP-o!6;6Ijd6lpGU6T3<}eN-B*v&>%-X(ql`tAig*?s)#z!1mAkH4f zJp~e$cTSNO#x8x~zWgd7N8}jx`B>#S28>+>!+w2_Q$pmH9r9#JGtga{EP2Y@Vdyx0 z(SCr;aZOm4%=YpVD#-?IY+9@{()*9VXRLCDpHo)!skHK+2t{RV2URfJy|Ab$V=002ovPDHLkV1oZnH8lVL literal 0 HcmV?d00001 diff --git a/app/src/main/res/mipmap-xhdpi/play_outline.png b/app/src/main/res/mipmap-xhdpi/play_outline.png new file mode 100644 index 0000000000000000000000000000000000000000..516f6432693ac6d89901a2c9a0e76baa01045808 GIT binary patch literal 1379 zcmV-p1)TbcP)y%WEavn41Afhq;gFm$1qB5K1qI<@ z9`ziggS+%G$_J*H;sc}fafeGBq@F5Fm}dy*N@?H%0|e1eJ6lQ2lz<}Y>Eb=ECh257 zMbjHlPLd%s25F{jdIAz0;Vof!O)K$y2Q=}FFb&g~zko&DCJNmw%tyd3CWuOkrf36V z{1IRbowTxm||j7vx+SoqLZiixj;!&0rU8q?9$w0549MdTg*Os_>#YMY}V#CI6|v4+Q4hEy3wKrG9T?qw2~kgkktcr}I*2yX{zY~8sAG?A$p6Y(7& zQ)4ax37%oQjLF0OiEWs;d%$6Ak4WStpqv40`&|Rdd4n_+@YmLF#MKGklSX<)sarr2 zTN@_O!9$j-6WX!ubqOeD26U*$AJR%ifPPA=?RfuyQKV``fPPBzkzV=- zd_amR0`yagBTf1TOd%C30`yZVM*2L{0)9~hO#6f$1ej35PM$eG#2r!n5ceUiau3i? zNAody2Wd;_0S^?v$Zq-vTtYhJ7NDPwxMN7?BY&9FPe;f&Ziw*N)WV7NDDsxcf+L!2-4-rCmm(n~u0; z*fs$|Lo>E>K?9W2@qVCz-58gEGF~I4S%dMvT&E*$Ew)h- zZUKf?Y>z3!-+5!P#$wLHg5ns(+YpLsg)_Kcb^ zUwmDbB>_?#XHJd}%qJMf+f$Z?{pxWoPatc=X})#*YwHZ-WYbSg6fb{Q(aV?gk__-1 zx`Gz&^Cdl0MD_Z8377Emf-a8Iz-s0brJ{_QMkc^{Cx?ikzv9#$hLfc4J*z8UJ-^-lEkLxi*Tjv?SeYUq!6rD(`SL z!4-aB)=c>_Xq-))+*+~&F lGp`V!zd}GEpb$_9_#bazb~6%eta1PV002ovPDHLkV1nTeaFqZ6 literal 0 HcmV?d00001 diff --git a/app/src/main/res/mipmap-xxhdpi/play_outline.png b/app/src/main/res/mipmap-xxhdpi/play_outline.png new file mode 100644 index 0000000000000000000000000000000000000000..0311f899dd60c1856b10b4af459409309444aad9 GIT binary patch literal 2145 zcmV-n2%h(eP)4O>k|04P4={^H zR0aP#;guS6}b11-zrxUTURjDxM=dLD=N zoXbEBq{(GJQ!tJ;l^${#rQTJbI6ypbEZJ3DeHDu?A=>=MiY(FN#JA`b7R-iaPBDv=K zBWV{^4gyW%29kbaI)Pe{`Ts%#{>NMgiCU2@*9p{z&@Ln&U=#wmIJGV$JBkfd&2QL^QL7Qi$*Ij`9J^8OFD}qVBpn!y zK#opr2a*lN1^ODh2_Dl45Ag&k4;i)C~6}v6|0`*|G2cs9r>8b6*?ts5QgV=4*4CM6G+OfOjC(slmb2I}v zJ+*mACKVoNDR#reGy^$3wHPDVH5VSJP5ur=Gmzs`JA>WY!UMgH-FDqTj!&%vyKRLB z+JoI@-9U~{?G5a97ar&&b}MxQIX<;j*qtamP(OAHbOSj)wI=K?6dq_0yIHz{9G}{3 z>;?)Cl*F!DH<05~n}Xd?;el>qSE(Dw@u^i|mo7X|7Q2LQAjhYcz%FyQ26{QXK+!+3 zi{YMF61xW?5@=_bKcu7oYyRc%f6ez}*BE-Bi_!Rt;+GNqsIfDUj~bsB9_SPK`&*4U zI4#@W)cdgdmb0%r^iNCP`+8q@v|;y+ejxSJlGmsAh1nA9lKNk{Dxa3TI4SHF6&`3Z zlDYbUR8LFZlbT=J8!iX>@1otFmiIr#xTO2w@KgOjs;4EdTlc}?R_umI=m(NcOL1ik z>ppsJMzUBvkZ@Y6dm2fjzd#kFuzOb{kiu!{Jn|W)%wHh+r_fc()B*{orM_~mW7m!G z8>k)03tEAM)6!oHlJ))r{hlm#N3{Y8r=`Eou*)#je<1ns;RKIs1QJe5e}6=B98*l7 zSCD+D5lA>K{dLI)R$QP-q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KKm9IU&rtP$6yqwzg0nXBuA59C** zwVu3v8IN-icJRE{CeaLE^&zQj2|XEroT6pS*}Vb7CV!TWZS{B*>hA4WQ@r8UuS%}W z7*irCBD(-9mHm^{5q_Xqe>3%4HF4*?%yJ6&h+Ci61xEJAldobwtV@1p_FTjjSGe!I9<_LJ-wl-3mMpVPH$QNXrD)0dz`8AQ3l!_0 zi5rn-j+cu)N85-l%a9gtjD5biU>Txe%#LIBjo^v<&i*#<+D?f3%SpJxQV7)v!KMsz kTWBoE0t7=)fd5l0U|9-H=YsoR{@G^jZCtGDto#!H3-tvgssI20 literal 0 HcmV?d00001 diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 58495b016..986f5b7ac 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -2,5 +2,6 @@ 16dp 150dp 100dp + 40dp 8dp