From 752de38105a4ec2adea466c3b81d7c22cf336249 Mon Sep 17 00:00:00 2001 From: Andrei Lazar Date: Fri, 8 Mar 2019 15:03:52 +0000 Subject: [PATCH] Bug 1526926 Search Widget for Fennec Part 1 - Add search widget code base r=petru Added Search widget provider class, declared the provider in the manifest and created mock layout for it. Differential Revision: https://phabricator.services.mozilla.com/D20149 --HG-- extra : moz-landing-system : lando --- .../app/src/main/res/values/dimens.xml | 16 +++ .../src/main/res/xml/search_widget_info.xml | 18 +++ mobile/android/base/AndroidManifest.xml.in | 17 +++ .../SearchWidgetConfigurationActivity.java | 34 +++++ .../gecko/search/SearchWidgetProvider.java | 121 ++++++++++++++++++ .../base/locales/en-US/android_strings.dtd | 6 + mobile/android/base/strings.xml.in | 4 + .../res/layout/widget_search_1_col_layout.xml | 28 ++++ .../res/layout/widget_search_2_col_layout.xml | 40 ++++++ .../res/layout/widget_search_3_col_layout.xml | 53 ++++++++ .../res/layout/widget_search_4_col_layout.xml | 53 ++++++++ .../res/layout/widget_search_5_col_layout.xml | 53 ++++++++ 12 files changed, 443 insertions(+) create mode 100644 mobile/android/app/src/main/res/xml/search_widget_info.xml create mode 100644 mobile/android/base/java/org/mozilla/gecko/search/SearchWidgetConfigurationActivity.java create mode 100644 mobile/android/base/java/org/mozilla/gecko/search/SearchWidgetProvider.java create mode 100644 mobile/android/services/src/main/res/layout/widget_search_1_col_layout.xml create mode 100644 mobile/android/services/src/main/res/layout/widget_search_2_col_layout.xml create mode 100644 mobile/android/services/src/main/res/layout/widget_search_3_col_layout.xml create mode 100644 mobile/android/services/src/main/res/layout/widget_search_4_col_layout.xml create mode 100644 mobile/android/services/src/main/res/layout/widget_search_5_col_layout.xml diff --git a/mobile/android/app/src/main/res/values/dimens.xml b/mobile/android/app/src/main/res/values/dimens.xml index 322666ffe526..625971f36c54 100644 --- a/mobile/android/app/src/main/res/values/dimens.xml +++ b/mobile/android/app/src/main/res/values/dimens.xml @@ -115,6 +115,22 @@ 8dp 7dp + + 50dp + 50dp + 100dp + 192dp + 256dp + 360dp + 32dp + 32dp + 9dp + 89dp + 153dp + 257dp + 32dp + 9dp + 64dp diff --git a/mobile/android/app/src/main/res/xml/search_widget_info.xml b/mobile/android/app/src/main/res/xml/search_widget_info.xml new file mode 100644 index 000000000000..8276683d38e4 --- /dev/null +++ b/mobile/android/app/src/main/res/xml/search_widget_info.xml @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/mobile/android/base/AndroidManifest.xml.in b/mobile/android/base/AndroidManifest.xml.in index ce5ab599320e..817e6074ae3e 100644 --- a/mobile/android/base/AndroidManifest.xml.in +++ b/mobile/android/base/AndroidManifest.xml.in @@ -228,6 +228,23 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/mobile/android/base/strings.xml.in b/mobile/android/base/strings.xml.in index 665f5d930209..e2937f9a34f0 100644 --- a/mobile/android/base/strings.xml.in +++ b/mobile/android/base/strings.xml.in @@ -69,6 +69,10 @@ &url_bar_qrcode_text2; &url_bar_mic_text2; + &search_widget_default_text; + &search_widget_default_cropped_text; + &search_widget_logo_description; + https://support.mozilla.org/1/mobile/&formatS1;/&formatS2;/&formatS3;/mobile-help &help_menu; diff --git a/mobile/android/services/src/main/res/layout/widget_search_1_col_layout.xml b/mobile/android/services/src/main/res/layout/widget_search_1_col_layout.xml new file mode 100644 index 000000000000..b31411689d88 --- /dev/null +++ b/mobile/android/services/src/main/res/layout/widget_search_1_col_layout.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + diff --git a/mobile/android/services/src/main/res/layout/widget_search_2_col_layout.xml b/mobile/android/services/src/main/res/layout/widget_search_2_col_layout.xml new file mode 100644 index 000000000000..92dd4f450096 --- /dev/null +++ b/mobile/android/services/src/main/res/layout/widget_search_2_col_layout.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + diff --git a/mobile/android/services/src/main/res/layout/widget_search_3_col_layout.xml b/mobile/android/services/src/main/res/layout/widget_search_3_col_layout.xml new file mode 100644 index 000000000000..215d5904d9b8 --- /dev/null +++ b/mobile/android/services/src/main/res/layout/widget_search_3_col_layout.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + diff --git a/mobile/android/services/src/main/res/layout/widget_search_4_col_layout.xml b/mobile/android/services/src/main/res/layout/widget_search_4_col_layout.xml new file mode 100644 index 000000000000..9495a97eb240 --- /dev/null +++ b/mobile/android/services/src/main/res/layout/widget_search_4_col_layout.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + diff --git a/mobile/android/services/src/main/res/layout/widget_search_5_col_layout.xml b/mobile/android/services/src/main/res/layout/widget_search_5_col_layout.xml new file mode 100644 index 000000000000..834cc94dad9a --- /dev/null +++ b/mobile/android/services/src/main/res/layout/widget_search_5_col_layout.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + +