Bug 708707: Fennec home screen widget. [r=mfinkle]
authorSriram Ramasubramanian <sriram@mozilla.com>
Fri, 19 Oct 2012 11:15:06 -0700
changeset 110809 d7464788b572006177f882d857ec143c5d32b34c
parent 110808 f0dbdf4d4768afd6d40a0c015c3a47767e8098df
child 110810 be7c882f0f851f2a51798819cb331bbdd571487d
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersmfinkle
bugs708707
milestone19.0a1
Bug 708707: Fennec home screen widget. [r=mfinkle]
mobile/android/base/AndroidManifest.xml.in
mobile/android/base/GeckoApp.java
mobile/android/base/GeckoAppWidgetProvider.java.in
mobile/android/base/Makefile.in
mobile/android/base/resources/drawable-hdpi/appwidget_bg.9.png
mobile/android/base/resources/drawable-xhdpi/appwidget_bg.9.png
mobile/android/base/resources/drawable/appwidget_bg.9.png
mobile/android/base/resources/layout/gecko_appwidget.xml
mobile/android/base/resources/values-v11/dimens.xml
mobile/android/base/resources/values/dimens.xml
mobile/android/base/resources/xml/gecko_appwidget_info.xml
--- a/mobile/android/base/AndroidManifest.xml.in
+++ b/mobile/android/base/AndroidManifest.xml.in
@@ -156,16 +156,25 @@
         </receiver>
 
         <receiver android:name="org.mozilla.gecko.ReferrerReceiver" android:exported="true">
             <intent-filter>
                 <action android:name="com.android.vending.INSTALL_REFERRER" />
             </intent-filter>
         </receiver>
 
+        <receiver android:name="GeckoAppWidgetProvider"
+                  android:label="@MOZ_APP_DISPLAYNAME@">
+            <intent-filter>
+                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
+            </intent-filter>
+            <meta-data android:name="android.appwidget.provider"
+                       android:resource="@xml/gecko_appwidget_info" />
+        </receiver>
+
         <activity android:name="Restarter"
                   android:process="@ANDROID_PACKAGE_NAME@Restarter"
                   android:theme="@style/Gecko">
           <intent-filter>
             <action android:name="org.mozilla.gecko.restart"/>
             <action android:name="org.mozilla.gecko.restart_update"/>
           </intent-filter>
         </activity>
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -135,16 +135,17 @@ abstract public class GeckoApp
     public static final String ACTION_ALERT_CLEAR   = "org.mozilla.gecko.ACTION_ALERT_CLEAR";
     public static final String ACTION_ALERT_CALLBACK = "org.mozilla.gecko.ACTION_ALERT_CALLBACK";
     public static final String ACTION_ANNOUNCEMENTS_PREF = "org.mozilla.gecko.ANNOUNCEMENTS_PREF";
     public static final String ACTION_WEBAPP_PREFIX = "org.mozilla.gecko.WEBAPP";
     public static final String ACTION_DEBUG         = "org.mozilla.gecko.DEBUG";
     public static final String ACTION_BOOKMARK      = "org.mozilla.gecko.BOOKMARK";
     public static final String ACTION_LOAD          = "org.mozilla.gecko.LOAD";
     public static final String ACTION_INIT_PW       = "org.mozilla.gecko.INIT_PW";
+    public static final String ACTION_WIDGET        = "org.mozilla.gecko.WIDGET";
     public static final String SAVED_STATE_TITLE         = "title";
     public static final String SAVED_STATE_IN_BACKGROUND = "inBackground";
     public static final String SAVED_STATE_PRIVATE_SESSION = "privateSession";
 
     public static final String PREFS_NAME          = "GeckoApp";
     public static final String PREFS_OOM_EXCEPTION = "OOMException";
     public static final String PREFS_WAS_STOPPED   = "wasStopped";
 
@@ -1992,16 +1993,19 @@ abstract public class GeckoApp
                 if (alertName == null)
                     alertName = "";
                 alertCookie = data.getQueryParameter("cookie");
                 if (alertCookie == null)
                     alertCookie = "";
             }
             handleNotification(ACTION_ALERT_CALLBACK, alertName, alertCookie);
         }
