From 6185c4ddcfef5e7a2587c605d968d2d200ceccaf Mon Sep 17 00:00:00 2001 From: kapodamy Date: Fri, 14 Dec 2018 14:11:10 -0300 Subject: [PATCH 1/9] delete list and grid icons * delete all grid.png files * delete all list.png files --- app/src/main/res/drawable-hdpi/grid.png | Bin 3341 -> 0 bytes app/src/main/res/drawable-hdpi/list.png | Bin 3156 -> 0 bytes app/src/main/res/drawable-ldrtl-xhdpi/grid.png | Bin 2960 -> 0 bytes app/src/main/res/drawable-ldrtl-xhdpi/list.png | Bin 3006 -> 0 bytes app/src/main/res/drawable-xxhdpi/grid.png | Bin 18221 -> 0 bytes app/src/main/res/drawable-xxhdpi/list.png | Bin 18220 -> 0 bytes 6 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 app/src/main/res/drawable-hdpi/grid.png delete mode 100644 app/src/main/res/drawable-hdpi/list.png delete mode 100644 app/src/main/res/drawable-ldrtl-xhdpi/grid.png delete mode 100644 app/src/main/res/drawable-ldrtl-xhdpi/list.png delete mode 100644 app/src/main/res/drawable-xxhdpi/grid.png delete mode 100644 app/src/main/res/drawable-xxhdpi/list.png diff --git a/app/src/main/res/drawable-hdpi/grid.png b/app/src/main/res/drawable-hdpi/grid.png deleted file mode 100644 index 26fa36c070f8a64dd45b446f92cd34cc5b159fbb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3341 zcmV+o4f67dP)f6Xi@@54ZTQ_E-Enz5K6$103tR-RB%L5k){YTDBysjLy@r}iiH7DvFijGMAUI` z6dRUFWUU$Bym{}eS9UO(Z2>7`&z9wUXbV-Il#&6`Y8GKGQ04S2&F6MJnWNa;Ck|;8QE#r9r;7G|| z@X{|>%+C|c55>;RS}qbKr-&IQTvLXPlM{>K&(BTgi^a?^4mXV>;xX8n8Ce|RasXz} z{8imI52H3ZN4bfe_i~WlJ|C&UW9+{8AKoW!}eExnGFE2re(F+`iE_4 z6#!l90Z_aBhs|Iw0E)7{bq;-T9=d#9QpDmcXDh4R++0fmp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1 z_|ZAJ=uaEUhRo^rr^)ztThPU$||MS58 zg#R7)dmdOwV9F+CpA)u=OaAxg^b*YI3!~J)OUAz#ZQux?{`;04-i57Kix6b|o XjPphH8Dpc*00000NkvXXu0mjff#6e2 diff --git a/app/src/main/res/drawable-hdpi/list.png b/app/src/main/res/drawable-hdpi/list.png deleted file mode 100644 index 16da863e2e21606532a4a0880c30ee609e142fe8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3156 zcmV-a46E~rP)f6Xi@@54ZTQ_E-Enz5K6$103tR-RB%L5k){YTDBysjLy@r}iiH7DvFijGMAUI` z6dRUFWUU$Bym{}eS9UO(Z2>7`&z9wUXbV-Il#&6`Y8GKGQ04S2&F6MJnWNa;Ck|;8QE#r9r;7G|| z@X{|>%+C|c55>;RS}qbKr-&IQTvLXPlM{>K&(BTgi^a?^4mXV>;xX8n8Ce|RasXz} z{8imI52H3ZN4bfe_i~WlJ|C&UW9+{8AKoW!}eExnGFE2re(F+`iE_4 z6#!l90Z_aBhs|Iw0E)7{bq;-T9=d#9QpDmcXDh4R++0fmpKB>E=%LdZt9g$j;($`3&Zthxi`{{&gM}5&R^+h%b~yM9Zd3AWW9E zTgVfL1(`yIK=_}U_z%PWq}jQaiQ4!P(3V&Nr6C$XejWfQDiI(Fdt@un?|lo#M+5oI zi_w{wo%_#%{(V=tO#a9gB!7-$M?^BX5>d|Vn*3S!?g~$*UQipUPL&zMmg;!4Do9IA%u zp=Rh?=qPj=x&RGBx1dpI68aT-2O}^EromdU5o`ssU{5#*j)WJ%$?!5bA1;Eoz?EiTr=n?cd`V|I)p<|3Oju?MT93~aB0<#&j8`F+Cg&D?-VWzQItUA^l>xvD< zaRIYI4MQ`g1<+DyrL=EogS06X zii({|v`U^zjmmKqDIK93(F5q|^fLNk`gQs{RV`IdRle#b)i%{Ds;|}NsClUI)k@Ub z)kf6bsWa4l)YH_rsduU0(?DsMX@qO!YV6TCtMPOWZH~(v?wpc2hv(eZgf-1HBQ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l~B}lB1GGha7`?2-Af=(ML7i=^W2#y!W}Xg^QjKchSvf0Fy}`|$MunZgo&G}MUI z?}KnzZaiNy2Q+XO7YL4bHXc@+i&V$nG8`waj0&cHLlECvKs0-;c3UD@ranQ-XP7B zyoPs3qfl)Gn|Y8Z7#g$*YHdaH1L=;&G{KFWJA8Z6!j1Vr6~A#hBx0I!)Sg zkJR6i|@GOBGf0+2Gf&dXNif{?% z1JR0bL4XJsMYx3XfoMgzAV7qRB3#1xK(r!U5Fo-u5ia3;AX*VF2oT|-2$yg^5UmIo z1c-1^giAOdh*pFP0z|kd!X=y!L@UAt0U}%!;S$aVq7~tS01+;Va0%xF(TZ?EfCv{w zxPy5How#7A2KEu*_X=kBbYK38m#iQtsIdb^nVXww%rq>JQ_TK!xlLBqFi Z62MTuf)7V!Tj8+Y%w)ZBnxV^{e*qu(_>2Gm diff --git a/app/src/main/res/drawable-xxhdpi/list.png b/app/src/main/res/drawable-xxhdpi/list.png deleted file mode 100644 index fbb7c107299cc04d04e03834fcf1f5c785249611..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18220 zcmeI43p7++`@j#nphzS|Wg6-2Hs)enW@3^{MlX@ON*Xg~80OZ@xQt4=_jW-^a!pZE zy1o_3t&1qPC=!a~k`O9MRNom2oofE?e|_J7{nxkFoMq;mXFvOS_TIn!?C0z=YaM^t zt+G^*SCK*5S^ZV#PJL?77+(Dzx!#^=yUj!Smq1HdE|(MJl1iJJic@-_@JGdnwP zj)24W=5P^KW@ZR3k3(lLK>!G>iFXKajp&yhL*YbUP*X(y%XZS|5F6G*mpsvo&fhPl5 zt#Pe`rNXi)Aybv-A8I-20}$+Y84;^B!)(cS?`MZdtCAbWA(UE*ZhMW-2Y_xFVPLS} z(y~FRiyS~2;8yC)Q!aS%bw{S%d=~(52xvemw@#7@w+9M!91Eubg)@Ll4u8|+fg=FG z6mB*}0%sL~j`voi@j!KIM4cK?eR5W+EO1Z?h+behPuk=ru)%4Y{SxWC+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p>*a^Ka6cRxgD(6>UPf#F=)=Z_XvO9W zC~PWdWln;|uESu^h=zE5Jsh22h@#{5aVUKZ-T>uEqw1k(7!X4v=+f{s18``NKbrsK z+MGl66UERs*EGmAjbKRA$I=Z@7_0#fMWN!UC{KMoLlglIQuXOn8i9(zeRn;^{3qA8 zJZK}#rZC6U5%vCm+r%&2{L~bg!G}UeI3}c^z#2+34&cTgOTR0ajG=VFrSSNmXcZbG zzc0g){4$b0L^eaKnMk3E5)FweidB$ig#Mv)v|A&V-^>_4PvAeJJnVmr`S05Z@CMo9 z0)E)lP_5rP;dAJM016LW?ghof|F8^)9sXzm_iTg~QZFv3tm;}G)?w^yU5sgZub9gL@fW%-?yg)RU?PY`>EgTILqmiux z(Tv07@N76Vkfdvb{#EfWt)SmS?S_92CGqVoO%YZWX8KryzCH@4gB|N;OuaFFM4JyH zbYp;$6lEwOLpDE^!Rxz<5uiSC}tJBQPN1MF}qPd|+A$E*KE; zq6C+CJ}|8W7YvAaQG!c6ADC8x3kF2ID8VJ34@@h;1p^{pl;9H22d0(af&mdPN^pti z1Jg=y!GMStCAh@%foUbUU_iu+5?tc>z_b!vFd*VZ2`=$`U|I<-7!dKI1ebU|Fs%d^ z42XD9f=fIfm{x)d21L9l!6lv#Oe?_!10r6O;1bUVrj_7=0TC}saEa#w(@Jo`fQT0* zxWw~;X(hN|K*Wm@T;ln_v=Uq}AmT*{F7bR|S_v)~5b>e}mv}xftppbgh^PH+N`3WrZgFMOA_sO>v`FV`L=%W! zp)FES)$fOiN5~SoDyOfxQ-vxcDoo_xPB{bpyBg?V*=Y!*MHh(*HKLQ~!e_^-p{uLQ kHHOZkUtfwLzhA$~01Ii?nce(jXGAJ1i&f?qOgC)*7k-EN9smFU From 8d1d4092aae1ff6bb60d5d3f015e03576fe6f638 Mon Sep 17 00:00:00 2001 From: kapodamy Date: Fri, 14 Dec 2018 14:51:55 -0300 Subject: [PATCH 2/9] add missing icons in bright theme * missing white icons * update attrs.xml and styles.xml --- .../giga/ui/fragment/MissionsFragment.java | 19 ++++++++++++++---- .../drawable-hdpi/ic_delete_black_24dp.png | Bin 0 -> 317 bytes .../drawable-hdpi/ic_delete_white_24dp.png | Bin 0 -> 319 bytes .../res/drawable-hdpi/ic_grid_black_24dp.png | Bin 0 -> 422 bytes .../res/drawable-hdpi/ic_grid_white_24dp.png | Bin 0 -> 415 bytes .../res/drawable-hdpi/ic_list_black_24dp.png | Bin 0 -> 265 bytes .../res/drawable-hdpi/ic_list_white_24dp.png | Bin 0 -> 276 bytes .../drawable-mdpi/ic_delete_black_24dp.png | Bin 0 -> 198 bytes .../drawable-mdpi/ic_delete_white_24dp.png | Bin 0 -> 198 bytes .../res/drawable-mdpi/ic_grid_black_24dp.png | Bin 0 -> 270 bytes .../res/drawable-mdpi/ic_grid_white_24dp.png | Bin 0 -> 279 bytes .../res/drawable-mdpi/ic_list_black_24dp.png | Bin 0 -> 248 bytes .../res/drawable-mdpi/ic_list_white_24dp.png | Bin 0 -> 254 bytes .../drawable-xhdpi/ic_delete_black_24dp.png | Bin 0 -> 270 bytes .../drawable-xhdpi/ic_delete_white_24dp.png | Bin 0 -> 274 bytes .../res/drawable-xhdpi/ic_grid_black_24dp.png | Bin 0 -> 276 bytes .../res/drawable-xhdpi/ic_grid_white_24dp.png | Bin 0 -> 288 bytes .../res/drawable-xhdpi/ic_list_black_24dp.png | Bin 0 -> 247 bytes .../res/drawable-xhdpi/ic_list_white_24dp.png | Bin 0 -> 249 bytes .../drawable-xxhdpi/ic_delete_black_24dp.png | Bin 0 -> 506 bytes .../drawable-xxhdpi/ic_delete_white_24dp.png | Bin 0 -> 495 bytes .../drawable-xxhdpi/ic_grid_black_24dp.png | Bin 0 -> 427 bytes .../drawable-xxhdpi/ic_grid_white_24dp.png | Bin 0 -> 419 bytes .../drawable-xxhdpi/ic_list_black_24dp.png | Bin 0 -> 292 bytes .../drawable-xxhdpi/ic_list_white_24dp.png | Bin 0 -> 295 bytes .../drawable-xxxhdpi/ic_delete_black_24dp.png | Bin 0 -> 541 bytes .../drawable-xxxhdpi/ic_delete_white_24dp.png | Bin 0 -> 547 bytes .../drawable-xxxhdpi/ic_grid_black_24dp.png | Bin 0 -> 363 bytes .../drawable-xxxhdpi/ic_grid_white_24dp.png | Bin 0 -> 382 bytes .../drawable-xxxhdpi/ic_list_black_24dp.png | Bin 0 -> 330 bytes .../drawable-xxxhdpi/ic_list_white_24dp.png | Bin 0 -> 320 bytes .../activity_main_player.xml | 2 +- .../main/res/layout/activity_main_player.xml | 2 +- app/src/main/res/menu/download_menu.xml | 18 ++++++++--------- app/src/main/res/values/attrs.xml | 3 +++ app/src/main/res/values/styles.xml | 8 ++++++-- 36 files changed, 35 insertions(+), 17 deletions(-) create mode 100644 app/src/main/res/drawable-hdpi/ic_delete_black_24dp.png create mode 100644 app/src/main/res/drawable-hdpi/ic_delete_white_24dp.png create mode 100644 app/src/main/res/drawable-hdpi/ic_grid_black_24dp.png create mode 100644 app/src/main/res/drawable-hdpi/ic_grid_white_24dp.png create mode 100644 app/src/main/res/drawable-hdpi/ic_list_black_24dp.png create mode 100644 app/src/main/res/drawable-hdpi/ic_list_white_24dp.png create mode 100644 app/src/main/res/drawable-mdpi/ic_delete_black_24dp.png create mode 100644 app/src/main/res/drawable-mdpi/ic_delete_white_24dp.png create mode 100644 app/src/main/res/drawable-mdpi/ic_grid_black_24dp.png create mode 100644 app/src/main/res/drawable-mdpi/ic_grid_white_24dp.png create mode 100644 app/src/main/res/drawable-mdpi/ic_list_black_24dp.png create mode 100644 app/src/main/res/drawable-mdpi/ic_list_white_24dp.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_delete_black_24dp.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_delete_white_24dp.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_grid_black_24dp.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_grid_white_24dp.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_list_black_24dp.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_list_white_24dp.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_delete_black_24dp.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_delete_white_24dp.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_grid_black_24dp.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_grid_white_24dp.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_list_black_24dp.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_list_white_24dp.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_delete_black_24dp.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_delete_white_24dp.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_grid_black_24dp.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_grid_white_24dp.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_list_black_24dp.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_list_white_24dp.png diff --git a/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java b/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java index aa9c497f1..a4be9301e 100644 --- a/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java +++ b/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java @@ -7,9 +7,12 @@ import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.content.SharedPreferences; +import android.content.res.TypedArray; import android.os.Bundle; import android.os.IBinder; import android.preference.PreferenceManager; +import android.support.annotation.AttrRes; +import android.support.annotation.DrawableRes; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; @@ -89,7 +92,7 @@ public class MissionsFragment extends Fragment { mEmpty = v.findViewById(R.id.list_empty_view); mList = v.findViewById(R.id.mission_recycler); - // Init + // Init layouts managers mGridManager = new GridLayoutManager(getActivity(), SPAN_SIZE); mGridManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() { @Override @@ -103,7 +106,6 @@ public class MissionsFragment extends Fragment { } } }); - mLinearManager = new LinearLayoutManager(getActivity()); setHasOptionsMenu(true); @@ -120,7 +122,7 @@ public class MissionsFragment extends Fragment { // Bug: in api< 23 this is never called // so mActivity=null - // so app crashes with nullpointer exception + // so app crashes with null-pointer exception mActivity = activity; } @@ -189,12 +191,21 @@ public class MissionsFragment extends Fragment { mList.setAdapter(mAdapter); if (mSwitch != null) { - mSwitch.setIcon(mLinear ? R.drawable.grid : R.drawable.list); + mSwitch.setIcon(getDrawableFromAttribute(mLinear ? R.attr.ic_grid : R.attr.ic_list)); mSwitch.setTitle(mLinear ? R.string.grid : R.string.list); mPrefs.edit().putBoolean("linear", mLinear).apply(); } } + @DrawableRes + private int getDrawableFromAttribute(@AttrRes int ic) { + TypedArray styledAttributes = mActivity.obtainStyledAttributes(new int[]{ic}); + int resId = styledAttributes.getResourceId(0, -1); + styledAttributes.recycle(); + + return resId; + } + @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); diff --git a/app/src/main/res/drawable-hdpi/ic_delete_black_24dp.png b/app/src/main/res/drawable-hdpi/ic_delete_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..ba8820363ec185ea85c54720ee4b709ae6c0fc9b GIT binary patch literal 317 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$UKzz{uk1;usRq`u2vQwrd~*`-l1I zl}pVN1U5;`nA+)R);zB_Fn@w?WKGNTn`$T9C!AFA)LgwOfX%MOrmcM0?bkcMTdY6v z^LoAQ|NCpJ+pAA_&R0B>Bwby5>yS;Brd#{P0~rgGBaT>F{djYkPj6$-N4a#dhbD3o?BL)(7O;=LW4@*f)`Jo8BYt zIftya32j?>=yc2(ws}iy%kMGiG#hCkp%?ZIvnsrJs*a}VWQg{6I_gJsv-&<@df#av zzvEDf4#%{D`5a#wrp`}z5jWE(nLSs=ZA)+LUHK!I!VUH-#c$tIcI_qWx=3KKFnGH9 KxvX|k1|%Oc%$UKzz{uw5;usRq`u2vRw{xHb+k>6a zY?~Ia1x6a4u`$RLnC+NW94K}~E#eR7;T&PX`j#0!N=h7I2Nxw=kXL+XxT9oe%zM4( zO^+%cuDxH$Hz#;sl&)HVL8I%N1pDQ+It%3Yd(Jpbc2TIv70J8nPTg7XIo&Z==JC2i^A^O4gt#+L7TuP3N4}#n zXOZ}ZSXcRCwhV6l{DGbteD- literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-hdpi/ic_grid_black_24dp.png b/app/src/main/res/drawable-hdpi/ic_grid_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..2db18582c2906e204f3007cee270ebb97d488f3d GIT binary patch literal 422 zcmV;X0a^ZuP)nP^NG9}0Xg73$+A(`%eX zYzI39{ssql7LECiivmBWLRIL&3vJ;l)4%wY2yGYmE9@sid-zk}4^yF6IL-8D`$mSD z#&Ur_#aqlqW7hGbz;C2NHTPvom>aoHkI6R)-;Bwd7v{;Re#UAd^Sr?C;Dx(qSx;Cv zIesw}nz&_Og{n{$`rks`_9mmc@9tUC2>VQqKfqEeKFkun6!?`?Xr_IlT%U}|ckn3U zJ9v5zUo%z~aGdD??<2Os%L0EaoPCd@F)PBv&hcxh&?YW3J;zDJcJQgdUt(97GsAqv z?*jiV6`HtZUxljBgA?kt7f1C7?;^GlzJYW6K-hQU<6v3%S3~y+=Pi1$(<;cOV(H#lW46F2v!N|ChQ%k7>%-!E3i_6g_mVx5dujOo5y0d zI636}IEAo;^TF4>|L`)*IX}}hHUAjg!?@7bc#^QUaX;Y47-BJ*8Dcl!N4d~gIe+jo zVOvZB9*(e*%zVOGz)!1C6}s_4uW(uD1%6~g`vHH6!%XM{eh2*LT<9@Q3jKyj!Y*JV z;7{-ZcaoXs_!{urO--NZ)O?^ zeS(KLE_8~Q2|K`}fIr3-mXevx*@s=?pXEY(I4|@R-xIdQn}9#Zdn_k2@9-<&KjuPn zckHWB6}oXkBi(&-UB6%_VFy?X_^IyRNq5_y!)Nt?}n0`#~?julWV6q_xt# z+@^!3z>|3ooJku?^YXgu{r4201ZHLp45Xb%^Rh|@W%tTr(0_x@fu(r|l+r3`US4#) z|DMABH*U;1FqC#G&CAPl&@=F3egciOM`>QZr-QP4W!Vk70bb1wFp)Ns=H;T}`3FG| a9F-kHEtdRUpr-Wz0000(&8NluWs++?wI<3<(9<}%Lxe&b)qs9!&MB^6DRV=&HVmA{$B#OOyRr2L$9JE zd(W~*+bF%M%6}EGz*pc{hI1p^_ePV23?Vbpf{s4fV`uu^=CzPUBM4RG+bL}D;p{0m uJK?^8ALjv<>XIEUFA5Img#Np1%UBdDwdP%o@-m>q7(8A5T-G@yGywoR=S(#K literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/ic_delete_white_24dp.png b/app/src/main/res/drawable-mdpi/ic_delete_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..8f10392cac7644b0c4b09e20f52ce13b0bd60970 GIT binary patch literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`Gjy`C>7wES+6Ote6n0olNO-6--h0jII{NMQ zMy}ueaxKL&dsZH6FiSF+QpS_;E_|3jq z-tICB4OJT`os5MAKy2_72&JcE@I(tr;OXR{1bc&@ftK`~41V|vz7mXpyOXOD%niO% zf~~<9G+Du${E8D(y|d0rZSER8r~U^6gJ)Xc{}lNzNM(c0Q3-N`Pk~5!CI&CGAe7U% z`NSi|BZG%DS$*K<olS)$JH_nJvHzcIY|_&nd#`n_Gtesxp00i_>zopr09-L;Gynhq literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/ic_list_white_24dp.png b/app/src/main/res/drawable-mdpi/ic_list_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..f0d3f5f7cff9f53b0fb070d4d40d4ca6f64fccee GIT binary patch literal 254 zcmVYH5>z7jL9j@K;A&C})*(v>SY-hgf<>yNbOAPL-GFPb&jM_+fX8A!;ikPZ zW1$D$;=Ik_@^M?OOU@&Bzz~Dz1)jp?(oY9w_{C53TWrJS@|_NRsj`WFk3Yv{l@3hs ziTCJT%){mK*2sMiFDP-1GI3Yoaw*e++HX+%KpQ=D6L%9XmrkvB{TIC81Fz9Ln1;(` z+~^G!*kK+0PW9b)N3cu>`WWFcdV%L~xeOY)?1EO|r68}40 zUw*tDBk^sD*$$bkKW4n^HXg}csAsr6{XYMs|4-Ph*TwJfo+p+M^dN($tDnm{r-UW| DT4rf% literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/ic_delete_white_24dp.png b/app/src/main/res/drawable-xhdpi/ic_delete_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..a1b828bf928a98888a4fbbf9204c1f87e7fef099 GIT binary patch literal 274 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpUto1QL?AsLNtZ`pb=2THU)?7Y#z zvvFIYXjxM$m!6{Dan>E&;tCNrZ)tvecX)r1ob<#g&z_yTBXFKOzFuy}U7zbqbvbPH z!uM3ZzPtb7xmUJZ?%hq4@0Z|WV4hcK@a(|tro^qg`4<%amoDgCeyn^mUqaj5W9Hgy zIleR2f9*PL#ih`|z{G)txWV9XvV6m(wp$Hy^1@8}3L=CzbWi7GTz_LV+YiS%k8+zn zzTdIJs*bZT=g#skos$EP=_^*vNo-v0wf(?O-(PgSGY6|=t%}oS3j3^ HP6baGgzB8KxQ$Z_4x!K2xpWj9bL^zv58&q<`;ZeoWf)DEOGbhq`oShT0EV zm;77zsn#lfQDy$Z5O;9*#D98U{4eFV{>x}!WRpl}V610fahbpSPTLpjh4vHo3I1Yb zuDEyMIzt6ZzW=Z03-KQI;=e?hQ~pbs9$;YRF*wk$hB5coqZ1py|J-~b-t#`^-&u?{ z`7g9TR0_GQQ~c}m!unEw>%OFhH}Z?Yrn5;*FkRpy@6z|ze!oc7H@kSwzb%Y=^55|0 X$7` zqU(&r2M$L>yVr1SmXe8hQzoBy*8PLvw~p%z-tIqCKY8|U_B@-1Eww%No<9Bz28;o& zddmNTK5#$sXRSZSq;=%7(0|1rvLCY#=F2=_V7EBH$oFG+1CN9BPUesOP4$X(dOv0> z9GJ23^UscX6RidR>-;c(w4Sy8IMb^4;o1wPr(a>@D`;SrdC=g91B&4a&o@$P!+|GYkUKRVB1pUOD3;8<0qn=I5OiIM{{4#GPh)XE(Q`_TNq il40co{U(Ob%5nSJyb}&CK9vgeGJ~h9pUXO@geCw&^>^0* literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/ic_list_black_24dp.png b/app/src/main/res/drawable-xhdpi/ic_list_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..0f7327fadeacdc39422adcbe44146bc63ad2b13f GIT binary patch literal 247 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpUteV#6kAsLNtr!MSr3KVe__dlv4 zaYU2tzcY_g(?KPR1&#vU|KEt;(D^nqVdB|5eVLb0W!j~_*yzEe?w1AVh)B=4oAjj#u-m?RtcV+|CnnTpCklVl{_vmKH kt&ktD*?@L)DAq{-Z;Fy02N)%w#4?n6R z;nIEZyFhbC!iJcD3kn@a%fE5vi2c5Ce!K6E*XJc?m?iq(TxE1jBDu#?yU=4l6FZCK};Nt#`3;4=`Yc3ke;b~mZPFrSI1ai;~RRj!eY zEAzg8y;Tm~f1WiMUg+4o;Ii7`Ov3{+%o(#5=wAb=KN>5#fg$gaBFJ!Q-XFirUoq+m r@kKEEe-tXYm9j&h4P^hZKZ^Q^pIZ|i?3U>R`h~&M)z4*}Q$iB}8Q5WF literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/ic_delete_black_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_delete_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..4cb4c08e2d5bc8bbb83fc99bd95d02010b5a9e89 GIT binary patch literal 506 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@Zgyv2U_9vQ;uumf=j|O^eU?Cm)`#Ys zwBiL7ITn60HWA|Ooaf}cIB20`^Q54~YF71aQ34-DcXwuS@9w&pq->b3zOy_n?A+uz zWySAj_x2{Soq02V1q1Vegoe-}yXum^2iQKa>|wtl=J}>Rk>v(kTqD~Bo()nPxO<*e z^lKbzu$`3ex5DD=we-D=?FUlww!b{USTHSdx=Nu_>(9O753C-~^lJ*wESCScsdBB9 zmDldyLNON_mCiRFk?}awcw`aVEybTR-#mNEzW&m({wMd_^5Wt@Xr%?N3HT#_$8Wpb zN=GerAsLSXg@cVOG+=~r{8lMmW2&KX!6@K-#SNt}_G?O}9;W`~HVNN3bdGvX$Ya~V zw9i<^?0qe>`GJ@vY%8@6XnnZwFtPiF@dnN>ZdnSwjK>cgmuJ^0GJP;bXwR;st|yik z(ocO}{f$qCar4J@bI%%VV3@LSxA*fT%8G@kN6hOgcYS? c#@hSkBi)|*CH`6b4j88lp00i_>zopr0G|KJPXGV_ literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/ic_delete_white_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_delete_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..bd11b4c66ce16c9380af0941567031454e81d02e GIT binary patch literal 495 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@Zgyv2VBF^E;uumf=j|QCY>`Bfwu=JS zw2mnpT(IcKsriY@H#BZ!Cob-tI`x)|wC~ELy<3x>&%YQI;^J$-xLV}o#v7pmDS1uC zzf%uaKiGEqPI`OfwjXJEdP;pvJsUcNZO^RuYPa`L;hkgYIbRIQH{PgPAD1Bc{R40H zuZ_Lz7FVnG|8EktnRCao_Nd{{HSa5WHn08uhq?d5ABN9aLg^auAD=Z`-(r`tfS*~< zS~r^Wif$tpXNboFCnixg-V*uO#&+4xY*7aPZX2B5Y!I=akM!7HSI3Vtw^l<#WI{6Rr|o>)z@2`(^Ls2)>wf(<0$JXLvMA)Y0rWX0iKk z>)m^l)a{^r=fLr0oV#id%F4{HTHv`v)aGc~WuE`rdefu!?_zqsA?;7D?6ml;yfz10 zmlf6>_KZ2kz2`9hpE;j$9@@q|;+hs+{*(JzZ+u;e)N|>xk~)d|O8Yx*Opm|pYH<0C Tc#eZw?LI_moH?*1-caYw{@t7% z9e;H9N!2l(Kl*Lc&i|}yy8g0$xOZp%^-7+U1q&LR*tn!LGO#cbc(&yIV6+jtZGQHz zX+iv(c&7Dd{~oqFzk{jnm2g2^&U};a^BXrO)%O=pE&I0pwT+UJ(*K#Mhog_Jt?6oh z_D{${?^}7p>u3MgoO|qf%e@zmO<<{G4y)VvuiRhTH~Y8tgDp4iv%Z`4JGxX(P;lb^ zGm9RIK33NVeq-`oyeImnNb~{M;`+_!jQOJMzxEbN%z3nH=l^pS&wUCR_n3VD{@P~V zlG-aA*gXYxg#`0iX}Q4v_p`3unIBxg{Z`7J^Dp1zU#WC?BL0&tnlG_7R(jnJU?ebj My85}Sb4q9e03TGkZU6uP literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/ic_grid_white_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_grid_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..ebe059481e836a0264e83096628fc1b1ce6023db GIT binary patch literal 419 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@Zgyv2V9fG#aSW-L^Y->auVzM(wugxV zZPOZ!0`D{_9O{b5aT62^V{x3Y_3qT~37@3G_HfKD|0tDaCttzSx0ip;uh!`Y>wf%X zXZHN%{^BQ7*wJr`cJgn~`Ig^UT3nyBU{)g&GbF(9e?nGzPS~X-eH)JB2cDuVN;?1mG^7U&HnBEV9^bGre|mW zHXBV)@x0xAcJq<^_iPq=+uYCojefA=hCM^t*}s29GVbmuPYBGpZ~FcEfju|oGp;}T zw~*_~Mq&R;vN(JMvN1uO$ych}?c-iigPeE%8uy|Ze;?SfbALG7q%YI=G5(IxZ9H?7 RIT;xE44$rjF6*2UngGv?vcv!Y literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/ic_list_black_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_list_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..52d0c00a17994990d99d28d8cc949109e2187854 GIT binary patch literal 292 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@ZgvM!uRUEHLn`LHy=j=`6e!U8P+qC) zfw!PE^R7;j&Iep7LQT;e5j%sWt2cVhJfy_kaWvcb^MO~rf8^(UGFiTpSzN_)5(vEv z6Mn!jr)iJM-4(%_?hh=bUkLtS{MWQ*Qr?x7Q{odII`BOKp}#)Q9he`;-e8-l22v=0 zz(U$%(vn?l2c&-Re40|S*l%ghi;8EqB72v}o@kUg(O5P6Tw~h-@eTY&-n#;q2bFD+ z7oVhZcOmlzP{PuJJ8zzopr08o&4p8x;= literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/ic_list_white_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_list_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..e5f698298456b7cb877e2352de76ad338dcf2a03 GIT binary patch literal 295 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@ZgvM!?>t=`Ln`LHy=Lge93bF&vB6Pr zlE^KM8NN#l8rL|82yR!1*cm+g%R#NBt*zWU%rfuu-1u9-@AGrk?LYQ2JtnDm0@0=Y z48{+HZ?s2?-rgelvg|;vXa-}=#X(|b2V6x@fb>j4=*i%#VYGjE4QwQHfjBeBkw6sml7DY( WbI`(vbM66s&fw|l=d#Wzp$Py9vUe{4 literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_delete_black_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_delete_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..ab07ea2ae96b3ffd072d9644d118d8b55bda90dc GIT binary patch literal 541 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7Ro>V0_}~;uumf=k4A7tIik79RK+I zk&Jo_BXg?J9M>Q=<>sX6(gCLqEa1^Q@Jw%t_k=TQrA2D0PyJ^~q%1gGV70jQ{PW*` z{#Mw%DrKDi{qy(N<=dD&C#f9ZOklq;cZ=+UD@p4kjnf;hA2@%qnmI@R%d)K-dG{p$ z`^f)|(_;IH)7K6}CiFk;tKVSz;1JXM=*;Pj=XL7;G}kh&^Q(WVa=c-E#qsE=wak70 zpX&biVC32$q}{NG=>&qf%#_1W-cbGj=ete+6MZJRluG|!Kj~(*!J8;y5r;5_NX8V_ z38DkRxO>R{!kfGDWotR}9>`~W%j4U9jpg}Aev@kP_Sozu-Uqh-CZ@er-eCDAYH|$o zzQ^*}U+NgHv){{{<$S>SPjl}*?gt+ZSo@Z;RCLyF39M$7k*!+DI)`Q6qd)5(1m0$z z$Gp5fF3oZF0q1Y^Gp=hMk^8_{!IHzfzbk=z2a8SG|JQ%YT(@)EFs}R1FJtF9>CZ9! Ysek4lOXgEx0Y*E6r>mdKI;Vst04N09wEzGB literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_delete_white_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_delete_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..a8358eb71286cb51ee10a3633a3f24ebfe0a933f GIT binary patch literal 547 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7Ro>V0`82;uumf=j~nFEYU=U)`uoi z%_q6G1Z>#kp{x`Uk)@cSpXVT;lcX4t!dUjssen`IT9}i;RD~w{gr%(!8s9hWh}j@n zKk1I8uq}TL_m6X@4KANOGHx<) zm^Pq-VtLE2OCJ3D=t@!oSBc}vUXTDV`9x)o^d{jBhLzSSOY{Vgu?8)n`6IlVyk z{vl`G!{v88-v5raXj=Yo+x zWnOhtsEt9rq5Lud<2}cn*DNi+W4`90k=#uCbNOmjWgjKN|93uIy=qm~4gRywycD%B Ss~-nOK7*&LpUXO@geCwAq2jUt literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_grid_black_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_grid_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..fe78d853e74f89291e5f1002f193801d8fd1138b GIT binary patch literal 363 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7Ro>U^Mb{aSW-L^Y-q>Tqj2X*Nftf zvFoK5Fx9aKG%!Er(l}IPTh?Gce`=a)cl|mO#aUP9b*L&#RPp@3O84a6NeqY}38*cjl9&RSn5V086#aSW-L^Y-q+%)<^Mu7T^{ zthi?~fol!l8>THC!Hr!4tDdJm%whg~l1K1I%#5X#PRCbs9$7wF#nZ~q^O;Ka^J48c z-|xjuUeo%wpYiv1mFcIrU)&9=V06}cqtE>8yNWQ-CVW7K;lZ?&*EM$B`U}2)n|4e5 zfmOo)iP!8;c~4UDob)B?XzYdk_gU96%i%KvDyQHH)N?6&>hu5SU=;LpaSW-L^Y+eKuhKw~)`yJ$ z?yQwK6ZL1E;}*`O&9htr>?VsVm>E{c-twFKc?oB=E&ram4IfWd~YbdU?pCapWtK=NmQ1i<=1FgO$YU^vvF&zt!)}%T z-R~yLnB|3*hrL|*F$`#!kELf(WXY^23kp~7+U%9yyZzQj-Had66Bv0m>;!8wK2X3W zagO2eThjxTlU6V4{_;;?^}98f_8*I8WMD9OYIQRCqHmS`xwSyC+{bInYPhBTiKQ?w z=jb791{zV#`(e_PR2tQ+DP=@0BoMa8a1Lb+N&0-mmZF6*2UngDQH BgQfrg literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_list_white_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_list_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..053a1a0da97aa4ac5f9aa2d4836fe12394d87bc3 GIT binary patch literal 320 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7Ro>U}X1naSW-L^Y)IlSBs-S>qSQS z-J;CNz9qbiW-6pDb5qig+R0!j%zV9&H^!m#utDn=%Yw^Z`!Z%dyq^O!1PmHfRVsZx zg}%`|dGNs6SLd{jcw lu3HAQ_#W6|um>3a-_n=QIhto+n7jfc;OXk;vd$@?2>{=GdBFex literal 0 HcmV?d00001 diff --git a/app/src/main/res/layout-large-land/activity_main_player.xml b/app/src/main/res/layout-large-land/activity_main_player.xml index 7d7e1230e..5f484267b 100644 --- a/app/src/main/res/layout-large-land/activity_main_player.xml +++ b/app/src/main/res/layout-large-land/activity_main_player.xml @@ -239,7 +239,7 @@ android:focusable="true" android:padding="5dp" android:scaleType="fitXY" - android:src="@drawable/list" + android:src="@drawable/ic_list_white_24dp" android:background="?attr/selectableItemBackground" tools:ignore="ContentDescription,RtlHardcoded"/> diff --git a/app/src/main/res/layout/activity_main_player.xml b/app/src/main/res/layout/activity_main_player.xml index 3dccc5c4c..8cf9ba32f 100644 --- a/app/src/main/res/layout/activity_main_player.xml +++ b/app/src/main/res/layout/activity_main_player.xml @@ -237,7 +237,7 @@ android:focusable="true" android:padding="5dp" android:scaleType="fitXY" - android:src="@drawable/list" + android:src="@drawable/ic_list_white_24dp" android:background="?attr/selectableItemBackground" tools:ignore="ContentDescription,RtlHardcoded"/> diff --git a/app/src/main/res/menu/download_menu.xml b/app/src/main/res/menu/download_menu.xml index e79367135..4e2b32715 100644 --- a/app/src/main/res/menu/download_menu.xml +++ b/app/src/main/res/menu/download_menu.xml @@ -3,17 +3,17 @@ xmlns:app="http://schemas.android.com/apk/res-auto"> - - + android:icon="?attr/ic_delete" + android:title="@string/clear_finished_download" + app:showAsAction="ifRoom" /> + + + diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index 7b879fb4c..c0e7fa532 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -38,6 +38,9 @@ + + + diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 87e19cede..da1ae0e38 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -22,7 +22,6 @@ @drawable/ic_info_outline_black_24dp @drawable/ic_bug_report_black_24dp @drawable/ic_headset_black_24dp - @drawable/ic_delete_sweep_white_24dp @drawable/ic_file_download_black_24dp @drawable/ic_share_black_24dp @drawable/ic_cast_black_24dp @@ -54,6 +53,9 @@ @drawable/ic_add_black_24dp @drawable/ic_settings_backup_restore_black_24dp @drawable/ic_blank_page_black_24dp + @drawable/ic_list_black_24dp + @drawable/ic_grid_black_24dp + @drawable/ic_delete_black_24dp @color/light_separator_color @color/light_contrast_background_color @@ -82,7 +84,6 @@ @drawable/ic_headset_white_24dp @drawable/ic_info_outline_white_24dp @drawable/ic_bug_report_white_24dp - @drawable/ic_delete_sweep_black_24dp @drawable/ic_file_download_white_24dp @drawable/ic_share_white_24dp @drawable/ic_cast_white_24dp @@ -114,6 +115,9 @@ @drawable/ic_add_white_24dp @drawable/ic_settings_backup_restore_white_24dp @drawable/ic_blank_page_white_24dp + @drawable/ic_list_white_24dp + @drawable/ic_grid_white_24dp + @drawable/ic_delete_white_24dp @color/dark_separator_color @color/dark_contrast_background_color From ecabbb57e62523fdab31e73d0246d3be05bf8cfc Mon Sep 17 00:00:00 2001 From: kapodamy Date: Sat, 15 Dec 2018 20:57:25 -0300 Subject: [PATCH 3/9] Update download_menu.xml * hide clear button by default --- app/src/main/res/menu/download_menu.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/menu/download_menu.xml b/app/src/main/res/menu/download_menu.xml index 4e2b32715..02efde55b 100644 --- a/app/src/main/res/menu/download_menu.xml +++ b/app/src/main/res/menu/download_menu.xml @@ -8,6 +8,7 @@ app:showAsAction="ifRoom" /> From 8fed18b2acdd1844d6a999330dea3f99714a5f23 Mon Sep 17 00:00:00 2001 From: kapodamy Date: Sat, 15 Dec 2018 20:58:28 -0300 Subject: [PATCH 4/9] Update MissionAdapter.java * check if the iterator is initialized --- .../giga/ui/adapter/MissionAdapter.java | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java b/app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java index df5f9e429..5057ed6db 100644 --- a/app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java +++ b/app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java @@ -158,7 +158,7 @@ public class MissionAdapter extends Adapter { str = R.string.missions_header_pending; } else { str = R.string.missions_header_finished; - setClearButtonVisibility(true); + mClear.setVisible(true); } ((ViewHolderHeader) view).header.setText(str); @@ -437,7 +437,7 @@ public class MissionAdapter extends Adapter { public void clearFinishedDownloads() { mDownloadManager.forgetFinishedDownloads(); applyChanges(); - setClearButtonVisibility(false); + mClear.setVisible(false); } private boolean handlePopupItem(@NonNull ViewHolderItem h, @NonNull MenuItem option) { @@ -506,11 +506,7 @@ public class MissionAdapter extends Adapter { mIterator.end(); checkEmptyMessageVisibility(); - - if (mIterator.getOldListSize() > 0) { - int lastItemType = mIterator.getSpecialAtItem(mIterator.getOldListSize() - 1); - setClearButtonVisibility(lastItemType == DownloadManager.SPECIAL_FINISHED); - } + checkClearButtonVisibility(mClear); } public void forceUpdate() { @@ -529,15 +525,18 @@ public class MissionAdapter extends Adapter { } public void setClearButton(MenuItem clearButton) { - if (mClear == null) { - int lastItemType = mIterator.getSpecialAtItem(mIterator.getOldListSize() - 1); - clearButton.setVisible(lastItemType == DownloadManager.SPECIAL_FINISHED); - } + if (mClear == null) checkClearButtonVisibility(clearButton); mClear = clearButton; } - private void setClearButtonVisibility(boolean flag) { - mClear.setVisible(flag); + private void checkClearButtonVisibility(MenuItem clearButton) { + if (mIterator.getOldListSize() < 1) { + clearButton.setVisible(false); + return; + } + + DownloadManager.MissionItem item = mIterator.getItem(mIterator.getOldListSize() - 1); + clearButton.setVisible(item.special == DownloadManager.SPECIAL_FINISHED || item.mission instanceof FinishedMission); } private void checkEmptyMessageVisibility() { From df4dd0122f60a426a552bfbc03647b978721dc51 Mon Sep 17 00:00:00 2001 From: kapodamy Date: Mon, 14 Jan 2019 22:54:44 -0300 Subject: [PATCH 5/9] Update missions_header.xml make the separator line """"""""simetric"""""""""" --- app/src/main/res/layout/missions_header.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/layout/missions_header.xml b/app/src/main/res/layout/missions_header.xml index 9505a2fce..6de38664d 100644 --- a/app/src/main/res/layout/missions_header.xml +++ b/app/src/main/res/layout/missions_header.xml @@ -4,8 +4,8 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="30dp" - android:layout_marginRight="16dp" - android:layout_marginEnd="16dp" + android:layout_marginRight="8dp" + android:layout_marginEnd="8dp" android:layout_marginTop="16dp" android:orientation="vertical" android:layout_marginLeft="8dp" From c4a5e8dc86fd6060bc21effc5f6f9242760741d4 Mon Sep 17 00:00:00 2001 From: kapodamy Date: Tue, 15 Jan 2019 14:58:56 -0300 Subject: [PATCH 6/9] misc fixes * add null checks before resuming a download * (MissionAdapter.java) reset percent after resuming a download. prevents the "Error" string get stuck, until the download start --- app/src/main/java/us/shandian/giga/get/DownloadMission.java | 5 +++-- .../java/us/shandian/giga/ui/adapter/MissionAdapter.java | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/us/shandian/giga/get/DownloadMission.java b/app/src/main/java/us/shandian/giga/get/DownloadMission.java index c25d517f1..b41cfc350 100644 --- a/app/src/main/java/us/shandian/giga/get/DownloadMission.java +++ b/app/src/main/java/us/shandian/giga/get/DownloadMission.java @@ -407,7 +407,8 @@ public class DownloadMission extends Mission { // ensure that the previous state is completely paused. joinForThread(init); - for (Thread thread : threads) joinForThread(thread); + if (threads != null) + for (Thread thread : threads) joinForThread(thread); enqueued = false; running = true; @@ -420,7 +421,7 @@ public class DownloadMission extends Mission { init = null; - if (threads.length < 1) { + if (threads == null || threads.length < 1) { threads = new Thread[currentThreadCount]; } diff --git a/app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java b/app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java index 5057ed6db..28e7ef480 100644 --- a/app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java +++ b/app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java @@ -447,6 +447,7 @@ public class MissionAdapter extends Adapter { if (mission != null) { switch (id) { case R.id.start: + h.status.setText(UNDEFINED_SPEED); h.state = -1; h.size.setText(Utility.formatBytes(mission.getLength())); mDownloadManager.resumeMission(mission); From 9db272f30ed12ed1c1b389572cac8c500ad07f18 Mon Sep 17 00:00:00 2001 From: kapodamy Date: Fri, 18 Jan 2019 14:32:28 -0300 Subject: [PATCH 7/9] Update MissionsFragment.java use another way to get the "Context" --- .../giga/ui/fragment/MissionsFragment.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java b/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java index a4be9301e..33e7b0a8a 100644 --- a/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java +++ b/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java @@ -43,7 +43,7 @@ public class MissionsFragment extends Fragment { private MissionAdapter mAdapter; private GridLayoutManager mGridManager; private LinearLayoutManager mLinearManager; - private Context mActivity; + private Context mContext; private DMBinder mBinder; private Bundle mBundle; @@ -56,7 +56,7 @@ public class MissionsFragment extends Fragment { mBinder = (DownloadManagerService.DMBinder) binder; mBinder.clearDownloadNotifications(); - mAdapter = new MissionAdapter(mActivity, mBinder.getDownloadManager(), mClear, mEmpty); + mAdapter = new MissionAdapter(mContext, mBinder.getDownloadManager(), mClear, mEmpty); mAdapter.deleterLoad(mBundle, getView()); mBundle = null; @@ -82,11 +82,11 @@ public class MissionsFragment extends Fragment { mPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); mLinear = mPrefs.getBoolean("linear", false); - mActivity = getActivity(); + //mContext = getActivity().getApplicationContext(); mBundle = savedInstanceState; // Bind the service - mActivity.bindService(new Intent(mActivity, DownloadManagerService.class), mConnection, Context.BIND_AUTO_CREATE); + mContext.bindService(new Intent(mContext, DownloadManagerService.class), mConnection, Context.BIND_AUTO_CREATE); // Views mEmpty = v.findViewById(R.id.list_empty_view); @@ -117,13 +117,13 @@ public class MissionsFragment extends Fragment { * Added in API level 23. */ @Override - public void onAttach(Context activity) { - super.onAttach(activity); + public void onAttach(Context context) { + super.onAttach(context); // Bug: in api< 23 this is never called // so mActivity=null // so app crashes with null-pointer exception - mActivity = activity; + mContext = context; } /** @@ -134,7 +134,7 @@ public class MissionsFragment extends Fragment { public void onAttach(Activity activity) { super.onAttach(activity); - mActivity = activity; + mContext = activity.getApplicationContext(); } @@ -145,7 +145,7 @@ public class MissionsFragment extends Fragment { mBinder.removeMissionEventListener(mAdapter.getMessenger()); mBinder.enableNotifications(true); - mActivity.unbindService(mConnection); + mContext.unbindService(mConnection); mAdapter.deleterDispose(null); mBinder = null; @@ -199,7 +199,7 @@ public class MissionsFragment extends Fragment { @DrawableRes private int getDrawableFromAttribute(@AttrRes int ic) { - TypedArray styledAttributes = mActivity.obtainStyledAttributes(new int[]{ic}); + TypedArray styledAttributes = mContext.obtainStyledAttributes(new int[]{ic}); int resId = styledAttributes.getResourceId(0, -1); styledAttributes.recycle(); From 684cb8197435eb08d3a30191be37a9dfa3d93d1c Mon Sep 17 00:00:00 2001 From: kapodamy Date: Sat, 19 Jan 2019 16:22:24 -0300 Subject: [PATCH 8/9] Update MissionsFragment.java work-around for reading the current theme icons --- .../giga/ui/fragment/MissionsFragment.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java b/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java index 33e7b0a8a..25960a419 100644 --- a/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java +++ b/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java @@ -16,6 +16,7 @@ import android.support.annotation.DrawableRes; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; +import android.util.TypedValue; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; @@ -198,12 +199,20 @@ public class MissionsFragment extends Fragment { } @DrawableRes - private int getDrawableFromAttribute(@AttrRes int ic) { - TypedArray styledAttributes = mContext.obtainStyledAttributes(new int[]{ic}); - int resId = styledAttributes.getResourceId(0, -1); + private int getDrawableFromAttribute(@AttrRes int attr) { + TypedArray styledAttributes = mContext.getTheme().obtainStyledAttributes(new int[]{attr}); + int resId = styledAttributes.getResourceId(0, 0); styledAttributes.recycle(); - return resId; + if (resId != 0) { + return resId; + } else { + // work-around + styledAttributes = mContext.obtainStyledAttributes(new int[]{attr}); + resId = styledAttributes.getResourceId(0, 0); + styledAttributes.recycle(); + return resId; + } } @Override From f2285c0b191b70aa25961f7ad19516c715fa522b Mon Sep 17 00:00:00 2001 From: kapodamy Date: Mon, 21 Jan 2019 01:30:03 -0300 Subject: [PATCH 9/9] MP4 muxer +misc modifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * allow retry downloads with "post-processing failed" error in the new muxer * MPEG-4 muxer ¡¡ no DASH output!! * keep the progress if download fails * remove TODO in SecondaryStreamHelper.java * misc clean-up * delete TestAlgo.java * delete ExtSDDownloadFailedActivity.java and remove it from AndroidManifest.xml * use hardcored version for changing icon colors --- app/src/main/AndroidManifest.xml | 1 - .../newpipe/download/DownloadDialog.java | 7 +- .../download/ExtSDDownloadFailedActivity.java | 38 ----- .../newpipe/util/SecondaryStreamHelper.java | 1 - .../giga/get/DownloadInitializer.java | 1 - .../us/shandian/giga/get/DownloadMission.java | 123 +++++++++++----- .../giga/postprocessing/Mp4DashMuxer.java | 4 +- .../giga/postprocessing/Mp4Muxer.java | 136 ++++++++++++++++++ .../giga/postprocessing/Postprocessing.java | 123 +++++++++------- .../giga/postprocessing/TestAlgo.java | 54 ------- ...TttmlConverter.java => TtmlConverter.java} | 15 +- .../giga/postprocessing/WebMMuxer.java | 4 +- .../giga/service/DownloadManager.java | 30 ++-- .../giga/ui/adapter/MissionAdapter.java | 48 +++---- .../giga/ui/fragment/MissionsFragment.java | 32 ++--- 15 files changed, 357 insertions(+), 260 deletions(-) delete mode 100644 app/src/main/java/org/schabi/newpipe/download/ExtSDDownloadFailedActivity.java create mode 100644 app/src/main/java/us/shandian/giga/postprocessing/Mp4Muxer.java delete mode 100644 app/src/main/java/us/shandian/giga/postprocessing/TestAlgo.java rename app/src/main/java/us/shandian/giga/postprocessing/{TttmlConverter.java => TtmlConverter.java} (83%) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1bc205f33..5aa1dc982 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -119,7 +119,6 @@ - { - // should be safe run the following code without "getActivity().runOnUiThread()" if (listed) { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(R.string.download_dialog_title) @@ -511,11 +510,11 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck if (secondaryStream != null) { secondaryStreamUrl = secondaryStream.getStream().getUrl(); - psName = selectedStream.getFormat() == MediaFormat.MPEG_4 ? Postprocessing.ALGORITHM_MP4_DASH_MUXER : Postprocessing.ALGORITHM_WEBM_MUXER; + psName = selectedStream.getFormat() == MediaFormat.MPEG_4 ? Postprocessing.ALGORITHM_MP4_MUXER : Postprocessing.ALGORITHM_WEBM_MUXER; psArgs = null; long videoSize = wrappedVideoStreams.getSizeInBytes((VideoStream) selectedStream); - // set nearLength, only, if both sizes are fetched or known. this probably does not work on weak internet connections + // set nearLength, only, if both sizes are fetched or known. this probably does not work on slow networks if (secondaryStream.getSizeInBytes() > 0 && videoSize > 0) { nearLength = secondaryStream.getSizeInBytes() + videoSize; } diff --git a/app/src/main/java/org/schabi/newpipe/download/ExtSDDownloadFailedActivity.java b/app/src/main/java/org/schabi/newpipe/download/ExtSDDownloadFailedActivity.java deleted file mode 100644 index c02ef92eb..000000000 --- a/app/src/main/java/org/schabi/newpipe/download/ExtSDDownloadFailedActivity.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.schabi.newpipe.download; - -import android.app.AlertDialog; -import android.content.DialogInterface; -import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; - -import org.schabi.newpipe.R; -import org.schabi.newpipe.settings.NewPipeSettings; -import org.schabi.newpipe.util.ServiceHelper; -import org.schabi.newpipe.util.ThemeHelper; - -public class ExtSDDownloadFailedActivity extends AppCompatActivity { - @Override - protected void onCreate(@Nullable Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - ThemeHelper.setTheme(this, ServiceHelper.getSelectedServiceId(this)); - } - - @Override - protected void onStart() { - super.onStart(); - new AlertDialog.Builder(this) - .setTitle(R.string.download_to_sdcard_error_title) - .setMessage(R.string.download_to_sdcard_error_message) - .setPositiveButton(R.string.yes, (DialogInterface dialogInterface, int i) -> { - NewPipeSettings.resetDownloadFolders(this); - finish(); - }) - .setNegativeButton(R.string.cancel, (DialogInterface dialogInterface, int i) -> { - dialogInterface.dismiss(); - finish(); - }) - .create() - .show(); - } -} diff --git a/app/src/main/java/org/schabi/newpipe/util/SecondaryStreamHelper.java b/app/src/main/java/org/schabi/newpipe/util/SecondaryStreamHelper.java index a5d3ea3eb..b3522aea0 100644 --- a/app/src/main/java/org/schabi/newpipe/util/SecondaryStreamHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/SecondaryStreamHelper.java @@ -36,7 +36,6 @@ public class SecondaryStreamHelper { * @return selected audio stream or null if a candidate was not found */ public static AudioStream getAudioStreamFor(@NonNull List audioStreams, @NonNull VideoStream videoStream) { - // TODO: check if m4v and m4a selected streams are DASH compliant switch (videoStream.getFormat()) { case WEBM: case MPEG_4: diff --git a/app/src/main/java/us/shandian/giga/get/DownloadInitializer.java b/app/src/main/java/us/shandian/giga/get/DownloadInitializer.java index ce7ae267c..b864cf4fb 100644 --- a/app/src/main/java/us/shandian/giga/get/DownloadInitializer.java +++ b/app/src/main/java/us/shandian/giga/get/DownloadInitializer.java @@ -156,7 +156,6 @@ public class DownloadInitializer extends Thread { if (retryCount++ > mMission.maxRetry) { Log.e(TAG, "initializer failed", e); - mMission.running = false; mMission.notifyError(e); return; } diff --git a/app/src/main/java/us/shandian/giga/get/DownloadMission.java b/app/src/main/java/us/shandian/giga/get/DownloadMission.java index b41cfc350..243a8585a 100644 --- a/app/src/main/java/us/shandian/giga/get/DownloadMission.java +++ b/app/src/main/java/us/shandian/giga/get/DownloadMission.java @@ -39,7 +39,7 @@ public class DownloadMission extends Mission { public static final int ERROR_SSL_EXCEPTION = 1004; public static final int ERROR_UNKNOWN_HOST = 1005; public static final int ERROR_CONNECT_HOST = 1006; - public static final int ERROR_POSTPROCESSING_FAILED = 1007; + public static final int ERROR_POSTPROCESSING = 1007; public static final int ERROR_HTTP_NO_CONTENT = 204; public static final int ERROR_HTTP_UNSUPPORTED_RANGE = 206; @@ -79,9 +79,12 @@ public class DownloadMission extends Mission { public String postprocessingName; /** - * Indicates if the post-processing algorithm is actually running, used to detect corrupt downloads + * Indicates if the post-processing state: + * 0: ready + * 1: running + * 2: completed */ - public boolean postprocessingRunning; + public int postprocessingState; /** * Indicate if the post-processing algorithm works on the same file @@ -356,7 +359,7 @@ public class DownloadMission extends Mission { finishCount++; if (finishCount == currentThreadCount) { - if (errCode > ERROR_NOTHING) return; + if (errCode != ERROR_NOTHING) return; if (DEBUG) { Log.d(TAG, "onFinish" + (current + 1) + "/" + urls.length); @@ -382,19 +385,26 @@ public class DownloadMission extends Mission { } } - private void notifyPostProcessing(boolean processing) { + private void notifyPostProcessing(int state) { if (DEBUG) { - Log.d(TAG, (processing ? "enter" : "exit") + " postprocessing on " + location + File.separator + name); + String action; + switch (state) { + case 1: + action = "Running"; + break; + case 2: + action = "Completed"; + break; + default: + action = "Failed"; + } + + Log.d(TAG, action + " postprocessing on " + location + File.separator + name); } synchronized (blockState) { - if (!processing) { - postprocessingName = null; - postprocessingArgs = null; - } - // don't return without fully write the current state - postprocessingRunning = processing; + postprocessingState = state; Utility.writeToFile(metadata, DownloadMission.this); } } @@ -403,7 +413,7 @@ public class DownloadMission extends Mission { * Start downloading with multiple threads. */ public void start() { - if (running || current >= urls.length) return; + if (running || isFinished()) return; // ensure that the previous state is completely paused. joinForThread(init); @@ -414,6 +424,19 @@ public class DownloadMission extends Mission { running = true; errCode = ERROR_NOTHING; + if (current >= urls.length && postprocessingName != null) { + runAsync(1, () -> { + if (doPostprocessing()) { + running = false; + deleteThisFromFile(); + + notify(DownloadManagerService.MESSAGE_FINISHED); + } + }); + + return; + } + if (blocks < 0) { initializer(); return; @@ -445,18 +468,18 @@ public class DownloadMission extends Mission { public synchronized void pause() { if (!running) return; - running = false; - recovered = true; - enqueued = false; - - if (postprocessingRunning) { + if (isPsRunning()) { if (DEBUG) { Log.w(TAG, "pause during post-processing is not applicable."); } return; } - if (init != null && init.isAlive()) { + running = false; + recovered = true; + enqueued = false; + + if (init != null && Thread.currentThread() != init && init.isAlive()) { init.interrupt(); synchronized (blockState) { resetState(); @@ -533,13 +556,36 @@ public class DownloadMission extends Mission { mWritingToFile = false; } + /** + * Indicates if the download if fully finished + * + * @return true, otherwise, false + */ public boolean isFinished() { - return current >= urls.length && postprocessingName == null; + return current >= urls.length && (postprocessingName == null || postprocessingState == 2); + } + + /** + * Indicates if the download file is corrupt due a failed post-processing + * + * @return {@code true} if this mission is unrecoverable + */ + public boolean isPsFailed() { + return postprocessingName != null && errCode == DownloadMission.ERROR_POSTPROCESSING && postprocessingThis; + } + + /** + * Indicates if a post-processing algorithm is running + * + * @return true, otherwise, false + */ + public boolean isPsRunning() { + return postprocessingName != null && postprocessingState == 1; } public long getLength() { long calculated; - if (postprocessingRunning) { + if (postprocessingState == 1) { calculated = length; } else { calculated = offsets[current < offsets.length ? current : (offsets.length - 1)] + length; @@ -551,16 +597,19 @@ public class DownloadMission extends Mission { } private boolean doPostprocessing() { - if (postprocessingName == null) return true; + if (postprocessingName == null || postprocessingState == 2) return true; + + notifyPostProcessing(1); + notifyProgress(0); + + Thread.currentThread().setName("[" + TAG + "] post-processing = " + postprocessingName + " filename = " + name); + + Exception exception = null; try { - notifyPostProcessing(true); - notifyProgress(0); - - Thread.currentThread().setName("[" + TAG + "] post-processing = " + postprocessingName + " filename = " + name); - - Postprocessing algorithm = Postprocessing.getAlgorithm(postprocessingName, this); - algorithm.run(); + Postprocessing + .getAlgorithm(postprocessingName, this) + .run(); } catch (Exception err) { StringBuilder args = new StringBuilder(" "); if (postprocessingArgs != null) { @@ -572,15 +621,21 @@ public class DownloadMission extends Mission { } Log.e(TAG, String.format("Post-processing failed. algorithm = %s args = [%s]", postprocessingName, args), err); - notifyError(ERROR_POSTPROCESSING_FAILED, err); - return false; + if (errCode == ERROR_NOTHING) errCode = ERROR_POSTPROCESSING; + + exception = err; } finally { - notifyPostProcessing(false); + notifyPostProcessing(errCode == ERROR_NOTHING ? 2 : 0); } - if (errCode != ERROR_NOTHING) notify(DownloadManagerService.MESSAGE_ERROR); + if (errCode != ERROR_NOTHING) { + if (exception == null) exception = errObject; + notifyError(ERROR_POSTPROCESSING, exception); - return errCode == ERROR_NOTHING; + return false; + } + + return true; } private boolean deleteThisFromFile() { diff --git a/app/src/main/java/us/shandian/giga/postprocessing/Mp4DashMuxer.java b/app/src/main/java/us/shandian/giga/postprocessing/Mp4DashMuxer.java index b303b66cd..45c06dd4b 100644 --- a/app/src/main/java/us/shandian/giga/postprocessing/Mp4DashMuxer.java +++ b/app/src/main/java/us/shandian/giga/postprocessing/Mp4DashMuxer.java @@ -13,9 +13,7 @@ import us.shandian.giga.get.DownloadMission; class Mp4DashMuxer extends Postprocessing { Mp4DashMuxer(DownloadMission mission) { - super(mission); - recommendedReserve = 15360 * 1024;// 15 MiB - worksOnSameFile = true; + super(mission, 15360 * 1024/* 15 MiB */, true); } @Override diff --git a/app/src/main/java/us/shandian/giga/postprocessing/Mp4Muxer.java b/app/src/main/java/us/shandian/giga/postprocessing/Mp4Muxer.java new file mode 100644 index 000000000..bf932d5c1 --- /dev/null +++ b/app/src/main/java/us/shandian/giga/postprocessing/Mp4Muxer.java @@ -0,0 +1,136 @@ +package us.shandian.giga.postprocessing; + +import android.media.MediaCodec.BufferInfo; +import android.media.MediaExtractor; +import android.media.MediaMuxer; +import android.media.MediaMuxer.OutputFormat; +import android.util.Log; + +import static org.schabi.newpipe.BuildConfig.DEBUG; + +import org.schabi.newpipe.streams.io.SharpStream; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.nio.ByteBuffer; + +import us.shandian.giga.get.DownloadMission; + + +class Mp4Muxer extends Postprocessing { + private static final String TAG = "Mp4Muxer"; + private static final int NOTIFY_BYTES_INTERVAL = 128 * 1024;// 128 KiB + + Mp4Muxer(DownloadMission mission) { + super(mission, 0, false); + } + + @Override + int process(SharpStream out, SharpStream... sources) throws IOException { + File dlFile = mission.getDownloadedFile(); + File tmpFile = new File(mission.location, mission.name.concat(".tmp")); + + if (tmpFile.exists()) + if (!tmpFile.delete()) return DownloadMission.ERROR_FILE_CREATION; + + if (!tmpFile.createNewFile()) return DownloadMission.ERROR_FILE_CREATION; + + FileInputStream source = null; + MediaMuxer muxer = null; + + //noinspection TryFinallyCanBeTryWithResources + try { + source = new FileInputStream(dlFile); + MediaExtractor tracks[] = { + getMediaExtractor(source, mission.offsets[0], mission.offsets[1] - mission.offsets[0]), + getMediaExtractor(source, mission.offsets[1], mission.length - mission.offsets[1]) + }; + + muxer = new MediaMuxer(tmpFile.getAbsolutePath(), OutputFormat.MUXER_OUTPUT_MPEG_4); + + int tracksIndex[] = { + muxer.addTrack(tracks[0].getTrackFormat(0)), + muxer.addTrack(tracks[1].getTrackFormat(0)) + }; + + ByteBuffer buffer = ByteBuffer.allocate(512 * 1024);// 512 KiB + BufferInfo info = new BufferInfo(); + + long written = 0; + long nextReport = NOTIFY_BYTES_INTERVAL; + + muxer.start(); + + while (true) { + int done = 0; + + for (int i = 0; i < tracks.length; i++) { + if (tracksIndex[i] < 0) continue; + + info.set(0, + tracks[i].readSampleData(buffer, 0), + tracks[i].getSampleTime(), + tracks[i].getSampleFlags() + ); + + if (info.size >= 0) { + muxer.writeSampleData(tracksIndex[i], buffer, info); + written += info.size; + done++; + } + if (!tracks[i].advance()) { + // EOF reached + tracks[i].release(); + tracksIndex[i] = -1; + } + + if (written > nextReport) { + nextReport = written + NOTIFY_BYTES_INTERVAL; + super.progressReport(written); + } + } + + if (done < 1) break; + } + + // this part should not fail + if (!dlFile.delete()) return DownloadMission.ERROR_FILE_CREATION; + if (!tmpFile.renameTo(dlFile)) return DownloadMission.ERROR_FILE_CREATION; + + return OK_RESULT; + } finally { + try { + if (muxer != null) { + muxer.stop(); + muxer.release(); + } + } catch (Exception err) { + if (DEBUG) + Log.e(TAG, "muxer stop/release failed", err); + } + + if (source != null) { + try { + source.close(); + } catch (IOException e) { + // nothing to do + } + } + + // if the operation fails, delete the temporal file + if (tmpFile.exists()) { + //noinspection ResultOfMethodCallIgnored + tmpFile.delete(); + } + } + } + + private MediaExtractor getMediaExtractor(FileInputStream source, long offset, long length) throws IOException { + MediaExtractor extractor = new MediaExtractor(); + extractor.setDataSource(source.getFD(), offset, length); + extractor.selectTrack(0); + + return extractor; + } +} diff --git a/app/src/main/java/us/shandian/giga/postprocessing/Postprocessing.java b/app/src/main/java/us/shandian/giga/postprocessing/Postprocessing.java index 80726f705..635140bd3 100644 --- a/app/src/main/java/us/shandian/giga/postprocessing/Postprocessing.java +++ b/app/src/main/java/us/shandian/giga/postprocessing/Postprocessing.java @@ -18,21 +18,21 @@ public abstract class Postprocessing { public static final String ALGORITHM_TTML_CONVERTER = "ttml"; public static final String ALGORITHM_MP4_DASH_MUXER = "mp4D"; + public static final String ALGORITHM_MP4_MUXER = "mp4"; public static final String ALGORITHM_WEBM_MUXER = "webm"; - private static final String ALGORITHM_TEST_ALGO = "test"; public static Postprocessing getAlgorithm(String algorithmName, DownloadMission mission) { if (null == algorithmName) { throw new NullPointerException("algorithmName"); } else switch (algorithmName) { case ALGORITHM_TTML_CONVERTER: - return new TttmlConverter(mission); + return new TtmlConverter(mission); case ALGORITHM_MP4_DASH_MUXER: return new Mp4DashMuxer(mission); + case ALGORITHM_MP4_MUXER: + return new Mp4Muxer(mission); case ALGORITHM_WEBM_MUXER: return new WebMMuxer(mission); - case ALGORITHM_TEST_ALGO: - return new TestAlgo(mission); /*case "example-algorithm": return new ExampleAlgorithm(mission);*/ default: @@ -52,71 +52,84 @@ public abstract class Postprocessing { */ public int recommendedReserve; + /** + * the download to post-process + */ protected DownloadMission mission; - Postprocessing(DownloadMission mission) { + Postprocessing(DownloadMission mission, int recommendedReserve, boolean worksOnSameFile) { this.mission = mission; + this.recommendedReserve = recommendedReserve; + this.worksOnSameFile = worksOnSameFile; } public void run() throws IOException { File file = mission.getDownloadedFile(); CircularFile out = null; - ChunkFileInputStream[] sources = new ChunkFileInputStream[mission.urls.length]; + int result; + long finalLength = -1; - try { - int i = 0; - for (; i < sources.length - 1; i++) { - sources[i] = new ChunkFileInputStream(file, mission.offsets[i], mission.offsets[i + 1], "rw"); - } - sources[i] = new ChunkFileInputStream(file, mission.offsets[i], mission.getDownloadedFile().length(), "rw"); + mission.done = 0; + mission.length = file.length(); - int[] idx = {0}; - CircularFile.OffsetChecker checker = () -> { - while (idx[0] < sources.length) { - /* - * WARNING: never use rewind() in any chunk after any writing (especially on first chunks) - * or the CircularFile can lead to unexpected results - */ - if (sources[idx[0]].isDisposed() || sources[idx[0]].available() < 1) { - idx[0]++; - continue;// the selected source is not used anymore + if (worksOnSameFile) { + ChunkFileInputStream[] sources = new ChunkFileInputStream[mission.urls.length]; + try { + int i = 0; + for (; i < sources.length - 1; i++) { + sources[i] = new ChunkFileInputStream(file, mission.offsets[i], mission.offsets[i + 1], "rw"); + } + sources[i] = new ChunkFileInputStream(file, mission.offsets[i], mission.getDownloadedFile().length(), "rw"); + + int[] idx = {0}; + CircularFile.OffsetChecker checker = () -> { + while (idx[0] < sources.length) { + /* + * WARNING: never use rewind() in any chunk after any writing (especially on first chunks) + * or the CircularFile can lead to unexpected results + */ + if (sources[idx[0]].isDisposed() || sources[idx[0]].available() < 1) { + idx[0]++; + continue;// the selected source is not used anymore + } + + return sources[idx[0]].getFilePointer() - 1; } - return sources[idx[0]].getFilePointer() - 1; + return -1; + }; + out = new CircularFile(file, 0, this::progressReport, checker); + + result = process(out, sources); + + if (result == OK_RESULT) + finalLength = out.finalizeFile(); + } finally { + for (SharpStream source : sources) { + if (source != null && !source.isDisposed()) { + source.dispose(); + } } - - return -1; - }; - - out = new CircularFile(file, 0, this::progressReport, checker); - - mission.done = 0; - mission.length = file.length(); - - int result = process(out, sources); - - if (result == OK_RESULT) { - long finalLength = out.finalizeFile(); - mission.done = finalLength; - mission.length = finalLength; - } else { - mission.errCode = DownloadMission.ERROR_UNKNOWN_EXCEPTION; - mission.errObject = new RuntimeException("post-processing algorithm returned " + result); - } - - if (result != OK_RESULT && worksOnSameFile) { - //noinspection ResultOfMethodCallIgnored - new File(mission.location, mission.name).delete(); - } - } finally { - for (SharpStream source : sources) { - if (source != null && !source.isDisposed()) { - source.dispose(); + if (out != null) { + out.dispose(); } } - if (out != null) { - out.dispose(); - } + } else { + result = process(null); + } + + if (result == OK_RESULT) { + if (finalLength < 0) finalLength = file.length(); + mission.done = finalLength; + mission.length = finalLength; + } else { + mission.errCode = DownloadMission.ERROR_UNKNOWN_EXCEPTION; + mission.errObject = new RuntimeException("post-processing algorithm returned " + result); + } + + if (result != OK_RESULT && worksOnSameFile) { + //noinspection ResultOfMethodCallIgnored + file.delete(); } } @@ -138,7 +151,7 @@ public abstract class Postprocessing { return mission.postprocessingArgs[index]; } - private void progressReport(long done) { + void progressReport(long done) { mission.done = done; if (mission.length < mission.done) mission.length = mission.done; diff --git a/app/src/main/java/us/shandian/giga/postprocessing/TestAlgo.java b/app/src/main/java/us/shandian/giga/postprocessing/TestAlgo.java deleted file mode 100644 index 66b235d7c..000000000 --- a/app/src/main/java/us/shandian/giga/postprocessing/TestAlgo.java +++ /dev/null @@ -1,54 +0,0 @@ -package us.shandian.giga.postprocessing; - -import android.util.Log; - -import org.schabi.newpipe.streams.io.SharpStream; - -import java.io.IOException; -import java.util.Random; - -import us.shandian.giga.get.DownloadMission; - -/** - * Algorithm for testing proposes - */ -class TestAlgo extends Postprocessing { - - public TestAlgo(DownloadMission mission) { - super(mission); - - worksOnSameFile = true; - recommendedReserve = 4096 * 1024;// 4 KiB - } - - @Override - int process(SharpStream out, SharpStream... sources) throws IOException { - - int written = 0; - int size = 5 * 1024 * 1024;// 5 MiB - byte[] buffer = new byte[8 * 1024];//8 KiB - mission.length = size; - - Random rnd = new Random(); - - // only write random data - sources[0].dispose(); - - while (written < size) { - rnd.nextBytes(buffer); - - int read = Math.min(buffer.length, size - written); - out.write(buffer, 0, read); - - try { - Thread.sleep((int) (Math.random() * 10)); - } catch (InterruptedException e) { - return -1; - } - - written += read; - } - - return Postprocessing.OK_RESULT; - } -} diff --git a/app/src/main/java/us/shandian/giga/postprocessing/TttmlConverter.java b/app/src/main/java/us/shandian/giga/postprocessing/TtmlConverter.java similarity index 83% rename from app/src/main/java/us/shandian/giga/postprocessing/TttmlConverter.java rename to app/src/main/java/us/shandian/giga/postprocessing/TtmlConverter.java index 4c9d44548..390061840 100644 --- a/app/src/main/java/us/shandian/giga/postprocessing/TttmlConverter.java +++ b/app/src/main/java/us/shandian/giga/postprocessing/TtmlConverter.java @@ -18,13 +18,12 @@ import us.shandian.giga.postprocessing.io.SharpInputStream; /** * @author kapodamy */ -class TttmlConverter extends Postprocessing { - private static final String TAG = "TttmlConverter"; +class TtmlConverter extends Postprocessing { + private static final String TAG = "TtmlConverter"; - TttmlConverter(DownloadMission mission) { - super(mission); - recommendedReserve = 0;// due how XmlPullParser works, the xml is fully loaded on the ram - worksOnSameFile = true; + TtmlConverter(DownloadMission mission) { + // due how XmlPullParser works, the xml is fully loaded on the ram + super(mission, 0, true); } @Override @@ -41,7 +40,7 @@ class TttmlConverter extends Postprocessing { out, getArgumentAt(1, "true").equals("true"), getArgumentAt(2, "true").equals("true") - ); + ); } catch (Exception err) { Log.e(TAG, "subtitle parse failed", err); @@ -56,7 +55,7 @@ class TttmlConverter extends Postprocessing { } else if (err instanceof XPathExpressionException) { return 7; } - + return 8; } diff --git a/app/src/main/java/us/shandian/giga/postprocessing/WebMMuxer.java b/app/src/main/java/us/shandian/giga/postprocessing/WebMMuxer.java index 009a9a66b..2ffb0f08d 100644 --- a/app/src/main/java/us/shandian/giga/postprocessing/WebMMuxer.java +++ b/app/src/main/java/us/shandian/giga/postprocessing/WebMMuxer.java @@ -15,9 +15,7 @@ import us.shandian.giga.get.DownloadMission; class WebMMuxer extends Postprocessing { WebMMuxer(DownloadMission mission) { - super(mission); - recommendedReserve = 2048 * 1024;// 2 MiB - worksOnSameFile = true; + super(mission, 2048 * 1024/* 2 MiB */, true); } @Override diff --git a/app/src/main/java/us/shandian/giga/service/DownloadManager.java b/app/src/main/java/us/shandian/giga/service/DownloadManager.java index 6bcf84745..883c26850 100644 --- a/app/src/main/java/us/shandian/giga/service/DownloadManager.java +++ b/app/src/main/java/us/shandian/giga/service/DownloadManager.java @@ -141,15 +141,18 @@ public class DownloadManager { File dl = mis.getDownloadedFile(); boolean exists = dl.exists(); - if (mis.postprocessingRunning && mis.postprocessingThis) { - // Incomplete post-processing results in a corrupted download file - // because the selected algorithm works on the same file to save space. - if (!dl.delete()) { - Log.w(TAG, "Unable to delete incomplete download file: " + sub.getPath()); + if (mis.isPsRunning()) { + if (mis.postprocessingThis) { + // Incomplete post-processing results in a corrupted download file + // because the selected algorithm works on the same file to save space. + if (exists && dl.isFile() && !dl.delete()) + Log.w(TAG, "Unable to delete incomplete download file: " + sub.getPath()); + + exists = true; } - exists = true; - mis.postprocessingRunning = false; - mis.errCode = DownloadMission.ERROR_POSTPROCESSING_FAILED; + + mis.postprocessingState = 0; + mis.errCode = DownloadMission.ERROR_POSTPROCESSING; mis.errObject = new RuntimeException("stopped unexpectedly"); } else if (exists && !dl.isFile()) { // probably a folder, this should never happens @@ -332,7 +335,7 @@ public class DownloadManager { int count = 0; synchronized (this) { for (DownloadMission mission : mMissionsPending) { - if (mission.running && mission.errCode != DownloadMission.ERROR_POSTPROCESSING_FAILED && !mission.isFinished()) + if (mission.running && !mission.isFinished() && !mission.isPsFailed()) count++; } } @@ -471,7 +474,7 @@ public class DownloadManager { boolean flag = false; synchronized (this) { for (DownloadMission mission : mMissionsPending) { - if (mission.running && mission.isFinished() && !mission.postprocessingRunning) { + if (mission.running && !mission.isFinished() && !mission.isPsRunning()) { flag = true; mission.pause(); } @@ -528,6 +531,8 @@ public class DownloadManager { ArrayList current; ArrayList hidden; + boolean hasFinished = false; + private MissionIterator() { hidden = new ArrayList<>(2); current = null; @@ -563,6 +568,7 @@ public class DownloadManager { list.addAll(finished); } + hasFinished = finished.size() > 0; return list; } @@ -637,6 +643,10 @@ public class DownloadManager { hidden.remove(mission); } + public boolean hasFinishedMissions() { + return hasFinished; + } + @Override public int getOldListSize() { diff --git a/app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java b/app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java index 28e7ef480..1b5b98145 100644 --- a/app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java +++ b/app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java @@ -59,7 +59,7 @@ import static us.shandian.giga.get.DownloadMission.ERROR_HTTP_UNSUPPORTED_RANGE; import static us.shandian.giga.get.DownloadMission.ERROR_NOTHING; import static us.shandian.giga.get.DownloadMission.ERROR_PATH_CREATION; import static us.shandian.giga.get.DownloadMission.ERROR_PERMISSION_DENIED; -import static us.shandian.giga.get.DownloadMission.ERROR_POSTPROCESSING_FAILED; +import static us.shandian.giga.get.DownloadMission.ERROR_POSTPROCESSING; import static us.shandian.giga.get.DownloadMission.ERROR_SSL_EXCEPTION; import static us.shandian.giga.get.DownloadMission.ERROR_UNKNOWN_EXCEPTION; import static us.shandian.giga.get.DownloadMission.ERROR_UNKNOWN_HOST; @@ -67,7 +67,8 @@ import static us.shandian.giga.get.DownloadMission.ERROR_UNKNOWN_HOST; public class MissionAdapter extends Adapter { private static final SparseArray ALGORITHMS = new SparseArray<>(); private static final String TAG = "MissionAdapter"; - private static final String UNDEFINED_SPEED = "--.-%"; + private static final String UNDEFINED_PROGRESS = "--.-%"; + static { ALGORITHMS.put(R.id.md5, "MD5"); @@ -178,7 +179,7 @@ public class MissionAdapter extends Adapter { if (h.item.mission instanceof DownloadMission) { DownloadMission mission = (DownloadMission) item.mission; String length = Utility.formatBytes(mission.getLength()); - if (mission.running && !mission.postprocessingRunning) length += " --.- kB/s"; + if (mission.running && !mission.isPsRunning()) length += " --.- kB/s"; h.size.setText(length); h.pause.setTitle(mission.unknownLength ? R.string.stop : R.string.pause); @@ -238,11 +239,10 @@ public class MissionAdapter extends Adapter { } if (hasError) { - if (Float.isNaN(progress) || Float.isInfinite(progress)) - h.progress.setProgress(1f); + h.progress.setProgress(isNotFinite(progress) ? 1f : progress); h.status.setText(R.string.msg_error); - } else if (Float.isNaN(progress) || Float.isInfinite(progress)) { - h.status.setText(UNDEFINED_SPEED); + } else if (isNotFinite(progress)) { + h.status.setText(UNDEFINED_PROGRESS); } else { h.status.setText(String.format("%.2f%%", progress * 100)); h.progress.setProgress(progress); @@ -251,11 +251,11 @@ public class MissionAdapter extends Adapter { long length = mission.getLength(); int state; - if (mission.errCode == ERROR_POSTPROCESSING_FAILED) { + if (mission.isPsFailed()) { state = 0; } else if (!mission.running) { state = mission.enqueued ? 1 : 2; - } else if (mission.postprocessingRunning) { + } else if (mission.isPsRunning()) { state = 3; } else { state = 0; @@ -406,7 +406,7 @@ public class MissionAdapter extends Adapter { case ERROR_CONNECT_HOST: str.append(mContext.getString(R.string.error_connect_host)); break; - case ERROR_POSTPROCESSING_FAILED: + case ERROR_POSTPROCESSING: str.append(mContext.getString(R.string.error_postprocessing_failed)); case ERROR_UNKNOWN_EXCEPTION: break; @@ -447,7 +447,7 @@ public class MissionAdapter extends Adapter { if (mission != null) { switch (id) { case R.id.start: - h.status.setText(UNDEFINED_SPEED); + h.status.setText(UNDEFINED_PROGRESS); h.state = -1; h.size.setText(Utility.formatBytes(mission.getLength())); mDownloadManager.resumeMission(mission); @@ -507,7 +507,7 @@ public class MissionAdapter extends Adapter { mIterator.end(); checkEmptyMessageVisibility(); - checkClearButtonVisibility(mClear); + mClear.setVisible(mIterator.hasFinishedMissions()); } public void forceUpdate() { @@ -526,20 +526,10 @@ public class MissionAdapter extends Adapter { } public void setClearButton(MenuItem clearButton) { - if (mClear == null) checkClearButtonVisibility(clearButton); + if (mClear == null) clearButton.setVisible(mIterator.hasFinishedMissions()); mClear = clearButton; } - private void checkClearButtonVisibility(MenuItem clearButton) { - if (mIterator.getOldListSize() < 1) { - clearButton.setVisible(false); - return; - } - - DownloadManager.MissionItem item = mIterator.getItem(mIterator.getOldListSize() - 1); - clearButton.setVisible(item.special == DownloadManager.SPECIAL_FINISHED || item.mission instanceof FinishedMission); - } - private void checkEmptyMessageVisibility() { int flag = mIterator.getOldListSize() > 0 ? View.GONE : View.VISIBLE; if (mEmptyMessage.getVisibility() != flag) mEmptyMessage.setVisibility(flag); @@ -596,6 +586,10 @@ public class MissionAdapter extends Adapter { } } + private boolean isNotFinite(Float value) { + return Float.isNaN(value) || Float.isInfinite(value); + } + class ViewHolderItem extends RecyclerView.ViewHolder { DownloadManager.MissionItem item; @@ -667,7 +661,7 @@ public class MissionAdapter extends Adapter { DownloadMission mission = item.mission instanceof DownloadMission ? (DownloadMission) item.mission : null; if (mission != null) { - if (!mission.postprocessingRunning) { + if (!mission.isPsRunning()) { if (mission.running) { pause.setVisible(true); } else { @@ -678,8 +672,10 @@ public class MissionAdapter extends Adapter { queue.setChecked(mission.enqueued); delete.setVisible(true); - start.setVisible(mission.errCode != ERROR_POSTPROCESSING_FAILED); - queue.setVisible(mission.errCode != ERROR_POSTPROCESSING_FAILED); + + boolean flag = !mission.isPsFailed(); + start.setVisible(flag); + queue.setVisible(flag); } } } else { diff --git a/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java b/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java index 25960a419..c4fd3b5fd 100644 --- a/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java +++ b/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java @@ -7,16 +7,12 @@ import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.content.SharedPreferences; -import android.content.res.TypedArray; import android.os.Bundle; import android.os.IBinder; import android.preference.PreferenceManager; -import android.support.annotation.AttrRes; -import android.support.annotation.DrawableRes; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; -import android.util.TypedValue; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; @@ -24,6 +20,7 @@ import android.view.View; import android.view.ViewGroup; import org.schabi.newpipe.R; +import org.schabi.newpipe.util.ThemeHelper; import us.shandian.giga.service.DownloadManager; import us.shandian.giga.service.DownloadManagerService; @@ -192,29 +189,20 @@ public class MissionsFragment extends Fragment { mList.setAdapter(mAdapter); if (mSwitch != null) { - mSwitch.setIcon(getDrawableFromAttribute(mLinear ? R.attr.ic_grid : R.attr.ic_list)); + boolean isLight = ThemeHelper.isLightThemeSelected(mContext); + int icon; + + if (mLinear) + icon = isLight ? R.drawable.ic_list_black_24dp : R.drawable.ic_list_white_24dp; + else + icon = isLight ? R.drawable.ic_grid_black_24dp : R.drawable.ic_grid_white_24dp; + + mSwitch.setIcon(icon); mSwitch.setTitle(mLinear ? R.string.grid : R.string.list); mPrefs.edit().putBoolean("linear", mLinear).apply(); } } - @DrawableRes - private int getDrawableFromAttribute(@AttrRes int attr) { - TypedArray styledAttributes = mContext.getTheme().obtainStyledAttributes(new int[]{attr}); - int resId = styledAttributes.getResourceId(0, 0); - styledAttributes.recycle(); - - if (resId != 0) { - return resId; - } else { - // work-around - styledAttributes = mContext.obtainStyledAttributes(new int[]{attr}); - resId = styledAttributes.getResourceId(0, 0); - styledAttributes.recycle(); - return resId; - } - } - @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState);