Bug 1098667 - Part 2: Add "Finish migrating" view to Remote Tabs home panel. r=rnewman
authorNick Alexander <nalexander@mozilla.com>
Tue, 25 Nov 2014 17:04:55 -0800
changeset 243921 3397a68199cc4cd46fdb217f00dd2237807a5683
parent 243920 ae7ca57ce7609cabeed7cbb87bb6cdf23d174ea1
child 243922 55313b1290fcd87d41530827b6054261c6ce840d
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs1098667
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1098667 - Part 2: Add "Finish migrating" view to Remote Tabs home panel. r=rnewman
mobile/android/base/home/RemoteTabsPanel.java
mobile/android/base/home/RemoteTabsStaticFragment.java
mobile/android/base/locales/en-US/android_strings.dtd
mobile/android/base/resources/layout/remote_tabs_needs_finish_migrating.xml
mobile/android/base/strings.xml.in
--- a/mobile/android/base/home/RemoteTabsPanel.java
+++ b/mobile/android/base/home/RemoteTabsPanel.java
@@ -152,16 +152,18 @@ public class RemoteTabsPanel extends Hom
         case None:
             return new RemoteTabsExpandableListFragment();
         case NeedsVerification:
             return RemoteTabsStaticFragment.newInstance(R.layout.remote_tabs_needs_verification);
         case NeedsPassword:
             return RemoteTabsStaticFragment.newInstance(R.layout.remote_tabs_needs_password);
         case NeedsUpgrade:
             return RemoteTabsStaticFragment.newInstance(R.layout.remote_tabs_needs_upgrade);
+        case NeedsFinishMigrating:
+            return RemoteTabsStaticFragment.newInstance(R.layout.remote_tabs_needs_finish_migrating);
         default:
             // This should never happen, but we're confident we have a Firefox
             // Account at this point, so let's show the needs password screen.
             // That's our best hope of righting the ship.
             Log.wtf(LOGTAG, "Got unexpected action needed; offering needs password.");
             return RemoteTabsStaticFragment.newInstance(R.layout.remote_tabs_needs_password);
         }
     }
--- a/mobile/android/base/home/RemoteTabsStaticFragment.java
+++ b/mobile/android/base/home/RemoteTabsStaticFragment.java
@@ -5,16 +5,17 @@
 package org.mozilla.gecko.home;
 
 import java.util.EnumSet;
 import java.util.Locale;
 
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.fxa.FirefoxAccounts;
 import org.mozilla.gecko.fxa.activities.FxAccountCreateAccountActivity;
+import org.mozilla.gecko.fxa.activities.FxAccountFinishMigratingActivity;
 import org.mozilla.gecko.fxa.activities.FxAccountUpdateCredentialsActivity;
 import org.mozilla.gecko.home.HomePager.OnUrlOpenListener;
 
 import android.content.Intent;
 import android.os.Bundle;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View.OnClickListener;
@@ -85,17 +86,18 @@ public class RemoteTabsStaticFragment ex
 
     @Override
     public void onViewCreated(View view, Bundle savedInstanceState) {
         for (int resourceId : new int[] {
                 R.id.remote_tabs_setup_get_started,
                 R.id.remote_tabs_setup_old_sync_link,
                 R.id.remote_tabs_needs_verification_resend_email,
                 R.id.remote_tabs_needs_verification_help,
-                R.id.remote_tabs_needs_password_sign_in, }) {
+                R.id.remote_tabs_needs_password_sign_in,
+                R.id.remote_tabs_needs_finish_migrating_sign_in, }) {
             maybeSetOnClickListener(view, resourceId);
         }
     }
 
     @Override
     public void onClick(final View v) {
         final int id = v.getId();
         if (id == R.id.remote_tabs_setup_get_started) {
@@ -111,20 +113,23 @@ public class RemoteTabsStaticFragment ex
         } else if (id == R.id.remote_tabs_needs_verification_resend_email) {
             // Send a fresh email; this displays a toast, so the user gets feedback.
             FirefoxAccounts.resendVerificationEmail(getActivity());
         } else if (id == R.id.remote_tabs_needs_verification_help) {
             // Don't allow switch-to-tab.
             final EnumSet<OnUrlOpenListener.Flags> flags = EnumSet.noneOf(OnUrlOpenListener.Flags.class);
             mUrlOpenListener.onUrlOpen(CONFIRM_ACCOUNT_SUPPORT_URL, flags);
         } else if (id == R.id.remote_tabs_needs_password_sign_in) {
-            // This Activity will redirect to the correct Activity as needed.
             final Intent intent = new Intent(getActivity(), FxAccountUpdateCredentialsActivity.class);
             intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
             startActivity(intent);
+        } else if (id == R.id.remote_tabs_needs_finish_migrating_sign_in) {
+            final Intent intent = new Intent(getActivity(), FxAccountFinishMigratingActivity.class);
+            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+            startActivity(intent);
         }
     }
 
     @Override
     protected void load() {
         // We're static, so nothing to do here!
     }
 }