+        else if (ACTION_WIDGET.equals(action)) {
+            addTab();
+        }
     }
 
     /*
      * Handles getting a uri from and intent in a way that is backwards
      * compatable with our previous implementations
      */
     protected String getURIFromIntent(Intent intent) {
         final String action = intent.getAction();
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/GeckoAppWidgetProvider.java.in
@@ -0,0 +1,45 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#filter substitution
+package @ANDROID_PACKAGE_NAME@;
+
+import org.mozilla.gecko.GeckoApp;
+
+import android.appwidget.AppWidgetManager;
+import android.appwidget.AppWidgetProvider;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.app.PendingIntent;
+import android.widget.RemoteViews;
+
+import org.mozilla.gecko.R;
+
+public class GeckoAppWidgetProvider extends AppWidgetProvider {
+
+    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
+        for (int i=0; i < appWidgetIds.length; i++) {
+            int appWidgetId = appWidgetIds[i];
+
+            // Launch the AwesomeScreen on tapping the URL bar.
+            Intent awesomeBarIntent = new Intent();
+            awesomeBarIntent.setComponent(new ComponentName("@ANDROID_PACKAGE_NAME@", "@ANDROID_PACKAGE_NAME@.App"));
+            awesomeBarIntent.setAction(GeckoApp.ACTION_WIDGET);
+            PendingIntent pendingAwesomeBarIntent = PendingIntent.getActivity(context, 0, awesomeBarIntent, 0);
+
+            // Launch the App on tapping the icon.
+            Intent iconIntent = new Intent();
+            iconIntent.setComponent(new ComponentName("@ANDROID_PACKAGE_NAME@", "@ANDROID_PACKAGE_NAME@.App"));
+            PendingIntent pendingIconIntent = PendingIntent.getActivity(context, 0, iconIntent, 0);
+
+            RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.gecko_appwidget);
+            views.setOnClickPendingIntent(R.id.awesome_bar, pendingAwesomeBarIntent);
+            views.setOnClickPendingIntent(R.id.icon, pendingIconIntent);
+
+            // Update the view.
+            appWidgetManager.updateAppWidget(appWidgetId, views);
+        }
+    }
+}
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -186,16 +186,17 @@ endif
 
 FENNEC_PP_JAVA_FILES = \
   App.java \
   AboutHomeContent.java \
   MarketplaceApp.java \
   WebApp.java \
   WebApps.java \
   GeckoActivity.java \
+  GeckoAppWidgetProvider.java \
   LauncherShortcuts.java \
   NotificationHandler.java \
   Restarter.java \
   db/BrowserContract.java \
   db/BrowserProvider.java \
   db/PasswordsProvider.java \
   db/FormHistoryProvider.java \
   db/TabsProvider.java \
@@ -342,16 +343,17 @@ RES_LAYOUT = \
   res/layout/awesomebar_tab_indicator.xml \
   res/layout/awesomebar_tabs.xml \
   res/layout/bookmark_edit.xml \
   res/layout/datetime_picker.xml \
   res/layout/doorhangerpopup.xml \
   res/layout/doorhanger.xml \
   res/layout/find_in_page_content.xml \
   res/layout/font_size_preference.xml \
+  res/layout/gecko_appwidget.xml \
   res/layout/web_app.xml \
   res/layout/launch_app_list.xml \
   res/layout/launch_app_listitem.xml \
   res/layout/menu_action_bar.xml \
   res/layout/menu_item.xml \
   res/layout/menu_popup.xml \
   res/layout/notification_icon_text.xml \
   res/layout/notification_progress.xml \
@@ -434,16 +436,17 @@ RES_VALUES_XLARGE_V11 = \
   res/values-xlarge-v11/styles.xml \
   $(NULL)
 
 RES_VALUES_LAND_V14 = \
   res/values-land-v14/dimens.xml \
   $(NULL)
 
 RES_XML = \
+        res/xml/gecko_appwidget_info.xml \
 	$(SYNC_RES_XML) \
 	$(NULL)
 
 RES_ANIM = \
   res/anim/grow_fade_in.xml \
   res/anim/grow_fade_in_center.xml \
   res/anim/shrink_fade_out.xml \
   $(NULL)
@@ -464,16 +467,17 @@ RES_DRAWABLE_BASE = \
   res/drawable/abouthome_promo_logo_apps.png \
   res/drawable/abouthome_promo_logo_sync.png \
   res/drawable/abouthome_thumbnail.png \
   res/drawable/abouthome_thumbnail_bg.png \
   res/drawable/address_bar_bg_shadow.png \
   res/drawable/alert_addon.png \
   res/drawable/alert_app.png \
   res/drawable/alert_download.png \
+  res/drawable/appwidget_bg.9.png \
   res/drawable/awesomebar_tab_center.9.png \
   res/drawable/awesomebar_tab_left.9.png \
   res/drawable/awesomebar_tab_right.9.png \
   res/drawable/ic_addons_empty.png \
   res/drawable/ic_awesomebar_go.png \
   res/drawable/ic_awesomebar_reader.png \
   res/drawable/ic_awesomebar_search.png \
   res/drawable/ic_awesomebar_star.png \
@@ -545,16 +549,17 @@ RES_DRAWABLE_HDPI = \
   res/drawable-hdpi/abouthome_promo_logo_apps.png \
   res/drawable-hdpi/abouthome_promo_logo_sync.png \
   res/drawable-hdpi/abouthome_thumbnail.png \
   res/drawable-hdpi/abouthome_thumbnail_bg.png \
   res/drawable-hdpi/address_bar_bg_shadow.png \
   res/drawable-hdpi/alert_addon.png \
   res/drawable-hdpi/alert_app.png \
   res/drawable-hdpi/alert_download.png \
+  res/drawable-hdpi/appwidget_bg.9.png \
   res/drawable-hdpi/awesomebar_tab_center.9.png \
   res/drawable-hdpi/awesomebar_tab_left.9.png \
   res/drawable-hdpi/awesomebar_tab_right.9.png \
   res/drawable-hdpi/ic_addons_empty.png \
   res/drawable-hdpi/ic_awesomebar_go.png \
   res/drawable-hdpi/ic_awesomebar_reader.png \
   res/drawable-hdpi/ic_awesomebar_search.png \
   res/drawable-hdpi/ic_awesomebar_star.png \
