From da1dfa32d0dd56c8c9b4667ebd75d847329285b6 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Wed, 26 Apr 2017 22:34:49 -0700 Subject: [PATCH] Creating a custom drawable to customize shadow. > Fixing DrapTargetBar set to visible (with alpha = 0) in the start causing unnecessary draw Bug: 37616877 Change-Id: Iaaff96099910f504f6e2f81c9376ddacde50ff6a --- proguard.flags | 4 + res/drawable-hdpi/ic_info_launcher.png | Bin 1372 -> 0 bytes res/drawable-hdpi/ic_remove_launcher.png | Bin 832 -> 0 bytes res/drawable-hdpi/ic_uninstall_launcher.png | Bin 552 -> 0 bytes res/drawable-mdpi/ic_info_launcher.png | Bin 689 -> 0 bytes res/drawable-mdpi/ic_remove_launcher.png | Bin 473 -> 0 bytes res/drawable-mdpi/ic_uninstall_launcher.png | Bin 378 -> 0 bytes res/drawable-v24/ic_info_shadow.xml | 18 ++ res/drawable-v24/ic_remove_shadow.xml | 18 ++ res/drawable-v24/ic_uninstall_shadow.xml | 18 ++ res/drawable-xhdpi/ic_info_launcher.png | Bin 2056 -> 0 bytes res/drawable-xhdpi/ic_remove_launcher.png | Bin 965 -> 0 bytes res/drawable-xhdpi/ic_uninstall_launcher.png | Bin 730 -> 0 bytes res/drawable-xxhdpi/ic_info_launcher.png | Bin 3596 -> 0 bytes res/drawable-xxhdpi/ic_remove_launcher.png | Bin 1694 -> 0 bytes res/drawable-xxhdpi/ic_uninstall_launcher.png | Bin 1058 -> 0 bytes res/drawable-xxxhdpi/ic_info_launcher.png | Bin 3276 -> 0 bytes res/drawable-xxxhdpi/ic_remove_launcher.png | Bin 1726 -> 0 bytes .../ic_uninstall_launcher.png | Bin 1042 -> 0 bytes res/drawable/ic_info_no_shadow.xml | 5 +- res/drawable/ic_remove_no_shadow.xml | 25 +++ res/drawable/ic_uninstall_no_shadow.xml | 25 +++ res/layout/drop_target_bar_horz.xml | 1 + res/layout/drop_target_bar_vert.xml | 1 + res/values/attrs.xml | 6 +- res/values/dimens.xml | 1 + res/values/drawables.xml | 20 ++ .../android/launcher3/DeleteDropTarget.java | 2 +- src/com/android/launcher3/InfoDropTarget.java | 6 +- .../launcher3/UninstallDropTarget.java | 7 +- .../launcher3/graphics/ShadowDrawable.java | 191 ++++++++++++++++++ 31 files changed, 338 insertions(+), 10 deletions(-) delete mode 100644 res/drawable-hdpi/ic_info_launcher.png delete mode 100644 res/drawable-hdpi/ic_remove_launcher.png delete mode 100644 res/drawable-hdpi/ic_uninstall_launcher.png delete mode 100644 res/drawable-mdpi/ic_info_launcher.png delete mode 100644 res/drawable-mdpi/ic_remove_launcher.png delete mode 100644 res/drawable-mdpi/ic_uninstall_launcher.png create mode 100644 res/drawable-v24/ic_info_shadow.xml create mode 100644 res/drawable-v24/ic_remove_shadow.xml create mode 100644 res/drawable-v24/ic_uninstall_shadow.xml delete mode 100644 res/drawable-xhdpi/ic_info_launcher.png delete mode 100644 res/drawable-xhdpi/ic_remove_launcher.png delete mode 100644 res/drawable-xhdpi/ic_uninstall_launcher.png delete mode 100644 res/drawable-xxhdpi/ic_info_launcher.png delete mode 100644 res/drawable-xxhdpi/ic_remove_launcher.png delete mode 100644 res/drawable-xxhdpi/ic_uninstall_launcher.png delete mode 100644 res/drawable-xxxhdpi/ic_info_launcher.png delete mode 100644 res/drawable-xxxhdpi/ic_remove_launcher.png delete mode 100644 res/drawable-xxxhdpi/ic_uninstall_launcher.png create mode 100644 res/drawable/ic_remove_no_shadow.xml create mode 100644 res/drawable/ic_uninstall_no_shadow.xml create mode 100644 res/values/drawables.xml create mode 100644 src/com/android/launcher3/graphics/ShadowDrawable.java diff --git a/proguard.flags b/proguard.flags index 6cbab08e2c..2ad9cacf21 100644 --- a/proguard.flags +++ b/proguard.flags @@ -82,6 +82,10 @@ *; } +-keep class com.android.launcher3.graphics.ShadowDrawable { + public (...); +} + # Proguard will strip methods required for talkback to properly scroll to # next row when focus is on the last item of last row when using a RecyclerView # Keep optimized and shrunk proguard to prevent issues like this when using diff --git a/res/drawable-hdpi/ic_info_launcher.png b/res/drawable-hdpi/ic_info_launcher.png deleted file mode 100644 index 11162e1e7897f881d6a1653b67c5aad4e0676718..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1372 zcmV-i1*7_jP)1Ne-S}exacIy!BY@Jp&2Rg>;>U_b*M6iSXp)i?`u|GBy z#0SW5x`$97Y-1Hhok*?EAvj^$W!Bl*2b$VP(&RR2o1|ywCZXtX-y}coJ?Hni-$Rn~ zJ$O=tFbevzRIk$P$Tlu<(PY{>+)P^#6Z$q-uQI#GDech2{H;VKt| zrpmQ?fdnc)3)cl&sV>)mUEX`^`%i`ak)V~Z5|Lo|&;C>Q*6s2DOSMWBR3FDP7YZFE zmCA5jk-q!D^D%vaa5BC^4$e7AcJ%Li`ztNU*|iu`B@cB` zm*m0Joz?y$kwNhQ9`5?R6nISs6%;@OTCRd#dokQ;qdmWEUkF!Lw&I=ZT{&^(#1gOK z&B})BlZ8FkQ+Vf1ed^ zV6#ip)qIIjfUehpu8)QU8o1(|oRwW_Laq_uAM^ST^&h%Z4!o{FE;X~Vos$DsVtj~q z)dTBvP|TGfugx876AKC*m=E(6Cm5rj3iv@?RQPmk0Cp>kf{7XP!2ED9$_MYR@j~{= z*rEacwYKm5gU}bdAjt$|r+{1EiHumI{yN|@1w@QWVpjkApzZBn3qjHl0X%OIB!^qh z0As__SeygjCL!;=_RZ4cOZHxda%>EUb7?F&3|u^&j1fTqHYva43Hf8Z?) z00a~&G*PLjs;C4YBuC0|z|(g##zX!x4`hnOhFmrYh}}h`f{$=nH@&yCPR$x zk8vx}PzFdqGBrVX>Lw$L02bu{q6CN#WW)ea0BMSX_Ql35K=pzJxK7d@NdR#MkW@{i zNurY;4yJg3F{>{IN+BKXO9lXKCXB0GBjd}+h?6vEzcq4|!w{WF29EYYqN~}Rf#Fs_ zp4~L_VZ4+v+dHGDo#X!>xA)Rx_H%k?3gRV7jjsNspYMGQd*=e*)$* z64WarSyIb%jt5Oh#tA*3A$Q`e0!Vyv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x%LMZsd|4E3p{LD3bZ~=`KHK5Dk;l*LMCqgL?^Oe6!If{O6vk##+keZLWGW(Q;N# z%z`a00xqQz!A%@0iARI}@{kxPFIN4=!k1TDf0s*%p%Eg!eDf>jC$08D7!z8jO{dPC zEe$i0N&ob{iEWk`rGo3M3UQyUv4!}z_>cNi_|?Y0pQHW!D0BmZOS|wjCncR)3~iG5A0NpeXfIP!JaZrFwB5Dt=z5p8!zpxrYDZ%@(&5w-oy{ms_V; zT|k7U2*gBMYjU7yJ_BlLh=R>h=ue7T#V;)8>a+Y`;-S<_1iraTwuk;oO%j;70c|d> zOZ{TiTB~(ah(9{np)b)`2PrS2oG*FPH~89FIACgjD@tu1-~D;uy`GsL@{(9Zsm_Qm qI7`A_A%R5HO-Qh))ld%!g>pq+J_t>54pprH0000Z}=y<{K{dni_9(Vs=|y` zlpEcP46|#oE^*+QmHUsI_jvlV^k?%P?{9m0Ww^v?wwUfvXKQm|Rs8BgKGb5A)7fEXw%puMMJJLozSa!izp{A36+;Go+&092YanF8#+>lO&y5Ot#mPJMdv>EIZ zs}_D4>fmd8uY{rf7$6)&w^$fko6SI2$8K~|~E4;A7&S0fKPxF@cj4hq?qRtBK&xRUl> z1&?{F35Loa+I~2$vI?`lJmx{~RVD2^4uIf^qQ1Q=JYxX{9}gcNGk(I`yB0Ng0t`5- zMtl=P>NF5QG9P3bQm@E2u?TzBai{`bgq9fsY@5|(4dWnL%AgeyAmgw+XxM8x zC`bqJpCQtyV4#b1tY$BJxVJ+Z67kX|AHT5iVx_zdtd*&mO3i1JoiHHAz`8s X10M>sqJCE}00000NkvXXu0mjfOqWuQ diff --git a/res/drawable-mdpi/ic_remove_launcher.png b/res/drawable-mdpi/ic_remove_launcher.png deleted file mode 100644 index 2bb281d5993576e608fe82daae7dd4bc74611e28..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 473 zcmV;~0Ve*5P)3c=>MlK;EE}1ePA#hO=yaZ!r-$cU;Lq@vGaKLNZ@m+sJ zKbd)F#x%h)-XHG| zzpI_;3gq*K-nNl#BcYf11%e%{GQ0Mr^{B7Kvdi?KpbPb++i4DR+&pe_0ok=GuvY_K zc18aLyH^fEycG1`%dV=z?#aPd{!V7Ho9H^~GY!7(o($l$in?d(JpWvpNqTP7^PjCl z-6<9A1a)T1!cNq0&;%2dkJK;hoY?}E70^c4)uYN~Rj@R@%xA8vtpt<+8TSa5Cx(`) P00000NkvXXu0mjfA>`?Y diff --git a/res/drawable-mdpi/ic_uninstall_launcher.png b/res/drawable-mdpi/ic_uninstall_launcher.png deleted file mode 100644 index bfcbc6dfa2bda67e1eb109ca29c39ffba365af12..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 378 zcmV-=0fqjFP)_pPCq#GgVPTUcltppE(zCyyEPi_@VUFZ^(9Y@Gu^6>o% Y7wCbw3l$mDQUCw|07*qoM6N<$f*K2>C;$Ke diff --git a/res/drawable-v24/ic_info_shadow.xml b/res/drawable-v24/ic_info_shadow.xml new file mode 100644 index 0000000000..9bd7e16d0b --- /dev/null +++ b/res/drawable-v24/ic_info_shadow.xml @@ -0,0 +1,18 @@ + + + diff --git a/res/drawable-v24/ic_remove_shadow.xml b/res/drawable-v24/ic_remove_shadow.xml new file mode 100644 index 0000000000..16a630e5fa --- /dev/null +++ b/res/drawable-v24/ic_remove_shadow.xml @@ -0,0 +1,18 @@ + + + diff --git a/res/drawable-v24/ic_uninstall_shadow.xml b/res/drawable-v24/ic_uninstall_shadow.xml new file mode 100644 index 0000000000..2532157abc --- /dev/null +++ b/res/drawable-v24/ic_uninstall_shadow.xml @@ -0,0 +1,18 @@ + + + diff --git a/res/drawable-xhdpi/ic_info_launcher.png b/res/drawable-xhdpi/ic_info_launcher.png deleted file mode 100644 index 041f2b3c0c5736b326c0c178a4ff92cae29b93f1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2056 zcmV+j2>17iP)=z_~^qYzBbf%Ybz|5 zy4;NkZ(gWsz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a1ee92ee96dda1bf7f606d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 730 zcmV<00ww*4P)ZTG?`#nVA`zFhdzmn|@MB=N0#IKh3G2WB?&!e4{|ALYLD;emGYd%S+){)==tl(G^<@GKY=a~>5b7Ca z1K6!qHDthgP#LVhYy?I@1I6;6umb>MJyA@zTQw70?fqqAAX03L9gv}m^+gCUti&1= zs0Sr9s@-=eR{6F2+ORtN(uMW@Xp!4iSUP^L}iAQPCtJwbR z?K>^jz28hofPk$`fUxxt3UC7{0)!7%%jTsiWW+{6 z0RXo`!g1laa9lVp+&V%9Y!o5@Xqbd*oYorx6f|r?3X)?(aCmFvK3pU4m&H|%^+Q0u z7{x)#HJnhuOh1Y*&06>cph|I!U&Ro+pMMOSSH%&!iA)a3u;Y!VFZyxJrQW5o`}OVE z{gCb3X>-wKkC3vRvK8$kc7OD$gO8L6BVj03z4!V3Kki%3U6;g4@L`2OU`+OHm90fi zlYyfRM!*4@SyYjdpoXMZY3AG`IXT@vl!zk;O#$Z9%U>cLuAWl+3o_2T)`AQh+yDRo M07*qoM6N<$f-uTfX#fBK diff --git a/res/drawable-xxhdpi/ic_info_launcher.png b/res/drawable-xxhdpi/ic_info_launcher.png deleted file mode 100644 index 8e602da02c5a653b4cf3c4d9d6c88f22a4383a39..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3596 zcmV+n4)gJeP)5Gc(%Z#LNq}*GmK4E!Cf2 znx4$f+57IQ-q5O~PhZui){~Ynlu`0t^Qtv*?=>&?z8V_}xEhF)@AW)_hEo~TJdtMhpa6@(?&5ipc7D@Q8mN~8F zH-Q0Sp$tv(zCjeDh`NuqYT6*Xo|>%2P%C?|W+GW?7DuxRpLNXG>>czYmGUQJc3cz^ zF#wDMtp%smawQ_+b{?bNDS{uGvduo3pQ(vlR~fH2&ES`+3?8hUKmagKtn)D5t8Ao6BI!p{rS5;z2S!+BQ?dF zsmVC#+G^JVJ6I+Nk5El&X7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NaC_Aw|fwDpyUIwQG0BZ)`flTB%or95MA1%{#>k z5F(-y0rT(v^#cA!XCUO*#F_`s-2Bxg+{+1oP^vmlW+zO9pHDb@+HFuKz+hB7zQw9H zuhI2z9RVsQ>RJwZrO2L&B)o1}%n0@+hFx*q?w}9R*5NGd8fPgJmd*gkjL)D%WtZ z4FiHuYq0<;z?du_F%HmzG?2+lE{m0kB*BONv>swc5XOwWjZBPOTTa~MgIFbJ@wcsMNG2lX4%vu&J z*D4!rupkT!MvFjiVda5l)~4Q+5+grKVeE*gz~FD^lSe$8RW*7$pj1^4n7%3G~hGRGnDafH#xLJNLWy*Ee95K%>#h z!+d z0wAqwQ%v-8wA&&(Z9Cm6os(mP^nCu&-4o7#?VE|}y?snHpblkmS#9YQP0{_c#YB57 zFzeJND*r#HDuYoRzxvgs?;v!?ef>=2Go_#*#JSwiDw@8tUi&40FwG;?2*?EioSi?_ ze~YuUzNjsV%b5X7BRi3sGKx&F0ywP5vO$W|AJRsOfIMxfu8IU~P6h@9hfG`kubbfW cocUDb4~CNS0J8FFCIA2c07*qoM6N<$g7?q^3;+NC diff --git a/res/drawable-xxxhdpi/ic_info_launcher.png b/res/drawable-xxxhdpi/ic_info_launcher.png deleted file mode 100644 index 3540de1a1645fa5350ff6759425656627e139196..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3276 zcmV;-3^VhIP)v`qwsRDx{5qm^FmfY!egF#11B50YvCwLr4J z182BWKt`H0!%hLlwg#`e-Trbx>9obj3w{X|~_1EppawQ&u(*MODkIaULg(7}d_S&mU^z?USWg)J- zQ-w>i=Z~K9d^#eLVnJj!*OJ2jf33l%Ut00@#EZ%BuqhOree9R6b2256YXmexGOKI3 zj@Z^ex_{Znc^&vi3h(~&(|#jYh6tP+$JG?j)^otNURphk*M@&3clW**TFe1UPolUL zj|)6Lyhi%anxkxZcJX?3$EN>2xSF&|{euJqDGnY#i@5XpDqpZv_|N2J9eJeTWN^X7 zo;3F&qo}m+WbK{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v5iCMD2@q#CoDb=DJ5HEP*V@J?S?_)>Ec~YWlNxS;k)yK+t z65@b2asABt8E+l~?!2Ig<6cBh-ng9SLDc8Irim6$pV@-p*}bojCeqCy6PnlrZ-PO( zHII}3^T#@hUmfDo(YEOr9e{k zUE1x6FW5bd5GPHM3d2mX!=Eo%JLk^(^Cj%S6vI>~k|u6-u6`Au?tx_~Q)MMv{p|wx zJzO{Yj|LBED;QSU4}q{vf#xbZ#L{XM!&o)k{K+wJmYM%bA*jqeHJYPib&X|~&_2R9aTl@1TKsnL7f#$`#@tPa2Su1Vc{d&Bc zFJ~Y2x%u*6i70G8&i?rlc4enp?E2?R)=9gx!SnudF*~poQ?=NN9sY80@I)zZd!|^) za4l9c#rDAyWxVZF#ZsZW78O{ElCy7&wBzd|S zkP(CA>62Pc7X!MOAg51&5@Nu-dLd9RC;}x4c;*99YBP*+V5fDe>7uDUfs%SMxAXSj zeJbFIh~Is>-S+fRbQ`L0C{ST!a*uC5_rVhrzxjM}4@OuO;gg*0O zy?8v&3?B3`!Z!aGW=2zIE%_OtXqAon%~i{)rhnsj`ac z+s^v(&FS4t7nZ2oP=z7((9cRn8DWSDB{!a!SfauZBaE_=etHbg9;&d3Im+} diff --git a/res/drawable-xxxhdpi/ic_uninstall_launcher.png b/res/drawable-xxxhdpi/ic_uninstall_launcher.png deleted file mode 100644 index 724437a2a500d53d94048b5612307a2e9328b4c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1042 zcmV+t1nv8YP)nW)Smu@<$X_ zqNqnxd_9~(nZuKbB`DNHq$3i}L|lo^m*;JD83xE#S8aVKDma)}#XvxTsb4cXnZxx< z44pctxgB&qK5GZ!_0K0)?|2U?RMcqEq3lFYc&Z>FEsEGgOSRMnFZkfJ!Fj+Amwtd< z9zdZ@Ud~874+kJ<_4L@(Vy#h$&f{Cn7IQ^qokfZ_&Q`@C`|o@qhKbqv(szrOmUMg> ziuucjPFUm@`{TbtrN~q}0#ai2I>)_%$;Iq;@opERPmbTXt|d5@s;AKkF2IV*0+g^x zV+cqwaTY5WSk&uMY#*N0``Zdj!MA({atzE01{$LE1&SWySRtYHgn)f;fQQ41i-QLk z*>s!n5V&t2=yqHoMhset5hJBvSiwQyK_MU&yh5?XRal4x>GYj^^eNIq7d=!E$RI$8 z)5D^|Y;3gUTflgsbpm>k=iwoQB%r{=sTFkTwGtuy*f7b9B1E8zJZ-Yfqc^uWlDyt- z?%wLi3&n^D1`~`GBSxOR;p|W0V*M0MVW7aIN-8e^o2|d@L1-zPJq#cqXoFMbr1?Im zQ)6Iz1zJllU4Xnc138j_Ma#efhSqEZGSa|$i`L?;R*-NFKp`GrT#G;#c|;TjuF}cC z_J9T}HYT??12ZrKGcW@)Fat9%12ZrKGcW@)FatAil}QF>pkT#Da*J0SP#`O=)wGrj zSHXZ4lQ4XXB~6*>qP0xV(XPUwuVO)X^H;Q%w|+x_jCvIZ9S{FL_X}Fd+|LjHj-X@k z77Gy_{CBURm3+4Z9*%f2NCl-H&^-m0K2-gSiKqJa(udGPfSV6J-JfvYni^_ z&3z7CcKu%;xM_?PH~rTK%dX$!kPF_#G`i?1kJfG2H^a~Xz+eu5d{piG2%bb|j14LR z(US(PJHfJ_9ePUVdZR3Z>`Ht{t70bB$K8`Q;$&;S4c M07*qoM6N<$g28R!6951J diff --git a/res/drawable/ic_info_no_shadow.xml b/res/drawable/ic_info_no_shadow.xml index 5f145c9f1a..91a3a565ab 100644 --- a/res/drawable/ic_info_no_shadow.xml +++ b/res/drawable/ic_info_no_shadow.xml @@ -17,8 +17,9 @@ android:width="24dp" android:height="24dp" android:viewportWidth="24.0" - android:viewportHeight="24.0"> + android:viewportHeight="24.0" + android:tint="?android:attr/textColorPrimary" > diff --git a/res/drawable/ic_remove_no_shadow.xml b/res/drawable/ic_remove_no_shadow.xml new file mode 100644 index 0000000000..ef538a6111 --- /dev/null +++ b/res/drawable/ic_remove_no_shadow.xml @@ -0,0 +1,25 @@ + + + + + diff --git a/res/drawable/ic_uninstall_no_shadow.xml b/res/drawable/ic_uninstall_no_shadow.xml new file mode 100644 index 0000000000..5bab4222eb --- /dev/null +++ b/res/drawable/ic_uninstall_no_shadow.xml @@ -0,0 +1,25 @@ + + + + + diff --git a/res/layout/drop_target_bar_horz.xml b/res/layout/drop_target_bar_horz.xml index fcbb54e397..ed18192c5b 100644 --- a/res/layout/drop_target_bar_horz.xml +++ b/res/layout/drop_target_bar_horz.xml @@ -20,6 +20,7 @@ android:theme="@style/HomeScreenElementTheme" android:layout_width="match_parent" android:layout_height="@dimen/dynamic_grid_drop_target_size" + android:visibility="invisible" android:layout_gravity="center_horizontal|top" android:focusable="false"> diff --git a/res/layout/drop_target_bar_vert.xml b/res/layout/drop_target_bar_vert.xml index 54d9dfe3af..e2a65d4a55 100644 --- a/res/layout/drop_target_bar_vert.xml +++ b/res/layout/drop_target_bar_vert.xml @@ -21,6 +21,7 @@ android:orientation="vertical" android:layout_height="match_parent" android:layout_gravity="left" + android:visibility="invisible" android:focusable="false" android:paddingTop="@dimen/vert_drop_target_vertical_gap" > diff --git a/res/values/attrs.xml b/res/values/attrs.xml index 18f409f343..18759f817c 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -16,7 +16,7 @@ */ --> - + @@ -111,4 +111,8 @@ + + + + diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 75618b894b..7dd9e5315f 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -146,6 +146,7 @@ 2dp 4dp 2dp + 2dp 8dp diff --git a/res/values/drawables.xml b/res/values/drawables.xml new file mode 100644 index 0000000000..fea17b1530 --- /dev/null +++ b/res/values/drawables.xml @@ -0,0 +1,20 @@ + + + + @drawable/ic_info_no_shadow + @drawable/ic_remove_no_shadow + @drawable/ic_uninstall_no_shadow + \ No newline at end of file diff --git a/src/com/android/launcher3/DeleteDropTarget.java b/src/com/android/launcher3/DeleteDropTarget.java index 9097ed23d7..975675a6fc 100644 --- a/src/com/android/launcher3/DeleteDropTarget.java +++ b/src/com/android/launcher3/DeleteDropTarget.java @@ -40,7 +40,7 @@ public class DeleteDropTarget extends ButtonDropTarget { // Get the hover color mHoverColor = getResources().getColor(R.color.delete_target_hover_tint); - setDrawable(R.drawable.ic_remove_launcher); + setDrawable(R.drawable.ic_remove_shadow); } @Override diff --git a/src/com/android/launcher3/InfoDropTarget.java b/src/com/android/launcher3/InfoDropTarget.java index 2f61a01ed7..7b3bded174 100644 --- a/src/com/android/launcher3/InfoDropTarget.java +++ b/src/com/android/launcher3/InfoDropTarget.java @@ -40,12 +40,10 @@ public class InfoDropTarget extends UninstallDropTarget { } @Override - protected void onFinishInflate() { - super.onFinishInflate(); + protected void setupUi() { // Get the hover color mHoverColor = Themes.getColorAccent(getContext()); - - setDrawable(R.drawable.ic_info_launcher); + setDrawable(R.drawable.ic_info_shadow); } @Override diff --git a/src/com/android/launcher3/UninstallDropTarget.java b/src/com/android/launcher3/UninstallDropTarget.java index 0fac29f30a..45c14d6bba 100644 --- a/src/com/android/launcher3/UninstallDropTarget.java +++ b/src/com/android/launcher3/UninstallDropTarget.java @@ -28,10 +28,13 @@ public class UninstallDropTarget extends ButtonDropTarget { @Override protected void onFinishInflate() { super.onFinishInflate(); + setupUi(); + } + + protected void setupUi() { // Get the hover color mHoverColor = getResources().getColor(R.color.uninstall_target_hover_tint); - - setDrawable(R.drawable.ic_uninstall_launcher); + setDrawable(R.drawable.ic_uninstall_shadow); } @Override diff --git a/src/com/android/launcher3/graphics/ShadowDrawable.java b/src/com/android/launcher3/graphics/ShadowDrawable.java new file mode 100644 index 0000000000..5e76649ca3 --- /dev/null +++ b/src/com/android/launcher3/graphics/ShadowDrawable.java @@ -0,0 +1,191 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.launcher3.graphics; + +import android.content.res.Resources; +import android.content.res.TypedArray; +import android.graphics.Bitmap; +import android.graphics.BlurMaskFilter; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.ColorFilter; +import android.graphics.Paint; +import android.graphics.PixelFormat; +import android.graphics.Rect; +import android.graphics.drawable.Drawable; +import android.util.AttributeSet; + +import com.android.launcher3.R; +import com.android.launcher3.Utilities; + +import org.xmlpull.v1.XmlPullParser; +import org.xmlpull.v1.XmlPullParserException; + +import java.io.IOException; + +/** + * A drawable which adds shadow around a child drawable. + */ +public class ShadowDrawable extends Drawable { + + private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG); + + private final ShadowDrawableState mState; + + public ShadowDrawable() { + this(new ShadowDrawableState()); + } + + private ShadowDrawable(ShadowDrawableState state) { + mState = state; + } + + @Override + public void draw(Canvas canvas) { + Rect bounds = getBounds(); + if (bounds.isEmpty()) { + return; + } + if (mState.mLastDrawnBitmap == null) { + regenerateBitmapCache(); + } + canvas.drawBitmap(mState.mLastDrawnBitmap, null, bounds, mPaint); + } + + @Override + public void setAlpha(int alpha) { + mPaint.setAlpha(alpha); + invalidateSelf(); + } + + @Override + public void setColorFilter(ColorFilter colorFilter) { + mPaint.setColorFilter(colorFilter); + invalidateSelf(); + } + + @Override + public ConstantState getConstantState() { + return mState; + } + + @Override + public int getOpacity() { + return PixelFormat.TRANSLUCENT; + } + + @Override + public int getIntrinsicHeight() { + return mState.mIntrinsicHeight; + } + + @Override + public int getIntrinsicWidth() { + return mState.mIntrinsicWidth; + } + + /** + * Sets the color for the generated shadow + */ + public void setShadowColor(int color) { + if (mState.mShadowColor != color) { + mState.mShadowColor = color; + mState.mLastDrawnBitmap = null; + invalidateSelf(); + } + } + + private void regenerateBitmapCache() { + Bitmap bitmap = Bitmap.createBitmap(mState.mIntrinsicWidth, mState.mIntrinsicHeight, + Bitmap.Config.ARGB_8888); + Canvas canvas = new Canvas(bitmap); + + // Call mutate, so that the pixel allocation by the underlying vector drawable is cleared. + Drawable d = mState.mChildState.newDrawable().mutate(); + d.setBounds(mState.mShadowSize, mState.mShadowSize, + mState.mIntrinsicWidth - mState.mShadowSize, + mState.mIntrinsicHeight - mState.mShadowSize); + d.draw(canvas); + + Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG); + paint.setMaskFilter(new BlurMaskFilter(mState.mShadowSize, BlurMaskFilter.Blur.NORMAL)); + int[] offset = new int[2]; + Bitmap shadow = bitmap.extractAlpha(paint, offset); + + paint.setMaskFilter(null); + paint.setColor(mState.mShadowColor); + bitmap.eraseColor(Color.TRANSPARENT); + canvas.drawBitmap(shadow, offset[0], offset[1], paint); + d.draw(canvas); + + if (Utilities.isAtLeastO()) { + bitmap = bitmap.copy(Bitmap.Config.HARDWARE, false); + } + mState.mLastDrawnBitmap = bitmap; + } + + @Override + public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, + Resources.Theme theme) throws XmlPullParserException, IOException { + super.inflate(r, parser, attrs, theme); + + final TypedArray a = theme == null + ? r.obtainAttributes(attrs, R.styleable.ShadowDrawable) + : theme.obtainStyledAttributes(attrs, R.styleable.ShadowDrawable, 0, 0); + + try { + Drawable d = a.getDrawable(R.styleable.ShadowDrawable_android_src); + if (d == null) { + throw new XmlPullParserException("missing src attribute"); + } + mState.mShadowColor = a.getColor( + R.styleable.ShadowDrawable_android_shadowColor, Color.BLACK); + mState.mShadowSize = r.getDimensionPixelSize(R.dimen.drawable_shadow_size); + + mState.mIntrinsicHeight = d.getIntrinsicHeight() + 2 * mState.mShadowSize; + mState.mIntrinsicWidth = d.getIntrinsicWidth() + 2 * mState.mShadowSize; + mState.mChangingConfigurations = d.getChangingConfigurations(); + + mState.mChildState = d.getConstantState(); + } finally { + a.recycle(); + } + } + + private static class ShadowDrawableState extends ConstantState { + + int mChangingConfigurations; + int mIntrinsicWidth; + int mIntrinsicHeight; + + int mShadowColor; + int mShadowSize; + + Bitmap mLastDrawnBitmap; + ConstantState mChildState; + + @Override + public Drawable newDrawable() { + return new ShadowDrawable(this); + } + + @Override + public int getChangingConfigurations() { + return mChangingConfigurations; + } + } +}