From a4f0c010d128f957555009e9a1ed8c132688f5a7 Mon Sep 17 00:00:00 2001 From: Anthony Restaino Date: Tue, 31 Mar 2015 11:20:41 -0400 Subject: [PATCH] Added Dark Theme to browser. Added options to Reading Mode. --- res/drawable-hdpi/ic_action_delete_dark.png | Bin 0 -> 355 bytes res/drawable-hdpi/ic_action_invert_dark.png | Bin 0 -> 304 bytes res/drawable-hdpi/ic_action_invert_light.png | Bin 0 -> 332 bytes res/drawable-hdpi/ic_action_plus_dark.png | Bin 0 -> 166 bytes res/drawable-hdpi/ic_action_star_dark.png | Bin 0 -> 652 bytes .../ic_action_text_size_dark.png | Bin 0 -> 210 bytes .../ic_action_text_size_light.png | Bin 0 -> 237 bytes res/drawable-hdpi/ic_webpage_dark.png | Bin 0 -> 637 bytes res/drawable-xhdpi/ic_action_delete_dark.png | Bin 0 -> 479 bytes res/drawable-xhdpi/ic_action_invert_dark.png | Bin 0 -> 422 bytes res/drawable-xhdpi/ic_action_invert_light.png | Bin 0 -> 462 bytes res/drawable-xhdpi/ic_action_plus_dark.png | Bin 0 -> 183 bytes res/drawable-xhdpi/ic_action_star_dark.png | Bin 0 -> 910 bytes .../ic_action_text_size_dark.png | Bin 0 -> 226 bytes .../ic_action_text_size_light.png | Bin 0 -> 254 bytes res/drawable-xhdpi/ic_webpage_dark.png | Bin 0 -> 921 bytes res/drawable-xxhdpi/ic_action_delete_dark.png | Bin 0 -> 764 bytes res/drawable-xxhdpi/ic_action_invert_dark.png | Bin 0 -> 643 bytes .../ic_action_invert_light.png | Bin 0 -> 686 bytes res/drawable-xxhdpi/ic_action_plus_dark.png | Bin 0 -> 237 bytes res/drawable-xxhdpi/ic_action_star_dark.png | Bin 0 -> 1455 bytes .../ic_action_text_size_dark.png | Bin 0 -> 275 bytes .../ic_action_text_size_light.png | Bin 0 -> 308 bytes res/drawable-xxhdpi/ic_webpage_dark.png | Bin 0 -> 1457 bytes res/drawable/toolbar_elevate_dark.xml | 19 +++ res/layout/about_settings.xml | 6 +- res/layout/advanced_settings.xml | 12 +- res/layout/bookmark_drawer.xml | 9 +- res/layout/bookmark_list_item.xml | 3 +- res/layout/bookmark_settings.xml | 6 +- res/layout/display_settings.xml | 47 +++++++- res/layout/general_settings.xml | 10 +- res/layout/license_activity.xml | 12 +- res/layout/privacy_settings.xml | 20 ++-- res/layout/seek_layout.xml | 13 ++ res/layout/settings.xml | 24 ++-- res/layout/tab_drawer.xml | 17 ++- res/layout/tab_list_item.xml | 5 +- res/menu/reading.xml | 18 +++ res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 3264 bytes res/values-v21/styles.xml | 29 +++++ res/values/attr.xml | 7 ++ res/values/colors.xml | 9 +- res/values/strings.xml | 3 + res/values/styles.xml | 30 ++++- .../lightning/AboutSettingsActivity.java | 5 +- .../lightning/AdvancedSettingsActivity.java | 5 +- .../browser/lightning/BookmarkActivity.java | 6 +- .../browser/lightning/BrowserActivity.java | 30 +++-- .../lightning/DisplaySettingsActivity.java | 81 +++++++++---- .../lightning/GeneralSettingsActivity.java | 5 +- .../browser/lightning/LicenseActivity.java | 5 + src/acr/browser/lightning/LightningView.java | 26 ++-- src/acr/browser/lightning/MainActivity.java | 17 ++- .../lightning/PrivacySettingsActivity.java | 5 +- .../browser/lightning/ReadingActivity.java | 113 ++++++++++++++++-- src/acr/browser/lightning/SearchAdapter.java | 16 +-- .../browser/lightning/SettingsActivity.java | 45 ++++--- 58 files changed, 501 insertions(+), 157 deletions(-) create mode 100644 res/drawable-hdpi/ic_action_delete_dark.png create mode 100644 res/drawable-hdpi/ic_action_invert_dark.png create mode 100644 res/drawable-hdpi/ic_action_invert_light.png create mode 100644 res/drawable-hdpi/ic_action_plus_dark.png create mode 100644 res/drawable-hdpi/ic_action_star_dark.png create mode 100644 res/drawable-hdpi/ic_action_text_size_dark.png create mode 100644 res/drawable-hdpi/ic_action_text_size_light.png create mode 100644 res/drawable-hdpi/ic_webpage_dark.png create mode 100644 res/drawable-xhdpi/ic_action_delete_dark.png create mode 100644 res/drawable-xhdpi/ic_action_invert_dark.png create mode 100644 res/drawable-xhdpi/ic_action_invert_light.png create mode 100644 res/drawable-xhdpi/ic_action_plus_dark.png create mode 100644 res/drawable-xhdpi/ic_action_star_dark.png create mode 100644 res/drawable-xhdpi/ic_action_text_size_dark.png create mode 100644 res/drawable-xhdpi/ic_action_text_size_light.png create mode 100644 res/drawable-xhdpi/ic_webpage_dark.png create mode 100644 res/drawable-xxhdpi/ic_action_delete_dark.png create mode 100644 res/drawable-xxhdpi/ic_action_invert_dark.png create mode 100644 res/drawable-xxhdpi/ic_action_invert_light.png create mode 100644 res/drawable-xxhdpi/ic_action_plus_dark.png create mode 100644 res/drawable-xxhdpi/ic_action_star_dark.png create mode 100644 res/drawable-xxhdpi/ic_action_text_size_dark.png create mode 100644 res/drawable-xxhdpi/ic_action_text_size_light.png create mode 100644 res/drawable-xxhdpi/ic_webpage_dark.png create mode 100644 res/drawable/toolbar_elevate_dark.xml create mode 100644 res/layout/seek_layout.xml create mode 100644 res/menu/reading.xml create mode 100644 res/mipmap-mdpi/ic_launcher.png diff --git a/res/drawable-hdpi/ic_action_delete_dark.png b/res/drawable-hdpi/ic_action_delete_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..c6f7100c7595da4040b20325f54ad9899f469b55 GIT binary patch literal 355 zcmV-p0i6DcP)Bd=q%ja>b}P6Z;N} zhWAW_K;Ia$;WH+pr6twG7})jWX$&nKw^Ihh@BWn%GA+S}USfGB5}(llODgmk1~E+zU0~=Wl*e98D2*CpG?9a^*}=G$Vr~tGr`eGC7L3jhUXls zK&i1xk3**tgDuwST$`iC5(8NF;jT)hQmItZ^Z{JQ>}umqY1jY&002ovPDHLkV1m3M Bpzr_y literal 0 HcmV?d00001 diff --git a/res/drawable-hdpi/ic_action_invert_dark.png b/res/drawable-hdpi/ic_action_invert_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..bd6cd0dd99d7d35cac4c85514c66b10c61ca5ce0 GIT binary patch literal 304 zcmV-00nh%4P)w%!4=PZ1E5EP^#4~)l^@F|2}8QVw#3>zU!?Evs4fR5agC-Pk# zKsN3~zN!UC#$S#G7(W4sbL3ybAHC1N3$QGwS+q_t6}A{4&Nqn_yOQub0D6&%T^fD| zK(|q`EdT_TkP|)h3H`*js-38+Z8UkfS6j$_zGIg>^#J-4J)NWsN4OzFJHmthzT3K@bE%l6nHY-sfT-M{P|20000TUZTM34{_lP2cX8F(OK!c2IXG08Fj00000 z?5L{h!X=h`UDr=8aUw?YP1Ah1M2S#JU8m%e6j2n#nTWP#5y88S{8R*0XB*3N#$4rg zj-+exoDdK~0Pl&iEN}GOQ~SKc2{6W;XrByX1&pBgk6i_@+xQ63a}0(bBY<8U7KG?d6f4=g*B9gMv z5ga;VgX}MUB@Xp7$5yGo@25SF1I?iY%pL04Nkkm#U2;Oy-H`2KD|o`=wa;@Zxm<0000VXF z_-^lBZqz>Qh^vNYmHeOVFKs8d94D#VUA^_#woAJ2SUhswx3d7X0>KCG1Et$Mg-&C}0L1j%^1`njxg HN@xNA^~E{q literal 0 HcmV?d00001 diff --git a/res/drawable-hdpi/ic_action_star_dark.png b/res/drawable-hdpi/ic_action_star_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..a04d62ffe153848d23ed4fedbe728553d0dbe843 GIT binary patch literal 652 zcmV;70(1R|P)8xo6Y76HYd;_ z*qp$+V5|5Ba6uYuOkfsd$gFMRE5UD-fIL^)l)w;$UlMs9vPFC$IHc$el3`n+4GDCr zrPE8i_f8uUNK$MH6p<9$l3}d0<)8*Mfj%CaB6dWL`@lBo>j%xC7F2+OhZb1?-he6a z2`quH-~jvtXKJH*oPwB&5o4PkBR*+x!u_!czJNK-_4eM9L!dVB%_ks;3yO+gQ5Vty z$p#^FwcYoZr~|udk~Dv**We|W#WOCc{417QlyO>lPa0s1w2CWp)IHR45&>&!vK{dB z4)LnNwu&dQqmOaU$JJ6e1}(RUBb)w6?T7fI)d@@#0mI;2ZQAY|_`d?b=zGps5fjH~ z5BQ^mywAaB5d5Q$`1YEv1ube5e$HY1ygCG0!%)nsRPlP3;}`JOeJl(Kbg5IM(brcj z1pLwQ#`lCFfoY2Q;fduYm)fuo_V^rOpWKbU(`P0O32af!sw#MkYFT*|dI3D=m}Rza zn->2>ZQuzorcNdAMw(LZ(l-jm)kZEinZOGr?yv885|oiiU%yVW-DCn|0T;0qP#-Y1 zo_+rD<0cbGC?N;Dphd2!;2j+6`6Wz=FX3JOlBYh=CiKz;_aF?sEI!<0I!h}60000p-g)_ly;(+1OMK7d=j{2`KWYyAKA-^9&QRy9dG&Ny zcW69&&!)3Uri{}V=jQCXvB>sCjz##6D)T5^g|Bamb_*)l%gDX|xp=39!2X?6SOf~> zuVnB~tNg0(!obKP;LwokpeOC;&GX#rZOoDH+CXDJtdxzo5>e~FfIrf%Q~lo FCIEcfN)-SA literal 0 HcmV?d00001 diff --git a/res/drawable-hdpi/ic_action_text_size_light.png b/res/drawable-hdpi/ic_action_text_size_light.png new file mode 100644 index 0000000000000000000000000000000000000000..3069b3c2e732fef935427c11afffdff75401e65a GIT binary patch literal 237 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpUtEuJopAr-gYUf<1i$Uvmw;lAbv z3LNM749l7I_};DC*ZAPkn`dtxyu1C)f@7gZoRP`Y|IM4H@cdk;nRywgo1y-2)b8m! z|5@Gp9lD0kHQSHnY>Q0l?fHT>a*EjVpdhR&F@%PrP-Eiw`~-bnn+)HxK2&s zn8mLB&*%GW?Bi<&v8{%o0w5Q7y85}Sb4q9e06o)ST>t<8 literal 0 HcmV?d00001 diff --git a/res/drawable-hdpi/ic_webpage_dark.png b/res/drawable-hdpi/ic_webpage_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..e2c2dd925baed68d6c7c4a41c8ce07e1a1e11083 GIT binary patch literal 637 zcmV-@0)qXCP)!U#VxgE2O?(6!TcgBS8Zc^M{2?}w*janna-#PD*eWenKn~vtXObb= zZ1zs}Zuf*_C;1BYhMoC#XJ%(NlQCk%h!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M6N<$ Eg7)pr*Z=?k literal 0 HcmV?d00001 diff --git a/res/drawable-xhdpi/ic_action_plus_dark.png b/res/drawable-xhdpi/ic_action_plus_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..849ed06df4f3563fa5ec0274450225a3335ebbe6 GIT binary patch literal 183 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=b)GJcAr-gY-rC4{KtaScaQXkO zpCc?B%Z#oisjqmj^TRC%zeIsalTsbu=E-TGqn;YX?scfRwU2I@ry2mXHlxo3kB zqel1np1BOApO}`1Gcqtd5cnd=f~*Y4UdLMTTU`@qo~PAa{xxx8%h@cnG(c)RUHx3v IIVCg!008JYaR2}S literal 0 HcmV?d00001 diff --git a/res/drawable-xhdpi/ic_action_star_dark.png b/res/drawable-xhdpi/ic_action_star_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..b7c2ba963d1532d74a396a50e4c1f4a003f95164 GIT binary patch literal 910 zcmV;919AL`P)xP+*}-nU36K-8}|webLC@<;ceRP5j7{TtYUx{ug*n zCCcY8r{GF1hoi(fV_P1+a9do`2#M?so%CTc(7dYQzo#=qUeZ?`+&1TflrkbDOgHr@%#lF4RBv5 zFj2+x_r&v4wkf}s_*Eznce#hF!^^}=a%U*6j~E5dI-3m8B_cTgZZ{(QAc`efI31G9 z#E_AfGHftF-01d(gi_Nbc9MDY2fIXFA-!nSCId`}i9bLcKjyN_%ewRmGUzRAG+JmW zTa<4meh?FXhApo7#`&Y@E^x->I%ke2;y7)^r*!1-#U=Lcv)C?&j52zp#0L}EA!@h5 z07E4d;PUtu_xYB1wgt8RdJSEXQr=0>3rZajcqF6=cOA z!;$yK(_fBga$B%{&7gf1sew%HHC%;Emc7}_1{gqNq_YmPw?THlmkki9r;B1)L;?zh kLZMJ76bgkxq4+=i16DtI9|vUW+yDRo07*qoM6N<$f~)y}FT;$&jJ#qDYf- zgk@vGQlb3D3xh1z`@eErWaVF+dOm~OMbt{{H>REFvC z{~s}NC^*bs@38BK?q|c#dGj0@Sp*yyAcPg)2H)HJbIl6VPRxk}IhLWpX`XM|R?~%? Q9lt~)y|$L?P=G|k!^R4B zvCR=azk92MH$BkJ*l?S-X@<_dwebcgCNvry-uApvzt{NOy@GR-Sb&-t{w>q!a-Fs8 zw4VAs%h$dQn{?hA_UoxLU18!-aL8wpNjiLd+D}Rt&jQl}vV6ghcV$HKFxk@A25ybU$^>bP0l+XkKRi$9H literal 0 HcmV?d00001 diff --git a/res/drawable-xhdpi/ic_webpage_dark.png b/res/drawable-xhdpi/ic_webpage_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..7524ab591cb13eacecc806bdf3ee6d27d8fa26a9 GIT binary patch literal 921 zcmV;K17`e*P)tJltfBPTwm^EB$VI;`^^^oD%WI=>9)S{`w9 z`8`eiI0GytY2p0ZKua0fqkn^HhxZAYg`U z80kaXX5&;?Vu9zBYJw>Z32_sUr8Plt$y|z4VVQOCc;s>#65=KR1L1cTbIL9WK;@ah zdnBP@m?3@vUf&}o9lIoePXTnlENf$fgx`S25vRZ@n*v3bK@fk>DB4Y1AR(8;AgD@% ztD3f^Bt#*=Z5q@RLOUUCO-P7BfZIZdl-8Nj!(bq^NJ4ImQh3V+0R^@g!oafOwN~3jUaT~qi?a-8hTSsBkXTWpKf3Q?uu+({f2P5og>`b-oMZqegsSQj!k2)8V zaz41EAz?rV8CbGTStKAihoj6BIw5EK`0fqh72t)T+b^b)C=?T#5su8R#=J7q@IL1w zW`|L<; vAY_(Zlq}M-hu2{d5fKp)5fKp)kz~q$%FG2n?tBQU00000NkvXXu0mjff7hJ$ literal 0 HcmV?d00001 diff --git a/res/drawable-xxhdpi/ic_action_delete_dark.png b/res/drawable-xxhdpi/ic_action_delete_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..37a738d834e46c136500de711fe20bd135ac56e0 GIT binary patch literal 764 zcmV{Mj$uopWMzlRe2P{`GA|GlgwrS z0000000000000000D3tdkGD;`Yub&XKHu0r-%dgP-=@7ZZKWXuE5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CL$h!-|O|( z+K}Ke_(&*0@R8tXz?A?mwgo>afq}W0D?c^(2?-1C1W&=IJIayaaCot+&qu0vrqYcdU~*j<03=g#Zr%k~t(1@ha^X0UiVxj^x;nHWCm} zjDXGYQzamvKmq1XnATE&Cf0Jw?PL+K856#@?N2`Y3@(9}R>^WHK#8L0rZ!pBL-YAX z3eYKP+H*n>5^T$et_7IX_29Dk;HL@UsZew1u4GGPuf`%iw1b zVD5rRP~}b6!Otq7)9F0yTVpP5cVq_Kx$FFW#yenqNTI*oZl59m0dzq~a5xCZar{=9 z>1c@4P@V;N5DP06VKV@idcZBqoj@|Kg6U|P{oJMvxIxwg%21He^Qc`xCUNUilB}}; zxw@Yy%6nRtViSA>6d=G%0H!R=YPesTsI#4211~l={n{Z#$cAZ5HGOJk?34BjP{t^}h z-y^o`j)Ev7R#gJumgR9wsMNZh&?Io>d+d$~zGn#xxBvhE0000000000003p?4~-K7 UbNg=o1poj507*qoM6N<$g0RsiZvX%Q literal 0 HcmV?d00001 diff --git a/res/drawable-xxhdpi/ic_action_plus_dark.png b/res/drawable-xxhdpi/ic_action_plus_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..7927662a27e94c0e2cc0791344bdced5df6e0776 GIT binary patch literal 237 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGoTRdGHLn>~)y<^DLU?AXn&?I{4 z`MpK?@3**Z@ONO+GX79~Gdwd<6Q~jdVvLNB{YrTl^qc9*#^g<}f|xiO7?>0q7&sId zurTYb1Maxr+PY0(L2g}JMRCKvf(7f>a|4w#alnYUBQ;$gG@Te2Sp*zl1dsvbum}M8 kFlK{0;<@~&w^WU#xe_oJ)r>mdKI;Vst0HrQM9RL6T literal 0 HcmV?d00001 diff --git a/res/drawable-xxhdpi/ic_action_star_dark.png b/res/drawable-xxhdpi/ic_action_star_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..44d9afd3fbec446fcdef61e7b0a505cc320a699f GIT binary patch literal 1455 zcmV;g1yK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y@qY&mI d28M=}wv7Lhb1pr|=WPOsdb;|#taD0e0svg=R^|Wz literal 0 HcmV?d00001 diff --git a/res/drawable-xxhdpi/ic_action_text_size_light.png b/res/drawable-xxhdpi/ic_action_text_size_light.png new file mode 100644 index 0000000000000000000000000000000000000000..d76000f08d27d463e81c224f332796e96c2a6b5c GIT binary patch literal 308 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGozdc~)y}mH-kb}g5k8LUE z8H$QFmA_reJA?DepCdwXjP3D9&&V}yfBH&u@dmMj@2A(SI@$R?zA#(_s2vInChuBj zZg_0IyDvxL|0|3^Ubkf){#bERa38CH0|O%qhcm*9h4t5asZnx)aez{H^dCCs}F|MBVS=zqEF z>;p9vY%&J%z)!Jdm(J<0J2P*8D?Jk#dtJBf+$;5^TQ(KK+{?hw@V|^HlI3FU;sfE! OK%$t>* literal 0 HcmV?d00001 diff --git a/res/drawable-xxhdpi/ic_webpage_dark.png b/res/drawable-xxhdpi/ic_webpage_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..9f6504e106195e3e2da35256306cf192d9e4d450 GIT binary patch literal 1457 zcmV;i1y1^jP)q`|u6ko6AqZe@vf>KGM8$s9yB~Z%xk_Kh(&@_m?^&cdqK~IaI=wZ;qo@kU2VP#E4POX64*VLU;e#9jwqalL&G;Ct+)vQ(LG}VG@@10U2K;1^ z@#pywSeMh2Gz@M}M3Idy9{{HnuKNXS&Q;?d1x_XObgu?h1A7$ufd4;|Yi?&xg2u^hlOJH%JPfLMkvbZI5M|HUn?Ibzj&H`HneM?cQVl2zV zT;Zzm3oQsW9|23UxX11Ew2Ruf=j1v8I^CY|lYbMKR_yDJEN?=ai|K{0295hxz<%Im zN>LYU1_~{bIbp=9v<2l^Og-IGhWebMiCJ{tZkMu}6Rrv1i;e~)3A~K$#xF4Z^cxkx z7dDI5EZtVG4QRt-+;IWW6o_ z?-)0eK-UC=u~~pLjUm|2Nvm>0RF@eRH@^Xv`QDOCjtQ`ol6=8_;#g~J>S%)?WP9q* zrK1>>t(;EmQ!fl5wKM)i7{{Mmr^nX$zwQP&#^8(B3{91rTk>%;?6< zifIee0_>7($W+=WKoM=%g&E+MZZ!d1za}XGXaROh(AHyXKYNvI%45Y@wPsu82@0@5 zQYF{!*$Oh6XkWNTr^q!a0jQ|>x~pX=vcfDZcG{-72%3&afKRkDhkOUT4cr^HO2-s~ zvxQkS09k3`D~v8QqL3lOD`YIAS?jy!a^P!cOA~zqk(DQQswBtgZR(7n(gF>>l2Xs- zB-eF$u7GkwBa#XEpvtQZ*Q|@_L+;bKVi$y+^X2JoeJMj$whka+?)C)P6<&zR&^zu&+%yb#4TH{;wdyZ(44Iwfl#Mqqqaz#G2 zQZh-W>5$dF2oG+3OoxZ0`QTP{G3JjhZlN@BKNUpzk1n1i`j0LirEBpw`^d%d(Zvyo z;y=8*-gkI+J^ii1x{5UhgTY`h7z_r3!C){L3 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/layout/about_settings.xml b/res/layout/about_settings.xml index 243beac..4a1da29 100644 --- a/res/layout/about_settings.xml +++ b/res/layout/about_settings.xml @@ -56,7 +56,7 @@ android:layout_height="1dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" - android:background="#cdcdcd" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> diff --git a/res/layout/advanced_settings.xml b/res/layout/advanced_settings.xml index 042baeb..7a5ad24 100644 --- a/res/layout/advanced_settings.xml +++ b/res/layout/advanced_settings.xml @@ -65,7 +65,7 @@ android:layout_height="1dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" - android:background="#cdcdcd" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> diff --git a/res/layout/bookmark_drawer.xml b/res/layout/bookmark_drawer.xml index 13b8e29..9348d60 100644 --- a/res/layout/bookmark_drawer.xml +++ b/res/layout/bookmark_drawer.xml @@ -4,7 +4,7 @@ android:layout_width="@dimen/navigation_width" android:layout_height="match_parent" android:layout_gravity="end" - android:background="@color/drawer_background" + android:background="?attr/drawerBackground" android:clickable="true" android:fitsSystemWindows="true" android:orientation="vertical" > @@ -28,7 +28,7 @@ android:layout_marginRight="16dp" android:contentDescription="Favicon" android:gravity="center_vertical" - android:src="@drawable/ic_action_star" > + android:src="?attr/starDrawable" > + android:textAppearance="?android:attr/textAppearanceListItemSmall" /> + android:background="?attr/dividerColor" /> + android:textAppearance="?android:attr/textAppearanceListItemSmall" /> \ No newline at end of file diff --git a/res/layout/bookmark_settings.xml b/res/layout/bookmark_settings.xml index c722801..f172e82 100644 --- a/res/layout/bookmark_settings.xml +++ b/res/layout/bookmark_settings.xml @@ -30,7 +30,7 @@ android:layout_height="1dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" - android:background="#cdcdcd" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> \ No newline at end of file diff --git a/res/layout/display_settings.xml b/res/layout/display_settings.xml index 68c6659..6816c7e 100644 --- a/res/layout/display_settings.xml +++ b/res/layout/display_settings.xml @@ -49,7 +49,7 @@ android:layout_height="1dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" - android:background="#cdcdcd" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + + + + + + + + + + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> diff --git a/res/layout/general_settings.xml b/res/layout/general_settings.xml index 53ac6c7..ce1eea4 100644 --- a/res/layout/general_settings.xml +++ b/res/layout/general_settings.xml @@ -56,7 +56,7 @@ android:layout_height="1dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" - android:background="#cdcdcd" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> diff --git a/res/layout/license_activity.xml b/res/layout/license_activity.xml index e557432..030a624 100644 --- a/res/layout/license_activity.xml +++ b/res/layout/license_activity.xml @@ -35,7 +35,7 @@ android:layout_height="1dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" - android:background="#cdcdcd" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> \ No newline at end of file diff --git a/res/layout/privacy_settings.xml b/res/layout/privacy_settings.xml index c498791..3a22150 100644 --- a/res/layout/privacy_settings.xml +++ b/res/layout/privacy_settings.xml @@ -50,7 +50,7 @@ android:layout_height="1dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" - android:background="#cdcdcd" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> diff --git a/res/layout/seek_layout.xml b/res/layout/seek_layout.xml new file mode 100644 index 0000000..0616d8d --- /dev/null +++ b/res/layout/seek_layout.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/res/layout/settings.xml b/res/layout/settings.xml index 8469644..3a04e18 100644 --- a/res/layout/settings.xml +++ b/res/layout/settings.xml @@ -50,7 +50,7 @@ android:layout_height="1dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" - android:background="#cdcdcd" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> diff --git a/res/layout/tab_drawer.xml b/res/layout/tab_drawer.xml index a308f6d..eb4b497 100644 --- a/res/layout/tab_drawer.xml +++ b/res/layout/tab_drawer.xml @@ -4,7 +4,7 @@ android:layout_width="@dimen/navigation_width" android:layout_height="match_parent" android:layout_gravity="start" - android:background="@color/drawer_background" + android:background="?drawerBackground" android:clickable="true" android:fitsSystemWindows="true" android:orientation="vertical" > @@ -27,7 +27,7 @@ android:layout_marginRight="16dp" android:contentDescription="@string/action_new_tab" android:gravity="center_vertical" - android:src="@drawable/ic_action_plus" > + android:src="?attr/plusDrawable" > + android:textAppearance="?android:attr/textAppearanceListItemSmall" /> + android:background="?attr/dividerColor" /> + android:background="?attr/dividerColor" /> @@ -90,7 +89,7 @@ android:paddingLeft="4dp" android:paddingRight="4dp" android:paddingTop="4dp" - android:src="@drawable/ic_action_back" /> + android:src="?attr/arrowBackDrawable" /> + android:src="?attr/arrowForwardDrawable" /> diff --git a/res/layout/tab_list_item.xml b/res/layout/tab_list_item.xml index 03af796..cb54e17 100644 --- a/res/layout/tab_list_item.xml +++ b/res/layout/tab_list_item.xml @@ -31,8 +31,7 @@ android:maxLines="1" android:minHeight="?android:attr/listPreferredItemHeightSmall" android:singleLine="true" - android:textAppearance="?android:attr/textAppearanceListItemSmall" - android:textColor="@color/dark_text" /> + android:textAppearance="?android:attr/textAppearanceListItemSmall" /> + android:src="?attr/deleteDrawable" > \ No newline at end of file diff --git a/res/menu/reading.xml b/res/menu/reading.xml new file mode 100644 index 0000000..57c9dd1 --- /dev/null +++ b/res/menu/reading.xml @@ -0,0 +1,18 @@ + + + + + + + + + \ No newline at end of file diff --git a/res/mipmap-mdpi/ic_launcher.png b/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..601a9d652b70c1021968486bed88422fed075560 GIT binary patch literal 3264 zcmV;x3_tUUP)}XoX6^C#_JemUgf{@m&=(NPLhI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e6e_mA z&O6sVtiUgg!o-x%pF04t)PRYSL?0$Bn##!+mEz0wq3Hqay z-1Y(Mo_?Q5os9U}mU+ITAnP0fC(ZgX@N05xEKBcvPP^(f2345LIfZyK zbI|S4vS~($hMI^5DhX5`;Mk5G>|gsO->;OFV4YQ2`b7l4^+S;kt=true false @null + @drawable/ic_action_invert_light + @drawable/ic_action_text_size_light + @color/divider_light + + + \ No newline at end of file diff --git a/res/values/attr.xml b/res/values/attr.xml index a794e07..c575601 100644 --- a/res/values/attr.xml +++ b/res/values/attr.xml @@ -10,6 +10,13 @@ + + + + + + + diff --git a/res/values/colors.xml b/res/values/colors.xml index dc6489c..0a874bd 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -1,7 +1,6 @@ - #ffffff #ff000000 #ffa0a0a0 #222222 @@ -16,9 +15,17 @@ #4D000000 #0073EF + #ffffff + #424242 + #9C9C9C + #2E2E2E #BDBDBD #424242 + + #1EFFFFFF + #1E000000 + \ No newline at end of file diff --git a/res/values/strings.xml b/res/values/strings.xml index e64a5fd..89c1746 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -210,4 +210,7 @@ URL Title + Invert color + Use Dark Theme + The theme change will take effect after you restart the browser. diff --git a/res/values/styles.xml b/res/values/styles.xml index 780ccab..a75ae83 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -12,6 +12,25 @@ true false @null + @drawable/ic_action_invert_light + @drawable/ic_action_text_size_light + @color/divider_light + + + - \ No newline at end of file diff --git a/src/acr/browser/lightning/AboutSettingsActivity.java b/src/acr/browser/lightning/AboutSettingsActivity.java index 2099b12..0f77f15 100644 --- a/src/acr/browser/lightning/AboutSettingsActivity.java +++ b/src/acr/browser/lightning/AboutSettingsActivity.java @@ -28,6 +28,10 @@ public class AboutSettingsActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { + mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0); + if (mPreferences.getBoolean(PreferenceConstants.DARK_THEME, false)) { + this.setTheme(R.style.Theme_SettingsTheme_Dark); + } super.onCreate(savedInstanceState); setContentView(R.layout.about_settings); @@ -37,7 +41,6 @@ public class AboutSettingsActivity extends ActionBarActivity { getSupportActionBar().setDisplayHomeAsUpEnabled(true); - mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0); if (mPreferences.getBoolean(PreferenceConstants.HIDE_STATUS_BAR, false)) { getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); diff --git a/src/acr/browser/lightning/AdvancedSettingsActivity.java b/src/acr/browser/lightning/AdvancedSettingsActivity.java index 42e32df..7eb24d4 100644 --- a/src/acr/browser/lightning/AdvancedSettingsActivity.java +++ b/src/acr/browser/lightning/AdvancedSettingsActivity.java @@ -34,6 +34,10 @@ public class AdvancedSettingsActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { + mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0); + if (mPreferences.getBoolean(PreferenceConstants.DARK_THEME, false)) { + this.setTheme(R.style.Theme_SettingsTheme_Dark); + } super.onCreate(savedInstanceState); setContentView(R.layout.advanced_settings); @@ -43,7 +47,6 @@ public class AdvancedSettingsActivity extends ActionBarActivity { getSupportActionBar().setDisplayHomeAsUpEnabled(true); - mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0); if (mPreferences.getBoolean(PreferenceConstants.HIDE_STATUS_BAR, false)) { getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); diff --git a/src/acr/browser/lightning/BookmarkActivity.java b/src/acr/browser/lightning/BookmarkActivity.java index e4d99f4..94e6f9e 100644 --- a/src/acr/browser/lightning/BookmarkActivity.java +++ b/src/acr/browser/lightning/BookmarkActivity.java @@ -31,6 +31,10 @@ public class BookmarkActivity extends ActionBarActivity implements OnClickListen @Override public void onCreate(Bundle savedInstanceState) { + mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0); + if (mPreferences.getBoolean(PreferenceConstants.DARK_THEME, false)) { + this.setTheme(R.style.Theme_SettingsTheme_Dark); + } super.onCreate(savedInstanceState); setContentView(R.layout.bookmark_settings); @@ -48,8 +52,6 @@ public class BookmarkActivity extends ActionBarActivity implements OnClickListen mBookmarkManager = new BookmarkManager(this); - mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0); - mSystemBrowser = mPreferences.getBoolean(PreferenceConstants.SYSTEM_BROWSER_PRESENT, false); exportBackup.setOnClickListener(this); diff --git a/src/acr/browser/lightning/BrowserActivity.java b/src/acr/browser/lightning/BrowserActivity.java index 7fe8d34..99975ab 100644 --- a/src/acr/browser/lightning/BrowserActivity.java +++ b/src/acr/browser/lightning/BrowserActivity.java @@ -129,6 +129,7 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl private static LayoutParams mMatchParent = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); private BookmarkManager mBookmarkManager; + private boolean mDarkTheme; @Override protected void onCreate(Bundle savedInstanceState) { @@ -145,6 +146,8 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl setSupportActionBar(mToolbar); mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0); + mDarkTheme = mPreferences.getBoolean(PreferenceConstants.DARK_THEME, false) + || isIncognito(); mContext = this; if (mWebViews != null) { mWebViews.clear(); @@ -184,7 +187,12 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl setNavigationDrawerWidth(); mDrawerLayout.setDrawerListener(new DrawerLocker()); - mWebpageBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_webpage); + if (mDarkTheme) { + mWebpageBitmap = BitmapFactory.decodeResource(getResources(), + R.drawable.ic_webpage_dark); + } else { + mWebpageBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_webpage); + } mActionBar = getSupportActionBar(); mHomepage = mPreferences.getString(PreferenceConstants.HOMEPAGE, Constants.HOMEPAGE); @@ -218,15 +226,10 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl lp.width = LayoutParams.MATCH_PARENT; v.setLayoutParams(lp); - // TODO - mArrowDrawable = new DrawerArrowDrawable(this); mArrowImage = (ImageView) mActionBar.getCustomView().findViewById(R.id.arrow); - mArrowImage.setLayerType(View.LAYER_TYPE_HARDWARE, null); // Use a - // hardware - // layer for - // the - // animation + // Use hardware acceleration for the animation + mArrowImage.setLayerType(View.LAYER_TYPE_HARDWARE, null); mArrowImage.setImageDrawable(mArrowDrawable); LinearLayout arrowButton = (LinearLayout) mActionBar.getCustomView().findViewById( R.id.arrow_button); @@ -771,11 +774,14 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl } mFullScreen = mPreferences.getBoolean(PreferenceConstants.FULL_SCREEN, false); mColorMode = mPreferences.getBoolean(PreferenceConstants.ENABLE_COLOR_MODE, true); + mColorMode &= !mDarkTheme; - if (!isIncognito() && !mColorMode && mWebpageBitmap != null) + if (!isIncognito() && !mColorMode && !mDarkTheme && mWebpageBitmap != null) { changeToolbarBackground(mWebpageBitmap); - else if (!isIncognito() && mCurrentView != null && mCurrentView.getFavicon() != null) + } else if (!isIncognito() && mCurrentView != null && !mDarkTheme + && mCurrentView.getFavicon() != null) { changeToolbarBackground(mCurrentView.getFavicon()); + } if (mFullScreen && mBrowserFrame.findViewById(R.id.toolbar_layout) == null) { mUiLayout.removeView(mToolbarLayout); @@ -1287,7 +1293,7 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl protected synchronized boolean newTab(String url, boolean show) { mIsNewIntent = false; - LightningView startingTab = new LightningView(mActivity, url); + LightningView startingTab = new LightningView(mActivity, url, mDarkTheme); if (mIdGenerator == 0) { startingTab.resumeTimers(); } @@ -2064,7 +2070,7 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl }); getUrl.setSelectAllOnFocus(true); - mSearchAdapter = new SearchAdapter(mContext, isIncognito()); + mSearchAdapter = new SearchAdapter(mContext, isIncognito() || mDarkTheme); getUrl.setAdapter(mSearchAdapter); } diff --git a/src/acr/browser/lightning/DisplaySettingsActivity.java b/src/acr/browser/lightning/DisplaySettingsActivity.java index ed0f32a..b21b035 100644 --- a/src/acr/browser/lightning/DisplaySettingsActivity.java +++ b/src/acr/browser/lightning/DisplaySettingsActivity.java @@ -3,6 +3,7 @@ */ package acr.browser.lightning; +import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.SharedPreferences; @@ -22,30 +23,31 @@ public class DisplaySettingsActivity extends ActionBarActivity { // mPreferences variables private SharedPreferences mPreferences; - private SharedPreferences.Editor mEditPrefs; - private CheckBox cbHideStatusBar, cbFullScreen, cbWideViewPort, cbOverView, cbTextReflow; + private CheckBox cbHideStatusBar, cbFullScreen, cbWideViewPort, cbOverView, cbTextReflow, + cbDarkTheme; + private Activity mActivity; @Override protected void onCreate(Bundle savedInstanceState) { + mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0); + if (mPreferences.getBoolean(PreferenceConstants.DARK_THEME, false)) { + this.setTheme(R.style.Theme_SettingsTheme_Dark); + } super.onCreate(savedInstanceState); setContentView(R.layout.display_settings); + mActivity = this; + // set up ActionBar - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + setSupportActionBar(toolbar); - getSupportActionBar().setDisplayHomeAsUpEnabled(true); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); - mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0); if (mPreferences.getBoolean(PreferenceConstants.HIDE_STATUS_BAR, false)) { getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); } - - // TODO WARNING: SharedPreferences.edit() without a corresponding - // commit() or apply() call - mEditPrefs = mPreferences.edit(); - initialize(); } @@ -57,7 +59,7 @@ public class DisplaySettingsActivity extends ActionBarActivity { private void initialize() { - RelativeLayout rHideStatusBar, rFullScreen, rWideViewPort, rOverView, rTextReflow, rTextSize; + RelativeLayout rHideStatusBar, rFullScreen, rWideViewPort, rOverView, rTextReflow, rTextSize, rDarkTheme; rHideStatusBar = (RelativeLayout) findViewById(R.id.rHideStatusBar); rFullScreen = (RelativeLayout) findViewById(R.id.rFullScreen); @@ -65,18 +67,23 @@ public class DisplaySettingsActivity extends ActionBarActivity { rOverView = (RelativeLayout) findViewById(R.id.rOverView); rTextReflow = (RelativeLayout) findViewById(R.id.rTextReflow); rTextSize = (RelativeLayout) findViewById(R.id.rTextSize); + rDarkTheme = (RelativeLayout) findViewById(R.id.rDarkTheme); cbHideStatusBar = (CheckBox) findViewById(R.id.cbHideStatusBar); cbFullScreen = (CheckBox) findViewById(R.id.cbFullScreen); cbWideViewPort = (CheckBox) findViewById(R.id.cbWideViewPort); cbOverView = (CheckBox) findViewById(R.id.cbOverView); cbTextReflow = (CheckBox) findViewById(R.id.cbTextReflow); + cbDarkTheme = (CheckBox) findViewById(R.id.cbDarkTheme); - cbHideStatusBar.setChecked(mPreferences.getBoolean(PreferenceConstants.HIDE_STATUS_BAR, false)); + cbHideStatusBar.setChecked(mPreferences.getBoolean(PreferenceConstants.HIDE_STATUS_BAR, + false)); cbFullScreen.setChecked(mPreferences.getBoolean(PreferenceConstants.FULL_SCREEN, false)); - cbWideViewPort.setChecked(mPreferences.getBoolean(PreferenceConstants.USE_WIDE_VIEWPORT, true)); + cbWideViewPort.setChecked(mPreferences.getBoolean(PreferenceConstants.USE_WIDE_VIEWPORT, + true)); cbOverView.setChecked(mPreferences.getBoolean(PreferenceConstants.OVERVIEW_MODE, true)); cbTextReflow.setChecked(mPreferences.getBoolean(PreferenceConstants.TEXT_REFLOW, false)); + cbDarkTheme.setChecked(mPreferences.getBoolean(PreferenceConstants.DARK_THEME, false)); rHideStatusBar(rHideStatusBar); rFullScreen(rFullScreen); @@ -84,11 +91,13 @@ public class DisplaySettingsActivity extends ActionBarActivity { rOverView(rOverView); rTextReflow(rTextReflow); rTextSize(rTextSize); + rDarkTheme(rDarkTheme); cbHideStatusBar(cbHideStatusBar); cbFullScreen(cbFullScreen); cbWideViewPort(cbWideViewPort); cbOverView(cbOverView); cbTextReflow(cbTextReflow); + cbDarkTheme(cbDarkTheme); } private void cbHideStatusBar(CheckBox view) { @@ -96,8 +105,8 @@ public class DisplaySettingsActivity extends ActionBarActivity { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - mEditPrefs.putBoolean(PreferenceConstants.HIDE_STATUS_BAR, isChecked); - mEditPrefs.apply(); + mPreferences.edit().putBoolean(PreferenceConstants.HIDE_STATUS_BAR, isChecked) + .apply(); } }); @@ -108,21 +117,31 @@ public class DisplaySettingsActivity extends ActionBarActivity { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - mEditPrefs.putBoolean(PreferenceConstants.FULL_SCREEN, isChecked); - mEditPrefs.apply(); + mPreferences.edit().putBoolean(PreferenceConstants.FULL_SCREEN, isChecked).apply(); } }); } + private void cbDarkTheme(CheckBox view) { + view.setOnCheckedChangeListener(new OnCheckedChangeListener() { + + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + mPreferences.edit().putBoolean(PreferenceConstants.DARK_THEME, isChecked).apply(); + mActivity.recreate(); + } + + }); + } private void cbWideViewPort(CheckBox view) { view.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - mEditPrefs.putBoolean(PreferenceConstants.USE_WIDE_VIEWPORT, isChecked); - mEditPrefs.apply(); + mPreferences.edit().putBoolean(PreferenceConstants.USE_WIDE_VIEWPORT, isChecked) + .apply(); } }); @@ -133,8 +152,8 @@ public class DisplaySettingsActivity extends ActionBarActivity { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - mEditPrefs.putBoolean(PreferenceConstants.OVERVIEW_MODE, isChecked); - mEditPrefs.apply(); + mPreferences.edit().putBoolean(PreferenceConstants.OVERVIEW_MODE, isChecked) + .apply(); } }); @@ -145,8 +164,7 @@ public class DisplaySettingsActivity extends ActionBarActivity { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - mEditPrefs.putBoolean(PreferenceConstants.TEXT_REFLOW, isChecked); - mEditPrefs.apply(); + mPreferences.edit().putBoolean(PreferenceConstants.TEXT_REFLOW, isChecked).apply(); } }); } @@ -173,6 +191,17 @@ public class DisplaySettingsActivity extends ActionBarActivity { }); } + private void rDarkTheme(RelativeLayout view) { + view.setOnClickListener(new OnClickListener() { + + @Override + public void onClick(View v) { + cbDarkTheme.setChecked(!cbDarkTheme.isChecked()); + } + + }); + } + private void rWideViewPort(RelativeLayout view) { view.setOnClickListener(new OnClickListener() { @@ -224,8 +253,8 @@ public class DisplaySettingsActivity extends ActionBarActivity { @Override public void onClick(DialogInterface dialog, int which) { - mEditPrefs.putInt(PreferenceConstants.TEXT_SIZE, which + 1); - mEditPrefs.apply(); + mPreferences.edit() + .putInt(PreferenceConstants.TEXT_SIZE, which + 1).apply(); } }); diff --git a/src/acr/browser/lightning/GeneralSettingsActivity.java b/src/acr/browser/lightning/GeneralSettingsActivity.java index fb2c98c..935ad05 100644 --- a/src/acr/browser/lightning/GeneralSettingsActivity.java +++ b/src/acr/browser/lightning/GeneralSettingsActivity.java @@ -44,6 +44,10 @@ public class GeneralSettingsActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { + mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0); + if (mPreferences.getBoolean(PreferenceConstants.DARK_THEME, false)) { + this.setTheme(R.style.Theme_SettingsTheme_Dark); + } super.onCreate(savedInstanceState); setContentView(R.layout.general_settings); @@ -53,7 +57,6 @@ public class GeneralSettingsActivity extends ActionBarActivity { getSupportActionBar().setDisplayHomeAsUpEnabled(true); - mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0); if (mPreferences.getBoolean(PreferenceConstants.HIDE_STATUS_BAR, false)) { getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); diff --git a/src/acr/browser/lightning/LicenseActivity.java b/src/acr/browser/lightning/LicenseActivity.java index e442f88..2cf3f17 100644 --- a/src/acr/browser/lightning/LicenseActivity.java +++ b/src/acr/browser/lightning/LicenseActivity.java @@ -4,6 +4,7 @@ package acr.browser.lightning; import android.content.Intent; +import android.content.SharedPreferences; import android.net.Uri; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; @@ -20,6 +21,10 @@ public class LicenseActivity extends ActionBarActivity implements View.OnClickLi @Override protected void onCreate(Bundle savedInstanceState) { + SharedPreferences preferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0); + if (preferences.getBoolean(PreferenceConstants.DARK_THEME, false)) { + this.setTheme(R.style.Theme_SettingsTheme_Dark); + } super.onCreate(savedInstanceState); setContentView(R.layout.license_activity); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); diff --git a/src/acr/browser/lightning/LightningView.java b/src/acr/browser/lightning/LightningView.java index 3814972..f0cadae 100644 --- a/src/acr/browser/lightning/LightningView.java +++ b/src/acr/browser/lightning/LightningView.java @@ -81,15 +81,20 @@ public class LightningView { @SuppressWarnings("deprecation") @SuppressLint("NewApi") - public LightningView(Activity activity, String url) { + public LightningView(Activity activity, String url, boolean darkTheme) { mActivity = activity; mWebView = new WebView(activity); - mTitle = new Title(activity); + mTitle = new Title(activity, darkTheme); mAdBlock = new AdBlock(activity); - mWebpageBitmap = BitmapFactory.decodeResource(activity.getResources(), - R.drawable.ic_webpage); + if (darkTheme) { + mWebpageBitmap = BitmapFactory.decodeResource(activity.getResources(), + R.drawable.ic_webpage_dark); + } else { + mWebpageBitmap = BitmapFactory.decodeResource(activity.getResources(), + R.drawable.ic_webpage); + } try { mBrowserController = (BrowserController) activity; @@ -1007,14 +1012,17 @@ public class LightningView { public class Title { private Bitmap mFavicon; - private String mTitle; - private Bitmap mDefaultIcon; - public Title(Context context) { - mDefaultIcon = BitmapFactory.decodeResource(context.getResources(), - R.drawable.ic_webpage); + public Title(Context context, boolean darkTheme) { + if (darkTheme) { + mDefaultIcon = BitmapFactory.decodeResource(context.getResources(), + R.drawable.ic_webpage_dark); + } else { + mDefaultIcon = BitmapFactory.decodeResource(context.getResources(), + R.drawable.ic_webpage); + } mFavicon = mDefaultIcon; mTitle = mActivity.getString(R.string.action_new_tab); } diff --git a/src/acr/browser/lightning/MainActivity.java b/src/acr/browser/lightning/MainActivity.java index a391219..8a4403e 100644 --- a/src/acr/browser/lightning/MainActivity.java +++ b/src/acr/browser/lightning/MainActivity.java @@ -12,13 +12,17 @@ import android.webkit.CookieSyncManager; public class MainActivity extends BrowserActivity { SharedPreferences mPreferences; - CookieManager mCookieManager; + private boolean mDark; @Override protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0); + mDark = mPreferences.getBoolean(PreferenceConstants.DARK_THEME, false); + if (mDark) { + this.setTheme(R.style.Theme_DarkTheme); + } + super.onCreate(savedInstanceState); } @Override @@ -58,6 +62,15 @@ public class MainActivity extends BrowserActivity { saveOpenTabs(); } + @Override + protected void onResume() { + super.onResume(); + if (mPreferences != null + && mPreferences.getBoolean(PreferenceConstants.DARK_THEME, false) != mDark) { + this.recreate(); + } + } + @Override public void updateHistory(String title, String url) { super.updateHistory(title, url); diff --git a/src/acr/browser/lightning/PrivacySettingsActivity.java b/src/acr/browser/lightning/PrivacySettingsActivity.java index 00afa57..d8e55f3 100644 --- a/src/acr/browser/lightning/PrivacySettingsActivity.java +++ b/src/acr/browser/lightning/PrivacySettingsActivity.java @@ -39,6 +39,10 @@ public class PrivacySettingsActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { + mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0); + if (mPreferences.getBoolean(PreferenceConstants.DARK_THEME, false)) { + this.setTheme(R.style.Theme_SettingsTheme_Dark); + } super.onCreate(savedInstanceState); setContentView(R.layout.privacy_settings); @@ -48,7 +52,6 @@ public class PrivacySettingsActivity extends ActionBarActivity { getSupportActionBar().setDisplayHomeAsUpEnabled(true); - mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0); if (mPreferences.getBoolean(PreferenceConstants.HIDE_STATUS_BAR, false)) { getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); diff --git a/src/acr/browser/lightning/ReadingActivity.java b/src/acr/browser/lightning/ReadingActivity.java index 0ac5340..c1d8ef8 100644 --- a/src/acr/browser/lightning/ReadingActivity.java +++ b/src/acr/browser/lightning/ReadingActivity.java @@ -6,27 +6,50 @@ import java.util.List; import acr.browser.lightning.reading.HtmlFetcher; import acr.browser.lightning.reading.JResult; import android.animation.ObjectAnimator; +import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.Context; +import android.content.DialogInterface; +import android.content.DialogInterface.OnClickListener; import android.content.Intent; +import android.content.SharedPreferences; import android.os.AsyncTask; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.support.v7.widget.Toolbar; +import android.view.LayoutInflater; +import android.view.Menu; import android.view.MenuItem; import android.view.View; +import android.widget.SeekBar; +import android.widget.SeekBar.OnSeekBarChangeListener; import android.widget.TextView; public class ReadingActivity extends ActionBarActivity { private TextView mTitle; private TextView mBody; + private boolean mInvert; + private String mUrl = null; + private SharedPreferences mPreferences; + private int mTextSize; + private static final float XXLARGE = 30.0f; + private static final float XLARGE = 26.0f; + private static final float LARGE = 22.0f; + private static final float MEDIUM = 18.0f; + private static final float SMALL = 14.0f; + private static final float XSMALL = 10.0f; @Override protected void onCreate(Bundle savedInstanceState) { + mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0); + boolean initInvert = mPreferences.getBoolean(PreferenceConstants.DARK_THEME, false); + mInvert = mPreferences.getBoolean(PreferenceConstants.INVERT_COLORS, initInvert); + if (mInvert) { + this.setTheme(R.style.Theme_SettingsTheme_Dark); + } super.onCreate(savedInstanceState); setContentView(R.layout.reading_view); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); @@ -35,6 +58,8 @@ public class ReadingActivity extends ActionBarActivity { mTitle = (TextView) findViewById(R.id.textViewTitle); mBody = (TextView) findViewById(R.id.textViewBody); + mTextSize = mPreferences.getInt(PreferenceConstants.READING_TEXT_SIZE, 2); + mBody.setTextSize(getTextSize(mTextSize)); mTitle.setText(getString(R.string.untitled)); mBody.setText(getString(R.string.loading)); @@ -47,16 +72,41 @@ public class ReadingActivity extends ActionBarActivity { } } + private float getTextSize(int size) { + switch (size) { + case 0: + return XSMALL; + case 1: + return SMALL; + case 2: + return MEDIUM; + case 3: + return LARGE; + case 4: + return XLARGE; + case 5: + return XXLARGE; + default: + return MEDIUM; + } + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.reading, menu); + return super.onCreateOptionsMenu(menu); + } + protected boolean loadPage(Intent intent) { if (intent == null) { return false; } - String url = intent.getStringExtra(Constants.LOAD_READING_URL); - if (url == null) { + mUrl = intent.getStringExtra(Constants.LOAD_READING_URL); + if (mUrl == null) { return false; } - getSupportActionBar().setTitle(Utils.getDomainName(url)); - new PageLoader(this).execute(url); + getSupportActionBar().setTitle(Utils.getDomainName(mUrl)); + new PageLoader(this).execute(mUrl); return true; } @@ -146,8 +196,57 @@ public class ReadingActivity extends ActionBarActivity { @Override public boolean onOptionsItemSelected(MenuItem item) { - finish(); + switch (item.getItemId()) { + case R.id.invert_item: + mPreferences.edit().putBoolean(PreferenceConstants.INVERT_COLORS, !mInvert).apply(); + Intent read = new Intent(this, ReadingActivity.class); + read.putExtra(Constants.LOAD_READING_URL, mUrl); + startActivity(read); + finish(); + break; + case R.id.text_size_item: + AlertDialog.Builder builder = new AlertDialog.Builder(this); + LayoutInflater inflater = this.getLayoutInflater(); + View view = inflater.inflate(R.layout.seek_layout, null); + final SeekBar bar = (SeekBar) view.findViewById(R.id.text_size_seekbar); + bar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() { + + @Override + public void onProgressChanged(SeekBar view, int size, boolean user) { + mBody.setTextSize(getTextSize(size)); + } + + @Override + public void onStartTrackingTouch(SeekBar arg0) { + } + + @Override + public void onStopTrackingTouch(SeekBar arg0) { + } + + }); + bar.setMax(5); + bar.setProgress(mTextSize); + builder.setView(view); + builder.setTitle(R.string.size); + builder.setPositiveButton(android.R.string.ok, new OnClickListener() { + + @Override + public void onClick(DialogInterface arg0, int arg1) { + mTextSize = bar.getProgress(); + mBody.setTextSize(getTextSize(mTextSize)); + mPreferences.edit() + .putInt(PreferenceConstants.READING_TEXT_SIZE, bar.getProgress()) + .apply(); + } + + }); + builder.show(); + break; + default: + finish(); + break; + } return super.onOptionsItemSelected(item); } - } diff --git a/src/acr/browser/lightning/SearchAdapter.java b/src/acr/browser/lightning/SearchAdapter.java index d8f9334..5eb3612 100644 --- a/src/acr/browser/lightning/SearchAdapter.java +++ b/src/acr/browser/lightning/SearchAdapter.java @@ -49,7 +49,7 @@ public class SearchAdapter extends BaseAdapter implements Filterable { private Context mContext; private boolean mUseGoogle = true; private boolean mIsExecuting = false; - private boolean mIncognito; + private boolean mDarkTheme; private BookmarkManager mBookmarkManager; private static final String ENCODING = "ISO-8859-1"; private static final long INTERVAL_DAY = 86400000; @@ -59,7 +59,7 @@ public class SearchAdapter extends BaseAdapter implements Filterable { private static final int API = Build.VERSION.SDK_INT; private Theme mTheme; - public SearchAdapter(Context context, boolean incognito) { + public SearchAdapter(Context context, boolean dark) { mDatabaseHandler = HistoryDatabase.getInstance(context); mTheme = context.getTheme(); mFilteredList = new ArrayList(); @@ -72,7 +72,7 @@ public class SearchAdapter extends BaseAdapter implements Filterable { mUseGoogle = mPreferences.getBoolean(PreferenceConstants.GOOGLE_SEARCH_SUGGESTIONS, true); mContext = context; mSearchSubtitle = mContext.getString(R.string.suggestion); - mIncognito = incognito; + mDarkTheme = dark; Thread delete = new Thread(new Runnable() { @Override @@ -164,7 +164,7 @@ public class SearchAdapter extends BaseAdapter implements Filterable { int imageId = R.drawable.ic_bookmark; switch (web.getImageId()) { case R.drawable.ic_bookmark: { - if (!mIncognito) { + if (!mDarkTheme) { imageId = R.drawable.ic_bookmark; } else { holder.mTitle.setTextColor(Color.WHITE); @@ -173,7 +173,7 @@ public class SearchAdapter extends BaseAdapter implements Filterable { break; } case R.drawable.ic_search: { - if (!mIncognito) { + if (!mDarkTheme) { imageId = R.drawable.ic_search; } else { holder.mTitle.setTextColor(Color.WHITE); @@ -182,7 +182,7 @@ public class SearchAdapter extends BaseAdapter implements Filterable { break; } case R.drawable.ic_history: { - if (!mIncognito) { + if (!mDarkTheme) { imageId = R.drawable.ic_history; } else { holder.mTitle.setTextColor(Color.WHITE); @@ -225,7 +225,7 @@ public class SearchAdapter extends BaseAdapter implements Filterable { return results; } String query = constraint.toString().toLowerCase(Locale.getDefault()); - if (mUseGoogle && !mIncognito && !mIsExecuting) { + if (mUseGoogle && !mDarkTheme && !mIsExecuting) { new RetrieveSearchSuggestions().execute(query); } @@ -403,7 +403,7 @@ public class SearchAdapter extends BaseAdapter implements Filterable { int maxBookmarks = (suggestionsSize + historySize < 3) ? (5 - suggestionsSize - historySize) : 2; - if (!mUseGoogle || mIncognito) { + if (!mUseGoogle || mDarkTheme) { maxHistory++; maxBookmarks++; } diff --git a/src/acr/browser/lightning/SettingsActivity.java b/src/acr/browser/lightning/SettingsActivity.java index 7e03894..524b5e3 100644 --- a/src/acr/browser/lightning/SettingsActivity.java +++ b/src/acr/browser/lightning/SettingsActivity.java @@ -35,32 +35,46 @@ public class SettingsActivity extends ActionBarActivity { private SharedPreferences mPreferences; private Context mContext; private Activity mActivity; + private boolean mDark; @Override protected void onCreate(Bundle savedInstanceState) { + mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0); + if (mPreferences.getBoolean(PreferenceConstants.DARK_THEME, false)) { + this.setTheme(R.style.Theme_SettingsTheme_Dark); + } super.onCreate(savedInstanceState); setContentView(R.layout.settings); + mDark = mPreferences.getBoolean(PreferenceConstants.DARK_THEME, false); mContext = this; mActivity = this; init(); } - + @Override public boolean onOptionsItemSelected(MenuItem item) { finish(); return true; } + @Override + protected void onResume() { + super.onResume(); + if (mPreferences != null + && mPreferences.getBoolean(PreferenceConstants.DARK_THEME, false) != mDark) { + this.recreate(); + } + } + @SuppressLint("NewApi") public void init() { // set up ActionBar - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + setSupportActionBar(toolbar); - getSupportActionBar().setDisplayHomeAsUpEnabled(true); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); // mPreferences storage - mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0); if (mPreferences.getBoolean(PreferenceConstants.HIDE_STATUS_BAR, false)) { getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); @@ -76,14 +90,14 @@ public class SettingsActivity extends ActionBarActivity { RelativeLayout layoutOrbot = (RelativeLayout) findViewById(R.id.layoutUseOrbot); RelativeLayout layoutColor = (RelativeLayout) findViewById(R.id.layoutColorMode); RelativeLayout layoutBookmarks = (RelativeLayout) findViewById(R.id.layoutBookmarks); - - layoutBookmarks.setOnClickListener(new OnClickListener(){ + + layoutBookmarks.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(mContext, BookmarkActivity.class)); } - + }); if (API >= 19) { @@ -113,7 +127,7 @@ public class SettingsActivity extends ActionBarActivity { color.setChecked(mPreferences.getBoolean(PreferenceConstants.ENABLE_COLOR_MODE, true)); initCheckBox(flash, adblock, images, enablejs, orbot, color); - clickListenerForCheckBoxes(layoutFlash, layoutBlockAds, layoutImages, layoutEnableJS, + clickListenerForCheckBoxes(layoutFlash, layoutBlockAds, layoutImages, layoutEnableJS, layoutOrbot, layoutColor, flash, adblock, images, enablejs, orbot, color); RelativeLayout general = (RelativeLayout) findViewById(R.id.layoutGeneral); @@ -129,10 +143,11 @@ public class SettingsActivity extends ActionBarActivity { about(about); } - public void clickListenerForCheckBoxes(RelativeLayout layoutFlash, RelativeLayout layoutBlockAds, - RelativeLayout layoutImages, RelativeLayout layoutEnableJS, RelativeLayout layoutOrbot, RelativeLayout layoutColor, - final CheckBox flash, final CheckBox adblock, final CheckBox images, final CheckBox enablejs, - final CheckBox orbot, final CheckBox color) { + public void clickListenerForCheckBoxes(RelativeLayout layoutFlash, + RelativeLayout layoutBlockAds, RelativeLayout layoutImages, + RelativeLayout layoutEnableJS, RelativeLayout layoutOrbot, RelativeLayout layoutColor, + final CheckBox flash, final CheckBox adblock, final CheckBox images, + final CheckBox enablejs, final CheckBox orbot, final CheckBox color) { layoutFlash.setOnClickListener(new OnClickListener() { @Override @@ -183,13 +198,13 @@ public class SettingsActivity extends ActionBarActivity { } }); - layoutColor.setOnClickListener(new OnClickListener(){ + layoutColor.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { color.setChecked(!color.isChecked()); } - + }); }