From 4c4cfb49b47cf6eb84b486b43c30ec1935348c34 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Wed, 25 Oct 2017 16:09:26 +0200 Subject: [PATCH] make tabs contain icons instead of title --- .../schabi/newpipe/fragments/MainFragment.java | 12 +++++++++++- .../subscription/SubscriptionFragment.java | 1 - .../res/drawable-hdpi/ic_channel_white_24dp.png | Bin 0 -> 398 bytes .../res/drawable-hdpi/ic_whatshot_white_24dp.png | Bin 0 -> 468 bytes .../res/drawable-mdpi/ic_channel_white_24dp.png | Bin 0 -> 304 bytes .../res/drawable-mdpi/ic_whatshot_white_24dp.png | Bin 0 -> 334 bytes .../res/drawable-xhdpi/ic_channel_white_24dp.png | Bin 0 -> 468 bytes .../drawable-xhdpi/ic_whatshot_white_24dp.png | Bin 0 -> 595 bytes .../drawable-xxhdpi/ic_channel_white_24dp.png | Bin 0 -> 739 bytes .../drawable-xxhdpi/ic_whatshot_white_24dp.png | Bin 0 -> 866 bytes .../drawable-xxxhdpi/ic_channel_white_24dp.png | Bin 0 -> 633 bytes .../drawable-xxxhdpi/ic_whatshot_white_24dp.png | Bin 0 -> 1129 bytes 12 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 app/src/main/res/drawable-hdpi/ic_channel_white_24dp.png create mode 100644 app/src/main/res/drawable-hdpi/ic_whatshot_white_24dp.png create mode 100644 app/src/main/res/drawable-mdpi/ic_channel_white_24dp.png create mode 100644 app/src/main/res/drawable-mdpi/ic_whatshot_white_24dp.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_channel_white_24dp.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_whatshot_white_24dp.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_channel_white_24dp.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_whatshot_white_24dp.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_channel_white_24dp.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_whatshot_white_24dp.png diff --git a/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java index 317630faa..42f52431e 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java @@ -84,6 +84,15 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte viewPager.setOffscreenPageLimit(adapter.getCount()); tabLayout.setupWithViewPager(viewPager); + + if(PreferenceManager.getDefaultSharedPreferences(getActivity()) + .getString(getString(R.string.main_page_content_key), getString(R.string.blank_page_key)) + .equals(getString(R.string.subscription_page_key))) { + tabLayout.getTabAt(0).setIcon(R.drawable.ic_channel_white_24dp); + } else { + tabLayout.getTabAt(0).setIcon(R.drawable.ic_whatshot_white_24dp); + tabLayout.getTabAt(1).setIcon(R.drawable.ic_channel_white_24dp); + } } /*////////////////////////////////////////////////////////////////////////// @@ -171,7 +180,8 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte @Override public CharSequence getPageTitle(int position) { - return getString(this.tabTitles[position]); + //return getString(this.tabTitles[position]); + return ""; } @Override diff --git a/app/src/main/java/org/schabi/newpipe/fragments/subscription/SubscriptionFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/subscription/SubscriptionFragment.java index 3ff56a163..afb2f078e 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/subscription/SubscriptionFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/subscription/SubscriptionFragment.java @@ -62,7 +62,6 @@ public class SubscriptionFragment extends BaseStateFragmentn;!$1&*;dh)(f!siq0+~ZlBH#{)`w)j?Q1Ejfej4sTiHHIe@%p1MjzWkQdlw-D z(^$5p$K%0+6RWZtRsmP%lj zsm_cJbt|u!sCB1n+a literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-hdpi/ic_whatshot_white_24dp.png b/app/src/main/res/drawable-hdpi/ic_whatshot_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..46ed1f8b67db8c34ee5ec652fab79b36ef42a684 GIT binary patch literal 468 zcmV;_0W1EAP)5Q+*74bf0x&=Nt=AV`E`P;rr% zjXDH^f>SO>Q6R;g4&L4KeM_!?|GRhZ|K5wMtQ@v7FkaE7-?&cDjH2)q>kD@n<{Vd9q~507XyO~ue0DK<<-#Cw zCU}8yO)lIf$`%=kNsK3Q;Uz9x+@)PVaRFmVE^JV5g&8i=q+d9W@lh^(r`87s6hI22 zAQwthTc=ea@Tu_RLWyc)3PB2^C>K6q`LrkmXEAbe;Vo8Kp}2>Ul?ykic2adXN*-fM zF7&X6^*{kMvxMQ1mK)EpJjPUoW4yzlnj?B;F2e!iUQ07sBGET*?k!xiBhgQF7;_ zt=D(V3|Lkn8~1QgbnsNeRQ3b2B&YAn+7hJYof5_7X|_XU=^;)Qi_=_;*MF9LG(5Cm zWxP+&4wdcRQj?TrYOC2r(`AdU+*5S4xO15Mt#f>#%8DJA9SS;b2e&jDED~?tC;#ia vey!RkT_w&;2fdy;+f2DTzqbCAddycI&vNIBYtmVuXBa$P{an^LB{Ts5C^vIp literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/ic_whatshot_white_24dp.png b/app/src/main/res/drawable-mdpi/ic_whatshot_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..4cf6f85f83b9b993773a899637777e081a897e0b GIT binary patch literal 334 zcmV-U0kQsxP)PLcWj2anrF;5%c2NSX}hp$76Tfz#mu|gK@oGFANh9etScs3QnAx2X+cJOQ~ zfN9<_O0tp1#kgl&J&bXV;gVB7s(2dAGQuPUZt#>9g%rm`IU=cOq^RN&)VR$jk6L2xJaZ4ns%n0LBXC)U?y|U z+~2uyz#oSmm2ce7H}7wwzf>W0Qz)0T)Wtp$x7`vo{nfrs>W~OT51_m65;gsGs8HXx zC2IPcklECbh(HgZhe|@Zq{5qC0}VA%D9rS%L7RT8&=@x)G*k?X01QAA`Vsof%=%vf zs#eSbB}9WSiQO*$iGWOzEf5IBchN2)iRa&^I`b27ssp8z2m_2GQs!2;)iw|991>Z51df-u$x84 zRV}Qg=!mL?ITq#UQgx7_XqI)V25#}o1T|WIT&CohmV$aVD-uJLd}h7kW0*cg;u5B- zii{AFj`GhG)tK2YzpT`0D(7-A3_zlPvjXWplF8f(cEzRs;koN>lk&rvu z$P&jaEsBQ@vbdUMlj5U|XSkT6MN2~i=gCt^jsX(-6SR@WBaFugty&JO(@+%0@$YfnCcp+Oup_~S#0D#fH>lKsg#m<+U}HdmSD`O}#Q!&dQiM=c2^LmF z2c!=9N8%qtY}rm+;>5A91wI)ZC6Vt(=iGDeO#)3c(L}96Pt;lJ^Bp}dlk-%P@{`n& zBt0sNv#EDdep1Mhp35tX)Xq;zaJI@UT3c`PkSgMYq&JI56>{>BD&{OAIp6@OrPo;` zN1TxKYL?`X6OvvgNsc)o=|w~;fuj?8s81TG${1*057f@$oY#R|MOWt{heg?8p9>C; z5nV3Z5Fpz2?mFebMeagZg$d2~zxyS%nM7+_)Y!iw4wy9D#)D zmm!&~UL_Nfsb+IXm^SMGGAvx>#YAUyX6CN(qw+2@0)Aj>D}F`c)l0ya-BaSoIeknh zzS{KqaXyQ-+_)=luE(h-9C5lnn`?k*^OIdiU6xUffB=uHyyyDLH(kAChDVUB-h?qj z2J{&)dId7` zw>`w=UbfzYwO_1Y>p$iDtfOY`LFN5G(tMR}K>r*l>at<{qo?FV(obio>pV5xG-%g3 z=vn$a)MAfI4mqE>VxvTcY{(71ION=%a?<-{OZT;>UZwv7_4Gmaoc-a~L=*pI`~fV* V9>c$)0PO$(002ovPDHLkV1jjtSHA!N literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/ic_whatshot_white_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_whatshot_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..8eaf3755da5295bbe800e7022c2db30d17f680f6 GIT binary patch literal 866 zcmV-o1D*VdP)7r0tpIELMaN&@wqXVwGqKn-Kqw3Fc(-sVUA4Js=7Sr{7>1#2m?Fj^D^ zEyVXdHt#D6J|?bjNi&Wqt0)*Io-@=*oWQ15p}2u~j&ZI2K|40v6pGzMH_9IUhwa!r zrcgXjG*fhNz5YiUn@)w|J;MFMbEI_zMltm$6kiZxkWTJknJoAk(^m?`5BT_Qg9Q$K_=O;5zb{x)h3LT%J_` z_F&VbP&DB3k^=B0rXqC;$0_W3d=hUbu=uY%+?1HB4gHEH89plcQGA z@EUemR;nzX!mdM6v5p*eM^zHbIEdW@4T_F-Tn@8b4y>mSmo~*ginF-%vqc8dyvPJD zr>RjqY+?eJ0w;KgO{^qEn%l^5oQt@P)2R5^MS&#b*`Z|6N)lR>99k(5N1hfXi=F&M zRO9SW^4Q2XL~)u%Eeui|AV-J^+NjY&VlACa;v+`~4O$GW;c-q<#HGjp8EUn-sOLet s=wpZxrkQ4hA^PZ|i8?J=vZQML4Wq^#!k7$FxBvhE07*qoM6N<$f@DjJI{*Lx literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_channel_white_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_channel_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..9384592d6aada1745b649ff14a9bd93b13119605 GIT binary patch literal 633 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD0wg^q?%xcgn3BBRT^Rni_n+Ah4nJ za0`PlBg3pY5H=O_J>@Oyb2bFjdNpwnz%e&978H@y}jk{cgR74^#l9A=H76F zygNd|jwxxmyo!fc~Ula*WC4&INvL)2weL1 z*XnZFGLe9lAzD{;!Vl&aZgXJa)8??d&nFlY*RFC>;p-4@uS@u(V6862Gn>+2;RtL%O8y^$I zD!bX@+T*(>%J=Q<;D7T-!$>{t#`pJoW}Xy&eK=V$r;&Mmp6eU+-2r!3@7Da9A};mh z-I1Tcya8Rz8P&%%n(OS1;xB%;E@t9TXkdU4H++n2*aKoc7#LXu91ujqmTavb_n5v& zKlr<(?p*l+Be7+LUK?&dk$U#w-+zX`{%g2r0u3;@-SBh0fBr`Hc{5($X-?t(vgg*v zyDATEX*;M}PFeB5uKaNO$HQG*a*uUCG!*B5`~T9wZl7&c%puh>+m8C?y@Bk8AG+Ai z71e!H^jq}N@X^QLT;BqZYfUREfAnTi^XCnpdzfE%>402n;N8G~wop%c^5vIyz=Xo! M>FVdQ&MBb@06@0`-T(jq literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_whatshot_white_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_whatshot_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..5c5d86873cce687891517d459d778b4b840d38c4 GIT binary patch literal 1129 zcmV-v1eW`WP)Z*MU8R+!PP3YYb2E=S+pnxf>h`>!&wJ)e=ene<{}H+?-gt{5#Tl!Q-KusDXz%pqBQdqR~+J^79LeRv5{5_6h|zgRWq{{KitlLnwYA%p%<5G;AX`Q zr?}J!1}I+mgv;%ttKx)pTxp%+gy(2$zT$(qwDkug6&FmQJyql=9vDUYmMR_?O#7M` zqfBC;0-+Zsdr2r$=)(>LLJ!PJl^G=2&3*+!FU(GpuT0y7{e{;stCkH^W8bIr)8CkZS&B{yi!P+F zE6p-;^e+bCq)1^g3cD&9qsvf-+1(0@nb=dq47I_>m@QIREWw5rKI9$}Y6ojDTdA;E zPgn3qU=?l#DIofj!mM02a2sx> zD@s6eJUPvNYQ-tvtCPU2*-Y~fnY;%tR{q8pVsIYSTG!^=2p z;uiTpH+JEyOg7Pz(>VKqzVe7dDslD;d9sT~aC3m`%riBd*Q@fbJdM@Cuo+3qqxp>jcZXRbmy~*Jk`clkX)^Y@|W+^(XCTiu1 z5=pibr7a{BEppjORNkYDqDL;