diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index c5f23956..52dd2edc 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -59,11 +59,7 @@
android:excludeFromRecents="true"
android:finishOnTaskLaunch="true" />
-
-
-
diff --git a/README.md b/README.md
index c7fba54c..19f5a85d 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,9 @@
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/duckduckgo/android?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Travis-CI](https://api.travis-ci.org/duckduckgo/android-search-and-stories.svg?branch=master)](https://travis-ci.org/duckduckgo/android-search-and-stories)
-We are excited to engage the community in the development of our new [apps](https://duckduckgo.com/app)! If you are trying to contribute in other ways, that happens over at [DuckDuckHack](http://duckduckhack.com) or on [GitHub](http://github.com/duckduckgo).
+We are excited to engage the community in the development of our [apps](https://duckduckgo.com/app)! While development on this project is currently on hold, we are working on a new project at https://github.com/duckduckgo/android which we will open up to contributions soon. Stay tuned!
+
+If you are trying to contribute in other ways, that happens over at [DuckDuckHack](http://duckduckhack.com) or on [GitHub](http://github.com/duckduckgo).
The Android app is available via Google Play here: https://play.google.com/store/apps/details?id=com.duckduckgo.mobile.android&hl=en_GB
@@ -11,18 +13,6 @@ The Android app is available via Google Play here: https://play.google.com/store
Contact us at android@duckduckgo.com if you want to get more involved, have questions or want to chat.
-## Getting started
-
-We're currently evaluating a variety of CI systems and suggested development environments. Android provides a rich set of environments, most of which are currently supported. You can familiarize yourself with the code by working on the following low-hanging fruit:
-- bug fixes
-- layout fixes
-- security fixes
-- improving the test suite
-
-Please check out the [issue tracker](https://github.com/duckduckgo/android-search-and-stories/issues) and [contributing](https://github.com/duckduckgo/android-search-and-stories/blob/master/CONTRIBUTING.md) guidelines.
## License
DuckDuckGo Search & Stories is distributed under the Apache 2.0 [license](https://github.com/duckduckgo/android/blob/master/LICENSE).
-
-## Notes
-DuckDuckGo Search & Stories represents a ton of hard work from people all around the world. We've spent a long time thinking about exactly what makes a great mobile experience. While we'd love to accept each and every pull request, that probably wouldn't lead to a coherent experience. If you would like to get more involved, mail us at android@duckduckgo.com.
diff --git a/build.gradle b/build.gradle
index 627bf7d5..08261370 100644
--- a/build.gradle
+++ b/build.gradle
@@ -19,8 +19,8 @@ android {
applicationId "com.duckduckgo.mobile.android"
minSdkVersion 16
targetSdkVersion 23
- versionCode 100
- versionName "3.1.0"
+ versionCode 101
+ versionName "3.1.1"
}
repositories {
diff --git a/res/drawable-hdpi/add.png b/res/drawable-hdpi/add.png
deleted file mode 100644
index da9b2067..00000000
Binary files a/res/drawable-hdpi/add.png and /dev/null differ
diff --git a/res/drawable-hdpi/bang_button.png b/res/drawable-hdpi/bang_button.png
deleted file mode 100644
index 4698c67d..00000000
Binary files a/res/drawable-hdpi/bang_button.png and /dev/null differ
diff --git a/res/drawable-hdpi/bang_button_pressed.png b/res/drawable-hdpi/bang_button_pressed.png
deleted file mode 100644
index fc54739c..00000000
Binary files a/res/drawable-hdpi/bang_button_pressed.png and /dev/null differ
diff --git a/res/drawable-hdpi/chrome.png b/res/drawable-hdpi/chrome.png
deleted file mode 100644
index 4cbce44c..00000000
Binary files a/res/drawable-hdpi/chrome.png and /dev/null differ
diff --git a/res/drawable-hdpi/firefox.png b/res/drawable-hdpi/firefox.png
deleted file mode 100644
index 7cd046c1..00000000
Binary files a/res/drawable-hdpi/firefox.png and /dev/null differ
diff --git a/res/drawable-hdpi/illustration_1.png b/res/drawable-hdpi/illustration_1.png
deleted file mode 100644
index deabe818..00000000
Binary files a/res/drawable-hdpi/illustration_1.png and /dev/null differ
diff --git a/res/drawable-hdpi/illustration_2.png b/res/drawable-hdpi/illustration_2.png
deleted file mode 100644
index 25e93409..00000000
Binary files a/res/drawable-hdpi/illustration_2.png and /dev/null differ
diff --git a/res/drawable-hdpi/illustration_3.png b/res/drawable-hdpi/illustration_3.png
deleted file mode 100644
index c459b349..00000000
Binary files a/res/drawable-hdpi/illustration_3.png and /dev/null differ
diff --git a/res/drawable-hdpi/illustration_3_instruction.png b/res/drawable-hdpi/illustration_3_instruction.png
deleted file mode 100644
index be356452..00000000
Binary files a/res/drawable-hdpi/illustration_3_instruction.png and /dev/null differ
diff --git a/res/drawable-hdpi/illustration_4.png b/res/drawable-hdpi/illustration_4.png
deleted file mode 100644
index 83b0b8da..00000000
Binary files a/res/drawable-hdpi/illustration_4.png and /dev/null differ
diff --git a/res/drawable-hdpi/menu_grey.png b/res/drawable-hdpi/menu_grey.png
deleted file mode 100644
index b39e355e..00000000
Binary files a/res/drawable-hdpi/menu_grey.png and /dev/null differ
diff --git a/res/drawable-hdpi/menu_red.png b/res/drawable-hdpi/menu_red.png
deleted file mode 100644
index 9711c9bc..00000000
Binary files a/res/drawable-hdpi/menu_red.png and /dev/null differ
diff --git a/res/drawable-ldpi/add.png b/res/drawable-ldpi/add.png
deleted file mode 100644
index 130d05f3..00000000
Binary files a/res/drawable-ldpi/add.png and /dev/null differ
diff --git a/res/drawable-ldpi/bang_button.png b/res/drawable-ldpi/bang_button.png
deleted file mode 100644
index b2445301..00000000
Binary files a/res/drawable-ldpi/bang_button.png and /dev/null differ
diff --git a/res/drawable-ldpi/bang_button_pressed.png b/res/drawable-ldpi/bang_button_pressed.png
deleted file mode 100644
index 03f63271..00000000
Binary files a/res/drawable-ldpi/bang_button_pressed.png and /dev/null differ
diff --git a/res/drawable-ldpi/menu_grey.png b/res/drawable-ldpi/menu_grey.png
deleted file mode 100644
index b413e271..00000000
Binary files a/res/drawable-ldpi/menu_grey.png and /dev/null differ
diff --git a/res/drawable-ldpi/menu_red.png b/res/drawable-ldpi/menu_red.png
deleted file mode 100644
index bfb268c3..00000000
Binary files a/res/drawable-ldpi/menu_red.png and /dev/null differ
diff --git a/res/drawable-mdpi/add.png b/res/drawable-mdpi/add.png
deleted file mode 100644
index e9bbf4eb..00000000
Binary files a/res/drawable-mdpi/add.png and /dev/null differ
diff --git a/res/drawable-mdpi/bang_button.png b/res/drawable-mdpi/bang_button.png
deleted file mode 100644
index 10a1769a..00000000
Binary files a/res/drawable-mdpi/bang_button.png and /dev/null differ
diff --git a/res/drawable-mdpi/bang_button_pressed.png b/res/drawable-mdpi/bang_button_pressed.png
deleted file mode 100644
index 2ac8eaf5..00000000
Binary files a/res/drawable-mdpi/bang_button_pressed.png and /dev/null differ
diff --git a/res/drawable-mdpi/chrome.png b/res/drawable-mdpi/chrome.png
deleted file mode 100644
index f98c0ad3..00000000
Binary files a/res/drawable-mdpi/chrome.png and /dev/null differ
diff --git a/res/drawable-mdpi/firefox.png b/res/drawable-mdpi/firefox.png
deleted file mode 100644
index 08f8beb7..00000000
Binary files a/res/drawable-mdpi/firefox.png and /dev/null differ
diff --git a/res/drawable-mdpi/illustration_1.png b/res/drawable-mdpi/illustration_1.png
deleted file mode 100644
index 84fc61b9..00000000
Binary files a/res/drawable-mdpi/illustration_1.png and /dev/null differ
diff --git a/res/drawable-mdpi/illustration_2.png b/res/drawable-mdpi/illustration_2.png
deleted file mode 100644
index 86e7d902..00000000
Binary files a/res/drawable-mdpi/illustration_2.png and /dev/null differ
diff --git a/res/drawable-mdpi/illustration_3.png b/res/drawable-mdpi/illustration_3.png
deleted file mode 100644
index e91c385f..00000000
Binary files a/res/drawable-mdpi/illustration_3.png and /dev/null differ
diff --git a/res/drawable-mdpi/illustration_3_instruction.png b/res/drawable-mdpi/illustration_3_instruction.png
deleted file mode 100644
index 03f1a294..00000000
Binary files a/res/drawable-mdpi/illustration_3_instruction.png and /dev/null differ
diff --git a/res/drawable-mdpi/illustration_4.png b/res/drawable-mdpi/illustration_4.png
deleted file mode 100644
index 3e15ab90..00000000
Binary files a/res/drawable-mdpi/illustration_4.png and /dev/null differ
diff --git a/res/drawable-mdpi/menu_grey.png b/res/drawable-mdpi/menu_grey.png
deleted file mode 100644
index e2c1a1a4..00000000
Binary files a/res/drawable-mdpi/menu_grey.png and /dev/null differ
diff --git a/res/drawable-mdpi/menu_red.png b/res/drawable-mdpi/menu_red.png
deleted file mode 100644
index 2e8a7617..00000000
Binary files a/res/drawable-mdpi/menu_red.png and /dev/null differ
diff --git a/res/drawable-xhdpi/add.png b/res/drawable-xhdpi/add.png
deleted file mode 100644
index 3d8b7429..00000000
Binary files a/res/drawable-xhdpi/add.png and /dev/null differ
diff --git a/res/drawable-xhdpi/chrome.png b/res/drawable-xhdpi/chrome.png
deleted file mode 100644
index 9b38d48c..00000000
Binary files a/res/drawable-xhdpi/chrome.png and /dev/null differ
diff --git a/res/drawable-xhdpi/firefox.png b/res/drawable-xhdpi/firefox.png
deleted file mode 100644
index eff6b17e..00000000
Binary files a/res/drawable-xhdpi/firefox.png and /dev/null differ
diff --git a/res/drawable-xhdpi/illustration_1.png b/res/drawable-xhdpi/illustration_1.png
deleted file mode 100644
index 70acf5f4..00000000
Binary files a/res/drawable-xhdpi/illustration_1.png and /dev/null differ
diff --git a/res/drawable-xhdpi/illustration_2.png b/res/drawable-xhdpi/illustration_2.png
deleted file mode 100644
index 5dc70dde..00000000
Binary files a/res/drawable-xhdpi/illustration_2.png and /dev/null differ
diff --git a/res/drawable-xhdpi/illustration_3.png b/res/drawable-xhdpi/illustration_3.png
deleted file mode 100644
index 8e37492d..00000000
Binary files a/res/drawable-xhdpi/illustration_3.png and /dev/null differ
diff --git a/res/drawable-xhdpi/illustration_3_instruction.png b/res/drawable-xhdpi/illustration_3_instruction.png
deleted file mode 100644
index bcd3a72c..00000000
Binary files a/res/drawable-xhdpi/illustration_3_instruction.png and /dev/null differ
diff --git a/res/drawable-xhdpi/illustration_4.png b/res/drawable-xhdpi/illustration_4.png
deleted file mode 100644
index 30f2cea9..00000000
Binary files a/res/drawable-xhdpi/illustration_4.png and /dev/null differ
diff --git a/res/drawable-xhdpi/menu_grey.png b/res/drawable-xhdpi/menu_grey.png
deleted file mode 100644
index 330f8036..00000000
Binary files a/res/drawable-xhdpi/menu_grey.png and /dev/null differ
diff --git a/res/drawable-xhdpi/menu_red.png b/res/drawable-xhdpi/menu_red.png
deleted file mode 100644
index 01950030..00000000
Binary files a/res/drawable-xhdpi/menu_red.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/add.png b/res/drawable-xxhdpi/add.png
deleted file mode 100644
index ee3e3486..00000000
Binary files a/res/drawable-xxhdpi/add.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/chrome.png b/res/drawable-xxhdpi/chrome.png
deleted file mode 100644
index 1d7baa50..00000000
Binary files a/res/drawable-xxhdpi/chrome.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/firefox.png b/res/drawable-xxhdpi/firefox.png
deleted file mode 100644
index fb9b5105..00000000
Binary files a/res/drawable-xxhdpi/firefox.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/illustration_1.png b/res/drawable-xxhdpi/illustration_1.png
deleted file mode 100644
index 5fe85909..00000000
Binary files a/res/drawable-xxhdpi/illustration_1.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/illustration_2.png b/res/drawable-xxhdpi/illustration_2.png
deleted file mode 100644
index 62f73fb1..00000000
Binary files a/res/drawable-xxhdpi/illustration_2.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/illustration_3.png b/res/drawable-xxhdpi/illustration_3.png
deleted file mode 100644
index 4d3fa0b6..00000000
Binary files a/res/drawable-xxhdpi/illustration_3.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/illustration_3_instruction.png b/res/drawable-xxhdpi/illustration_3_instruction.png
deleted file mode 100644
index 9826a3ac..00000000
Binary files a/res/drawable-xxhdpi/illustration_3_instruction.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/illustration_4.png b/res/drawable-xxhdpi/illustration_4.png
deleted file mode 100644
index 6590647a..00000000
Binary files a/res/drawable-xxhdpi/illustration_4.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/menu_grey.png b/res/drawable-xxhdpi/menu_grey.png
deleted file mode 100644
index bce35917..00000000
Binary files a/res/drawable-xxhdpi/menu_grey.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/menu_red.png b/res/drawable-xxhdpi/menu_red.png
deleted file mode 100644
index edb466f7..00000000
Binary files a/res/drawable-xxhdpi/menu_red.png and /dev/null differ
diff --git a/res/drawable-xxxhdpi/add.png b/res/drawable-xxxhdpi/add.png
deleted file mode 100644
index 529e9950..00000000
Binary files a/res/drawable-xxxhdpi/add.png and /dev/null differ
diff --git a/res/drawable-xxxhdpi/chrome.png b/res/drawable-xxxhdpi/chrome.png
deleted file mode 100644
index 218da430..00000000
Binary files a/res/drawable-xxxhdpi/chrome.png and /dev/null differ
diff --git a/res/drawable-xxxhdpi/firefox.png b/res/drawable-xxxhdpi/firefox.png
deleted file mode 100644
index d10fae62..00000000
Binary files a/res/drawable-xxxhdpi/firefox.png and /dev/null differ
diff --git a/res/drawable-xxxhdpi/illustration_1.png b/res/drawable-xxxhdpi/illustration_1.png
deleted file mode 100644
index 8b805bac..00000000
Binary files a/res/drawable-xxxhdpi/illustration_1.png and /dev/null differ
diff --git a/res/drawable-xxxhdpi/illustration_2.png b/res/drawable-xxxhdpi/illustration_2.png
deleted file mode 100644
index d174d2b0..00000000
Binary files a/res/drawable-xxxhdpi/illustration_2.png and /dev/null differ
diff --git a/res/drawable-xxxhdpi/illustration_3.png b/res/drawable-xxxhdpi/illustration_3.png
deleted file mode 100644
index 466094bb..00000000
Binary files a/res/drawable-xxxhdpi/illustration_3.png and /dev/null differ
diff --git a/res/drawable-xxxhdpi/illustration_3_instruction.png b/res/drawable-xxxhdpi/illustration_3_instruction.png
deleted file mode 100644
index fefa1580..00000000
Binary files a/res/drawable-xxxhdpi/illustration_3_instruction.png and /dev/null differ
diff --git a/res/drawable-xxxhdpi/illustration_4.png b/res/drawable-xxxhdpi/illustration_4.png
deleted file mode 100644
index b76eaf36..00000000
Binary files a/res/drawable-xxxhdpi/illustration_4.png and /dev/null differ
diff --git a/res/drawable-xxxhdpi/menu_grey.png b/res/drawable-xxxhdpi/menu_grey.png
deleted file mode 100644
index d0fbaf15..00000000
Binary files a/res/drawable-xxxhdpi/menu_grey.png and /dev/null differ
diff --git a/res/drawable-xxxhdpi/menu_red.png b/res/drawable-xxxhdpi/menu_red.png
deleted file mode 100644
index 8c610abf..00000000
Binary files a/res/drawable-xxxhdpi/menu_red.png and /dev/null differ
diff --git a/res/drawable/instruction.png b/res/drawable/instruction.png
deleted file mode 100644
index ff83159a..00000000
Binary files a/res/drawable/instruction.png and /dev/null differ
diff --git a/res/drawable/instruction2.png b/res/drawable/instruction2.png
deleted file mode 100644
index c080f334..00000000
Binary files a/res/drawable/instruction2.png and /dev/null differ
diff --git a/res/drawable/instruction3.png b/res/drawable/instruction3.png
deleted file mode 100644
index 632ab967..00000000
Binary files a/res/drawable/instruction3.png and /dev/null differ
diff --git a/res/drawable/instruction_background.xml b/res/drawable/instruction_background.xml
deleted file mode 100644
index cd04086c..00000000
--- a/res/drawable/instruction_background.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/res/drawable/instruction_background_2.xml b/res/drawable/instruction_background_2.xml
deleted file mode 100644
index 97ed1ea1..00000000
--- a/res/drawable/instruction_background_2.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
- -
-
-
-
-
- -
-
-
-
-
-
-
\ No newline at end of file
diff --git a/res/drawable/instruction_bullet_point_background.xml b/res/drawable/instruction_bullet_point_background.xml
deleted file mode 100644
index 41d00a07..00000000
--- a/res/drawable/instruction_bullet_point_background.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/res/drawable/instructions1_3.png b/res/drawable/instructions1_3.png
deleted file mode 100644
index bc6c541d..00000000
Binary files a/res/drawable/instructions1_3.png and /dev/null differ
diff --git a/res/drawable/instructions2_3.png b/res/drawable/instructions2_3.png
deleted file mode 100644
index 699b7085..00000000
Binary files a/res/drawable/instructions2_3.png and /dev/null differ
diff --git a/res/drawable/instructions3_3.png b/res/drawable/instructions3_3.png
deleted file mode 100644
index 47c49662..00000000
Binary files a/res/drawable/instructions3_3.png and /dev/null differ
diff --git a/res/drawable/onboarding_banner_button_background.xml b/res/drawable/onboarding_banner_button_background.xml
deleted file mode 100644
index f0b3a127..00000000
--- a/res/drawable/onboarding_banner_button_background.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/res/drawable/onboarding_button_background.xml b/res/drawable/onboarding_button_background.xml
deleted file mode 100644
index 4ea99f8f..00000000
--- a/res/drawable/onboarding_button_background.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/res/drawable/onboarding_pageindicator.xml b/res/drawable/onboarding_pageindicator.xml
deleted file mode 100644
index 1a9265a8..00000000
--- a/res/drawable/onboarding_pageindicator.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
- -
-
-
-
-
-
-
- -
-
-
-
-
-
\ No newline at end of file
diff --git a/res/drawable/onboarding_pageindicator_background.xml b/res/drawable/onboarding_pageindicator_background.xml
deleted file mode 100644
index cf8140a5..00000000
--- a/res/drawable/onboarding_pageindicator_background.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
\ No newline at end of file
diff --git a/res/layout-land/activity_onboarding.xml b/res/layout-land/activity_onboarding.xml
deleted file mode 100644
index 14a223ca..00000000
--- a/res/layout-land/activity_onboarding.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
diff --git a/res/layout/activity_onboarding.xml b/res/layout/activity_onboarding.xml
deleted file mode 100644
index c167b063..00000000
--- a/res/layout/activity_onboarding.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/res/layout/dialog_onboarding_instruction.xml b/res/layout/dialog_onboarding_instruction.xml
deleted file mode 100644
index f5ff5108..00000000
--- a/res/layout/dialog_onboarding_instruction.xml
+++ /dev/null
@@ -1,263 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/res/layout/fragment_onboarding.xml b/res/layout/fragment_onboarding.xml
deleted file mode 100644
index 9b837691..00000000
--- a/res/layout/fragment_onboarding.xml
+++ /dev/null
@@ -1,166 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/res/layout/viewholder_feed_header.xml b/res/layout/viewholder_feed_header.xml
deleted file mode 100644
index c8d390b7..00000000
--- a/res/layout/viewholder_feed_header.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/res/layout/viewholder_feed_header_background_height.xml b/res/layout/viewholder_feed_header_background_height.xml
deleted file mode 100644
index dd9dd10e..00000000
--- a/res/layout/viewholder_feed_header_background_height.xml
+++ /dev/null
@@ -1,135 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/res/layout/viewholder_onboarding.xml b/res/layout/viewholder_onboarding.xml
deleted file mode 100644
index bf5ac28c..00000000
--- a/res/layout/viewholder_onboarding.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index 24839192..0cc09225 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -257,10 +257,54 @@
Avanti
Chiudi
Rimuovi
-
-
-
-
+ Salva immagine
+
+ Installa Orbot
+ Devi avere installato e avviato Orbot per redirigere il traffico. Vuoi installarlo?
+ Avvia Orbot
+ Sembra che Orbot non sia in esecuzione. Vuoi avviarlo e connetterti a Tor?
+ Sembra che Orbot non sia in esecuzione. Vuoi avviarlo e connetterti a Tor?\nSe Orbot non si attiva in modo automatico, avvialo manualmente
+ Connesso a Tor
+
+
+ Vera privacy
+ Non memorizziamo o condividiamo\nle tue informazioni personali. Mai.
+ Non ti seguiamo\nproponendoti pubblicità.
+ Dato che non memorizziamo le tue informazioni personali,\nnon abbiamo nulla da vendere ai pubblicitari.
+ Nessun tracciamento
+ Gli altri motori di ricerca tracciano le tue ricerche anche\nquando sei in modalità di navigazione in incognito.\nNoi non ti tracciamo — punto.
+ La privacy è un diritto!
+ Usa DuckDuckGo e riprendi il\ncontrollo della tua privacy!
+ Aggiungi alla schermata iniziale
+ Aggiungi a %s
+ DuckDuckGo aggiunto alla schermata iniziale
+ Ricerca DDG
+
+
+ DuckDuckGo
+ Firefox
+ Chrome
+ Usa DuckDuckGo in %s
+ "Gli altri motori di ricerca tracciano le tue ricerche anche quando sei in modalità di navigazione in incognito. Noi non ti tracciamo — punto"
+ Apri
+ 1
+ 2
+ 3
+ @string/instruction_open
+ @string/browser_firefox
+ @string/instruction_open
+ Menu
+ Vai a
+ Impostazioni -> Ricerca
+ Seleziona
+ @string/browser_duckduckgo
+ Apri
+ Chrome
+ Apri
+ Menu a 3 punti
+ Tocca
+ Aggiungi alla pagina iniziale
+ Fatto!
diff --git a/res/values-land-hdpi/dimens.xml b/res/values-land-hdpi/dimens.xml
deleted file mode 100644
index ecf5caab..00000000
--- a/res/values-land-hdpi/dimens.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- 90dp
-
\ No newline at end of file
diff --git a/res/values-land-mdpi/dimens.xml b/res/values-land-mdpi/dimens.xml
deleted file mode 100644
index 6f5a5181..00000000
--- a/res/values-land-mdpi/dimens.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- 70dp
-
\ No newline at end of file
diff --git a/res/values-land-xhdpi/dimens.xml b/res/values-land-xhdpi/dimens.xml
deleted file mode 100644
index ecf5caab..00000000
--- a/res/values-land-xhdpi/dimens.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- 90dp
-
\ No newline at end of file
diff --git a/res/values-land-xxhdpi/dimens.xml b/res/values-land-xxhdpi/dimens.xml
deleted file mode 100644
index 354986f4..00000000
--- a/res/values-land-xxhdpi/dimens.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- 120dp
-
\ No newline at end of file
diff --git a/res/values-sw600dp/booleans.xml b/res/values-sw600dp/booleans.xml
deleted file mode 100644
index d3a0e92c..00000000
--- a/res/values-sw600dp/booleans.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- true
-
\ No newline at end of file
diff --git a/res/values-sw720dp/bools.xml b/res/values-sw720dp/bools.xml
deleted file mode 100644
index a5cc2e96..00000000
--- a/res/values-sw720dp/bools.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- true
-
\ No newline at end of file
diff --git a/res/values-xlarge/booleans.xml b/res/values-xlarge/booleans.xml
deleted file mode 100644
index d3a0e92c..00000000
--- a/res/values-xlarge/booleans.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- true
-
\ No newline at end of file
diff --git a/res/values/booleans.xml b/res/values/booleans.xml
deleted file mode 100644
index f855de6a..00000000
--- a/res/values/booleans.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- false
-
\ No newline at end of file
diff --git a/res/values/bools.xml b/res/values/bools.xml
deleted file mode 100644
index 1a6ad7d4..00000000
--- a/res/values/bools.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- false
-
\ No newline at end of file
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 5aa73fad..20845ba8 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -51,19 +51,6 @@
#dddddd
- #93c04c
- #9b6cd3
- #f58b6b
- #6bbbe0
-
- #48000000
- #66b3ef
- #66b3ef
- #2da1e4
-
- #333333
- #666666
-
#ffffff
#64000000
#333333
@@ -71,13 +58,6 @@
- #d24e25
- #b33331
- #d65420
- #bf4000
- #fafafa
- #d9d9d9
- #c7c7c7
#ffffff
#cfcfcf
#fafafa
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index aacdf7ec..2713be9a 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -58,14 +58,6 @@
0dp
- 129dp
- 43.5dp
- 24dp
-
- 200dp
- 19dp
- 10dp
-
8dp
diff --git a/src/com/duckduckgo/mobile/android/activity/DuckDuckGo.java b/src/com/duckduckgo/mobile/android/activity/DuckDuckGo.java
index 88123be7..2579960b 100644
--- a/src/com/duckduckgo/mobile/android/activity/DuckDuckGo.java
+++ b/src/com/duckduckgo/mobile/android/activity/DuckDuckGo.java
@@ -12,7 +12,6 @@
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
-import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.text.Editable;
@@ -33,7 +32,6 @@
import com.duckduckgo.mobile.android.adapters.RecentResultCursorAdapter;
import com.duckduckgo.mobile.android.bus.BusProvider;
import com.duckduckgo.mobile.android.container.DuckDuckGoContainer;
-import com.duckduckgo.mobile.android.dialogs.InstructionDialogFragment;
import com.duckduckgo.mobile.android.dialogs.NewSourcesDialogBuilder;
import com.duckduckgo.mobile.android.dialogs.menuDialogs.HistorySearchMenuDialog;
import com.duckduckgo.mobile.android.dialogs.menuDialogs.HistoryStoryMenuDialog;
@@ -58,7 +56,6 @@
import com.duckduckgo.mobile.android.events.WebViewEvents.WebViewOpenMenuEvent;
import com.duckduckgo.mobile.android.events.WebViewEvents.WebViewReloadActionEvent;
import com.duckduckgo.mobile.android.events.WebViewEvents.WebViewSearchOrGoToUrlEvent;
-import com.duckduckgo.mobile.android.events.WebViewEvents.WebViewSearchWebTermEvent;
import com.duckduckgo.mobile.android.events.WebViewEvents.WebViewShowHistoryObjectEvent;
import com.duckduckgo.mobile.android.events.deleteEvents.DeleteStoryInHistoryEvent;
import com.duckduckgo.mobile.android.events.deleteEvents.DeleteUrlInHistoryEvent;
@@ -98,9 +95,7 @@
import com.duckduckgo.mobile.android.util.DDGControlVar;
import com.duckduckgo.mobile.android.util.DDGUtils;
import com.duckduckgo.mobile.android.util.DisplayStats;
-import com.duckduckgo.mobile.android.util.OnboardingHelper;
import com.duckduckgo.mobile.android.util.PreferencesManager;
-import com.duckduckgo.mobile.android.util.ReadArticlesManager;
import com.duckduckgo.mobile.android.util.SCREEN;
import com.duckduckgo.mobile.android.util.SESSIONTYPE;
import com.duckduckgo.mobile.android.util.Sharer;
@@ -127,8 +122,7 @@ public class DuckDuckGo extends AppCompatActivity {
private DDGAutoCompleteTextView searchEditText;
private SharedPreferences sharedPreferences;
- private OnboardingHelper onboardingHelper;
-
+
public boolean savedState = false;
private boolean backPressed = false;
private boolean canCommitFragmentSafely = true;
@@ -169,10 +163,6 @@ public void syncAdapters() {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTheme(R.style.DDGTheme);
- onboardingHelper = new OnboardingHelper(this);
- if(onboardingHelper.shouldShowOnboarding()) {
- showOnboardingInstruction();
- }
Log.d(TAG, "on create");
canCommitFragmentSafely = true;
@@ -763,14 +753,6 @@ private void stopAction() {
getSearchField().setCompoundDrawables(null, null, null, null);
}
- private void showOnboardingInstruction() {
- int instructionType = onboardingHelper.isDefaultBrowserFirefox()
- ? InstructionDialogFragment.EXTRA_INSTRUCTION_FIREFOX
- : InstructionDialogFragment.EXTRA_INSTRUCTION_CHROME;
- InstructionDialogFragment.newInstance(instructionType, true)
- .show(getSupportFragmentManager(), InstructionDialogFragment.TAG);
- }
-
public void searchOrGoToUrl(final String text, final SESSIONTYPE sessionType) {
if(DDGControlVar.useExternalBrowser==DDGConstants.ALWAYS_INTERNAL) {
if(fragmentManager.findFragmentByTag(WebFragment.TAG)==null) {
diff --git a/src/com/duckduckgo/mobile/android/activity/OnboardingActivity.java b/src/com/duckduckgo/mobile/android/activity/OnboardingActivity.java
deleted file mode 100644
index cbd556ab..00000000
--- a/src/com/duckduckgo/mobile/android/activity/OnboardingActivity.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package com.duckduckgo.mobile.android.activity;
-
-import android.content.Context;
-import android.content.Intent;
-import android.graphics.Point;
-import android.os.Build;
-import android.support.v4.app.ActivityCompat;
-import android.support.v4.view.ViewPager;
-import android.support.v7.app.AppCompatActivity;
-import android.os.Bundle;
-import android.transition.Fade;
-import android.view.Display;
-import android.view.View;
-import android.view.ViewTreeObserver;
-import android.widget.Button;
-import android.widget.FrameLayout;
-import android.widget.LinearLayout;
-
-import com.duckduckgo.mobile.android.R;
-import com.duckduckgo.mobile.android.adapters.OnboardingPageAdapter;
-import com.duckduckgo.mobile.android.dialogs.InstructionDialogFragment;
-import com.duckduckgo.mobile.android.util.CompatUtils;
-import com.duckduckgo.mobile.android.util.OnboardingHelper;
-import com.duckduckgo.mobile.android.util.OnboardingTransformer;
-import com.duckduckgo.mobile.android.views.pageindicator.OnboardingPageIndicator;
-
-import java.util.Arrays;
-
-public class OnboardingActivity extends AppCompatActivity {
-
- public static Intent getStartIntent(Context context) {
- return new Intent(context, OnboardingActivity.class);
- }
-
- private FrameLayout activityContainer;
- private LinearLayout containerLayout;
- private ViewPager viewPager;
- private OnboardingPageAdapter adapter;
- private OnboardingPageIndicator pageIndicator;
- private Button addToHomeScreenButton;
-
- private OnboardingHelper onboardingHelper;
- private InstructionDialogFragment instructionDialogFragment = null;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- Fade fade = new Fade();
- fade.setDuration(400);
- getWindow().setReturnTransition(fade);
- }
- setContentView(R.layout.activity_onboarding);
- initUI();
- }
-
- @Override
- public void finish() {
- if(viewPager.getCurrentItem() >= adapter.getCount() -1)
- onboardingHelper.setOnboardingDismissed();
- super.finish();
- }
-
- @Override
- public void onBackPressed() {
- if(viewPager.getCurrentItem() > 0) {
- viewPager.setCurrentItem(viewPager.getCurrentItem() - 1);
- }
- }
-
- private void initUI() {
- onboardingHelper = new OnboardingHelper(this);
- activityContainer = (FrameLayout) findViewById(R.id.activity_onboarding);
- containerLayout = (LinearLayout) findViewById(R.id.container_layout);
- boolean isFirefoxDefault = onboardingHelper.isDefaultBrowserFirefox();
- addToHomeScreenButton = (Button) findViewById(R.id.add_to_home_screen_button);
- addToHomeScreenButton.setText(
- String.format(getString(R.string.add_to),
- getString(isFirefoxDefault ? R.string.browser_firefox : R.string.browser_chrome))
- );
- addToHomeScreenButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- addTo();
- }
- });
-
- adapter = new OnboardingPageAdapter(this, getSupportFragmentManager());
-
- viewPager = (ViewPager) findViewById(R.id.view_pager);
- viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
- @Override
- public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
- if(position == 4) {
- ActivityCompat.finishAfterTransition(OnboardingActivity.this);
- }
- }
-
- @Override
- public void onPageSelected(int position) {
- }
-
- @Override
- public void onPageScrollStateChanged(int state) {
- }
- });
- viewPager.setAdapter(adapter);
-
- pageIndicator = (OnboardingPageIndicator) findViewById(R.id.page_indicator);
- pageIndicator.setViewPager(viewPager, adapter.getCount() - 1);
-
- viewPager.setPageTransformer(false, new OnboardingTransformer(adapter, pageIndicator, Arrays.asList(pageIndicator, addToHomeScreenButton)));
-
- Display display = getWindowManager().getDefaultDisplay();
- Point size = new Point();
- CompatUtils.getDisplaySize(display, size);
- int width = size.x;
- int height = size.y;
- if(width > height) return;
- final float bottomRatio = 13.6f;
- final int bottomMargin = (int) (height / bottomRatio);
- containerLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
- @Override
- public void onGlobalLayout() {
- FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) containerLayout.getLayoutParams();
- params.bottomMargin = bottomMargin;
- containerLayout.setLayoutParams(params);
- CompatUtils.removeOnGlobalLayoutListener(containerLayout.getViewTreeObserver(), this);
- }
- });
- if(instructionDialogFragment == null) {
- instructionDialogFragment = InstructionDialogFragment.newInstance(
- onboardingHelper.isDefaultBrowserFirefox()
- ? InstructionDialogFragment.EXTRA_INSTRUCTION_FIREFOX
- : InstructionDialogFragment.EXTRA_INSTRUCTION_CHROME,
- true);
- instructionDialogFragment.show(getSupportFragmentManager(), InstructionDialogFragment.TAG);
- }
- }
-
- private void addTo() {
- InstructionDialogFragment.newInstance(
- onboardingHelper.isDefaultBrowserFirefox() ? InstructionDialogFragment.EXTRA_INSTRUCTION_FIREFOX : InstructionDialogFragment.EXTRA_INSTRUCTION_CHROME)
- .show(getSupportFragmentManager(), InstructionDialogFragment.TAG);
- }
-}
diff --git a/src/com/duckduckgo/mobile/android/adapters/OnboardingBannerAdapter.java b/src/com/duckduckgo/mobile/android/adapters/OnboardingBannerAdapter.java
deleted file mode 100644
index 5e64d11e..00000000
--- a/src/com/duckduckgo/mobile/android/adapters/OnboardingBannerAdapter.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package com.duckduckgo.mobile.android.adapters;
-
-import android.content.Context;
-import android.support.v4.view.PagerAdapter;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import com.duckduckgo.mobile.android.R;
-import com.duckduckgo.mobile.android.util.OnboardingPageConfiguration;
-
-/**
- * Created by fgei on 4/11/17.
- */
-
-public class OnboardingBannerAdapter extends PagerAdapter {
-
- private final OnboardingPageConfiguration[] items;
-
- public OnboardingBannerAdapter() {
- items = new OnboardingPageConfiguration[] {
- OnboardingPageConfiguration.getPrivacy(),
- OnboardingPageConfiguration.getNoAds(),
- OnboardingPageConfiguration.getNoTracking(),
- OnboardingPageConfiguration.getRight()
- };
- }
-
- @Override
- public Object instantiateItem(ViewGroup container, int position) {
- OnboardingPageConfiguration onboardingPageConfiguration = getItem(position);
- LayoutInflater inflater = LayoutInflater.from(container.getContext());
- ViewGroup root = (ViewGroup) inflater.inflate(R.layout.viewholder_onboarding, container, false);
- populate(root, onboardingPageConfiguration);
- container.addView(root);
- return root;
- }
-
- @Override
- public void destroyItem(ViewGroup container, int position, Object object) {
- container.removeView((View) object);
- }
-
- @Override
- public boolean isViewFromObject(View view, Object o) {
- return view == o;
- }
-
- @Override
- public int getCount() {
- return items.length;
- }
-
- public OnboardingPageConfiguration getItem(int position) {
- return items[position];
- }
-
- private void populate(View rootView, OnboardingPageConfiguration onboardingPageConfiguration) {
- Context context = rootView.getContext();
- TextView titleTextView = (TextView) rootView.findViewById(R.id.title_text_view);
- String title = context.getString(onboardingPageConfiguration.title).replaceAll("\\n", " ");
- titleTextView.setText(title);
- TextView subtitleTextView = (TextView) rootView.findViewById(R.id.subtitle_text_view);
- String subtitle = context.getString(onboardingPageConfiguration.subtitle).replaceAll("\\n", " ");
- subtitleTextView.setText(subtitle);
- ImageView iconImageView = (ImageView) rootView.findViewById(R.id.icon_image_view);
- iconImageView.setImageResource(onboardingPageConfiguration.icon);
- }
-}
diff --git a/src/com/duckduckgo/mobile/android/adapters/OnboardingPageAdapter.java b/src/com/duckduckgo/mobile/android/adapters/OnboardingPageAdapter.java
deleted file mode 100644
index 2f117283..00000000
--- a/src/com/duckduckgo/mobile/android/adapters/OnboardingPageAdapter.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package com.duckduckgo.mobile.android.adapters;
-
-import android.content.Context;
-import android.support.annotation.ColorInt;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.FragmentPagerAdapter;
-import android.support.v4.content.ContextCompat;
-
-import com.duckduckgo.mobile.android.fragment.OnboardingPageFragment;
-import com.duckduckgo.mobile.android.util.OnboardingPageConfiguration;
-
-/**
- * Created by fgei on 4/4/17.
- */
-
-public class OnboardingPageAdapter extends FragmentPagerAdapter {
-
- private final OnboardingPageConfiguration[] items;
- private Context context;
-
- public OnboardingPageAdapter(Context context, FragmentManager fm) {
- super(fm);
- this.context = context;
- items = new OnboardingPageConfiguration[] {
- OnboardingPageConfiguration.getPrivacy(),
- OnboardingPageConfiguration.getNoAds(),
- OnboardingPageConfiguration.getNoTracking(),
- OnboardingPageConfiguration.getRight(),
- OnboardingPageConfiguration.getFadeOnboarding()
- };
- }
-
- @Override
- public Fragment getItem(int position) {
- OnboardingPageConfiguration onboardingPageConfiguration = items[position];
- return OnboardingPageFragment.newInstance(onboardingPageConfiguration, position);
- }
-
- @Override
- public int getCount() {
- return items.length;
- }
-
- @ColorInt
- public int getBackgroundColor(int position) {
- return ContextCompat.getColor(context, items[position].backgroundColor);
- }
-}
diff --git a/src/com/duckduckgo/mobile/android/adapters/RecyclerMainFeedAdapter.java b/src/com/duckduckgo/mobile/android/adapters/RecyclerMainFeedAdapter.java
index 2ca83f31..d56e1adb 100644
--- a/src/com/duckduckgo/mobile/android/adapters/RecyclerMainFeedAdapter.java
+++ b/src/com/duckduckgo/mobile/android/adapters/RecyclerMainFeedAdapter.java
@@ -4,6 +4,7 @@
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Handler;
+import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.view.ViewPager;
import android.support.v7.view.menu.MenuBuilder;
@@ -21,7 +22,6 @@
import com.duckduckgo.mobile.android.DDGApplication;
import com.duckduckgo.mobile.android.R;
import com.duckduckgo.mobile.android.bus.BusProvider;
-import com.duckduckgo.mobile.android.dialogs.InstructionDialogFragment;
import com.duckduckgo.mobile.android.download.AsyncImageView;
import com.duckduckgo.mobile.android.events.SourceFilterEvent;
import com.duckduckgo.mobile.android.events.feedEvents.FeedCancelCategoryFilterEvent;
@@ -30,8 +30,6 @@
import com.duckduckgo.mobile.android.objects.FeedObject;
import com.duckduckgo.mobile.android.util.DDGControlVar;
import com.duckduckgo.mobile.android.util.DDGUtils;
-import com.duckduckgo.mobile.android.util.OnboardingHelper;
-import com.duckduckgo.mobile.android.util.PreferencesManager;
import com.duckduckgo.mobile.android.views.DDGOverflowMenu;
import com.duckduckgo.mobile.android.views.pageindicator.BannerOnboardingPageIndicator;
import com.squareup.picasso.Picasso;
@@ -41,32 +39,18 @@
import java.util.ArrayList;
import java.util.List;
-public class RecyclerMainFeedAdapter extends RecyclerView.Adapter {
+public class RecyclerMainFeedAdapter extends RecyclerView.Adapter {
private static final String TAG = "MainFeedAdapter";
- private static final int ITEM_TYPE_FEED = 0;
- private static final int ITEM_TYPE_HEADER = 1;
-
- private boolean isOnboardingBannerVisible = true;
private Context context;
private final LayoutInflater inflater;
- private FragmentManager fragmentManager;
- private OnboardingHelper onboardingHelper;
private DDGOverflowMenu feedMenu = null;
private Menu menu = null;
public List data;
- public abstract class BaseViewHolder extends RecyclerView.ViewHolder {
- public BaseViewHolder(View itemView) {
- super(itemView);
- }
- public abstract void attach();
- public abstract void detach();
- }
-
- public class FeedViewHolder extends BaseViewHolder {
+ public class FeedViewHolder extends RecyclerView.ViewHolder {
public final TextView textViewTitle;
public final FrameLayout frameCategoryContainer;
@@ -87,94 +71,10 @@ public FeedViewHolder(View v) {
this.imageViewFeedIcon = (AsyncImageView) v.findViewById(R.id.feedItemSourceIcon);
}
- @Override
- public void attach() {
-
- }
-
- @Override
- public void detach() {
-
- }
}
- public class HeaderViewHolder extends BaseViewHolder {
-
- private final int SLIDE_TIME = 10000;
-
- public final ViewPager viewPager;
- public final BannerOnboardingPageIndicator pageIndicator;
- public final Button instructionbutton;
- public final ImageButton dismissImageButton;
- final Handler handler;
- final Runnable slideRunnable;
-
- private boolean isRunning = false;
-
- public HeaderViewHolder(View itemView) {
- super(itemView);
- instructionbutton = (Button) itemView.findViewById(R.id.instruction_button);
- dismissImageButton = (ImageButton) itemView.findViewById(R.id.dismiss_image_button);
- viewPager = (ViewPager) itemView.findViewById(R.id.view_pager);
- viewPager.setAdapter(new OnboardingBannerAdapter());
- viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
- @Override
- public void onPageScrolled(int i, float v, int i1) {
- }
-
- @Override
- public void onPageSelected(int i) {
- if(!isRunning) {
- startSlidingViewPager();
- }
- }
-
- @Override
- public void onPageScrollStateChanged(int i) {
- if(isRunning && i == ViewPager.SCROLL_STATE_DRAGGING) {
- stopSlidingViewPager();
- }
- }
- });
- pageIndicator = (BannerOnboardingPageIndicator) itemView.findViewById(R.id.page_indicator);
- pageIndicator.setViewPager(viewPager);
- handler = new Handler();
- slideRunnable = new Runnable() {
- @Override
- public void run() {
- int nextItem = viewPager.getCurrentItem() + 1;
- if(nextItem == viewPager.getAdapter().getCount()) nextItem = 0;
- viewPager.setCurrentItem(nextItem, true);
- handler.postDelayed(this, SLIDE_TIME);
- }
- };
- }
-
- @Override
- public void attach() {
- startSlidingViewPager();
- }
-
- @Override
- public void detach() {
- stopSlidingViewPager();
- }
-
- private void startSlidingViewPager() {
- isRunning = true;
- handler.postDelayed(slideRunnable, SLIDE_TIME);
- }
- private void stopSlidingViewPager() {
- isRunning = false;
- handler.removeCallbacks(slideRunnable);
- }
- }
-
- public RecyclerMainFeedAdapter(Context context, FragmentManager fragmentManager) {
+ public RecyclerMainFeedAdapter(Context context) {
this.context = context;
- this.fragmentManager = fragmentManager;
- onboardingHelper = new OnboardingHelper(context);
- isOnboardingBannerVisible = onboardingHelper.shouldShowOnboardingBanner();
inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
data = new ArrayList<>();
@@ -183,43 +83,18 @@ public RecyclerMainFeedAdapter(Context context, FragmentManager fragmentManager)
feedMenu = new DDGOverflowMenu(context);
}
+ public FeedObject getItem(int position) {
+ return data.get(position);
+ }
+
@Override
- public BaseViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
- if(viewType == ITEM_TYPE_HEADER) return new HeaderViewHolder(inflater.inflate(R.layout.viewholder_feed_header, parent, false));
+ public FeedViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
return new FeedViewHolder(inflater.inflate(R.layout.item_main_feed, parent, false));
}
@Override
- public void onBindViewHolder(final BaseViewHolder holder, int position) {
- if(position == 0 && isOnboardingBannerVisible) {
- //that's the header;
- final HeaderViewHolder headerHolder = (HeaderViewHolder) holder;
- boolean isFirefoxDefault = onboardingHelper.isDefaultBrowserFirefox();
- final boolean showFirefoxInstruction = isFirefoxDefault || PreferencesManager.isDDGAddedToHomeScreen();
- headerHolder.instructionbutton.setText(
- String.format(context.getString(R.string.add_to),
- context.getString(showFirefoxInstruction ? R.string.browser_firefox : R.string.browser_chrome))
- );
- headerHolder.instructionbutton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- InstructionDialogFragment.newInstance(
- showFirefoxInstruction ? InstructionDialogFragment.EXTRA_INSTRUCTION_FIREFOX : InstructionDialogFragment.EXTRA_INSTRUCTION_CHROME)
- .show(fragmentManager, InstructionDialogFragment.TAG);
- }
- });
- headerHolder.dismissImageButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- dismissOnboardingBanner();
- }
- });
- return;
- }
- final FeedObject feed = getItem(position);//data.get(position - 1); //header
-
- final FeedViewHolder feedHolder = (FeedViewHolder) holder;
-
+ public void onBindViewHolder(final FeedViewHolder feedHolder, int position) {
+ final FeedObject feed = getItem(position);
URL feedUrl = null;
if (feed != null) {
@@ -330,42 +205,9 @@ public boolean onLongClick(View v) {
}
}
- public FeedObject getItem(int position) {
- int index = position;
- if(isOnboardingBannerVisible) index -= 1;
- return data.get(index);
- }
-
@Override
public int getItemCount() {
- int size = data.size();
- if(isOnboardingBannerVisible) return size+ 1;
- return size;
- }
-
- @Override
- public int getItemViewType(int position) {
- if(position == 0 && isOnboardingBannerVisible) return ITEM_TYPE_HEADER;
- return ITEM_TYPE_FEED;
- }
-
- @Override
- public void onViewAttachedToWindow(BaseViewHolder holder) {
- super.onViewAttachedToWindow(holder);
- holder.attach();
- }
-
- @Override
- public void onViewDetachedFromWindow(BaseViewHolder holder) {
- holder.detach();
- super.onViewDetachedFromWindow(holder);
- }
-
- private void dismissOnboardingBanner() {
- onboardingHelper.setOnboardingBannerDismissed();
- isOnboardingBannerVisible = false;
- notifyItemRemoved(0);
-
+ return data.size();
}
private void showMenu(View anchor, FeedObject feed) {
diff --git a/src/com/duckduckgo/mobile/android/dialogs/InstructionDialogFragment.java b/src/com/duckduckgo/mobile/android/dialogs/InstructionDialogFragment.java
deleted file mode 100644
index 84e47dee..00000000
--- a/src/com/duckduckgo/mobile/android/dialogs/InstructionDialogFragment.java
+++ /dev/null
@@ -1,216 +0,0 @@
-package com.duckduckgo.mobile.android.dialogs;
-
-import android.app.Dialog;
-import android.content.Context;
-import android.graphics.Color;
-import android.graphics.Typeface;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Handler;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.v4.content.ContextCompat;
-import android.support.v7.app.AppCompatDialogFragment;
-import android.text.SpannableStringBuilder;
-import android.text.style.ForegroundColorSpan;
-import android.text.style.StyleSpan;
-import android.transition.TransitionManager;
-import android.util.Log;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import com.duckduckgo.mobile.android.R;
-import com.duckduckgo.mobile.android.util.OnboardingHelper;
-
-/**
- * Created by fgei on 4/7/17.
- */
-
-public class InstructionDialogFragment extends AppCompatDialogFragment {
-
- public static final String TAG = "instruction_dialog_fragment";
-
- public static InstructionDialogFragment newInstance(int instructionType) {
- return newInstance(instructionType, false);
- }
-
- public static InstructionDialogFragment newInstance(int instructionType, boolean disableDismissButton) {
- InstructionDialogFragment fragment = new InstructionDialogFragment();
- Bundle args = new Bundle();
- args.putInt(EXTRA_INSTRUCTION_TYPE, instructionType);
- args.putBoolean(EXTRA_DISABLE_DISMISS_BUTTON, disableDismissButton);
- fragment.setArguments(args);
- return fragment;
- }
-
- public static final int EXTRA_INSTRUCTION_FIREFOX = 0;
- public static final int EXTRA_INSTRUCTION_CHROME = 1;
-
- private static final String EXTRA_INSTRUCTION_TYPE = "instruction_type";
- private static final String EXTRA_DISABLE_DISMISS_BUTTON = "disable_dismiss_button";
-
- private static final int INITIAL_DISABLE_TIME = 1000;
-
- private View firefoxInstructionContainer, chromeInstructionContainer;
- private View toggleInstructionContainer;
- private TextView toggleInstructionTextView;
- private ImageView toggleInstructionImageView;
- private TextView titleTextView;
- private TextView doneButton;
- private ViewGroup transitionRoot;
-
- private OnboardingHelper onboardingHelper;
-
- private boolean isInstructionChromeType = true;
- private boolean disableDismissButton = false;
-
- @Override
- public void onCreate(@Nullable Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setStyle(STYLE_NO_TITLE, 0);
- Bundle args = getArguments();
- if(args.containsKey(EXTRA_INSTRUCTION_TYPE)) {
- isInstructionChromeType = args.getInt(EXTRA_INSTRUCTION_TYPE) == EXTRA_INSTRUCTION_CHROME;
- }
- if(args.containsKey(EXTRA_DISABLE_DISMISS_BUTTON)) {
- disableDismissButton = args.getBoolean(EXTRA_DISABLE_DISMISS_BUTTON);
- }
- }
-
- @Nullable
- @Override
- public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
- View rootView = inflater.inflate(R.layout.dialog_onboarding_instruction, container, false);
- init(getContext(), rootView);
- return rootView;
- }
-
- @Override
- public void onActivityCreated(Bundle savedInstanceState) {
- super.onActivityCreated(savedInstanceState);
- if(disableDismissButton && savedInstanceState == null) {
- disableViewForTime(doneButton, INITIAL_DISABLE_TIME );
- }
- }
-
- @Override
- public void onStart() {
- super.onStart();
- if(getDialog() != null) {
- getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
- getDialog().getWindow().setBackgroundDrawableResource(android.R.color.transparent);
- }
- }
-
- @Override
- public void dismiss() {
- onboardingHelper.setOnboardingDismissed();
- super.dismiss();
- }
-
- @NonNull
- @Override
- public Dialog onCreateDialog(Bundle savedInstanceState) {
- return new Dialog(getContext(), getTheme()) {
- @Override
- public void onBackPressed() {
- onboardingHelper.setOnboardingDismissed();
- super.onBackPressed();
- }
- };
- }
-
- private void init(Context context, final View rootView) {
- onboardingHelper = new OnboardingHelper(context);
- transitionRoot = (ViewGroup) rootView;
- TextView instruction1TextView = (TextView) rootView.findViewById(R.id.instruction_1_text_view);
- instruction1TextView.setText(getStyledString(getContext(), R.string.instruction_firefox_1_a, R.string.instruction_firefox_1_b));
-
- TextView instruction2TextView = (TextView) rootView.findViewById(R.id.instruction_2_text_view);
- instruction2TextView.setText(getStyledString(getContext(), R.string.instruction_firefox_2_a, R.string.instruction_firefox_2_b));
-
- TextView instruction3TextView = (TextView) rootView.findViewById(R.id.instruction_3_text_view);
- instruction3TextView.setText(getStyledString(getContext(), R.string.instruction_firefox_3_a, R.string.instruction_firefox_3_b));
-
- TextView instruction4TextView = (TextView) rootView.findViewById(R.id.instruction_4_text_view);
- instruction4TextView.setText(getStyledString(getContext(), R.string.instruction_firefox_4_a, R.string.instruction_firefox_4_b));
-
- doneButton = (TextView) rootView.findViewById(R.id.done_button);
- doneButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- dismiss();
- }
- });
- firefoxInstructionContainer = rootView.findViewById(R.id.instruction_container);
- chromeInstructionContainer = rootView.findViewById(R.id.add_to_home_screen_button);
- chromeInstructionContainer.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- onboardingHelper.addToHomeScreen();
- dismiss();
- }
- });
- toggleInstructionImageView = (ImageView) rootView.findViewById(R.id.add_to_image_view);
- toggleInstructionTextView = (TextView) rootView.findViewById(R.id.add_to_text_view);
- toggleInstructionContainer = rootView.findViewById(R.id.add_to_container);
- toggleInstructionContainer.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- isInstructionChromeType = !isInstructionChromeType;
- initInstructionType(isInstructionChromeType, true);
- }
- });
- titleTextView = (TextView) rootView.findViewById(R.id.instruction_title_text_view);
- initInstructionType(isInstructionChromeType, false);
- }
-
- private void initInstructionType(boolean isChromeType, boolean withAnimation) {
- if(withAnimation) {
- if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
- TransitionManager.beginDelayedTransition(transitionRoot);
- }
- }
- chromeInstructionContainer.setVisibility(isChromeType ? View.VISIBLE : View.GONE);
- firefoxInstructionContainer.setVisibility(isChromeType ? View.GONE : View.VISIBLE);
- toggleInstructionImageView.setImageResource(isChromeType ? R.drawable.firefox: R.drawable.chrome);
- toggleInstructionTextView.setText(
- String.format(
- getString(R.string.add_to),
- getString(isChromeType ? R.string.browser_firefox : R.string.browser_chrome)));
- titleTextView.setText(
- String.format(getString(R.string.add_to),
- getString(isChromeType ? R.string.browser_chrome : R.string.browser_firefox)));
- }
-
- private void disableViewForTime(final TextView textView, int millis) {
- final int textColor = textView.getCurrentTextColor();
- textView.setEnabled(false);
- textView.setTextColor(Color.GRAY);
- new Handler().postDelayed(new Runnable() {
- @Override
- public void run() {
- textView.setEnabled(true);
- textView.setTextColor(textColor);
- }
- }, millis);
- }
-
- private static SpannableStringBuilder getStyledString(Context context, int textResId, int textBoldResId) {
- String text = context.getString(textResId);
- String textPrimary = context.getString(textBoldResId);
- SpannableStringBuilder builder = new SpannableStringBuilder(text + " " + textPrimary);
- int startPrimaryIndex = text.length() + 1;
- int endPrimaryIndex = startPrimaryIndex + textPrimary.length();
- builder.setSpan(
- new ForegroundColorSpan(ContextCompat.getColor(context, R.color.onboarding_primary_text)),
- startPrimaryIndex,
- endPrimaryIndex,
- 0);
- builder.setSpan(new StyleSpan(Typeface.BOLD), startPrimaryIndex, endPrimaryIndex, 0);
- return builder;
- }
-}
diff --git a/src/com/duckduckgo/mobile/android/fragment/FeedFragment.java b/src/com/duckduckgo/mobile/android/fragment/FeedFragment.java
index f1340449..60664b85 100644
--- a/src/com/duckduckgo/mobile/android/fragment/FeedFragment.java
+++ b/src/com/duckduckgo/mobile/android/fragment/FeedFragment.java
@@ -146,7 +146,7 @@ public void onRefresh() {
}
public void init() {
- recyclerAdapter = new RecyclerMainFeedAdapter(activity, getFragmentManager());
+ recyclerAdapter = new RecyclerMainFeedAdapter(activity);
mainFeedTask = null;
diff --git a/src/com/duckduckgo/mobile/android/fragment/OnboardingPageFragment.java b/src/com/duckduckgo/mobile/android/fragment/OnboardingPageFragment.java
deleted file mode 100644
index 9d648bc4..00000000
--- a/src/com/duckduckgo/mobile/android/fragment/OnboardingPageFragment.java
+++ /dev/null
@@ -1,144 +0,0 @@
-package com.duckduckgo.mobile.android.fragment;
-
-import android.graphics.Point;
-import android.os.Bundle;
-import android.support.annotation.ColorInt;
-import android.support.annotation.DrawableRes;
-import android.support.annotation.Nullable;
-import android.support.v4.app.Fragment;
-import android.support.v4.content.ContextCompat;
-import android.view.Display;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.ViewTreeObserver;
-import android.widget.FrameLayout;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import com.duckduckgo.mobile.android.R;
-import com.duckduckgo.mobile.android.util.CompatUtils;
-import com.duckduckgo.mobile.android.util.OnboardingPageConfiguration;
-
-/**
- * Created by fgei on 4/4/17.
- */
-
-public class OnboardingPageFragment extends Fragment {
-
- private static final String EXTRA_INDEX_POSITION = "index_position";
- private static final String EXTRA_PAGE_CONFIGURATION = "page_configuration";
-
- private static final float BOTTOM_MARGIN_CONSTRAINT_PORTRAIT = 3.819f;
- private static final float BOTTOM_MARGIN_CONSTRAINT_LANDSCAPE = 4.228f;
-
- public static OnboardingPageFragment newInstance(OnboardingPageConfiguration onboardingPageConfiguration, int indexPosition) {
- OnboardingPageFragment f = new OnboardingPageFragment();
- Bundle args = new Bundle();
- args.putParcelable(EXTRA_PAGE_CONFIGURATION, onboardingPageConfiguration);
- args.putInt(EXTRA_INDEX_POSITION, indexPosition);
- f.setArguments(args);
- return f;
- }
-
- private OnboardingPageConfiguration onboardingPageConfiguration;
-
- private ViewGroup backgroundFrameLayout;
- private TextView titleTextView;
- private TextView subtitleTextView;
- private ImageView iconImageView;
-
- @Override
- public void onCreate(@Nullable Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- onboardingPageConfiguration = getOnboardingPageConfiguration();
- }
-
- @Nullable
- @Override
- public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
- View rootView = inflater.inflate(
- R.layout.fragment_onboarding,
- container,
- false);
- backgroundFrameLayout = (ViewGroup) rootView;
- titleTextView = (TextView) rootView.findViewById(R.id.title_text_view);
- subtitleTextView = (TextView) rootView.findViewById(R.id.subtitle_text_view);
- iconImageView = (ImageView) rootView.findViewById(R.id.icon_image_view);
- return rootView;
- }
-
- @Override
- public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
- super.onViewCreated(view, savedInstanceState);
- backgroundFrameLayout.setTag(getIndexPosition());
- }
-
- @Override
- public void onActivityCreated(@Nullable Bundle savedInstanceState) {
- super.onActivityCreated(savedInstanceState);
- backgroundFrameLayout.setBackgroundColor(getBackgroundColor());
- if(!onboardingPageConfiguration.hasContent) return;
- String title = getTitle();
- titleTextView.setText(title);
- String subtitle = getSubtitle();
- subtitleTextView.setText(subtitle);
- iconImageView.setImageResource(getIcon());
- initLayout();
- }
-
- private int getIndexPosition() {
- return getArguments().getInt(EXTRA_INDEX_POSITION);
- }
-
- private OnboardingPageConfiguration getOnboardingPageConfiguration() {
- return getArguments().getParcelable(EXTRA_PAGE_CONFIGURATION);
-
- }
-
- private void initLayout() {
- Display display = getActivity().getWindowManager().getDefaultDisplay();
- Point size = new Point();
- CompatUtils.getDisplaySize(display, size);
- int width = size.x;
- int height = size.y;
- final FrameLayout containerLayout = (FrameLayout) backgroundFrameLayout.findViewById(R.id.container_layout);
- final FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) containerLayout.getLayoutParams();
-
- boolean isPortrait = width < height;
- //float portraitBottomRatio = 3.819f;
- //float landscapeBottomRatio = 4.228f;
- float bottomMarginConstraint = isPortrait ? BOTTOM_MARGIN_CONSTRAINT_PORTRAIT : BOTTOM_MARGIN_CONSTRAINT_LANDSCAPE;
- final int bottomMargin = (int) (height / bottomMarginConstraint);
- final int topMargin = height - (int) (height / 1.278);
- containerLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
- @Override
- public void onGlobalLayout() {
- CompatUtils.removeOnGlobalLayoutListener(containerLayout.getViewTreeObserver(), this);
- params.bottomMargin = bottomMargin;
- containerLayout.setLayoutParams(params);
- }
- });
- }
-
- public String getTitle() {
- if(!onboardingPageConfiguration.hasContent) return "";
- return getString(onboardingPageConfiguration.title);
- }
-
- public String getSubtitle() {
- if(!onboardingPageConfiguration.hasContent) return "";
- return getString(onboardingPageConfiguration.subtitle);
- }
-
- @DrawableRes
- public int getIcon() {
- if(!onboardingPageConfiguration.hasContent) return 0;
- return onboardingPageConfiguration.icon;
- }
-
- @ColorInt
- public int getBackgroundColor() {
- return ContextCompat.getColor(getContext(), onboardingPageConfiguration.backgroundColor);
- }
-}
diff --git a/src/com/duckduckgo/mobile/android/util/OnboardingHelper.java b/src/com/duckduckgo/mobile/android/util/OnboardingHelper.java
deleted file mode 100644
index 0afb90aa..00000000
--- a/src/com/duckduckgo/mobile/android/util/OnboardingHelper.java
+++ /dev/null
@@ -1,104 +0,0 @@
-package com.duckduckgo.mobile.android.util;
-
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.ActivityInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.net.Uri;
-import android.os.Build;
-import android.widget.Toast;
-
-import com.duckduckgo.mobile.android.R;
-
-/**
- * Created by fgei on 4/20/17.
- */
-
-public class OnboardingHelper {
-
- private static final String PACKAGE_CHROME = "com.android.chrome";
- private static final String PACKAGE_FIREFOX = "org.mozilla.firefox";
-
- private static final String BASE_URL = "https://duckduckgo.com/";
- private static final String ADD_TO_HOMESCREEN_T_PARAM = "?t=ddg_android_hs";
-
- private Context context;
- private PackageManager packageManager;
- private boolean isTablet = false;
- private boolean isApi14;
-
- public OnboardingHelper(Context context) {
- this.context = context.getApplicationContext();
- packageManager = context.getPackageManager();
- isTablet = context.getResources().getBoolean(R.bool.isTablet);
- isApi14 = Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH;
- }
-
- public boolean shouldShowOnboarding() {
- return !PreferencesManager.getHasShownOnboarding() && !isTablet && isApi14;
- }
-
- public boolean shouldShowOnboardingBanner() {
- return !PreferencesManager.isOnboardingBannerDismissed() && !isTablet && isApi14;
- }
-
- public void setOnboardingDismissed() {
- PreferencesManager.setHasShownOnboarding();
- }
-
- public void setOnboardingBannerDismissed() {
- PreferencesManager.setOnboardingBannerDismissed();
- }
-
- public void addToHomeScreen() {
- context.sendBroadcast(getAddToHomescreenIntent(context));
- PreferencesManager.setDDGAddedToHomeScreen();
- Toast.makeText(context, R.string.ddg_added_to_home_page, Toast.LENGTH_SHORT).show();
- }
-
- public boolean isDefaultBrowserSelected() {
- ResolveInfo resolveInfo = getDefaultActivityForIntent(packageManager, getDDGIntent());
- if(resolveInfo == null || resolveInfo.activityInfo == null || resolveInfo.activityInfo.packageName == null) return false;
- ActivityInfo activityInfo = resolveInfo.activityInfo;
- return activityInfo.packageName != null;
- }
-
- public boolean isDefaultBrowserFirefox() {
- return isDefaultBrowserForPackage(PACKAGE_FIREFOX);
- }
-
- public boolean isDefaultBrowserChrome() {
- return isDefaultBrowserForPackage(PACKAGE_CHROME);
- }
-
- private boolean isDefaultBrowserForPackage(String packageName) {
- if(!isDefaultBrowserSelected()) return false;
- ActivityInfo activityInfo = getDefaultActivityForIntent(packageManager, getDDGIntent()).activityInfo;
- return activityInfo.packageName.contains(packageName);
- }
-
- private ResolveInfo getDefaultActivityForIntent(PackageManager packageManager, Intent intent) {
- return packageManager.resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY);
- }
-
- public static Intent getAddToHomescreenIntent(Context context) {
- Intent ddgIntent = getDDGAddToHomeScreenIntent();
- Intent shortcutIntent = new Intent();
- shortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, ddgIntent);
- shortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, context.getString(R.string.ddg_homescreen_label));
- shortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, Intent.ShortcutIconResource.fromContext(context, R.drawable.icon));
- shortcutIntent.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
- shortcutIntent.putExtra("duplicate", false);
- return shortcutIntent;
- }
-
- private static Intent getDDGIntent() {
- return new Intent(Intent.ACTION_VIEW, Uri.parse(BASE_URL));
- }
-
- private static Intent getDDGAddToHomeScreenIntent() {
- String url = BASE_URL + ADD_TO_HOMESCREEN_T_PARAM;
- return new Intent(Intent.ACTION_VIEW, Uri.parse(url));
- }
-}
diff --git a/src/com/duckduckgo/mobile/android/util/OnboardingPageConfiguration.java b/src/com/duckduckgo/mobile/android/util/OnboardingPageConfiguration.java
deleted file mode 100644
index c122bf37..00000000
--- a/src/com/duckduckgo/mobile/android/util/OnboardingPageConfiguration.java
+++ /dev/null
@@ -1,131 +0,0 @@
-package com.duckduckgo.mobile.android.util;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-
-import com.duckduckgo.mobile.android.R;
-
-/**
- * Created by fgei on 4/30/17.
- */
-
-public class OnboardingPageConfiguration implements Parcelable {
-
- private static final int PRIVACY_TITLE = R.string.privacy_title;
- private static final int PRIVACY_SUBTITLE = R.string.privacy_subtitle;
- private static final int PRIVACY_ICON = R.drawable.illustration_1;
- private static final int PRIVACY_BACKGROUND_COLOR = R.color.onboarding_privacy_background;
-
- private static final int NO_ADS_TITLE = R.string.no_ads_title;
- private static final int NO_ADS_SUBTITLE = R.string.no_ads_subtitle;
- private static final int NO_ADS_ICON = R.drawable.illustration_2;
- private static final int NO_ADS_BACKGROUND_COLOR = R.color.onboarding_no_ads_background;
-
- private static final int NO_TRACKING_TITLE = R.string.no_tracking_title;
- private static final int NO_TRACKING_SUBTITLE = R.string.no_tracking_subtitle;
- private static final int NO_TRACKING_ICON = R.drawable.illustration_3;
- private static final int NO_TRACKING_BACKGROUND_COLOR = R.color.onboarding_no_tracking_background;
-
- private static final int RIGHT_TITLE = R.string.right_title;
- private static final int RIGHT_SUBTITLE = R.string.right_subtitle;
- private static final int RIGHT_ICON = R.drawable.illustration_4;
- private static final int RIGHT_BACKGROUND_COLOR = R.color.onboarding_right_background;
-
- private static final int INVALID_RES_ID = -1;
-
- public static OnboardingPageConfiguration getPrivacy() {
- return new OnboardingPageConfiguration(
- PRIVACY_TITLE,
- PRIVACY_SUBTITLE,
- PRIVACY_ICON,
- PRIVACY_BACKGROUND_COLOR
- );
- }
-
- public static OnboardingPageConfiguration getNoAds() {
- return new OnboardingPageConfiguration(
- NO_ADS_TITLE,
- NO_ADS_SUBTITLE,
- NO_ADS_ICON,
- NO_ADS_BACKGROUND_COLOR
- );
- }
-
- public static OnboardingPageConfiguration getNoTracking() {
- return new OnboardingPageConfiguration(
- NO_TRACKING_TITLE,
- NO_TRACKING_SUBTITLE,
- NO_TRACKING_ICON,
- NO_TRACKING_BACKGROUND_COLOR
- );
- }
-
- public static OnboardingPageConfiguration getRight() {
- return new OnboardingPageConfiguration(
- RIGHT_TITLE,
- RIGHT_SUBTITLE,
- RIGHT_ICON,
- RIGHT_BACKGROUND_COLOR
- );
- }
-
- public static OnboardingPageConfiguration getFadeOnboarding() {
- return new OnboardingPageConfiguration(RIGHT_BACKGROUND_COLOR);
- }
-
- public final int title;
- public final int subtitle;
- public final int icon;
- public final int backgroundColor;
- public final boolean hasContent;
-
- public OnboardingPageConfiguration(int title, int subtitle, int icon, int backgroundColor) {
- this.title = title;
- this.subtitle = subtitle;
- this.icon = icon;
- this.backgroundColor = backgroundColor;
- this.hasContent = true;
- }
-
- public OnboardingPageConfiguration(int backgroundColor) {
- this.title = INVALID_RES_ID;
- this.subtitle = INVALID_RES_ID;
- this.icon = INVALID_RES_ID;
- this.backgroundColor = backgroundColor;
- this.hasContent = false;
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(this.title);
- dest.writeInt(this.subtitle);
- dest.writeInt(this.icon);
- dest.writeInt(this.backgroundColor);
- dest.writeByte(this.hasContent ? (byte) 1 : (byte) 0);
- }
-
- protected OnboardingPageConfiguration(Parcel in) {
- this.title = in.readInt();
- this.subtitle = in.readInt();
- this.icon = in.readInt();
- this.backgroundColor = in.readInt();
- this.hasContent = in.readByte() != 0;
- }
-
- public static final Creator CREATOR = new Creator() {
- @Override
- public OnboardingPageConfiguration createFromParcel(Parcel source) {
- return new OnboardingPageConfiguration(source);
- }
-
- @Override
- public OnboardingPageConfiguration[] newArray(int size) {
- return new OnboardingPageConfiguration[size];
- }
- };
-}
diff --git a/src/com/duckduckgo/mobile/android/util/OnboardingTransformer.java b/src/com/duckduckgo/mobile/android/util/OnboardingTransformer.java
deleted file mode 100644
index 94ee64cb..00000000
--- a/src/com/duckduckgo/mobile/android/util/OnboardingTransformer.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package com.duckduckgo.mobile.android.util;
-
-import android.graphics.Color;
-import android.os.Build;
-import android.support.annotation.ColorInt;
-import android.support.annotation.FloatRange;
-import android.support.v4.view.ViewPager;
-import android.view.View;
-
-import com.duckduckgo.mobile.android.R;
-import com.duckduckgo.mobile.android.adapters.OnboardingPageAdapter;
-import com.duckduckgo.mobile.android.views.pageindicator.OnboardingPageIndicator;
-
-import java.util.List;
-
-/**
- * Created by fgei on 4/4/17.
- */
-
-public class OnboardingTransformer implements ViewPager.PageTransformer {
-
- private OnboardingPageAdapter onboardingPageAdapter;
- private OnboardingPageIndicator pageIndicator;
- private List fadeViews;
-
- public OnboardingTransformer(OnboardingPageAdapter onboardingPageAdapter, OnboardingPageIndicator pageIndicator, List fadeViews) {
- this.onboardingPageAdapter = onboardingPageAdapter;
- this.pageIndicator = pageIndicator;
- this.fadeViews = fadeViews;
- }
-
- @Override
- public void transformPage(View page, float position) {
- final View image = page.findViewById(R.id.icon_image_view);
- final float absolutePosition = Math.abs(position);
- int pageIndex = (Integer) page.getTag();
-
- if(position >= -1.0 && position <= 1.0) {
- if(position > 0) {
- int leftColor = onboardingPageAdapter.getBackgroundColor(pageIndex - 1);
- int rightColor = onboardingPageAdapter.getBackgroundColor(pageIndex);
-
- int color = blendARGB(rightColor, leftColor, position);
- page.setBackgroundColor(color);
- if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
- image.setScaleX(1 - absolutePosition);
- image.setScaleY(1 - absolutePosition);
- if(pageIndex == (onboardingPageAdapter.getCount() - 1)) {
- for(View v : fadeViews) {
- v.setAlpha(absolutePosition);
- }
- }
- }
- pageIndicator.setPositionSelected(pageIndex - 1, 1 - absolutePosition);
- pageIndicator.setPositionSelected(pageIndex, absolutePosition);
- } else if(position < 0) {
- int nextIndex = pageIndex + 1;
- int leftColor = onboardingPageAdapter.getBackgroundColor(pageIndex);
- int rightColor = onboardingPageAdapter.getBackgroundColor(nextIndex);
-
- int color = blendARGB(rightColor, leftColor, 1 - absolutePosition);
- page.setBackgroundColor(color);
- if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
- image.setScaleX(1 - absolutePosition);
- image.setScaleY(1 - absolutePosition);
- if(nextIndex == (onboardingPageAdapter.getCount() - 1)) {
- for(View v : fadeViews) {
- v.setAlpha(1 - absolutePosition);
- }
- }
- }
- pageIndicator.setPositionSelected(pageIndex, absolutePosition);
- pageIndicator.setPositionSelected(pageIndex + 1, 1 - absolutePosition);
- } else {
- page.setBackgroundColor(onboardingPageAdapter.getBackgroundColor(pageIndex));
- }
- } else {
- page.setBackgroundColor(onboardingPageAdapter.getBackgroundColor(pageIndex));
- }
- }
-
- public static int blendARGB(@ColorInt int color1, @ColorInt int color2,
- @FloatRange(from = 0.0, to = 1.0) float ratio) {
- final float inverseRatio = 1 - ratio;
- float a = Color.alpha(color1) * inverseRatio + Color.alpha(color2) * ratio;
- float r = Color.red(color1) * inverseRatio + Color.red(color2) * ratio;
- float g = Color.green(color1) * inverseRatio + Color.green(color2) * ratio;
- float b = Color.blue(color1) * inverseRatio + Color.blue(color2) * ratio;
- return Color.argb((int) a, (int) r, (int) g, (int) b);
- }
-}