Bug 1270641 - Choose winner of expanded-firstrun. r=ahunt draft
authorChenxia Liu <liuche@mozilla.com>
Thu, 26 May 2016 14:38:40 -0700
changeset 371828 d278663d315ffa68c441136780f098f74d444add
parent 371827 abce57bf965ba789f1ae52cf5865d60177132385
child 522022 cc3b9f01d323b40cea67712e80628fd6fc9d3198
push id19358
push usercliu@mozilla.com
push dateThu, 26 May 2016 21:42:05 +0000
reviewersahunt
bugs1270641
milestone48.0a2
Bug 1270641 - Choose winner of expanded-firstrun. r=ahunt MozReview-Commit-ID: 7Ay3YDR4KgU
mobile/android/base/java/org/mozilla/gecko/firstrun/FirstrunAnimationContainer.java
mobile/android/base/java/org/mozilla/gecko/firstrun/FirstrunPagerConfig.java
mobile/android/base/java/org/mozilla/gecko/firstrun/WelcomePanel.java
mobile/android/base/java/org/mozilla/gecko/util/Experiments.java
mobile/android/base/java/org/mozilla/gecko/util/UnusedResourcesUtil.java
mobile/android/base/locales/en-US/android_strings.dtd
mobile/android/base/moz.build
mobile/android/base/resources/drawable-large-hdpi-v11/firstrun_background_coffee.png
mobile/android/base/resources/drawable-large-xhdpi-v11/firstrun_background_coffee.png
mobile/android/base/resources/drawable-large-xxhdpi-v11/firstrun_background_coffee.png
mobile/android/base/resources/drawable-nodpi/firstrun_background_coffee.png
mobile/android/base/resources/layout/firstrun_welcome_fragment.xml
mobile/android/base/resources/values-large-v11/dimens.xml
mobile/android/base/resources/values/dimens.xml
mobile/android/base/strings.xml.in
--- a/mobile/android/base/java/org/mozilla/gecko/firstrun/FirstrunAnimationContainer.java
+++ b/mobile/android/base/java/org/mozilla/gecko/firstrun/FirstrunAnimationContainer.java
@@ -59,18 +59,16 @@ public class FirstrunAnimationContainer 
     public void hide() {
         visible = false;
         if (onFinishListener != null) {
             onFinishListener.onFinish();
         }
         animateHide();
 
         // Stop all versions of firstrun A/B sessions.
-        Telemetry.stopUISession(TelemetryContract.Session.EXPERIMENT, Experiments.ONBOARDING2_A);
-        Telemetry.stopUISession(TelemetryContract.Session.EXPERIMENT, Experiments.ONBOARDING2_B);
         Telemetry.stopUISession(TelemetryContract.Session.EXPERIMENT, Experiments.ONBOARDING2_C);
     }
 
     private void animateHide() {
         final Animator alphaAnimator = ObjectAnimator.ofFloat(this, "alpha", 0);
         alphaAnimator.setDuration(150);
         alphaAnimator.addListener(new AnimatorListenerAdapter() {
             @Override
--- a/mobile/android/base/java/org/mozilla/gecko/firstrun/FirstrunPagerConfig.java
+++ b/mobile/android/base/java/org/mozilla/gecko/firstrun/FirstrunPagerConfig.java
@@ -22,44 +22,27 @@ public class FirstrunPagerConfig {
 
     public static final String KEY_IMAGE = "imageRes";
     public static final String KEY_TEXT = "textRes";
     public static final String KEY_SUBTEXT = "subtextRes";
 
    public static List<FirstrunPanelConfig> getDefault(Context context) {
         final List<FirstrunPanelConfig> panels = new LinkedList<>();
 
-        if (Experiments.isInExperimentLocal(context, Experiments.ONBOARDING2_A)) {
-            panels.add(new FirstrunPanelConfig(WelcomePanel.class.getName(), WelcomePanel.TITLE_RES));
-            Telemetry.startUISession(TelemetryContract.Session.EXPERIMENT, Experiments.ONBOARDING2_A);
-            GeckoSharedPrefs.forProfile(context).edit().putString(Experiments.PREF_ONBOARDING_VERSION, Experiments.ONBOARDING2_A).apply();
-        } else if (Experiments.isInExperimentLocal(context, Experiments.ONBOARDING2_B)) {
-            panels.add(SimplePanelConfigs.urlbarPanelConfig);
-            panels.add(SimplePanelConfigs.bookmarksPanelConfig);
-            panels.add(SimplePanelConfigs.syncPanelConfig);
-            panels.add(new FirstrunPanelConfig(SyncPanel.class.getName(), SyncPanel.TITLE_RES));
-            Telemetry.startUISession(TelemetryContract.Session.EXPERIMENT, Experiments.ONBOARDING2_B);
-            GeckoSharedPrefs.forProfile(context).edit().putString(Experiments.PREF_ONBOARDING_VERSION, Experiments.ONBOARDING2_B).apply();
-        } else if (Experiments.isInExperimentLocal(context, Experiments.ONBOARDING2_C)) {
-            panels.add(SimplePanelConfigs.urlbarPanelConfig);
-            panels.add(SimplePanelConfigs.bookmarksPanelConfig);
-            panels.add(SimplePanelConfigs.dataPanelConfig);
-            panels.add(SimplePanelConfigs.syncPanelConfig);
-            panels.add(new FirstrunPanelConfig(SyncPanel.class.getName(), SyncPanel.TITLE_RES));
-            Telemetry.startUISession(TelemetryContract.Session.EXPERIMENT, Experiments.ONBOARDING2_C);
-            GeckoSharedPrefs.forProfile(context).edit().putString(Experiments.PREF_ONBOARDING_VERSION, Experiments.ONBOARDING2_C).apply();
-        } else {
-            Log.d(LOGTAG, "Not in an experiment!");
-            panels.add(new FirstrunPanelConfig(WelcomePanel.class.getName(), WelcomePanel.TITLE_RES));
-        }
+        panels.add(SimplePanelConfigs.urlbarPanelConfig);
+        panels.add(SimplePanelConfigs.bookmarksPanelConfig);
+        panels.add(SimplePanelConfigs.dataPanelConfig);
+        panels.add(SimplePanelConfigs.syncPanelConfig);
+        panels.add(new FirstrunPanelConfig(SyncPanel.class.getName(), SyncPanel.TITLE_RES));
+        Telemetry.startUISession(TelemetryContract.Session.EXPERIMENT, "onboarding2-c");
+        GeckoSharedPrefs.forProfile(context).edit().putString(Experiments.PREF_ONBOARDING_VERSION, Experiments.ONBOARDING2_C).apply();
 
         return panels;
     }
 
-
     public static List<FirstrunPanelConfig> getRestricted() {
         final List<FirstrunPanelConfig> panels = new LinkedList<>();
         panels.add(new FirstrunPanelConfig(RestrictedWelcomePanel.class.getName(), RestrictedWelcomePanel.TITLE_RES));
         return panels;
     }
 
     public static class FirstrunPanelConfig {
 
deleted file mode 100644
--- a/mobile/android/base/java/org/mozilla/gecko/firstrun/WelcomePanel.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
- * 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/. */
-
-package org.mozilla.gecko.firstrun;
-
-import android.content.Intent;
-import android.os.Bundle;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ImageView;
-import org.mozilla.gecko.R;
-import org.mozilla.gecko.Telemetry;
-import org.mozilla.gecko.TelemetryContract;
-import org.mozilla.gecko.fxa.FxAccountConstants;
-import org.mozilla.gecko.fxa.activities.FxAccountWebFlowActivity;
-
-public class WelcomePanel extends FirstrunPanel {
-    public static final int TITLE_RES = R.string.firstrun_panel_title_welcome;
-
-    @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstance) {
-        final ViewGroup root = (ViewGroup) inflater.inflate(R.layout.firstrun_welcome_fragment, container, false);
-        root.findViewById(R.id.welcome_account).setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.BUTTON, "firstrun-sync");
-                showBrowserHint = false;
-
-                final Intent intent = new Intent(FxAccountConstants.ACTION_FXA_GET_STARTED);
-                intent.putExtra(FxAccountWebFlowActivity.EXTRA_ENDPOINT, FxAccountConstants.ENDPOINT_FIRSTRUN);
-                intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
-                startActivity(intent);
-
-                close();
-            }
-        });
-
-        root.findViewById(R.id.welcome_browse).setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.BUTTON, "firstrun-browser");
-                close();
-            }
-        });
-
-        return root;
-    }
-}
--- a/mobile/android/base/java/org/mozilla/gecko/util/Experiments.java
+++ b/mobile/android/base/java/org/mozilla/gecko/util/Experiments.java
@@ -30,20 +30,16 @@ public class Experiments {
     // Show a system notification linking to a "What's New" page on app update.
     public static final String WHATSNEW_NOTIFICATION = "whatsnew-notification";
 
     // Subscribe to known, bookmarked sites and show a notification if new content is available.
     public static final String CONTENT_NOTIFICATIONS_12HRS = "content-notifications-12hrs";
     public static final String CONTENT_NOTIFICATIONS_8AM = "content-notifications-8am";
     public static final String CONTENT_NOTIFICATIONS_5PM = "content-notifications-5pm";
 
-    // Onboarding: "Features and Story". These experiments are determined
-    // on the client, they are not part of the server config.
-    public static final String ONBOARDING2_A = "onboarding2-a"; // Control: Single (blue) welcome screen
-    public static final String ONBOARDING2_B = "onboarding2-b"; // 4 static Feature slides
     public static final String ONBOARDING2_C = "onboarding2-c"; // 4 static + 1 clickable (Data saving) Feature slides
 
     // Synchronizing the catalog of downloadable content from Kinto
     public static final String DOWNLOAD_CONTENT_CATALOG_SYNC = "download-content-catalog-sync";
 
     // Promotion for "Add to homescreen"
     public static final String PROMOTE_ADD_TO_HOMESCREEN = "promote-add-to-homescreen";
 
@@ -87,25 +83,17 @@ public class Experiments {
     }
 
     /**
      * Returns if a user is in certain local experiment.
      * @param experiment Name of experiment to look up
      * @return returns value for experiment or false if experiment does not exist.
      */
     public static boolean isInExperimentLocal(Context context, String experiment) {
-        if (SwitchBoard.isInBucket(context, 0, 33)) {
-            return Experiments.ONBOARDING2_A.equals(experiment);
-        } else if (SwitchBoard.isInBucket(context, 33, 66)) {
-            return Experiments.ONBOARDING2_B.equals(experiment);
-        } else if (SwitchBoard.isInBucket(context, 66, 100)) {
-            return Experiments.ONBOARDING2_C.equals(experiment);
-        } else {
-            return false;
-        }
+        return Experiments.ONBOARDING2_C.equals(experiment);
     }
 
     /**
      * Returns list of all active experiments, remote and local.
      * @return List of experiment names Strings
      */
     public static List<String> getActiveExperiments(Context c) {
         final List<String> experiments = new LinkedList<>();
--- a/mobile/android/base/java/org/mozilla/gecko/util/UnusedResourcesUtil.java
+++ b/mobile/android/base/java/org/mozilla/gecko/util/UnusedResourcesUtil.java
@@ -8,16 +8,20 @@ import org.mozilla.gecko.R;
  */
 @SuppressWarnings("unused")
 final class UnusedResourcesUtil {
     public static final int[] CONSTANTS = {
             R.dimen.match_parent,
             R.dimen.wrap_content,
     };
 
+    public static final int[] USED_IN_BRANDING = {
+            R.drawable.large_icon
+    };
+
     public static final int[] USED_IN_COLOR_PALETTE = {
             R.color.private_browsing_purple, // This will be used eventually, then this item removed.
     };
 
     public static final int[] USED_IN_CRASH_REPORTER = {
             R.string.crash_allow_contact2,
             R.string.crash_close_label,
             R.string.crash_comment,
--- a/mobile/android/base/locales/en-US/android_strings.dtd
+++ b/mobile/android/base/locales/en-US/android_strings.dtd
@@ -1,15 +1,13 @@
 <!-- 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/. -->
 
 <!ENTITY firstrun_panel_title_welcome "Welcome">
-<!ENTITY  onboard_start_message3 "Browse with &brandShortName;">
-<!ENTITY  onboard_start_subtext3 "Make your mobile Web browsing experience truly your own.">
 
 <!ENTITY firstrun_urlbar_message "Welcome to &brandShortName;">
 <!ENTITY firstrun_urlbar_subtext "Find things faster with helpful search suggestion shortcuts.">
 <!ENTITY firstrun_bookmarks_title "History">
 <!ENTITY firstrun_bookmarks_message "Your faves, front and center">
 <!ENTITY firstrun_bookmarks_subtext "Get results from your bookmarks and history when you search.">
 <!ENTITY firstrun_data_title "Data">
 <!ENTITY firstrun_data_message "Less data, more savings">
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -302,17 +302,16 @@ gbjar.sources += ['java/org/mozilla/geck
     'FindInPageBar.java',
     'firstrun/DataPanel.java',
     'firstrun/FirstrunAnimationContainer.java',
     'firstrun/FirstrunPager.java',
     'firstrun/FirstrunPagerConfig.java',
     'firstrun/FirstrunPanel.java',
     'firstrun/RestrictedWelcomePanel.java',
     'firstrun/SyncPanel.java',
-    'firstrun/WelcomePanel.java',
     'FormAssistPopup.java',
     'GeckoAccessibility.java',
     'GeckoActivity.java',
     'GeckoActivityStatus.java',
     'GeckoApp.java',
     'GeckoApplication.java',
     'GeckoAppShell.java',
     'GeckoBatteryManager.java',
deleted file mode 100644
index e25e7a962e0fd373a6544689ba66b1bf8d4832e7..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 48b2fc7abe80e7e8464f3813874563821a8e5b08..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index eb7701079520bb6edeec5cc654b87f899441505e..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 770eeae967efcb4c022de61f84364d90c4594751..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/mobile/android/base/resources/layout/firstrun_welcome_fragment.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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/. -->
-
-
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-            android:layout_height="wrap_content"
-            android:layout_width="match_parent"
-            android:orientation="vertical"
-            android:fillViewport="true">
-
-    <LinearLayout android:layout_width="match_parent"
-                  android:layout_height="wrap_content"
-                  android:minHeight="248dp"
-                  android:background="@color/android:white"
-                  android:gravity="center_horizontal"
-                  android:orientation="vertical">
-
-        <FrameLayout android:layout_width="match_parent"
-                     android:layout_height="wrap_content"
-                     android:background="@color/link_blue">
-
-            <ImageView android:layout_width="wrap_content"
-                       android:layout_height="248dp"
-                       android:scaleType="fitCenter"
-                       android:layout_gravity="center"
-                       android:adjustViewBounds="true"
-                       android:src="@drawable/firstrun_background_coffee"/>
-
-            <ImageView android:layout_width="@dimen/firstrun_brand_size"
-                       android:layout_height="@dimen/firstrun_brand_size"
-                       android:src="@drawable/large_icon"
-                       android:layout_gravity="center"/>
-        </FrameLayout>
-
-        <TextView android:layout_width="@dimen/firstrun_content_width"
-                  android:layout_height="wrap_content"
-                  android:gravity="center"
-                  android:paddingTop="30dp"
-                  android:textAppearance="@style/TextAppearance.FirstrunLight.Main"
-                  android:text="@string/firstrun_welcome_message"/>
-
-        <TextView android:layout_width="@dimen/firstrun_content_width"
-                  android:layout_height="wrap_content"
-                  android:paddingTop="20dp"
-                  android:paddingBottom="30dp"
-                  android:gravity="center"
-                  android:textAppearance="@style/TextAppearance.FirstrunRegular.Body"
-                  android:text="@string/firstrun_welcome_subtext"/>
-
-        <Button android:id="@+id/welcome_account"
-                style="@style/Widget.Firstrun.Button"
-                android:background="@drawable/button_background_action_orange_round"
-                android:layout_gravity="center"
-                android:text="@string/firstrun_signin_button"/>
-
-        <TextView android:id="@+id/welcome_browse"
-                  android:layout_width="wrap_content"
-                  android:layout_height="wrap_content"
-                  android:padding="20dp"
-                  android:gravity="center"
-                  android:textAppearance="@style/TextAppearance.FirstrunRegular.Link"
-                  android:text="@string/firstrun_welcome_button_browser"/>
-    </LinearLayout>
-</ScrollView>
--- a/mobile/android/base/resources/values-large-v11/dimens.xml
+++ b/mobile/android/base/resources/values-large-v11/dimens.xml
@@ -19,17 +19,16 @@
 
     <dimen name="browser_toolbar_site_security_height">60dp</dimen>
     <dimen name="browser_toolbar_site_security_width">34dp</dimen>
     <dimen name="browser_toolbar_site_security_margin_right">1dp</dimen>
     <!-- We primarily use padding (instead of margins) to increase the hit area. -->
     <dimen name="browser_toolbar_site_security_padding_vertical">21dp</dimen>
     <dimen name="browser_toolbar_site_security_padding_horizontal">8dp</dimen>
 
-    <dimen name="firstrun_brand_size">72dp</dimen>
     <dimen name="firstrun_background_height">300dp</dimen>
 
     <dimen name="tabs_panel_indicator_width">72dp</dimen>
     <dimen name="tabs_panel_button_width">60dp</dimen>
     <dimen name="panel_grid_view_column_width">200dp</dimen>
 
     <dimen name="overlay_prompt_container_width">360dp</dimen>
 
--- a/mobile/android/base/resources/values/dimens.xml
+++ b/mobile/android/base/resources/values/dimens.xml
@@ -55,17 +55,16 @@
          redesign sometime after this is written) you should increase this value to the largest
          commonly-used size of favicon and, performance permitting, fetch the remainder from the
          database. The largest available size is always stored in the database, regardless of this
          value.-->
     <dimen name="favicon_largest_interesting_size">32dp</dimen>
 
     <dimen name="firstrun_content_width">300dp</dimen>
     <dimen name="firstrun_min_height">180dp</dimen>
-    <dimen name="firstrun_brand_size">48dp</dimen>
     <dimen name="firstrun_background_height">180dp</dimen>
 
     <dimen name="overlay_prompt_content_width">260dp</dimen>
     <dimen name="overlay_prompt_button_width">148dp</dimen>
     <dimen name="overlay_prompt_container_width">@dimen/match_parent</dimen>
 
     <!-- Site security icon -->
     <dimen name="browser_toolbar_site_security_height">32dp</dimen>
--- a/mobile/android/base/strings.xml.in
+++ b/mobile/android/base/strings.xml.in
@@ -25,18 +25,16 @@
   <string name="moz_android_shared_fxaccount_type">@ANDROID_PACKAGE_NAME@_fxaccount</string>
   <string name="android_package_name_for_ui">@ANDROID_PACKAGE_NAME@</string>
 
 #include ../search/strings/search_strings.xml.in
 
 #include ../services/strings.xml.in
 
   <string name="firstrun_panel_title_welcome">&firstrun_panel_title_welcome;</string>
-  <string name="firstrun_welcome_message">&onboard_start_message3;</string>
-  <string name="firstrun_welcome_subtext">&onboard_start_subtext3;</string>
 
   <string name="firstrun_urlbar_message">&firstrun_urlbar_message;</string>
   <string name="firstrun_urlbar_subtext">&firstrun_urlbar_subtext;</string>
   <string name="firstrun_bookmarks_title">&firstrun_bookmarks_title;</string>
   <string name="firstrun_bookmarks_message">&firstrun_bookmarks_message;</string>
   <string name="firstrun_bookmarks_subtext">&firstrun_bookmarks_subtext;</string>
   <string name="firstrun_data_title">&firstrun_data_title;</string>
   <string name="firstrun_data_message">&firstrun_data_message;</string>