@@ -611,16 +616,17 @@ RES_DRAWABLE_XHDPI = \
   res/drawable-xhdpi/abouthome_thumbnail_bg.png \
   res/drawable-xhdpi/address_bar_bg_shadow.png \
   res/drawable-xhdpi/address_bar_texture_port.png \
   res/drawable-xhdpi/address_bar_url_default.9.png \
   res/drawable-xhdpi/address_bar_url_pressed.9.png \
   res/drawable-xhdpi/alert_addon.png \
   res/drawable-xhdpi/alert_app.png \
   res/drawable-xhdpi/alert_download.png \
+  res/drawable-xhdpi/appwidget_bg.9.png \
   res/drawable-xhdpi/awesomebar_tab_center.9.png \
   res/drawable-xhdpi/awesomebar_tab_left.9.png \
   res/drawable-xhdpi/awesomebar_tab_right.9.png \
   res/drawable-xhdpi/ic_addons_empty.png \
   res/drawable-xhdpi/ic_awesomebar_go.png \
   res/drawable-xhdpi/ic_awesomebar_reader.png \
   res/drawable-xhdpi/ic_awesomebar_search.png \
   res/drawable-xhdpi/ic_awesomebar_star.png \
new file mode 100644
index 0000000000000000000000000000000000000000..164bdf246c0d527c135c3f575edd4f549b8bd49d
GIT binary patch
literal 1634
zc$@)Z2A%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Ir659oQ;n_C)ML8slkMPC8*N
zxV<;|c5x%Z*^Fu#$DEi)8aa_0@KTyT3Hao`x#az6Z%s9n%P6_>rh(O^S6ap835(5t
Y0WwEzNb9y3egFUf07*qoM6N<$f`otH!vFvP
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/resources/layout/gecko_appwidget.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+                android:layout_width="fill_parent"
+                android:layout_height="54dp"
+                android:paddingLeft="@dimen/widget_padding"
+                android:paddingRight="@dimen/widget_padding"
+                android:gravity="center_vertical"
+                android:layout_gravity="center_vertical">
+
+    <LinearLayout android:layout_width="fill_parent"
+                  android:layout_height="48dp"
+                  android:layout_marginTop="3dp"
+                  android:layout_marginLeft="25dp"
+                  android:layout_alignParentTop="true"
+                  android:orientation="horizontal"
+                  android:background="@drawable/appwidget_bg"
+                  android:layout_gravity="center_vertical">
+
+        <Button android:id="@+id/awesome_bar"
+                android:layout_width="fill_parent"
+                android:layout_height="36dp"
+                android:layout_marginTop="2dp"
+                android:layout_marginBottom="2dp"
+                android:layout_marginLeft="4dp"
+                android:layout_marginRight="4dp"
+                android:background="@drawable/address_bar_url"
+                android:singleLine="true"
+                android:gravity="center_vertical|left"
+                android:hint="@string/awesomebar_default_text"
+                android:textSize="16sp"
+                android:textColor="#222222"
+                android:paddingLeft="25dp"
+                android:paddingRight="10dp"/>
+
+     </LinearLayout>
+
+     <ImageButton android:id="@+id/icon"
+                  android:layout_width="54dp"
+                  android:layout_height="54dp"
+                  android:background="@drawable/widget_icon"
+                  android:scaleType="fitXY"
+                  android:layout_marginTop="-2dp"
+                  android:layout_alignParentTop="true" />
+
+</RelativeLayout>
--- a/mobile/android/base/resources/values-v11/dimens.xml
+++ b/mobile/android/base/resources/values-v11/dimens.xml
@@ -2,10 +2,11 @@
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <resources>
 
     <dimen name="tabs_counter_size">22sp</dimen>
     <dimen name="menu_popup_arrow_margin">5dip</dimen>
+    <dimen name="widget_padding">0dp</dimen>
 
 </resources>
--- a/mobile/android/base/resources/values/dimens.xml
+++ b/mobile/android/base/resources/values/dimens.xml
@@ -38,10 +38,11 @@
     <dimen name="tab_thumbnail_width">136dp</dimen>
     <dimen name="tabs_counter_size">22sp</dimen>
     <dimen name="tabs_list_divider_height">2dp</dimen>
     <dimen name="text_selection_handle_width">30dp</dimen>
     <dimen name="text_selection_handle_height">44dp</dimen>
     <dimen name="text_selection_handle_shadow">2dp</dimen>
     <dimen name="validation_message_height">50dp</dimen>
     <dimen name="validation_message_margin_top">6dp</dimen>
+    <dimen name="widget_padding">8dp</dimen>
 
 </resources>
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/resources/xml/gecko_appwidget_info.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
+                    android:minWidth="270dp"
+                    android:minHeight="54dp"
+                    android:initialLayout="@layout/gecko_appwidget"
+                    android:resizeMode="horizontal"/>