--- a/mobile/android/base/locales/en-US/android_strings.dtd
+++ b/mobile/android/base/locales/en-US/android_strings.dtd
@@ -424,16 +424,18 @@ size. -->
 <!-- Localization note (home_move_up_to_filter): The variable is replaced by the name of the
      previous location in the navigation, such as the previous folder -->
 <!ENTITY home_move_up_to_filter "Up to &formatS;">
 
 <!ENTITY home_remote_tabs_title "Synced Tabs">
 <!ENTITY home_remote_tabs_empty "Your tabs from other devices show up here.">
 <!ENTITY home_remote_tabs_unable_to_connect "Unable to connect">
 <!ENTITY home_remote_tabs_need_to_sign_in "Please sign in to reconnect your Firefox Account and continue syncing.">
+<!ENTITY home_remote_tabs_need_to_finish_migrating "Your new Firefox Account is ready!">
+
 <!ENTITY home_remote_tabs_trouble_verifying "Trouble verifying your account?">
 <!ENTITY home_remote_tabs_need_to_verify "Please verify your Firefox Account to start syncing.">
 
 <!ENTITY home_remote_tabs_one_hidden_device "1 device hidden">
 <!-- Localization note (home_remote_tabs_many_hidden_devices) : The
      formatD is replaced with the number of hidden devices.  The
      number of hidden devices is always more than one.  We can't use
      Android plural forms, sadly. See Bug #753859. -->
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/resources/layout/remote_tabs_needs_finish_migrating.xml
@@ -0,0 +1,34 @@
+<?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_width="match_parent"
+    android:layout_height="match_parent" >
+
+    <LinearLayout style="@style/RemoteTabsPanelFrame" >
+
+        <TextView
+            style="@style/RemoteTabsPanelItem.TextAppearance.Header"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="@string/fxaccount_finish_migrating_header" />
+
+        <TextView
+            style="@style/RemoteTabsPanelItem.TextAppearance"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="@string/home_remote_tabs_need_to_finish_migrating" />
+
+        <Button
+            android:id="@+id/remote_tabs_needs_finish_migrating_sign_in"
+            style="@style/RemoteTabsPanelItem.Button"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="@string/fxaccount_finish_migrating_button_label" />
+    </LinearLayout>
+
+</ScrollView>
--- a/mobile/android/base/strings.xml.in
+++ b/mobile/android/base/strings.xml.in
@@ -364,16 +364,17 @@
   <string name="home_reading_list_hint">&home_reading_list_hint2;</string>
   <string name="home_reading_list_hint_accessible">&home_reading_list_hint_accessible;</string>
   <string name="home_default_empty">&home_default_empty;</string>
   <string name="home_move_up_to_filter">&home_move_up_to_filter;</string>
   <string name="home_remote_tabs_title">&home_remote_tabs_title;</string>
   <string name="home_remote_tabs_empty">&home_remote_tabs_empty;</string>
   <string name="home_remote_tabs_unable_to_connect">&home_remote_tabs_unable_to_connect;</string>
   <string name="home_remote_tabs_need_to_sign_in">&home_remote_tabs_need_to_sign_in;</string>
+  <string name="home_remote_tabs_need_to_finish_migrating">&home_remote_tabs_need_to_finish_migrating;</string>
   <string name="home_remote_tabs_trouble_verifying">&home_remote_tabs_trouble_verifying;</string>
   <string name="home_remote_tabs_need_to_verify">&home_remote_tabs_need_to_verify;</string>
   <string name="home_remote_tabs_one_hidden_device">&home_remote_tabs_one_hidden_device;</string>
   <string name="home_remote_tabs_many_hidden_devices">&home_remote_tabs_many_hidden_devices;</string>
   <string name="home_remote_tabs_hidden_devices_title">&home_remote_tabs_hidden_devices_title;</string>
   <string name="home_remote_tabs_unhide_selected_devices">&home_remote_tabs_unhide_selected_devices;</string>
   <string name="private_browsing_title">&private_browsing_title;</string>
   <string name="private_tabs_panel_empty_desc">&private_tabs_panel_empty_desc;</string>