diff --git a/.travis.yml b/.travis.yml
index d0075eb88..66f370d0d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,8 +5,8 @@ jdk:
android:
components:
- tools
- - build-tools-25.0.3
- - android-25
+ - build-tools-26.0.0
+ - android-26
- extra-android-support
- extra-android-m2repository
licenses:
@@ -18,4 +18,5 @@ before_install:
install:
- ./gradlew
script:
- - ./gradlew assembleDebug --stacktrace
+ - ./gradlew :app:assembleDebug --stacktrace
+ - ./gradlew :app:test --stacktrace
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8d1521ce8..c83a801fc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,18 @@
Change Log
==========
+Version 4.5.1 *(2017-06-28)*
+----------------------------
+- Fixed bug with folders disappearing on bookmark homepage
+- Updated history page
+- Updated bookmark page
+- Updating target to Android O
+- Updating default bookmark favicons
+- Fixed occasional bug with bookmark long press
+- Updated downloads page design
+- Enhanced keyboard shortcuts
+- Fixed bug in google search suggestions for certain languages
+
Version 4.5.0 *(2017-06-08)*
----------------------------
- Translation updates
diff --git a/README.md b/README.md
index 43a7f3bab..5c4d40cbf 100644
--- a/README.md
+++ b/README.md
@@ -4,13 +4,10 @@
![](ic_launcher_small.png)
#### Download
-* [Download APK from here](https://github.com/anthonycr/Lightning-Browser/releases)
-
-* [Download from F-Droid](https://f-droid.org/repository/browse/?fdfilter=lightning&fdid=acr.browser.lightning)
-
-* [Download Free from Google Play](https://play.google.com/store/apps/details?id=acr.browser.barebones)
-
-* [Download Paid from Google Play](https://play.google.com/store/apps/details?id=acr.browser.lightning)
+[](https://f-droid.org/app/acr.browser.lightning) [](https://play.google.com/store/apps/details?id=acr.browser.lightning)
#### Master Branch
* [![Build Status](https://travis-ci.org/anthonycr/Lightning-Browser.svg?branch=master)](https://travis-ci.org/anthonycr/Lightning-Browser)
diff --git a/app/build.gradle b/app/build.gradle
index 451c6d713..beb699bb5 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,13 +1,14 @@
apply plugin: 'com.android.application'
+apply plugin: 'kotlin-android'
apply plugin: 'com.getkeepsafe.dexcount'
android {
- compileSdkVersion 25
- buildToolsVersion '25.0.3'
+ compileSdkVersion project.targetSdkVersion
+ buildToolsVersion project.buildToolsVersion
defaultConfig {
- minSdkVersion 14
- targetSdkVersion 25
+ minSdkVersion project.minSdkVersion
+ targetSdkVersion project.targetSdkVersion
versionName project.versionName
vectorDrawables.useSupportLibrary = true
}
@@ -63,9 +64,10 @@ dexcount {
}
dependencies {
+ testCompile 'junit:junit:4.12'
// support libraries
- def supportLibVersion = '25.3.1'
+ def supportLibVersion = '25.4.0'
compile "com.android.support:palette-v7:$supportLibVersion"
compile "com.android.support:appcompat-v7:$supportLibVersion"
compile "com.android.support:design:$supportLibVersion"
@@ -107,4 +109,7 @@ dependencies {
def leakCanaryVersion = '1.5.1'
debugCompile "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion"
releaseCompile "com.squareup.leakcanary:leakcanary-android-no-op:$leakCanaryVersion"
+
+ // Kotlin
+ compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
}
diff --git a/app/src/LightningPlus/assets/hosts.txt b/app/src/LightningPlus/assets/hosts.txt
index e9d12ca49..0d66715b8 100644
--- a/app/src/LightningPlus/assets/hosts.txt
+++ b/app/src/LightningPlus/assets/hosts.txt
@@ -1033,6 +1033,7 @@
127.0.0.1 4228414.fls.doubleclick.net
127.0.0.1 4235225.fls.doubleclick.net
127.0.0.1 4236808.fls.doubleclick.net
+127.0.0.1 4294919531.kt.mixmarket.biz
127.0.0.1 4299553.fls.doubleclick.net
127.0.0.1 43.6.87.194.dynamic.dol.ru
127.0.0.1 4331660.fls.doubleclick.net
@@ -14754,6 +14755,7 @@
127.0.0.1 ad1.hpg.com.br
127.0.0.1 ad1.icorp.net
127.0.0.1 ad1.kde.cz
+127.0.0.1 ad1.nend.net
127.0.0.1 ad1.pamedia.com.au
127.0.0.1 ad1.paycount.com
127.0.0.1 ad1.primorye.ru
@@ -15137,6 +15139,7 @@
127.0.0.1 ad2.doublepimp.com
127.0.0.1 ad2.ero-advertising.com
127.0.0.1 ad2.firehousezone.com
+127.0.0.1 ad2.fivecdm.com
127.0.0.1 ad2.hpg.com.br
127.0.0.1 ad2.ip.ro
127.0.0.1 ad2.linxcz.cz
@@ -16026,6 +16029,7 @@
127.0.0.1 addeppo.com
127.0.0.1 addesktop.com
127.0.0.1 addfreestats.com
+127.0.0.1 addiliate.com
127.0.0.1 addiply.com
127.0.0.1 addltest.timesink.com
127.0.0.1 addoer.com
@@ -16055,6 +16059,8 @@
127.0.0.1 adespresso.com
127.0.0.1 adex.adchakra.net
127.0.0.1 adex.admailtiser.com
+127.0.0.1 adexc.net
+127.0.0.1 adexce.net
127.0.0.1 adexcite.com
127.0.0.1 adexit.com
127.0.0.1 adexit.de
@@ -16197,6 +16203,7 @@
127.0.0.1 adg.bzgint.com
127.0.0.1 adgaem.go2cloud.org
127.0.0.1 adgalax.com
+127.0.0.1 adgale.com
127.0.0.1 adgardener.com
127.0.0.1 adgatemedia.com
127.0.0.1 adgatemedia.go2cloud.org
@@ -16537,6 +16544,7 @@
127.0.0.1 adrspain.go2cloud.org
127.0.0.1 adrtrklnk.com
127.0.0.1 adrunner.superstats.com
+127.0.0.1 adrunnr.com
127.0.0.1 ads-03.tor.focusin.ads.targetnet.com
127.0.0.1 ads-aa.wunderground.com
127.0.0.1 ads-au.onelouder.com
@@ -16838,6 +16846,7 @@
127.0.0.1 ads.dfiles.ru
127.0.0.1 ads.dgonn.com
127.0.0.1 ads.dhakatribune.com
+127.0.0.1 ads.diamonds
127.0.0.1 ads.digital-digest.com
127.0.0.1 ads.digitalhealthcare.com
127.0.0.1 ads.digitalmedianet.com
@@ -17074,6 +17083,7 @@
127.0.0.1 ads.keywordblocks.com
127.0.0.1 ads.kinobox.cz
127.0.0.1 ads.kinxxx.com
+127.0.0.1 ads.kiosked.com
127.0.0.1 ads.kizu.org
127.0.0.1 ads.klixxx.com
127.0.0.1 ads.komli.com
@@ -17720,6 +17730,7 @@
127.0.0.1 ads.webmastersdirect.com
127.0.0.1 ads.webmd.com
127.0.0.1 ads.webme.com
+127.0.0.1 ads.webseoanalytics.com
127.0.0.1 ads.webshots.com
127.0.0.1 ads.website-guru.com
127.0.0.1 ads.whaleads.com
@@ -18294,6 +18305,7 @@
127.0.0.1 adserver.adreactor.com
127.0.0.1 adserver.ads.com.ph
127.0.0.1 adserver.ads360.com
+127.0.0.1 adserver.adtech.advertising.com
127.0.0.1 adserver.adtech.de
127.0.0.1 adserver.adtech.de.1754.9018.302br.net
127.0.0.1 adserver.adtech.de.1756.9018.302br.net
@@ -18441,6 +18453,7 @@
127.0.0.1 adserver.trellian.com
127.0.0.1 adserver.tweakers.net
127.0.0.1 adserver.ubiyoo.com
+127.0.0.1 adserver.unityads.unity3d.com
127.0.0.1 adserver.veruta.com
127.0.0.1 adserver.virgin.net
127.0.0.1 adserver.weakgame.com
@@ -19197,7 +19210,6 @@
127.0.0.1 affiliatenetwork.com
127.0.0.1 affiliateprogram.keywordspy.com
127.0.0.1 affiliatequality.com
-127.0.0.1 affiliates-cdn.mozilla.org
127.0.0.1 affiliates.5dimes.com
127.0.0.1 affiliates.a2hosting.com
127.0.0.1 affiliates.about.com
@@ -19384,6 +19396,7 @@
127.0.0.1 akamai.bizrate.com
127.0.0.1 akamai.smartadserver.com
127.0.0.1 akillimeyveler.reklamagaci.com
+127.0.0.1 akm.playnow.guru
127.0.0.1 akmnetwork.com
127.0.0.1 aknoj.voluumtrk.com
127.0.0.1 aksb-a.akamaihd.net
@@ -19731,7 +19744,6 @@
127.0.0.1 antoinette-grabowski.us
127.0.0.1 antoinette-hanlon.us
127.0.0.1 antoinette-meisner.us
-127.0.0.1 anx.mindspark.com
127.0.0.1 any.gs
127.0.0.1 anycast.fw.adsafeprotected.com
127.0.0.1 anycast.pixel.adsafeprotected.com
@@ -19886,7 +19898,6 @@
127.0.0.1 api.vungle.com
127.0.0.1 api.w3i.com
127.0.0.1 api.widgetbucks.com
-127.0.0.1 api.wipmania.com
127.0.0.1 api.xdirectx.com
127.0.0.1 api.yeahmobi.com
127.0.0.1 api.yieldkit.com
@@ -20187,6 +20198,7 @@
127.0.0.1 assets.servedby-buysellads.com
127.0.0.1 assets.sharethrough.com
127.0.0.1 assets.tapad.com
+127.0.0.1 assistonglobal.com
127.0.0.1 assoc-amazon.co.uk
127.0.0.1 associatedcontent.112.2o7.net
127.0.0.1 associateprograms.com
@@ -20510,7 +20522,6 @@
127.0.0.1 bam-3.nr-data.net
127.0.0.1 bam-4.nr-data.net
127.0.0.1 bam-5.nr-data.net
-127.0.0.1 bam.nr-data.net
127.0.0.1 ban.krooncasino.com
127.0.0.1 ban.promotools.biz
127.0.0.1 ban3ers.ero-advertising.com
@@ -21500,6 +21511,7 @@
127.0.0.1 bbpntg3.homestead.com
127.0.0.1 bbs.duba.net
127.0.0.1 bbvj6.voluumtrk.com
+127.0.0.1 bc2.fivecdm.com
127.0.0.1 bc84-88b8-96b7-6515.reporo.net
127.0.0.1 bcanalytics.bigcommerce.com
127.0.0.1 bcast.pw
@@ -21706,7 +21718,6 @@
127.0.0.1 blog.adspaces.ero-advertising.com
127.0.0.1 blog.chartboost.com
127.0.0.1 blog.data.ero-advertising.com
-127.0.0.1 blog.disqus.com
127.0.0.1 blog.duba.net
127.0.0.1 blog.ero-advertising.com
127.0.0.1 blog.intext.ero-advertising.com
@@ -23301,6 +23312,7 @@
127.0.0.1 c.aol.com
127.0.0.1 c.apple.com
127.0.0.1 c.atdmt.com
+127.0.0.1 c.ato.mx
127.0.0.1 c.baidu.com
127.0.0.1 c.betrad.com
127.0.0.1 c.bigmir.net
@@ -23365,6 +23377,7 @@
127.0.0.1 c.thanksearch.com
127.0.0.1 c.tracking.gamigoads.com
127.0.0.1 c.trffrcmrd.com
+127.0.0.1 c.us1.dyntrk.com
127.0.0.1 c.viewsecure.net
127.0.0.1 c.vindicosuite.com
127.0.0.1 c.vrvm.com
@@ -23574,7 +23587,6 @@
127.0.0.1 campaigns.f2.com.au
127.0.0.1 campaigns.interclick.com
127.0.0.1 campaigns.rioseo.com
-127.0.0.1 campaigns.services.mozilla.com
127.0.0.1 campaigntracking01.com
127.0.0.1 campf.voluumtrk.com
127.0.0.1 camsiteonline.wiredcircular.com
@@ -23694,6 +23706,7 @@
127.0.0.1 cbvtest.2cnt.net
127.0.0.1 cbx.net
127.0.0.1 cc.amazingcounters.com
+127.0.0.1 cc.chango.com
127.0.0.1 cc.connextra.com
127.0.0.1 cc.zeit.de
127.0.0.1 cc03-41cf-c2ea-3a84.reporo.net
@@ -23714,6 +23727,7 @@
127.0.0.1 cdn-0.pics.dvdcdn.com
127.0.0.1 cdn-akamai.mookie1.com
127.0.0.1 cdn-ci34.actonsoftware.com
+127.0.0.1 cdn-highwinds.unityads.unity3d.com
127.0.0.1 cdn-i.dmdentertainment.com
127.0.0.1 cdn-static.liverail.com
127.0.0.1 cdn-tags.mmondi.com
@@ -24245,6 +24259,7 @@
127.0.0.1 choice.demdex.net
127.0.0.1 choice.microsoft.com
127.0.0.1 choices.truste.com
+127.0.0.1 chokoladsrv.net
127.0.0.1 chope-co.b.appier.net
127.0.0.1 christie-hanlon.us
127.0.0.1 christie-pearlman.us
@@ -26626,6 +26641,7 @@
127.0.0.1 d.refinedads.com
127.0.0.1 d.rmgserving.com
127.0.0.1 d.skimresources.com
+127.0.0.1 d.socdm.com
127.0.0.1 d.tds.adlabs.ru
127.0.0.1 d.thanksearch.com
127.0.0.1 d.thelocal.com
@@ -27259,6 +27275,7 @@
127.0.0.1 dimpact.co.il
127.0.0.1 dina-rish.us
127.0.0.1 dinclinx.com
+127.0.0.1 dintandnesin.ru
127.0.0.1 direct-revenue.com
127.0.0.1 direct-stats.com
127.0.0.1 direct-xxx-access.com
@@ -27477,7 +27494,6 @@
127.0.0.1 doubleclicks.me
127.0.0.1 doug1izaerwt3.cloudfront.net
127.0.0.1 dowlatow.justclick.ru
-127.0.0.1 download-performance.com
127.0.0.1 download.akamaitools.com.edgesuite.net
127.0.0.1 download.hitbox.com
127.0.0.1 download.installnow.mobi
@@ -27586,7 +27602,6 @@
127.0.0.1 dvdbeats.com
127.0.0.1 dvnzx.voluumtrk.com
127.0.0.1 dw-eu.com.com
-127.0.0.1 dw.cbsi.com
127.0.0.1 dw.cbsi.com.cn
127.0.0.1 dw.cnet.com
127.0.0.1 dw.com.com
@@ -28022,6 +28037,7 @@
127.0.0.1 enews.bfast.com
127.0.0.1 enewsletters.ziffdavisinternet.com
127.0.0.1 enfintrouver.com
+127.0.0.1 engage.morespeck.com
127.0.0.1 engagebdr.com
127.0.0.1 engine.4dsply.com
127.0.0.1 engine.a.redditmedia.com
@@ -28103,6 +28119,7 @@
127.0.0.1 epxkb8zz4ssdv7b.global.ssl.fastly.net
127.0.0.1 eqads.com
127.0.0.1 eqgdx.voluumtrk.com
+127.0.0.1 eqs-redserver.appspot.com
127.0.0.1 equantum.com
127.0.0.1 equitymarketingsolutions.com
127.0.0.1 eqx.smartadserver.com
@@ -28258,6 +28275,7 @@
127.0.0.1 everyfreegift.com
127.0.0.1 everyscape.com
127.0.0.1 everythingbts.com
+127.0.0.1 evewronsedent.ru
127.0.0.1 evidencecleanergold.com
127.0.0.1 evisit.exeter.ac.uk
127.0.0.1 evisitcs2.com
@@ -28493,6 +28511,7 @@
127.0.0.1 feedshare.flipora.com
127.0.0.1 felitb.rightinthebox.com
127.0.0.1 femi9.voluumtrk.com
+127.0.0.1 fenix-translation.com.ua
127.0.0.1 ferdy.org
127.0.0.1 fermakontenta.justclick.ru
127.0.0.1 ferrago.uk.intellitxt.com
@@ -29471,7 +29490,6 @@
127.0.0.1 geo.hyperlinksecure.com
127.0.0.1 geo.ivwbox.de
127.0.0.1 geo.metronews.ca
-127.0.0.1 geo.mozilla.org
127.0.0.1 geo.mtvnn.com
127.0.0.1 geo.offermatica.com
127.0.0.1 geo.q5media.net
@@ -30117,6 +30135,7 @@
127.0.0.1 hc.rapidshare.com
127.0.0.1 hc1.humanclick.com
127.0.0.1 hc2.humanclick.com
+127.0.0.1 hcharbach.de
127.0.0.1 hchrmain.112.2o7.net
127.0.0.1 hclrm.voluumtrk.com
127.0.0.1 hcu1u.voluumtrk.com
@@ -30153,6 +30172,7 @@
127.0.0.1 help.doubleclick.net
127.0.0.1 help.qualaroo.com
127.0.0.1 hernando.com
+127.0.0.1 hetsedryropt.com
127.0.0.1 hexacash.com
127.0.0.1 heywire.com
127.0.0.1 heyzap.com
@@ -30350,6 +30370,7 @@
127.0.0.1 hosting2.rts.lj.doublepimp.com
127.0.0.1 hosting4.rts.fling.doublepimp.com
127.0.0.1 hostlnks.com
+127.0.0.1 hostpedia.ro
127.0.0.1 hostpost4.xyz
127.0.0.1 hot50.net
127.0.0.1 hotdatinglist.com
@@ -30366,6 +30387,7 @@
127.0.0.1 housead.umeng.com
127.0.0.1 howaboutwe.go2cloud.org
127.0.0.1 howardchui.us.intellitxt.com
+127.0.0.1 howrowthettof.com
127.0.0.1 hoz01.voluumtrk.com
127.0.0.1 hpglobal.112.2o7.net
127.0.0.1 hphqglobal.112.2o7.net
@@ -30486,13 +30508,16 @@
127.0.0.1 i.n.jwpltx.com
127.0.0.1 i.nuseek.com
127.0.0.1 i.offerx.co.uk
+127.0.0.1 i.playnow.guru
127.0.0.1 i.plug.it
127.0.0.1 i.po.st
127.0.0.1 i.psa-ads.openx.com
127.0.0.1 i.r1-cdn.net
127.0.0.1 i.sahcdn.com
127.0.0.1 i.sbitinbsjs.info
+127.0.0.1 i.serves.live
127.0.0.1 i.simpli.fi
+127.0.0.1 i.socdm.com
127.0.0.1 i.tapit.com
127.0.0.1 i.tfag.de
127.0.0.1 i.theuseful.com
@@ -30659,7 +30684,6 @@
127.0.0.1 iframe.mediaplazza.com
127.0.0.1 iframe.sponsorpay.com
127.0.0.1 iframe.travel.yahoo.com
-127.0.0.1 iframehost.com
127.0.0.1 iframes.hustler.com
127.0.0.1 iframesrccdn1.adexprt.com
127.0.0.1 iframesrccdn2.adexprt.com
@@ -30846,7 +30870,6 @@
127.0.0.1 imaginemedia.net
127.0.0.1 imap.linkshare.com
127.0.0.1 imatmobile.com
-127.0.0.1 imb.mobitkr.com
127.0.0.1 imedia.co.il
127.0.0.1 imeds.ero-advertising.com
127.0.0.1 imeseonetwork.go2cloud.org
@@ -30945,6 +30968,7 @@
127.0.0.1 img04.webtrekk.net
127.0.0.1 img05.webtrekk.net
127.0.0.1 img06.webtrekk.net
+127.0.0.1 img1.nend.net
127.0.0.1 img1.webring.com
127.0.0.1 img2.freeze.com
127.0.0.1 img2.paipaiimg.com
@@ -31314,7 +31338,6 @@
127.0.0.1 j.adlooxtracking.com
127.0.0.1 j.clickdensity.com
127.0.0.1 j.kissinsights.com
-127.0.0.1 j.mp
127.0.0.1 j.ophan.co.uk
127.0.0.1 j.rvttrack.com
127.0.0.1 j.sahcdn.com
@@ -33074,6 +33097,7 @@
127.0.0.1 mediauk.247realmedia.com
127.0.0.1 mediavisor.doubleclick.com
127.0.0.1 mediavisor.doubleclick.net
+127.0.0.1 mediawhirl.net
127.0.0.1 mediciinternet.go2cloud.org
127.0.0.1 medicinenet.us.intellitxt.com
127.0.0.1 medio.com
@@ -33159,7 +33183,6 @@
127.0.0.1 metrics.loomia.com
127.0.0.1 metrics.mcafee.com
127.0.0.1 metrics.mmailhost.com
-127.0.0.1 metrics.mozilla.com
127.0.0.1 metrics.nexgen.neustar.biz
127.0.0.1 metrics.payback.de
127.0.0.1 metrics.premiereradio.net
@@ -33609,7 +33632,6 @@
127.0.0.1 my.applifier.com
127.0.0.1 my.blueadvertise.com
127.0.0.1 my.hellobar.com
-127.0.0.1 my.leadpages.net
127.0.0.1 my.media-servers.net
127.0.0.1 my.mobfox.com
127.0.0.1 my.omniture.com
@@ -33716,6 +33738,7 @@
127.0.0.1 n-tv.de.intellitxt.com
127.0.0.1 n-tv.met.vgwort.de
127.0.0.1 n.bodybuilding.com
+127.0.0.1 n.fclick-adnow.com
127.0.0.1 n.gemini.yahoo.com
127.0.0.1 n.ladycash.ru
127.0.0.1 n.lcads.ru
@@ -33782,6 +33805,7 @@
127.0.0.1 nancy-mosca.us
127.0.0.1 nandp.go2cloud.org
127.0.0.1 nanigans.com
+127.0.0.1 nanoadexchange.com
127.0.0.1 nanostats.nanopress.it
127.0.0.1 naomi-thorn.us
127.0.0.1 napster.searchwho.com
@@ -34006,6 +34030,7 @@
127.0.0.1 nl1.ero-advertising.com
127.0.0.1 nl2.ero-advertising.com
127.0.0.1 nlbanner.nl
+127.0.0.1 nlett3r.com
127.0.0.1 nlhra.voluumtrk.com
127.0.0.1 nm.netmng.com
127.0.0.1 nmaio.voluumtrk.com
@@ -34144,6 +34169,7 @@
127.0.0.1 nuera.go2cloud.org
127.0.0.1 nuggad.net
127.0.0.1 numb.hotshare.biz
+127.0.0.1 nurno.com
127.0.0.1 nv.ad.naver.com
127.0.0.1 nv4n8.voluumtrk.com
127.0.0.1 nvk.realsecuredredirect.com
@@ -34196,6 +34222,7 @@
127.0.0.1 o.addthis.com
127.0.0.1 o.leadbolt.com
127.0.0.1 o.sa.aol.com
+127.0.0.1 o.ss2.us
127.0.0.1 o.swisscom.ch
127.0.0.1 o.xbox.com
127.0.0.1 o.yieldsquare.com
@@ -34443,6 +34470,7 @@
127.0.0.1 onclickads.net
127.0.0.1 onclickads2.net
127.0.0.1 onclickrev.com
+127.0.0.1 onclkds.com
127.0.0.1 one-time-offer.com
127.0.0.1 one.123counters.com
127.0.0.1 oneandonlynetwork.com
@@ -34625,6 +34653,7 @@
127.0.0.1 outils.acf-webmaster.net
127.0.0.1 outils.f5biz.com
127.0.0.1 outpost.real.com
+127.0.0.1 output.nend.net
127.0.0.1 outsidethebeltway.us.intellitxt.com
127.0.0.1 ov.yahoo.co.jp
127.0.0.1 overpro.com
@@ -34842,6 +34871,7 @@
127.0.0.1 papayamobile.com
127.0.0.1 papi.slideme.org
127.0.0.1 paramount.go2cloud.org
+127.0.0.1 pardtosinsing.ru
127.0.0.1 parenting.searchwho.com
127.0.0.1 paris.typepad.com
127.0.0.1 paritycube.go2cloud.org
@@ -35247,6 +35277,7 @@
127.0.0.1 player-services.goviral-content.com
127.0.0.1 player.piksel.com
127.0.0.1 playminigolf.com
+127.0.0.1 playnow.guru
127.0.0.1 playtomic.com
127.0.0.1 plb27.voluumtrk.com
127.0.0.1 pleasedontslaymy.download
@@ -35427,6 +35458,7 @@
127.0.0.1 preciselylocate.com
127.0.0.1 precisionleads.go2cloud.org
127.0.0.1 predictad.com
+127.0.0.1 predictivadvertising.com
127.0.0.1 predictivenetworks.com
127.0.0.1 preferences.truste.com
127.0.0.1 preferredpublishers.go2cloud.org
@@ -35907,6 +35939,7 @@
127.0.0.1 r.369dl.com
127.0.0.1 r.ads.zynga.com
127.0.0.1 r.adserver01.de
+127.0.0.1 r.af-share.jp
127.0.0.1 r.aol.com
127.0.0.1 r.apina.biz
127.0.0.1 r.bbci.co.uk
@@ -35942,7 +35975,6 @@
127.0.0.1 r.zeroredirect1.com
127.0.0.1 r.zeroredirect2.com
127.0.0.1 r0d2x.voluumtrk.com
-127.0.0.1 r1---sn-vgqsen7z.googlevideo.com
127.0.0.1 r1.ace.advertising.com
127.0.0.1 r1.beta.ace.advertising.com
127.0.0.1 r1.computerbild.de
@@ -35950,27 +35982,20 @@
127.0.0.1 r1.fmpub.net
127.0.0.1 r1.pcwelt.de
127.0.0.1 r1.plugrush.com
-127.0.0.1 r1.sn-vgqsen7z.googlevideo.com
127.0.0.1 r1.zedo.com
127.0.0.1 r10.cooleremail.com
127.0.0.1 r11.cooleremail.com
-127.0.0.1 r17---sn-vgqsenes.googlevideo.com
-127.0.0.1 r2---sn-vgqs7n7k.googlevideo.com
127.0.0.1 r2.cooleremail.com
127.0.0.1 r2.linksynergy.com
127.0.0.1 r2.plugrush.com
-127.0.0.1 r20---sn-vgqs7ne7.googlevideo.com
127.0.0.1 r20.rs6.net
-127.0.0.1 r20.sn-vgqs7ne7.googlevideo.com
127.0.0.1 r2fjs.voluumtrk.com
127.0.0.1 r2jmarketing.go2cloud.org
127.0.0.1 r2v3n.voluumtrk.com
127.0.0.1 r3.cooleremail.com
127.0.0.1 r3.plugrush.com
-127.0.0.1 r4---sn-vgqs7nez.googlevideo.com
127.0.0.1 r4.cooleremail.com
127.0.0.1 r4.plugrush.com
-127.0.0.1 r4.sn-vgqs7nez.googlevideo.com
127.0.0.1 r4zih.voluumtrk.com
127.0.0.1 r5.cooleremail.com
127.0.0.1 r5.plugrush.com
@@ -36032,6 +36057,7 @@
127.0.0.1 rates.insureship.com
127.0.0.1 rating.openstat.com
127.0.0.1 rating.openstat.ru
+127.0.0.1 ratsparropret.ru
127.0.0.1 ratx9.voluumtrk.com
127.0.0.1 ravenstonedigital.go2cloud.org
127.0.0.1 rawdinner.justclick.ru
@@ -36153,6 +36179,7 @@
127.0.0.1 redirects.timesink.com
127.0.0.1 reditions.net
127.0.0.1 redmas.com
+127.0.0.1 redrct.site
127.0.0.1 redshiftleads.steele.net
127.0.0.1 redtube.yoshatia.com
127.0.0.1 reduxmedia.com
@@ -36395,12 +36422,12 @@
127.0.0.1 roia.hutchmedia.com
127.0.0.1 roiadtracker.com
127.0.0.1 roitracker.com
-127.0.0.1 rollbar.com
127.0.0.1 romanticfm.2cnt.net
127.0.0.1 romview.atdmt.com.915.9004.302br.net
127.0.0.1 ronaldheft.com
127.0.0.1 roomkey.d1.sc.omtrdc.net
127.0.0.1 rootzwiki.us.intellitxt.com
+127.0.0.1 ropretratspar.com
127.0.0.1 rose.ixbt.com
127.0.0.1 rosettastone.tt.omtrdc.net
127.0.0.1 rotabanner.kulichki.net
@@ -36529,11 +36556,13 @@
127.0.0.1 ryerose.net
127.0.0.1 rygpq.voluumtrk.com
127.0.0.1 ryield.jmp9.com
+127.0.0.1 ryropthetsed.ru
127.0.0.1 rytj3.voluumtrk.com
127.0.0.1 rzr.tractionize.com
127.0.0.1 s-adserver.cxad.cxense.com
127.0.0.1 s-adserver.sandbox.cxad.cxense.com
127.0.0.1 s-assets.tp-cdn.com
+127.0.0.1 s-cs.send.microad.jp
127.0.0.1 s-jsonp.moatads.com
127.0.0.1 s-yoolk-banner-assets.yoolk.com
127.0.0.1 s-yoolk-billboard-assets.yoolk.com
@@ -36748,6 +36777,7 @@
127.0.0.1 s90.cnzz.com
127.0.0.1 s95.research.de.com
127.0.0.1 s9kpd.voluumtrk.com
+127.0.0.1 sa-receiver.sematext.com
127.0.0.1 sa.bbc.co.uk
127.0.0.1 sa.bbc.com
127.0.0.1 sa.seotoaster.com
@@ -36845,7 +36875,6 @@
127.0.0.1 script.ioam.de
127.0.0.1 script.leadboxer.com
127.0.0.1 script.opentracker.net
-127.0.0.1 script.starpass.fr
127.0.0.1 script.tailsweep.com
127.0.0.1 scripts.adrcdn.com
127.0.0.1 scripts.affiliatefuture.com
@@ -37042,7 +37071,6 @@
127.0.0.1 selina-wimmer.us
127.0.0.1 sellads.eu
127.0.0.1 sem.shopexplorer.com
-127.0.0.1 sematext.com
127.0.0.1 semrush.com
127.0.0.1 send.microad.jp
127.0.0.1 send4fun.com
@@ -37513,8 +37541,6 @@
127.0.0.1 sndkorea.co.kr
127.0.0.1 sndkorea.nowcdn.co.kr
127.0.0.1 snimi-sam.justclick.ru
-127.0.0.1 snippets-stats.mozilla.org
-127.0.0.1 snippets.mozilla.com
127.0.0.1 snonline.ivwbox.de
127.0.0.1 snowplow-collector.sugarops.com
127.0.0.1 soa.adition.com
@@ -38244,6 +38270,7 @@
127.0.0.1 stats.united-domains.de
127.0.0.1 stats.unity3d.com
127.0.0.1 stats.uswitch.com
+127.0.0.1 stats.valaffiliates.com
127.0.0.1 stats.vertriebsassistent.de
127.0.0.1 stats.viddler.com
127.0.0.1 stats.virtuemart.net
@@ -38491,6 +38518,7 @@
127.0.0.1 sync.livejasmin.com
127.0.0.1 sync.mathtag.com
127.0.0.1 sync.smarttds.ru
+127.0.0.1 sync.teads.tv
127.0.0.1 sync.zenoviaexchange.com
127.0.0.1 syndicate.payloadz.com
127.0.0.1 syndicate.powerofads.com
@@ -38675,7 +38703,6 @@
127.0.0.1 tag.gamecentral.hiro.tv
127.0.0.1 tag.gstat.orangeportails.net
127.0.0.1 tag.myplay.com
-127.0.0.1 tag.navdmp.com
127.0.0.1 tag.reachadv.it
127.0.0.1 tag.researchnow.com
127.0.0.1 tag.shopping-feed.com
@@ -38944,6 +38971,7 @@
127.0.0.1 tfn.das.tamedia.ch
127.0.0.1 tfncdn.thaflynation.com
127.0.0.1 tfp.2ref.co
+127.0.0.1 tg.socdm.com
127.0.0.1 tga.acs86.com
127.0.0.1 tga.csbew.com
127.0.0.1 tgbvfr.website
@@ -38969,7 +38997,6 @@
127.0.0.1 thehitsusa.com
127.0.0.1 theinterwebs.space
127.0.0.1 theoads.com
-127.0.0.1 theoads.com.
127.0.0.1 theodosium.com
127.0.0.1 thepoint.go2cloud.org
127.0.0.1 theresa-buchman.us
@@ -39040,7 +39067,6 @@
127.0.0.1 tigerloads.com
127.0.0.1 tigertext.com
127.0.0.1 til.go2cloud.org
-127.0.0.1 tiles.services.mozilla.com
127.0.0.1 tiller.co
127.0.0.1 tim-eckhoff.us
127.0.0.1 timebus2.112.2o7.net
@@ -39203,6 +39229,7 @@
127.0.0.1 tr.ilius.net
127.0.0.1 tr.interlake.net
127.0.0.1 tr.newsletter.capdecision.fr
+127.0.0.1 tr.note001.com
127.0.0.1 tr.sjc.contextweb.com
127.0.0.1 tr.x-tk.net
127.0.0.1 tr1.myroitracking.com
@@ -39353,6 +39380,7 @@
127.0.0.1 track.reinvigorate.net
127.0.0.1 track.right-ads.com
127.0.0.1 track.ringcentral.com
+127.0.0.1 track.scanguard.com
127.0.0.1 track.scanmyphones.com
127.0.0.1 track.scorpiointeractive.com
127.0.0.1 track.searchignite.com
@@ -39478,6 +39506,7 @@
127.0.0.1 trackicollect.ibase.fr
127.0.0.1 tracking.1moretoy.com
127.0.0.1 tracking.247search.com
+127.0.0.1 tracking.4v4jfe79erfxfu8z8.com
127.0.0.1 tracking.actionads.ru
127.0.0.1 tracking.adjug.com
127.0.0.1 tracking.admarketplace.net
@@ -39582,6 +39611,8 @@
127.0.0.1 tracking.netzathleten-media.de
127.0.0.1 tracking.nuasti.com
127.0.0.1 tracking.olx-st.com
+127.0.0.1 tracking.orixa-media.com
+127.0.0.1 tracking.perfecttoolmedia.com
127.0.0.1 tracking.performancerevenues.com
127.0.0.1 tracking.plattformad.com
127.0.0.1 tracking.practicefusion.com
@@ -39808,6 +39839,7 @@
127.0.0.1 trk.kissmetrics.com
127.0.0.1 trk.m.libero.it
127.0.0.1 trk.mailtoward.com
+127.0.0.1 trk.meacashtrk.com
127.0.0.1 trk.mobile-setting.com
127.0.0.1 trk.pswec.com
127.0.0.1 trk.rrcpm.com
@@ -39817,6 +39849,7 @@
127.0.0.1 trk.vidible.tv
127.0.0.1 trk.vindicosuite.com
127.0.0.1 trk02.gtrk.info
+127.0.0.1 trk1.opanw.com
127.0.0.1 trk2it4.com
127.0.0.1 trk4.com
127.0.0.1 trkag1.com
@@ -40270,6 +40303,7 @@
127.0.0.1 uk.nedstatpro.net
127.0.0.1 uk.sitestat.com
127.0.0.1 uk.static.planet49.com
+127.0.0.1 uk.websearchnow.net
127.0.0.1 uk1.siteimprove.com
127.0.0.1 ukaffiliates2.com
127.0.0.1 ukbanners.com
@@ -40343,6 +40377,7 @@
127.0.0.1 urlcash.net
127.0.0.1 urlcheck.hulu.com
127.0.0.1 urlstats.com
+127.0.0.1 urlzzz.com
127.0.0.1 urx.io
127.0.0.1 us-ads.openx.net
127.0.0.1 us-east-1.profile-api.ads.linkedin.com
@@ -40361,7 +40396,6 @@
127.0.0.1 us.js.yimg.com
127.0.0.1 us.marketgid.com
127.0.0.1 us.static.planet49.com
-127.0.0.1 us.upgradenow24.com
127.0.0.1 us.wa.ui-portal.com
127.0.0.1 us.webprodcdn.com
127.0.0.1 us.winninganswers.net
@@ -44182,6 +44216,7 @@
127.0.0.1 vt.adition.com
127.0.0.1 vtncmn.com
127.0.0.1 vtot.proxy.aol.com
+127.0.0.1 vtrack.larvtrk.com
127.0.0.1 vtracking.in.com
127.0.0.1 vtrtl.de
127.0.0.1 vu.moatads.com
@@ -45057,10 +45092,13 @@
127.0.0.1 www.adclix.com
127.0.0.1 www.adclub.net
127.0.0.1 www.adcron.com
+127.0.0.1 www.addiliate.com
127.0.0.1 www.addinto.com
127.0.0.1 www.addme.com
127.0.0.1 www.addthis.com
127.0.0.1 www.adelina-ashman.us
+127.0.0.1 www.adexc.net
+127.0.0.1 www.adexce.net
127.0.0.1 www.adexcite.com
127.0.0.1 www.adexm.com
127.0.0.1 www.adfest.com
@@ -45094,6 +45132,7 @@
127.0.0.1 www.admarketplace.net
127.0.0.1 www.admarvel.com
127.0.0.1 www.admaya.in
+127.0.0.1 www.admaym.com
127.0.0.1 www.admedo.com
127.0.0.1 www.admeld.com
127.0.0.1 www.admestate.ru
@@ -45464,6 +45503,7 @@
127.0.0.1 www.cartonetwork.com
127.0.0.1 www.cartoonnrtwork.com
127.0.0.1 www.casalemedia.com
+127.0.0.1 www.casalparis.cat
127.0.0.1 www.cash-duck.com
127.0.0.1 www.cash4files.com
127.0.0.1 www.cash4webmaster.de
@@ -45499,6 +45539,7 @@
127.0.0.1 www.checkm8.com
127.0.0.1 www.cherish-mauk.us
127.0.0.1 www.cheryl-edelstein.us
+127.0.0.1 www.chokoladsrv.net
127.0.0.1 www.christi-canfield.us
127.0.0.1 www.christie-hanlon.us
127.0.0.1 www.chrystal-hollins.us
@@ -45538,6 +45579,7 @@
127.0.0.1 www.clicksrvr.co
127.0.0.1 www.clickstotrack.com
127.0.0.1 www.clicksurecpa.com
+127.0.0.1 www.clicksyndicatetracking.com
127.0.0.1 www.clickterra.net
127.0.0.1 www.clicktracksolutions.com
127.0.0.1 www.clicktraffix.com
@@ -45576,6 +45618,7 @@
127.0.0.1 www.compete.com
127.0.0.1 www.competeinc.com
127.0.0.1 www.comscore.com
+127.0.0.1 www.comunedeicittadini.it
127.0.0.1 www.con.vmsn.de
127.0.0.1 www.conductedresearch.com
127.0.0.1 www.connectlinking1.com
@@ -45756,7 +45799,6 @@
127.0.0.1 www.doubleclick.ne.jp
127.0.0.1 www.doubleclick.net
127.0.0.1 www.doubleclick.net.my
-127.0.0.1 www.download-performance.com
127.0.0.1 www.downloadcounter.de
127.0.0.1 www.dprtb.com
127.0.0.1 www.dragonballzhomeland.com
@@ -46130,7 +46172,6 @@
127.0.0.1 www.ientry.com
127.0.0.1 www.ientrymail.com
127.0.0.1 www.ientrynetwork.net
-127.0.0.1 www.iframehost.com
127.0.0.1 www.ifsmarketing.com
127.0.0.1 www.igain-mail.co.uk
127.0.0.1 www.ignitad.com
@@ -46491,6 +46532,7 @@
127.0.0.1 www.mediamind.com
127.0.0.1 www.mediaplex.com
127.0.0.1 www.mediasheva.com
+127.0.0.1 www.mediawhirl.net
127.0.0.1 www.medio.com
127.0.0.1 www.meethotties.mobi
127.0.0.1 www.megacounter.de
@@ -46623,6 +46665,7 @@
127.0.0.1 www.n78adserv.com
127.0.0.1 www.n79adserv.com
127.0.0.1 www.nadia-carlyle.us
+127.0.0.1 www.nanoadexchange.com
127.0.0.1 www.naomi-thorn.us
127.0.0.1 www.naturalsearchtoolresults.com
127.0.0.1 www.navteq.com
@@ -46647,11 +46690,13 @@
127.0.0.1 www.nicolette-brier.us
127.0.0.1 www.nicolette-salas.us
127.0.0.1 www.njashka.ru
+127.0.0.1 www.nlett3r.com
127.0.0.1 www.nngalleries2.com
127.0.0.1 www.noelle-traxler.us
127.0.0.1 www.noelle-trotter.us
127.0.0.1 www.nonames.tk
127.0.0.1 www.noowho.com
+127.0.0.1 www.nurno.com
127.0.0.1 www.nvtrak.com
127.0.0.1 www.nxsrv1.com
127.0.0.1 www.o2onbusiness.de
@@ -46675,6 +46720,7 @@
127.0.0.1 www.omtrdc.net
127.0.0.1 www.onclickads.net
127.0.0.1 www.onclickpredictiv.com
+127.0.0.1 www.onclkds.com
127.0.0.1 www.oneandonlynetwork.com
127.0.0.1 www.onelouder.com
127.0.0.1 www.onestat.com
@@ -46781,6 +46827,7 @@
127.0.0.1 www.pptrk.com
127.0.0.1 www.prchecker.info
127.0.0.1 www.preciselylocate.com
+127.0.0.1 www.predictivadvertising.com
127.0.0.1 www.premiumhdv.com
127.0.0.1 www.primosearch.com
127.0.0.1 www.pringotrack.com
@@ -46883,7 +46930,6 @@
127.0.0.1 www.robotreplay.com
127.0.0.1 www.roiadtracker.com
127.0.0.1 www.roitracker.com
-127.0.0.1 www.rollbar.com
127.0.0.1 www.rotrk.com
127.0.0.1 www.roxyaffiliates.com
127.0.0.1 www.rsmrttracking.com
@@ -46960,7 +47006,6 @@
127.0.0.1 www.selina-krouse.us
127.0.0.1 www.selipuquoe.com
127.0.0.1 www.sellads.eu
-127.0.0.1 www.sematext.com
127.0.0.1 www.semrush.com
127.0.0.1 www.send4fun.com
127.0.0.1 www.seniorttub.bid
@@ -47260,6 +47305,7 @@
127.0.0.1 www.upsellit.com
127.0.0.1 www.upv4.moatads.com
127.0.0.1 www.urlstats.com
+127.0.0.1 www.urlzzz.com
127.0.0.1 www.urmediazone.com
127.0.0.1 www.urx.io
127.0.0.1 www.usabilla.com
@@ -47275,6 +47321,7 @@
127.0.0.1 www.vayavicio.com
127.0.0.1 www.vdownloadall.com
127.0.0.1 www.vectormarketing.com
+127.0.0.1 www.venturead.com
127.0.0.1 www.veruta.com
127.0.0.1 www.vibrantmedia.com
127.0.0.1 www.video-loader.com
@@ -47672,6 +47719,7 @@
127.0.0.1 xiazai.duba.net
127.0.0.1 xiti.com
127.0.0.1 xl.topstat.com
+127.0.0.1 xl415.com
127.0.0.1 xlite.counterpath.com
127.0.0.1 xml.adtech.fr
127.0.0.1 xml.fusionxml.com
@@ -47873,6 +47921,7 @@
127.0.0.1 zbxproxy01.con.local.vmsn.de
127.0.0.1 zc.zeroredirect1.com
127.0.0.1 zc.zeroredirect2.com
+127.0.0.1 zc2.quebec-bin.com
127.0.0.1 zd.zeroredirect1.com
127.0.0.1 zdau-builder.122.2o7.net
127.0.0.1 zdau-zdnetau.122.2o7.net
@@ -47974,4 +48023,4 @@
127.0.0.1 zz.zeroredirect1.com
127.0.0.1 zzz.clickbank.net
127.0.0.1 _thums.ero-advertising.com
-# Hosts: 47966
\ No newline at end of file
+# Hosts: 48015
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index f955ce5b3..ea99c1edb 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -25,7 +25,7 @@
android:required="false"/>
@@ -133,9 +133,9 @@
diff --git a/app/src/main/java/acr/browser/lightning/app/BrowserApp.java b/app/src/main/java/acr/browser/lightning/BrowserApp.java
similarity index 96%
rename from app/src/main/java/acr/browser/lightning/app/BrowserApp.java
rename to app/src/main/java/acr/browser/lightning/BrowserApp.java
index 1bbc19a56..7d5fdf9ad 100644
--- a/app/src/main/java/acr/browser/lightning/app/BrowserApp.java
+++ b/app/src/main/java/acr/browser/lightning/BrowserApp.java
@@ -1,4 +1,4 @@
-package acr.browser.lightning.app;
+package acr.browser.lightning;
import android.app.Activity;
import android.app.Application;
@@ -20,11 +20,13 @@
import javax.inject.Inject;
-import acr.browser.lightning.BuildConfig;
import acr.browser.lightning.database.HistoryItem;
import acr.browser.lightning.database.bookmark.BookmarkExporter;
-import acr.browser.lightning.database.bookmark.legacy.LegacyBookmarkManager;
import acr.browser.lightning.database.bookmark.BookmarkModel;
+import acr.browser.lightning.database.bookmark.legacy.LegacyBookmarkManager;
+import acr.browser.lightning.di.AppComponent;
+import acr.browser.lightning.di.AppModule;
+import acr.browser.lightning.di.DaggerAppComponent;
import acr.browser.lightning.preference.PreferenceManager;
import acr.browser.lightning.utils.FileUtils;
import acr.browser.lightning.utils.MemoryLeakUtils;
diff --git a/app/src/main/java/acr/browser/lightning/activity/IncognitoActivity.java b/app/src/main/java/acr/browser/lightning/IncognitoActivity.java
similarity index 95%
rename from app/src/main/java/acr/browser/lightning/activity/IncognitoActivity.java
rename to app/src/main/java/acr/browser/lightning/IncognitoActivity.java
index 9f085b507..ecdb90837 100644
--- a/app/src/main/java/acr/browser/lightning/activity/IncognitoActivity.java
+++ b/app/src/main/java/acr/browser/lightning/IncognitoActivity.java
@@ -1,4 +1,4 @@
-package acr.browser.lightning.activity;
+package acr.browser.lightning;
import android.content.Intent;
import android.os.Build;
@@ -12,7 +12,7 @@
import com.anthonycr.bonsai.CompletableAction;
import com.anthonycr.bonsai.CompletableSubscriber;
-import acr.browser.lightning.R;
+import acr.browser.lightning.browser.activity.BrowserActivity;
@SuppressWarnings("deprecation")
public class IncognitoActivity extends BrowserActivity {
diff --git a/app/src/main/java/acr/browser/lightning/activity/MainActivity.java b/app/src/main/java/acr/browser/lightning/MainActivity.java
similarity index 72%
rename from app/src/main/java/acr/browser/lightning/activity/MainActivity.java
rename to app/src/main/java/acr/browser/lightning/MainActivity.java
index 058085937..298c362ee 100644
--- a/app/src/main/java/acr/browser/lightning/activity/MainActivity.java
+++ b/app/src/main/java/acr/browser/lightning/MainActivity.java
@@ -1,9 +1,10 @@
-package acr.browser.lightning.activity;
+package acr.browser.lightning;
import android.content.Intent;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
+import android.view.KeyEvent;
import android.view.Menu;
import android.webkit.CookieManager;
import android.webkit.CookieSyncManager;
@@ -12,7 +13,7 @@
import com.anthonycr.bonsai.CompletableAction;
import com.anthonycr.bonsai.CompletableSubscriber;
-import acr.browser.lightning.R;
+import acr.browser.lightning.browser.activity.BrowserActivity;
@SuppressWarnings("deprecation")
public class MainActivity extends BrowserActivity {
@@ -76,5 +77,22 @@ public void run() {
});
}
+ @Override
+ public boolean dispatchKeyEvent(KeyEvent event) {
+ if (event.getAction() == KeyEvent.ACTION_DOWN && event.isCtrlPressed()) {
+ switch (event.getKeyCode()) {
+ case KeyEvent.KEYCODE_P:
+ // Open a new private window
+ if(event.isShiftPressed()) {
+ startActivity(new Intent(this, IncognitoActivity.class));
+ overridePendingTransition(R.anim.slide_up_in, R.anim.fade_out_scale);
+ return true;
+ }
+ break;
+ }
+ }
+ return super.dispatchKeyEvent(event);
+ }
+
}
diff --git a/app/src/main/java/acr/browser/lightning/activity/AppCompatPreferenceActivity.java b/app/src/main/java/acr/browser/lightning/activity/AppCompatPreferenceActivity.java
index 14f70b128..9110e6eab 100644
--- a/app/src/main/java/acr/browser/lightning/activity/AppCompatPreferenceActivity.java
+++ b/app/src/main/java/acr/browser/lightning/activity/AppCompatPreferenceActivity.java
@@ -40,11 +40,11 @@ protected void onPostCreate(Bundle savedInstanceState) {
getDelegate().onPostCreate(savedInstanceState);
}
- ActionBar getSupportActionBar() {
+ protected final ActionBar getSupportActionBar() {
return getDelegate().getSupportActionBar();
}
- void setSupportActionBar(@Nullable Toolbar toolbar) {
+ protected final void setSupportActionBar(@Nullable Toolbar toolbar) {
getDelegate().setSupportActionBar(toolbar);
}
diff --git a/app/src/main/java/acr/browser/lightning/utils/AdBlock.java b/app/src/main/java/acr/browser/lightning/adblock/AdBlock.java
similarity index 72%
rename from app/src/main/java/acr/browser/lightning/utils/AdBlock.java
rename to app/src/main/java/acr/browser/lightning/adblock/AdBlock.java
index 0fd6fc07a..698b23150 100644
--- a/app/src/main/java/acr/browser/lightning/utils/AdBlock.java
+++ b/app/src/main/java/acr/browser/lightning/adblock/AdBlock.java
@@ -1,4 +1,4 @@
-package acr.browser.lightning.utils;
+package acr.browser.lightning.adblock;
import android.app.Application;
import android.content.res.AssetManager;
@@ -16,7 +16,9 @@
import java.io.InputStreamReader;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.ArrayList;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
import javax.inject.Inject;
@@ -24,6 +26,8 @@
import acr.browser.lightning.BuildConfig;
import acr.browser.lightning.preference.PreferenceManager;
+import acr.browser.lightning.utils.StringBuilderUtils;
+import acr.browser.lightning.utils.Utils;
@Singleton
public class AdBlock {
@@ -132,42 +136,16 @@ public void onSubscribe(@NonNull CompletableSubscriber subscriber) {
String line;
long time = System.currentTimeMillis();
+ final List domains = new ArrayList<>(1);
+
while ((line = reader.readLine()) != null) {
lineBuilder.append(line);
- if (!StringBuilderUtils.isEmpty(lineBuilder) &&
- !StringBuilderUtils.startsWith(lineBuilder, COMMENT)) {
- StringBuilderUtils.replace(lineBuilder, LOCAL_IP_V4, EMPTY);
- StringBuilderUtils.replace(lineBuilder, LOCAL_IP_V4_ALT, EMPTY);
- StringBuilderUtils.replace(lineBuilder, LOCAL_IP_V6, EMPTY);
- StringBuilderUtils.replace(lineBuilder, TAB, EMPTY);
-
- int comment = lineBuilder.indexOf(COMMENT);
- if (comment >= 0) {
- lineBuilder.replace(comment, lineBuilder.length(), EMPTY);
- }
-
- StringBuilderUtils.trim(lineBuilder);
-
- if (!StringBuilderUtils.isEmpty(lineBuilder) &&
- !StringBuilderUtils.equals(lineBuilder, LOCALHOST)) {
- while (StringBuilderUtils.contains(lineBuilder, SPACE)) {
- int space = lineBuilder.indexOf(SPACE);
- StringBuilder partial = StringBuilderUtils.substring(lineBuilder, 0, space);
- StringBuilderUtils.trim(partial);
-
- String partialLine = partial.toString();
- mBlockedDomainsList.add(partialLine);
- StringBuilderUtils.replace(lineBuilder, partialLine, EMPTY);
- StringBuilderUtils.trim(lineBuilder);
- }
- if (lineBuilder.length() > 0) {
- mBlockedDomainsList.add(lineBuilder.toString());
- }
- }
- }
+ parseString(lineBuilder, domains);
lineBuilder.setLength(0);
}
+
+ mBlockedDomainsList.addAll(domains);
Log.d(TAG, "Loaded ad list in: " + (System.currentTimeMillis() - time) + " ms");
} catch (IOException e) {
Log.wtf(TAG, "Reading blocked domains list from file '"
@@ -179,4 +157,41 @@ public void onSubscribe(@NonNull CompletableSubscriber subscriber) {
});
}
+ private static void parseString(@NonNull StringBuilder lineBuilder, @NonNull List parsedList) {
+ if (!StringBuilderUtils.isEmpty(lineBuilder) &&
+ !StringBuilderUtils.startsWith(lineBuilder, COMMENT)) {
+ StringBuilderUtils.replace(lineBuilder, LOCAL_IP_V4, EMPTY);
+ StringBuilderUtils.replace(lineBuilder, LOCAL_IP_V4_ALT, EMPTY);
+ StringBuilderUtils.replace(lineBuilder, LOCAL_IP_V6, EMPTY);
+ StringBuilderUtils.replace(lineBuilder, TAB, EMPTY);
+
+ int comment = lineBuilder.indexOf(COMMENT);
+ if (comment >= 0) {
+ lineBuilder.replace(comment, lineBuilder.length(), EMPTY);
+ }
+
+ StringBuilderUtils.trim(lineBuilder);
+
+ if (!StringBuilderUtils.isEmpty(lineBuilder) &&
+ !StringBuilderUtils.equals(lineBuilder, LOCALHOST)) {
+ while (StringBuilderUtils.contains(lineBuilder, SPACE)) {
+ int space = lineBuilder.indexOf(SPACE);
+ StringBuilder partial = StringBuilderUtils.substring(lineBuilder, 0, space);
+ StringBuilderUtils.trim(partial);
+
+ String partialLine = partial.toString();
+
+ // Add string to list
+ parsedList.add(partialLine);
+ StringBuilderUtils.replace(lineBuilder, partialLine, EMPTY);
+ StringBuilderUtils.trim(lineBuilder);
+ }
+ if (lineBuilder.length() > 0) {
+ // Add string to list.
+ parsedList.add(lineBuilder.toString());
+ }
+ }
+ }
+ }
+
}
diff --git a/app/src/main/java/acr/browser/lightning/browser/BrowserPresenter.java b/app/src/main/java/acr/browser/lightning/browser/BrowserPresenter.java
index 5ccfa72d2..a92b6a47f 100644
--- a/app/src/main/java/acr/browser/lightning/browser/BrowserPresenter.java
+++ b/app/src/main/java/acr/browser/lightning/browser/BrowserPresenter.java
@@ -1,11 +1,13 @@
package acr.browser.lightning.browser;
import android.app.Activity;
+import android.app.Application;
import android.content.DialogInterface;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
+import android.webkit.URLUtil;
import com.anthonycr.bonsai.CompletableOnSubscribe;
import com.anthonycr.bonsai.Schedulers;
@@ -14,9 +16,10 @@
import acr.browser.lightning.BuildConfig;
import acr.browser.lightning.R;
-import acr.browser.lightning.activity.TabsManager;
-import acr.browser.lightning.app.BrowserApp;
+import acr.browser.lightning.BrowserApp;
+import acr.browser.lightning.constant.BookmarkPage;
import acr.browser.lightning.constant.Constants;
+import acr.browser.lightning.constant.StartPage;
import acr.browser.lightning.controller.UIController;
import acr.browser.lightning.preference.PreferenceManager;
@@ -33,6 +36,7 @@ public class BrowserPresenter {
private static final String TAG = "BrowserPresenter";
@NonNull private final TabsManager mTabsModel;
+ @Inject Application mApplication;
@Inject PreferenceManager mPreferences;
@NonNull private final BrowserView mView;
@@ -116,7 +120,7 @@ private void onTabChanged(@Nullable LightningView newTab) {
mView.updateProgress(newTab.getProgress());
mView.setBackButtonEnabled(newTab.canGoBack());
mView.setForwardButtonEnabled(newTab.canGoForward());
- mView.updateUrl(newTab.getUrl(), true);
+ mView.updateUrl(newTab.getUrl(), false);
mView.setTabView(newTab.getWebView());
int index = mTabsModel.indexOfTab(newTab);
if (index >= 0) {
@@ -143,6 +147,19 @@ public void closeAllOtherTabs() {
}
+ @NonNull
+ private String mapHomepageToCurrentUrl() {
+ String homepage = mPreferences.getHomepage();
+ switch (homepage) {
+ case Constants.SCHEME_HOMEPAGE:
+ return Constants.FILE + StartPage.getStartPageFile(mApplication);
+ case Constants.SCHEME_BOOKMARKS:
+ return Constants.FILE + BookmarkPage.getBookmarkPage(mApplication, null);
+ default:
+ return homepage;
+ }
+ }
+
/**
* Deletes the tab at the specified position.
*
@@ -165,8 +182,8 @@ public void deleteTab(int position) {
boolean shouldClose = mShouldClose && isShown && tabToDelete.isNewTab();
final LightningView currentTab = mTabsModel.getCurrentTab();
if (mTabsModel.size() == 1 && currentTab != null &&
- (UrlUtils.isStartPageUrl(currentTab.getUrl()) ||
- currentTab.getUrl().equals(mPreferences.getHomepage()))) {
+ URLUtil.isFileUrl(currentTab.getUrl()) &&
+ currentTab.getUrl().equals(mapHomepageToCurrentUrl())) {
mView.closeActivity();
return;
} else {
@@ -232,7 +249,7 @@ public void run() {
tab.loadUrl(url);
}
} else if (url != null) {
- if (url.startsWith(Constants.FILE)) {
+ if (URLUtil.isFileUrl(url)) {
mView.showBlockedLocalFileDialog(new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
diff --git a/app/src/main/java/acr/browser/lightning/browser/BrowserView.java b/app/src/main/java/acr/browser/lightning/browser/BrowserView.java
index b701bbb9e..e301a0c84 100644
--- a/app/src/main/java/acr/browser/lightning/browser/BrowserView.java
+++ b/app/src/main/java/acr/browser/lightning/browser/BrowserView.java
@@ -2,6 +2,7 @@
import android.content.DialogInterface;
import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.view.View;
@@ -11,7 +12,7 @@ public interface BrowserView {
void removeTabView();
- void updateUrl(String url, boolean shortUrl);
+ void updateUrl(@Nullable String url, boolean isLoading);
void updateProgress(int progress);
@@ -21,7 +22,7 @@ public interface BrowserView {
void closeActivity();
- void showBlockedLocalFileDialog(DialogInterface.OnClickListener listener);
+ void showBlockedLocalFileDialog(@NonNull DialogInterface.OnClickListener listener);
void showSnackbar(@StringRes int resource);
diff --git a/app/src/main/java/acr/browser/lightning/browser/SearchBoxModel.java b/app/src/main/java/acr/browser/lightning/browser/SearchBoxModel.java
new file mode 100644
index 000000000..4e3e07339
--- /dev/null
+++ b/app/src/main/java/acr/browser/lightning/browser/SearchBoxModel.java
@@ -0,0 +1,71 @@
+package acr.browser.lightning.browser;
+
+import android.app.Application;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.text.TextUtils;
+
+import javax.inject.Inject;
+
+import acr.browser.lightning.R;
+import acr.browser.lightning.BrowserApp;
+import acr.browser.lightning.preference.PreferenceManager;
+import acr.browser.lightning.utils.UrlUtils;
+import acr.browser.lightning.utils.Utils;
+
+/**
+ * A UI model for the search box.
+ */
+public class SearchBoxModel {
+
+ @Inject PreferenceManager mPreferences;
+ @Inject Application mApplication;
+
+ @NonNull private final String mUntitledTitle;
+
+ @Inject
+ public SearchBoxModel() {
+ BrowserApp.getAppComponent().inject(this);
+ mUntitledTitle = mApplication.getString(R.string.untitled);
+ }
+
+ /**
+ * Returns the contents of the search box based on a variety of factors.
+ *
+ * - The user's preference to show either the URL, domain, or page title
+ * - Whether or not the current page is loading
+ * - Whether or not the current page is a Lightning generated page.
+ *
+ * This method uses the URL, title, and loading information to determine what
+ * should be displayed by the search box.
+ *
+ * @param url the URL of the current page.
+ * @param title the title of the current page, if known.
+ * @param isLoading whether the page is currently loading or not.
+ * @return the string that should be displayed by the search box.
+ */
+ @NonNull
+ public String getDisplayContent(@NonNull String url, @Nullable String title, boolean isLoading) {
+ if (UrlUtils.isSpecialUrl(url)) {
+ return "";
+ } else if (isLoading) {
+ return url;
+ } else {
+ switch (mPreferences.getUrlBoxContentChoice()) {
+ default:
+ case 0: // Default, show only the domain
+ String domain = Utils.getDomainName(url);
+ return domain != null ? domain : url;
+ case 1: // URL, show the entire URL
+ return url;
+ case 2: // Title, show the page's title
+ if (!TextUtils.isEmpty(title)) {
+ return title;
+ } else {
+ return mUntitledTitle;
+ }
+ }
+ }
+ }
+
+}
diff --git a/app/src/main/java/acr/browser/lightning/activity/TabsManager.java b/app/src/main/java/acr/browser/lightning/browser/TabsManager.java
similarity index 96%
rename from app/src/main/java/acr/browser/lightning/activity/TabsManager.java
rename to app/src/main/java/acr/browser/lightning/browser/TabsManager.java
index 11ce58cc8..a7098a479 100644
--- a/app/src/main/java/acr/browser/lightning/activity/TabsManager.java
+++ b/app/src/main/java/acr/browser/lightning/browser/TabsManager.java
@@ -1,4 +1,4 @@
-package acr.browser.lightning.activity;
+package acr.browser.lightning.browser;
import android.app.Activity;
import android.app.Application;
@@ -12,6 +12,7 @@
import android.support.v7.app.AlertDialog;
import android.text.TextUtils;
import android.util.Log;
+import android.webkit.URLUtil;
import android.webkit.WebView;
import com.anthonycr.bonsai.Completable;
@@ -30,9 +31,8 @@
import javax.inject.Inject;
import acr.browser.lightning.R;
-import acr.browser.lightning.app.BrowserApp;
+import acr.browser.lightning.BrowserApp;
import acr.browser.lightning.constant.BookmarkPage;
-import acr.browser.lightning.constant.Constants;
import acr.browser.lightning.constant.DownloadsPage;
import acr.browser.lightning.constant.HistoryPage;
import acr.browser.lightning.constant.StartPage;
@@ -174,15 +174,15 @@ public void onItem(@Nullable String item) {
});
} else if (UrlUtils.isDownloadsUrl(url)) {
new DownloadsPage().getDownloadsPage()
- .subscribeOn(Schedulers.io())
- .observeOn(Schedulers.main())
- .subscribe(new SingleOnSubscribe() {
- @Override
- public void onItem(@Nullable String item) {
- Preconditions.checkNonNull(item);
- tab.loadUrl(item);
- }
- });
+ .subscribeOn(Schedulers.io())
+ .observeOn(Schedulers.main())
+ .subscribe(new SingleOnSubscribe() {
+ @Override
+ public void onItem(@Nullable String item) {
+ Preconditions.checkNonNull(item);
+ tab.loadUrl(item);
+ }
+ });
} else if (UrlUtils.isStartPageUrl(url)) {
new StartPage().getHomepage()
.subscribeOn(Schedulers.io())
@@ -214,7 +214,7 @@ public void onItem(@Nullable String item) {
@Override
public void onComplete() {
if (url != null) {
- if (url.startsWith(Constants.FILE)) {
+ if (URLUtil.isFileUrl(url)) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
Dialog dialog = builder.setCancelable(true)
.setTitle(R.string.title_warning)
diff --git a/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java b/app/src/main/java/acr/browser/lightning/browser/activity/BrowserActivity.java
similarity index 93%
rename from app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java
rename to app/src/main/java/acr/browser/lightning/browser/activity/BrowserActivity.java
index 56edc7202..81b7a1f33 100644
--- a/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java
+++ b/app/src/main/java/acr/browser/lightning/browser/activity/BrowserActivity.java
@@ -2,7 +2,7 @@
* Copyright 2015 Anthony Restaino
*/
-package acr.browser.lightning.activity;
+package acr.browser.lightning.browser.activity;
import android.app.Activity;
import android.app.Dialog;
@@ -90,12 +90,15 @@
import javax.inject.Inject;
import acr.browser.lightning.R;
-import acr.browser.lightning.app.BrowserApp;
+import acr.browser.lightning.reading.activity.ReadingActivity;
import acr.browser.lightning.browser.BookmarksView;
import acr.browser.lightning.browser.BrowserPresenter;
import acr.browser.lightning.browser.BrowserView;
+import acr.browser.lightning.IncognitoActivity;
+import acr.browser.lightning.browser.SearchBoxModel;
+import acr.browser.lightning.browser.TabsManager;
import acr.browser.lightning.browser.TabsView;
-import acr.browser.lightning.constant.BookmarkPage;
+import acr.browser.lightning.BrowserApp;
import acr.browser.lightning.constant.Constants;
import acr.browser.lightning.constant.DownloadsPage;
import acr.browser.lightning.constant.HistoryPage;
@@ -105,11 +108,14 @@
import acr.browser.lightning.database.history.HistoryModel;
import acr.browser.lightning.dialog.BrowserDialog;
import acr.browser.lightning.dialog.LightningDialogBuilder;
-import acr.browser.lightning.fragment.BookmarksFragment;
-import acr.browser.lightning.fragment.TabsFragment;
+import acr.browser.lightning.browser.fragment.BookmarksFragment;
+import acr.browser.lightning.browser.fragment.TabsFragment;
import acr.browser.lightning.interpolator.BezierDecelerateInterpolator;
import acr.browser.lightning.receiver.NetworkReceiver;
+import acr.browser.lightning.search.SearchEngineProvider;
import acr.browser.lightning.search.SuggestionsAdapter;
+import acr.browser.lightning.search.engine.BaseSearchEngine;
+import acr.browser.lightning.settings.activity.SettingsActivity;
import acr.browser.lightning.utils.DrawableUtils;
import acr.browser.lightning.utils.IntentUtils;
import acr.browser.lightning.utils.Preconditions;
@@ -185,8 +191,14 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
// The singleton BookmarkManager
@Inject BookmarkModel mBookmarkManager;
+ @Inject HistoryModel mHistoryModel;
+
@Inject LightningDialogBuilder mBookmarksDialogBuilder;
+ @Inject SearchBoxModel mSearchBoxModel;
+
+ @Inject SearchEngineProvider mSearchEngineProvider;
+
private TabsManager mTabsManager;
// Image
@@ -216,7 +228,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
public abstract void updateHistory(@Nullable final String title, @NonNull final String url);
@NonNull
- abstract Completable updateCookiePreference();
+ protected abstract Completable updateCookiePreference();
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -327,8 +339,8 @@ public void onDrawerStateChanged(int newState) {
lp.height = LayoutParams.MATCH_PARENT;
customView.setLayoutParams(lp);
- mArrowImage = (ImageView) customView.findViewById(R.id.arrow);
- FrameLayout arrowButton = (FrameLayout) customView.findViewById(R.id.arrow_button);
+ mArrowImage = customView.findViewById(R.id.arrow);
+ FrameLayout arrowButton = customView.findViewById(R.id.arrow_button);
if (mShowTabsInDrawer) {
if (mArrowImage.getWidth() <= 0) {
mArrowImage.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
@@ -366,7 +378,7 @@ public void run() {
arrowButton.setOnClickListener(this);
// create the search EditText in the ToolBar
- mSearch = (SearchView) customView.findViewById(R.id.search);
+ mSearch = customView.findViewById(R.id.search);
mSearchBackground = customView.findViewById(R.id.search_container);
// initialize search background color
@@ -443,11 +455,11 @@ private int getTabsFragmentViewId() {
* @return true if the panic trigger sent
* the intent, false otherwise.
*/
- static boolean isPanicTrigger(@Nullable Intent intent) {
+ protected static boolean isPanicTrigger(@Nullable Intent intent) {
return intent != null && INTENT_PANIC_TRIGGER.equals(intent.getAction());
}
- void panicClean() {
+ protected void panicClean() {
Log.d(TAG, "Closing browser");
mTabsManager.newTab(this, "", false);
mTabsManager.switchToTab(0);
@@ -508,7 +520,7 @@ public void onFocusChange(final View v, final boolean hasFocus) {
final LightningView currentView = mTabsManager.getCurrentTab();
if (!hasFocus && currentView != null) {
setIsLoading(currentView.getProgress() < 100);
- updateUrl(currentView.getUrl(), true);
+ updateUrl(currentView.getUrl(), false);
} else if (hasFocus && currentView != null) {
// Hack to make sure the text gets selected
@@ -652,45 +664,8 @@ private void initializePreferences() {
setFullscreen(mPreferences.getHideStatusBarEnabled(), false);
- switch (mPreferences.getSearchChoice()) {
- case 0:
- mSearchText = mPreferences.getSearchUrl();
- if (!mSearchText.startsWith(Constants.HTTP)
- && !mSearchText.startsWith(Constants.HTTPS)) {
- mSearchText = Constants.GOOGLE_SEARCH;
- }
- break;
- case 1:
- mSearchText = Constants.GOOGLE_SEARCH;
- break;
- case 2:
- mSearchText = Constants.ASK_SEARCH;
- break;
- case 3:
- mSearchText = Constants.BING_SEARCH;
- break;
- case 4:
- mSearchText = Constants.YAHOO_SEARCH;
- break;
- case 5:
- mSearchText = Constants.STARTPAGE_SEARCH;
- break;
- case 6:
- mSearchText = Constants.STARTPAGE_MOBILE_SEARCH;
- break;
- case 7:
- mSearchText = Constants.DUCK_SEARCH;
- break;
- case 8:
- mSearchText = Constants.DUCK_LITE_SEARCH;
- break;
- case 9:
- mSearchText = Constants.BAIDU_SEARCH;
- break;
- case 10:
- mSearchText = Constants.YANDEX_SEARCH;
- break;
- }
+ BaseSearchEngine currentSearchEngine = mSearchEngineProvider.getCurrentSearchEngine();
+ mSearchText = currentSearchEngine.getQueryUrl();
updateCookiePreference().subscribeOn(Schedulers.worker()).subscribe();
mProxyUtils.updateProxySettings(this);
@@ -749,52 +724,70 @@ public boolean onKeyUp(int keyCode, @NonNull KeyEvent event) {
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// Keyboard shortcuts
- if (event.isCtrlPressed() && event.getAction() == KeyEvent.ACTION_DOWN) {
- switch (event.getKeyCode()) {
- case KeyEvent.KEYCODE_T:
- // Open new tab
- newTab(null, true);
- return true;
- case KeyEvent.KEYCODE_W:
- // Close current tab
- mPresenter.deleteTab(mTabsManager.indexOfCurrentTab());
- return true;
- case KeyEvent.KEYCODE_Q:
- // Close browser
- closeBrowser();
- return true;
- case KeyEvent.KEYCODE_R:
- // Refresh current tab
- LightningView currentTab = mTabsManager.getCurrentTab();
- if (currentTab != null) {
- currentTab.reload();
- }
- return true;
- case KeyEvent.KEYCODE_TAB:
- int nextIndex = 0;
- if (event.isShiftPressed()) {
- // Go back one tab
- if (mTabsManager.indexOfCurrentTab() > 0) {
- nextIndex = mTabsManager.indexOfCurrentTab() - 1;
- } else {
- nextIndex = mTabsManager.last();
+ if (event.getAction() == KeyEvent.ACTION_DOWN) {
+ if (event.isCtrlPressed()) {
+ switch (event.getKeyCode()) {
+ case KeyEvent.KEYCODE_F:
+ // Search in page
+ findInPage();
+ return true;
+ case KeyEvent.KEYCODE_T:
+ // Open new tab
+ newTab(null, true);
+ return true;
+ case KeyEvent.KEYCODE_W:
+ // Close current tab
+ mPresenter.deleteTab(mTabsManager.indexOfCurrentTab());
+ return true;
+ case KeyEvent.KEYCODE_Q:
+ // Close browser
+ closeBrowser();
+ return true;
+ case KeyEvent.KEYCODE_R:
+ // Refresh current tab
+ LightningView currentTab = mTabsManager.getCurrentTab();
+ if (currentTab != null) {
+ currentTab.reload();
}
- } else {
- // Go forward one tab
- if (mTabsManager.indexOfCurrentTab() < mTabsManager.last()) {
- nextIndex = mTabsManager.indexOfCurrentTab() + 1;
+ return true;
+ case KeyEvent.KEYCODE_TAB:
+ int nextIndex;
+ if (event.isShiftPressed()) {
+ // Go back one tab
+ if (mTabsManager.indexOfCurrentTab() > 0) {
+ nextIndex = mTabsManager.indexOfCurrentTab() - 1;
+ } else {
+ nextIndex = mTabsManager.last();
+ }
} else {
- nextIndex = 0;
+ // Go forward one tab
+ if (mTabsManager.indexOfCurrentTab() < mTabsManager.last()) {
+ nextIndex = mTabsManager.indexOfCurrentTab() + 1;
+ } else {
+ nextIndex = 0;
+ }
}
+ mPresenter.tabChanged(nextIndex);
+ return true;
+ }
+ } else if (event.getKeyCode() == KeyEvent.KEYCODE_SEARCH) {
+ // Highlight search field
+ mSearch.requestFocus();
+ mSearch.selectAll();
+ return true;
+ } else if (event.isAltPressed()) {
+ // Alt + tab number
+ if (KeyEvent.KEYCODE_0 <= event.getKeyCode() && event.getKeyCode() <= KeyEvent.KEYCODE_9) {
+ int nextIndex;
+ if (event.getKeyCode() > mTabsManager.last() + KeyEvent.KEYCODE_1 || event.getKeyCode() == KeyEvent.KEYCODE_0) {
+ nextIndex = mTabsManager.last();
+ } else {
+ nextIndex = event.getKeyCode() - KeyEvent.KEYCODE_1;
}
mPresenter.tabChanged(nextIndex);
return true;
+ }
}
- } else if (event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_SEARCH) {
- // Highlight search field
- mSearch.requestFocus();
- mSearch.selectAll();
- return true;
}
return super.dispatchKeyEvent(event);
}
@@ -1111,7 +1104,7 @@ public void run() {
}
@Override
- public void showBlockedLocalFileDialog(DialogInterface.OnClickListener listener) {
+ public void showBlockedLocalFileDialog(@NonNull DialogInterface.OnClickListener listener) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
Dialog dialog = builder.setCancelable(true)
.setTitle(R.string.title_warning)
@@ -1219,7 +1212,7 @@ private static void removeViewFromParent(@Nullable View view) {
}
}
- void handleNewIntent(Intent intent) {
+ protected void handleNewIntent(Intent intent) {
mPresenter.onNewIntent(intent);
}
@@ -1243,14 +1236,14 @@ private synchronized boolean newTab(String url, boolean show) {
return mPresenter.newTab(url, show);
}
- void performExitCleanUp() {
+ protected void performExitCleanUp() {
final LightningView currentTab = mTabsManager.getCurrentTab();
if (mPreferences.getClearCacheExit() && currentTab != null && !isIncognito()) {
WebUtils.clearCache(currentTab.getWebView());
Log.d(TAG, "Cache Cleared");
}
if (mPreferences.getClearHistoryExitEnabled() && !isIncognito()) {
- WebUtils.clearHistory(this);
+ WebUtils.clearHistory(this, mHistoryModel);
Log.d(TAG, "History Cleared");
}
if (mPreferences.getClearCookiesExitEnabled() && !isIncognito()) {
@@ -1369,7 +1362,7 @@ protected void onPause() {
}
}
- void saveOpenTabs() {
+ protected void saveOpenTabs() {
if (mPreferences.getRestoreLostTabsEnabled()) {
mTabsManager.saveState();
}
@@ -1533,36 +1526,16 @@ public int getUiColor() {
}
@Override
- public void updateUrl(@Nullable String url, boolean shortUrl) {
+ public void updateUrl(@Nullable String url, boolean isLoading) {
if (url == null || mSearch == null || mSearch.hasFocus()) {
return;
}
final LightningView currentTab = mTabsManager.getCurrentTab();
mBookmarksView.handleUpdatedUrl(url);
- if (shortUrl && !UrlUtils.isSpecialUrl(url)) {
- switch (mPreferences.getUrlBoxContentChoice()) {
- case 0: // Default, show only the domain
- url = url.replaceFirst(Constants.HTTP, "");
- url = Utils.getDomainName(url);
- mSearch.setText(url);
- break;
- case 1: // URL, show the entire URL
- mSearch.setText(url);
- break;
- case 2: // Title, show the page's title
- if (currentTab != null && !currentTab.getTitle().isEmpty()) {
- mSearch.setText(currentTab.getTitle());
- } else {
- mSearch.setText(mUntitledTitle);
- }
- break;
- }
- } else {
- if (UrlUtils.isSpecialUrl(url)) {
- url = "";
- }
- mSearch.setText(url);
- }
+
+ String currentTitle = currentTab != null ? currentTab.getTitle() : null;
+
+ mSearch.setText(mSearchBoxModel.getDisplayContent(url, currentTitle, isLoading));
}
@Override
@@ -1579,12 +1552,12 @@ public void updateProgress(int n) {
mProgressBar.setProgress(n);
}
- void addItemToHistory(@Nullable final String title, @NonNull final String url) {
+ protected void addItemToHistory(@Nullable final String title, @NonNull final String url) {
if (UrlUtils.isSpecialUrl(url)) {
return;
}
- HistoryModel.visitHistoryItem(url, title)
+ mHistoryModel.visitHistoryItem(url, title)
.subscribeOn(Schedulers.io())
.subscribe(new CompletableOnSubscribe() {
@Override
@@ -1696,7 +1669,7 @@ private void openBookmarks() {
* @param runnable an optional runnable to run after
* the drawers are closed.
*/
- void closeDrawers(@Nullable final Runnable runnable) {
+ protected final void closeDrawers(@Nullable final Runnable runnable) {
if (!mDrawerLayout.isDrawerOpen(mDrawerLeft) && !mDrawerLayout.isDrawerOpen(mDrawerRight)) {
if (runnable != null) {
runnable.run();
@@ -2176,8 +2149,7 @@ protected void applyTransformation(float interpolatedTime, Transformation t) {
@Override
public void handleBookmarksChange() {
final LightningView currentTab = mTabsManager.getCurrentTab();
- if (currentTab != null && currentTab.getUrl().startsWith(Constants.FILE)
- && currentTab.getUrl().endsWith(BookmarkPage.FILENAME)) {
+ if (currentTab != null && UrlUtils.isBookmarkUrl(currentTab.getUrl())) {
currentTab.loadBookmarkpage();
}
if (currentTab != null) {
@@ -2188,8 +2160,7 @@ public void handleBookmarksChange() {
@Override
public void handleDownloadDeleted() {
final LightningView currentTab = mTabsManager.getCurrentTab();
- if (currentTab != null && currentTab.getUrl().startsWith(Constants.FILE)
- && currentTab.getUrl().endsWith(DownloadsPage.FILENAME)) {
+ if (currentTab != null && UrlUtils.isDownloadsUrl(currentTab.getUrl())) {
currentTab.loadDownloadspage();
}
if (currentTab != null) {
diff --git a/app/src/main/java/acr/browser/lightning/activity/ThemableBrowserActivity.java b/app/src/main/java/acr/browser/lightning/browser/activity/ThemableBrowserActivity.java
similarity index 93%
rename from app/src/main/java/acr/browser/lightning/activity/ThemableBrowserActivity.java
rename to app/src/main/java/acr/browser/lightning/browser/activity/ThemableBrowserActivity.java
index 3a29986da..00848828c 100644
--- a/app/src/main/java/acr/browser/lightning/activity/ThemableBrowserActivity.java
+++ b/app/src/main/java/acr/browser/lightning/browser/activity/ThemableBrowserActivity.java
@@ -1,4 +1,4 @@
-package acr.browser.lightning.activity;
+package acr.browser.lightning.browser.activity;
import android.content.Intent;
import android.content.res.Configuration;
@@ -10,13 +10,14 @@
import javax.inject.Inject;
import acr.browser.lightning.R;
-import acr.browser.lightning.app.BrowserApp;
+import acr.browser.lightning.BrowserApp;
import acr.browser.lightning.preference.PreferenceManager;
import acr.browser.lightning.utils.ThemeUtils;
public abstract class ThemableBrowserActivity extends AppCompatActivity {
- @Inject PreferenceManager mPreferences;
+ // TODO: 6/26/17 get rid fo protected reference
+ @Inject protected PreferenceManager mPreferences;
private int mTheme;
private boolean mShowTabsInDrawer;
diff --git a/app/src/main/java/acr/browser/lightning/activity/BookmarkUiModel.java b/app/src/main/java/acr/browser/lightning/browser/bookmark/BookmarkUiModel.java
similarity index 95%
rename from app/src/main/java/acr/browser/lightning/activity/BookmarkUiModel.java
rename to app/src/main/java/acr/browser/lightning/browser/bookmark/BookmarkUiModel.java
index 457a98417..0d42c0bb2 100644
--- a/app/src/main/java/acr/browser/lightning/activity/BookmarkUiModel.java
+++ b/app/src/main/java/acr/browser/lightning/browser/bookmark/BookmarkUiModel.java
@@ -1,4 +1,4 @@
-package acr.browser.lightning.activity;
+package acr.browser.lightning.browser.bookmark;
import android.support.annotation.Nullable;
diff --git a/app/src/main/java/acr/browser/lightning/fragment/BookmarksFragment.java b/app/src/main/java/acr/browser/lightning/browser/fragment/BookmarksFragment.java
similarity index 97%
rename from app/src/main/java/acr/browser/lightning/fragment/BookmarksFragment.java
rename to app/src/main/java/acr/browser/lightning/browser/fragment/BookmarksFragment.java
index 62776b26b..ebe0c3491 100644
--- a/app/src/main/java/acr/browser/lightning/fragment/BookmarksFragment.java
+++ b/app/src/main/java/acr/browser/lightning/browser/fragment/BookmarksFragment.java
@@ -1,4 +1,4 @@
-package acr.browser.lightning.fragment;
+package acr.browser.lightning.browser.fragment;
import android.app.Activity;
import android.content.Context;
@@ -34,11 +34,11 @@
import javax.inject.Inject;
import acr.browser.lightning.R;
-import acr.browser.lightning.activity.BookmarkUiModel;
-import acr.browser.lightning.activity.ReadingActivity;
-import acr.browser.lightning.activity.TabsManager;
+import acr.browser.lightning.browser.bookmark.BookmarkUiModel;
+import acr.browser.lightning.reading.activity.ReadingActivity;
+import acr.browser.lightning.browser.TabsManager;
import acr.browser.lightning.animation.AnimationUtils;
-import acr.browser.lightning.app.BrowserApp;
+import acr.browser.lightning.BrowserApp;
import acr.browser.lightning.browser.BookmarksView;
import acr.browser.lightning.constant.Constants;
import acr.browser.lightning.controller.UIController;
@@ -320,10 +320,10 @@ private void setBookmarkDataSet(@NonNull List items, boolean animat
}
private void setupNavigationButton(@NonNull View view, @IdRes int buttonId, @IdRes int imageId) {
- FrameLayout frameButton = (FrameLayout) view.findViewById(buttonId);
+ FrameLayout frameButton = view.findViewById(buttonId);
frameButton.setOnClickListener(this);
frameButton.setOnLongClickListener(this);
- ImageView buttonImage = (ImageView) view.findViewById(imageId);
+ ImageView buttonImage = view.findViewById(imageId);
buttonImage.setColorFilter(mIconColor, PorterDuff.Mode.SRC_IN);
}
@@ -537,8 +537,8 @@ public void onBindViewHolder(final BookmarkViewHolder holder, int position) {
Subscription oldSubscription = mFaviconFetchSubscriptions.get(url);
SubscriptionUtils.safeUnsubscribe(oldSubscription);
- final Subscription faviconSubscription = mFaviconModel.faviconForUrl(url, mWebpageBitmap, true)
- .subscribeOn(Schedulers.worker())
+ final Subscription faviconSubscription = mFaviconModel.faviconForUrl(url, web.getTitle())
+ .subscribeOn(Schedulers.io())
.observeOn(Schedulers.main())
.subscribe(new SingleOnSubscribe() {
@Override
diff --git a/app/src/main/java/acr/browser/lightning/fragment/TabsFragment.java b/app/src/main/java/acr/browser/lightning/browser/fragment/TabsFragment.java
similarity index 95%
rename from app/src/main/java/acr/browser/lightning/fragment/TabsFragment.java
rename to app/src/main/java/acr/browser/lightning/browser/fragment/TabsFragment.java
index 62642cfe2..beed6ca72 100644
--- a/app/src/main/java/acr/browser/lightning/fragment/TabsFragment.java
+++ b/app/src/main/java/acr/browser/lightning/browser/fragment/TabsFragment.java
@@ -1,4 +1,4 @@
-package acr.browser.lightning.fragment;
+package acr.browser.lightning.browser.fragment;
import android.app.Activity;
import android.content.Context;
@@ -34,12 +34,12 @@
import javax.inject.Inject;
import acr.browser.lightning.R;
-import acr.browser.lightning.activity.TabsManager;
-import acr.browser.lightning.app.BrowserApp;
+import acr.browser.lightning.browser.TabsManager;
+import acr.browser.lightning.BrowserApp;
import acr.browser.lightning.browser.TabsView;
import acr.browser.lightning.controller.UIController;
-import acr.browser.lightning.fragment.anim.HorizontalItemAnimator;
-import acr.browser.lightning.fragment.anim.VerticalItemAnimator;
+import acr.browser.lightning.browser.fragment.anim.HorizontalItemAnimator;
+import acr.browser.lightning.browser.fragment.anim.VerticalItemAnimator;
import acr.browser.lightning.preference.PreferenceManager;
import acr.browser.lightning.utils.DrawableUtils;
import acr.browser.lightning.utils.ThemeUtils;
@@ -130,7 +130,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
} else {
view = inflater.inflate(R.layout.tab_strip, container, false);
layoutManager = new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false);
- ImageView newTab = (ImageView) view.findViewById(R.id.new_tab_button);
+ ImageView newTab = view.findViewById(R.id.new_tab_button);
newTab.setColorFilter(ThemeUtils.getIconDarkThemeColor(getActivity()));
newTab.setOnClickListener(new View.OnClickListener() {
@Override
@@ -183,7 +183,7 @@ private TabsManager getTabsManager() {
private void setupFrameLayoutButton(@NonNull final View root, @IdRes final int buttonId,
@IdRes final int imageId) {
final View frameButton = root.findViewById(buttonId);
- final ImageView buttonImage = (ImageView) root.findViewById(imageId);
+ final ImageView buttonImage = root.findViewById(imageId);
frameButton.setOnClickListener(this);
frameButton.setOnLongClickListener(this);
buttonImage.setColorFilter(mIconColor, PorterDuff.Mode.SRC_IN);
@@ -399,11 +399,11 @@ public class LightningViewHolder extends RecyclerView.ViewHolder implements View
public LightningViewHolder(@NonNull View view) {
super(view);
- txtTitle = (TextView) view.findViewById(R.id.textTab);
- favicon = (ImageView) view.findViewById(R.id.faviconTab);
- exit = (ImageView) view.findViewById(R.id.deleteButton);
- layout = (LinearLayout) view.findViewById(R.id.tab_item_background);
- exitButton = (FrameLayout) view.findViewById(R.id.deleteAction);
+ txtTitle = view.findViewById(R.id.textTab);
+ favicon = view.findViewById(R.id.faviconTab);
+ exit = view.findViewById(R.id.deleteButton);
+ layout = view.findViewById(R.id.tab_item_background);
+ exitButton = view.findViewById(R.id.deleteAction);
exit.setColorFilter(mIconColor, PorterDuff.Mode.SRC_IN);
exitButton.setOnClickListener(this);
diff --git a/app/src/main/java/acr/browser/lightning/fragment/anim/HorizontalItemAnimator.java b/app/src/main/java/acr/browser/lightning/browser/fragment/anim/HorizontalItemAnimator.java
similarity index 99%
rename from app/src/main/java/acr/browser/lightning/fragment/anim/HorizontalItemAnimator.java
rename to app/src/main/java/acr/browser/lightning/browser/fragment/anim/HorizontalItemAnimator.java
index 732cf9652..dce288676 100644
--- a/app/src/main/java/acr/browser/lightning/fragment/anim/HorizontalItemAnimator.java
+++ b/app/src/main/java/acr/browser/lightning/browser/fragment/anim/HorizontalItemAnimator.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package acr.browser.lightning.fragment.anim;
+package acr.browser.lightning.browser.fragment.anim;
import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
diff --git a/app/src/main/java/acr/browser/lightning/fragment/anim/VerticalItemAnimator.java b/app/src/main/java/acr/browser/lightning/browser/fragment/anim/VerticalItemAnimator.java
similarity index 99%
rename from app/src/main/java/acr/browser/lightning/fragment/anim/VerticalItemAnimator.java
rename to app/src/main/java/acr/browser/lightning/browser/fragment/anim/VerticalItemAnimator.java
index 4a2f5eedb..ea18b3382 100644
--- a/app/src/main/java/acr/browser/lightning/fragment/anim/VerticalItemAnimator.java
+++ b/app/src/main/java/acr/browser/lightning/browser/fragment/anim/VerticalItemAnimator.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package acr.browser.lightning.fragment.anim;
+package acr.browser.lightning.browser.fragment.anim;
import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
diff --git a/app/src/main/java/acr/browser/lightning/constant/BookmarkPage.java b/app/src/main/java/acr/browser/lightning/constant/BookmarkPage.java
index e4179329f..0f1707fab 100644
--- a/app/src/main/java/acr/browser/lightning/constant/BookmarkPage.java
+++ b/app/src/main/java/acr/browser/lightning/constant/BookmarkPage.java
@@ -6,8 +6,10 @@
import android.app.Activity;
import android.app.Application;
import android.graphics.Bitmap;
+import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
+import android.text.TextUtils;
import com.anthonycr.bonsai.Single;
import com.anthonycr.bonsai.SingleAction;
@@ -24,9 +26,11 @@
import javax.inject.Inject;
import acr.browser.lightning.R;
-import acr.browser.lightning.app.BrowserApp;
+import acr.browser.lightning.BrowserApp;
import acr.browser.lightning.database.HistoryItem;
import acr.browser.lightning.database.bookmark.BookmarkModel;
+import acr.browser.lightning.favicon.FaviconModel;
+import acr.browser.lightning.favicon.FaviconUtils;
import acr.browser.lightning.utils.Preconditions;
import acr.browser.lightning.utils.ThemeUtils;
import acr.browser.lightning.utils.Utils;
@@ -74,12 +78,27 @@ public final class BookmarkPage {
private static final String END = "