new file mode 100644
--- /dev/null
+++ b/mobile/android/app/src/main/res/drawable/pwa_cancel_button.xml
@@ -0,0 +1,12 @@
+<?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/. -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <!-- pressed state -->
+ <item android:drawable="@color/pwa_cancel_btn_press" android:state_pressed="true" />
+ <!-- normal mode -->
+ <item android:drawable="@color/pwa_cancel_btn" />
+
+</selector>
new file mode 100644
--- /dev/null
+++ b/mobile/android/app/src/main/res/drawable/pwa_confirm_button.xml
@@ -0,0 +1,12 @@
+<?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/. -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <!-- pressed state -->
+ <item android:drawable="@drawable/pwa_confirm_button_pressed" android:state_pressed="true" />
+ <!-- normal mode -->
+ <item android:drawable="@drawable/pwa_confirm_button_normal" />
+
+</selector>
new file mode 100644
--- /dev/null
+++ b/mobile/android/app/src/main/res/drawable/pwa_confirm_button_normal.xml
@@ -0,0 +1,11 @@
+<?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/. -->
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="rectangle">
+ <!-- Gradient Bg for listrow -->
+ <gradient
+ android:angle="45"
+ android:endColor="#0A84FF"
+ android:startColor="#00CBD7" />
+</shape>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/mobile/android/app/src/main/res/drawable/pwa_confirm_button_pressed.xml
@@ -0,0 +1,11 @@
+<?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/. -->
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="rectangle">
+ <!-- Gradient Bg for listrow -->
+ <gradient
+ android:angle="45"
+ android:endColor="#0060DF"
+ android:startColor="#008EA4" />
+</shape>
\ No newline at end of file
deleted file mode 100644
--- a/mobile/android/app/src/main/res/drawable/pwa_gradient.xml
+++ /dev/null
@@ -1,13 +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/. -->
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="rectangle">
- <!-- Gradient Bg for listrow -->
- <gradient
- android:startColor="@color/photon_loading_indicator_light"
- android:centerColor="@color/photon_loading_indicator_dark"
- android:endColor="@color/photon_highlight"
- android:angle="315" />
-</shape>
\ No newline at end of file
--- a/mobile/android/app/src/main/res/layout/pwa_confirm.xml
+++ b/mobile/android/app/src/main/res/layout/pwa_confirm.xml
@@ -1,66 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<org.mozilla.gecko.toolbar.PwaConfirm xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/pwa_confirm_root"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@color/photon_browser_toolbar_bg"
- android:clickable="true"
- android:elevation="15dp">
-
-
- <ImageView
- android:id="@+id/pwa_confirm_icon"
- android:layout_width="40dp"
- android:layout_height="40dp"
- android:layout_margin="20dp"
- tools:src="@drawable/favicon_globe" />
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/pwa_confirm_root"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginTop="@dimen/browser_toolbar_height_flipper"
+ android:background="@color/dark_transparent_overlay"
+ android:clickable="true">
- <TextView
- android:id="@+id/pwa_confirm_title"
- android:layout_width="match_parent"
+ <RelativeLayout
+ style="@style/PwaConfirm"
android:layout_height="wrap_content"
- android:layout_alignTop="@+id/pwa_confirm_icon"
- android:layout_toEndOf="@+id/pwa_confirm_icon"
- android:layout_toStartOf="@+id/pwa_confirm_cancel"
- android:maxLines="2"
- android:textSize="18sp"
- android:textStyle="bold"
- tools:text="Mozilla title can grow to two lines... do" />
+ android:layout_centerHorizontal="true"
+ android:layout_marginTop="@dimen/tablet_tab_strip_height_pwa"
+ android:background="@color/photon_browser_toolbar_bg"
+ android:clickable="true"
+ android:elevation="15dp">
+
+ <android.support.v7.widget.CardView
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+
+ android:id="@+id/pwa_confirm_icon_wrap"
+ android:layout_width="50dp"
+ android:layout_height="50dp"
+ android:layout_margin="20dp"
+ app:cardCornerRadius="3dp">
- <TextView
- android:id="@+id/pwa_confirm_url"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignEnd="@+id/pwa_confirm_title"
- android:layout_alignStart="@+id/pwa_confirm_title"
- android:layout_below="@+id/pwa_confirm_title"
- android:maxLines="1"
- android:textSize="13sp"
- tools:text="http://www.mozilla.org/12345678911123" />
+ <ImageView
+ android:id="@+id/pwa_confirm_icon"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:background="#f0f"/>
+
+ </android.support.v7.widget.CardView>
+
+ <TextView
+ android:id="@+id/pwa_confirm_title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignTop="@+id/pwa_confirm_icon_wrap"
+ android:layout_toEndOf="@+id/pwa_confirm_icon_wrap"
+ android:layout_toStartOf="@+id/pwa_confirm_cancel"
+ android:ellipsize="end"
+ android:maxLines="2"
+ android:textColor="#333333"
+ android:textSize="18sp"
+ android:textStyle="bold"
+ tools:text="Mozilla title can grow to two lines... do"/>
- <ImageButton
- android:id="@+id/pwa_confirm_cancel"
- android:layout_width="48dp"
- android:layout_height="48dp"
- android:layout_alignParentEnd="true"
- android:layout_alignParentTop="true"
- android:background="@null"
- android:src="@drawable/ic_cancel_nm" />
+ <ImageButton
+ android:id="@+id/pwa_confirm_cancel"
+ android:layout_width="48dp"
+ android:layout_height="48dp"
+ android:layout_alignParentEnd="true"
+ android:layout_alignParentTop="true"
+ android:background="@drawable/pwa_cancel_button"
+ android:scaleType="center"
+ android:src="@drawable/ic_cancel_nm"/>
+x
+ <Button
+ android:id="@+id/pwa_confirm_action"
+ android:layout_width="match_parent"
+ android:layout_height="69dp"
+ android:layout_below="@+id/pwa_confirm_url"
+ android:layout_marginTop="20dp"
+ android:background="@drawable/pwa_confirm_button"
+ android:gravity="center"
+ android:text="@string/pwa_add_to_launcher_confirm"
+ android:textAllCaps="true"
+ android:textColor="#fff"
+ android:textStyle="bold"/>
- <Button
- android:id="@+id/pwa_confirm_action"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@+id/pwa_confirm_url"
- android:layout_marginTop="20dp"
- android:background="@drawable/pwa_gradient"
- android:gravity="center"
- android:text="+ Add To Home Screen"
- android:textAllCaps="true"
- android:textColor="#fff"
- android:textStyle="bold" />
+ <TextView
+ android:id="@+id/pwa_confirm_url"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignStart="@+id/pwa_confirm_title"
+ android:layout_below="@+id/pwa_confirm_title"
+ android:ellipsize="end"
+ android:maxLines="1"
+ android:textColor="@color/ob_subtitle"
+ android:textSize="13sp"
+ tools:text="http://www.mozilla.org/12345678911123"/>
+ </RelativeLayout>
</org.mozilla.gecko.toolbar.PwaConfirm>
\ No newline at end of file
--- a/mobile/android/app/src/main/res/layout/pwa_onboarding.xml
+++ b/mobile/android/app/src/main/res/layout/pwa_onboarding.xml
@@ -1,73 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<org.mozilla.gecko.toolbar.PwaOnboarding xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/pwa_onboarding_root"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="#CCBBBBBB"
- android:clickable="true"
- android:orientation="vertical"
- android:paddingBottom="50dp"
- android:paddingEnd="30dp"
- android:paddingStart="30dp"
- android:paddingTop="50dp">
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/pwa_onboarding_root"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/dark_transparent_overlay"
+ android:clickable="true"
+ android:gravity="center"
+ android:orientation="vertical"
+ android:padding="20dp">
+
+ <android.support.v7.widget.CardView
+ android:layout_width="290dp"
+ android:layout_height="wrap_content"
+ android:layout_centerHorizontal="true"
+ android:layout_centerVertical="true"
+ android:layout_gravity="center"
+ app:cardCornerRadius="5dp">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="#fff"
- android:clickable="true"
- android:orientation="vertical"
- android:weightSum="10">
-
- <View
+ <LinearLayout
android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="0.8" />
+ android:layout_height="match_parent"
+ android:orientation="vertical">
- <ImageView
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_marginEnd="20dp"
- android:layout_marginStart="20dp"
- android:layout_weight="4"
- android:src="@drawable/pwa_popup" />
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_margin="5dp"
+ android:layout_weight="1">
- <View
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="0.6" />
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="#fff"
+ android:clickable="true"
+ android:orientation="vertical">
- <TextView
- android:id="@+id/pwa_onboarding_sumo"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_marginEnd="20dp"
- android:layout_marginStart="20dp"
- android:layout_weight="3"
- android:text="You can easily add this website to
-your Home screen to have instant
-access and browse faster with an
-app-like experience."
- android:textSize="13sp" />
+ <ImageView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="10dp"
+ android:src="@drawable/pwa_popup"/>
+
- <View
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="0.6" />
+ <TextView
+ android:id="@+id/pwa_onboarding_sumo"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="30dp"
+ android:layout_marginEnd="15dp"
+ android:layout_marginStart="15dp"
+ android:layout_marginTop="10dp"
+ android:lineSpacingExtra="1.4dp"
+ android:text="@string/pwa_onboarding_sumo"
+ android:textColor="#737373"
+ android:textSize="16sp"/>
+ </LinearLayout>
+ </ScrollView>
+
- <TextView
- android:id="@+id/pwa_onboarding_dismiss"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:gravity="center"
- android:minHeight="48dp"
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:background="#e5e5e5"/>
- android:text="Continue to Website"
- android:textAllCaps="true"
- android:textColor="@color/photon_highlight"
- android:textStyle="bold" />
- </LinearLayout>
+ <TextView
+ android:id="@+id/pwa_onboarding_dismiss"
+ android:layout_width="match_parent"
+ android:layout_height="50dp"
+ android:gravity="center"
+ android:text="@string/pwa_continue_to_website"
+ android:textAllCaps="true"
+ android:textColor="@color/photon_highlight"
+ android:textStyle="bold"/>
+ </LinearLayout>
+ </android.support.v7.widget.CardView>
</org.mozilla.gecko.toolbar.PwaOnboarding>
\ No newline at end of file
new file mode 100644
index 0000000000000000000000000000000000000000..1216be3d40ca683ebfcdc0a21ffc46558a4d7884
GIT binary patch
literal 2156
zc${rkdpy(YAOD(5Bey15nOdvdZRD1*3B%;R;z$T<#LU=+70Rfikwcd`ts&(Vb=1a^
za>^z7Ew>ixRIbV8M^}uWYwEY1^!xo@=Xajh>+^h`&*yo+KcDCQJpVjwKOc8Bl`Sd&
z0H}H3aRjM1ml;?|I{yS(%9c7gI>Fr;;EQ4Jq=9k*{v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dimen>
<dimen name="tab_panel_grid_vpadding_autofit">30dp</dimen>
<dimen name="tab_panel_grid_item_hpadding_autofit">20dp</dimen>
<dimen name="tab_panel_grid_item_vpadding_autofit">8dp</dimen>
<!-- PageActionButtons dimensions -->
<dimen name="page_action_button_width">@dimen/browser_toolbar_icon_width</dimen>
+
+ <dimen name="tablet_tab_strip_height_pwa">48dp</dimen>
+
</resources>
--- a/mobile/android/app/src/photon/res/values-large/styles.xml
+++ b/mobile/android/app/src/photon/res/values-large/styles.xml
@@ -202,17 +202,23 @@
<style name="UrlBar.SiteIdentity" parent="UrlBar.V15.SiteIdentity" />
<style name="UrlBar.V15.SiteIdentity" parent="UrlBar.Base.SiteIdentity">
<item name="android:layout_marginLeft">8dp</item>
<item name="android:paddingRight">@dimen/browser_toolbar_site_security_margin_end</item>
</style>
+
<style name="TabsTray.AddTab" parent="TabsTray.V15.AddTab"/>
<style name="TabsTray.V15.AddTab" parent="TabsTray.Base.AddTab"/>
<style name="TabsTray.Menu" parent="TabsTray.V15.Menu"/>
<style name="TabsTray.V15.Menu" parent="TabsTray.Base.Menu">
<item name="android:layout_marginRight">6dp</item>
</style>
+ <style name="PwaConfirm">
+ <item name="android:layout_width">640dp</item>
+
+ </style>
+
</resources>
--- a/mobile/android/app/src/photon/res/values/colors.xml
+++ b/mobile/android/app/src/photon/res/values/colors.xml
@@ -262,9 +262,15 @@
<color name="activity_stream_subtitle">#FF919191</color>
<color name="activity_stream_icon">#FF919191</color>
<color name="tablet_tab_strip_divider_color">#737373</color>
<color name="tablet_tab_strip_indicator">#0060DF</color>
<color name="tablet_tab_strip_indicator_private">#8000D7</color>
<color name="bookmark_folder_bg_color">#FCFCFC</color>
+
+ <!-- PWA -->
+ <color name="pwa_cancel_btn_press">#ededf0</color>
+ <color name="pwa_cancel_btn">#00ffffff</color>
+
+
</resources>
--- a/mobile/android/app/src/photon/res/values/dimens.xml
+++ b/mobile/android/app/src/photon/res/values/dimens.xml
@@ -41,16 +41,17 @@
<!-- If you update one of these values, update the others. -->
<dimen name="tablet_nav_button_width">48dp</dimen>
<dimen name="tablet_nav_button_width_half">21dp</dimen>
<dimen name="tablet_nav_button_width_plus_half">36dp</dimen>
<dimen name="tablet_fwd_button_padding_start">4dp</dimen>
<dimen name="tablet_fwd_button_padding_end">4dp</dimen>
+ <dimen name="tablet_tab_strip_height_pwa">0dp</dimen>
<dimen name="tablet_tab_strip_height">48dp</dimen>
<dimen name="tablet_tab_strip_item_width">178dp</dimen>
<dimen name="tablet_tab_strip_item_height">40dp</dimen>
<dimen name="tablet_tab_strip_fading_edge_size">15dp</dimen>
<dimen name="tablet_tab_strip_item_margin">0dp</dimen>
<dimen name="tablet_tab_strip_divider_width">1dp</dimen>
<dimen name="tablet_tab_strip_divider_height">30dp</dimen>
<dimen name="tablet_tab_strip_divider_padding_bottom">4dp</dimen>
--- a/mobile/android/app/src/photon/res/values/styles.xml
+++ b/mobile/android/app/src/photon/res/values/styles.xml
@@ -956,20 +956,26 @@
<style name="TabStrip.Favicon" parent="TabStrip.V15.Favicon"/>
<style name="TabStrip.Base.Favicon" parent="TabStrip.Base"/>
<style name="TabStrip.V15.Favicon" parent="TabStrip.Base.Favicon">
<item name="android:layout_marginLeft">12dp</item>
<item name="android:layout_marginRight">8dp</item>
</style>
+
<style name="TabStrip.Close" parent="TabStrip.V15.Close"/>
<style name="TabStrip.V15.Close" parent="TabStrip.Base">
<item name="android:layout_alignParentRight">true</item>
</style>
<style name="TabStrip.Title" parent="TabStrip.V15.Title"/>
<style name="TabStrip.V15.Title" parent="TabStrip.Base">
<item name="android:layout_toRightOf">@id/favicon</item>
<item name="android:layout_toLeftOf">@id/close</item>
</style>
+ <style name="PwaConfirm">
+ <item name="android:layout_width">match_parent</item>
+ </style>
+
+
</resources>
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -144,16 +144,17 @@ import org.mozilla.gecko.tabs.TabHistory
import org.mozilla.gecko.tabs.TabHistoryPage;
import org.mozilla.gecko.tabs.TabsPanel;
import org.mozilla.gecko.telemetry.TelemetryCorePingDelegate;
import org.mozilla.gecko.telemetry.TelemetryUploadService;
import org.mozilla.gecko.telemetry.measurements.SearchCountMeasurements;
import org.mozilla.gecko.toolbar.AutocompleteHandler;
import org.mozilla.gecko.toolbar.BrowserToolbar;
import org.mozilla.gecko.toolbar.BrowserToolbar.TabEditingState;
+import org.mozilla.gecko.toolbar.PageActionLayout;
import org.mozilla.gecko.trackingprotection.TrackingProtectionPrompt;
import org.mozilla.gecko.updater.PostUpdateHandler;
import org.mozilla.gecko.updater.UpdateServiceHelper;
import org.mozilla.gecko.util.ActivityUtils;
import org.mozilla.gecko.util.Clipboard;
import org.mozilla.gecko.util.ContextUtils;
import org.mozilla.gecko.util.DrawableUtil;
import org.mozilla.gecko.util.EventCallback;
@@ -1174,17 +1175,16 @@ public class BrowserApp extends GeckoApp
if (urls != null) {
openUrls(urls);
}
}
@Override
public void onResume() {
super.onResume();
-
if (mIsAbortingAppLaunch) {
return;
}
if (!mHasResumed) {
getAppEventDispatcher().unregisterUiThreadListener(this, "Prompt:ShowTop");
mHasResumed = true;
}
--- a/mobile/android/base/java/org/mozilla/gecko/Tab.java
+++ b/mobile/android/base/java/org/mozilla/gecko/Tab.java
@@ -33,16 +33,18 @@ import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
+import static org.mozilla.gecko.toolbar.PageActionLayout.PageAction.UUID_PAGE_ACTION_PWA;
+
public class Tab {
private static final String LOGTAG = "GeckoTab";
private static Pattern sColorPattern;
private final int mId;
private final BrowserDB mDB;
private long mLastUsed;
private String mUrl;
@@ -464,20 +466,20 @@ public class Tab {
public void setManifestUrl(String manifestUrl) {
mManifestUrl = manifestUrl;
updatePageAction();
}
public void updatePageAction() {
if (mManifestUrl != null) {
- PageActionLayout.PageAction.showPwaPageAction();
+ showPwaPageAction();
} else {
- PageActionLayout.PageAction.clearPwaPageAction();
+ clearPwaPageAction();
}
}
public void setHasOpenSearch(boolean hasOpenSearch) {
mHasOpenSearch = hasOpenSearch;
}
public void setLoadedFromCache(boolean loadedFromCache) {
@@ -845,9 +847,26 @@ public class Tab {
public void setShouldShowToolbarWithoutAnimationOnFirstSelection(final boolean shouldShowWithoutAnimation) {
mShouldShowToolbarWithoutAnimationOnFirstSelection = shouldShowWithoutAnimation;
}
public boolean getShouldShowToolbarWithoutAnimationOnFirstSelection() {
return mShouldShowToolbarWithoutAnimationOnFirstSelection;
}
+
+ private void clearPwaPageAction() {
+ GeckoBundle bundle = new GeckoBundle();
+ bundle.putString("id", UUID_PAGE_ACTION_PWA);
+ EventDispatcher.getInstance().dispatch("PageActions:Remove", bundle);
+ }
+
+ private void showPwaPageAction() {
+ if (!isPrivate()) {
+ GeckoBundle bundle = new GeckoBundle();
+ bundle.putString("id", UUID_PAGE_ACTION_PWA);
+ bundle.putString("title", mAppContext.getString(R.string.pwa_add_to_launcher_badge));
+ bundle.putString("icon", "drawable://add_to_homescreen");
+ bundle.putBoolean("important", true);
+ EventDispatcher.getInstance().dispatch("PageActions:Add", bundle);
+ }
+ }
}
--- a/mobile/android/base/java/org/mozilla/gecko/tabs/TabStripItemView.java
+++ b/mobile/android/base/java/org/mozilla/gecko/tabs/TabStripItemView.java
@@ -1,9 +1,9 @@
-/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
+/* -*- Mode: Java; c-basic-offset: 4; tab-2: 20; 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.tabs;
import org.mozilla.gecko.AboutPages;
import org.mozilla.gecko.R;
--- a/mobile/android/base/java/org/mozilla/gecko/toolbar/PageActionLayout.java
+++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/PageActionLayout.java
@@ -1,19 +1,19 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; 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.toolbar;
import org.mozilla.gecko.EventDispatcher;
-import org.mozilla.gecko.GeckoApplication;
import org.mozilla.gecko.GeckoSharedPrefs;
import org.mozilla.gecko.R;
+import org.mozilla.gecko.Tabs;
import org.mozilla.gecko.preferences.GeckoPreferences;
import org.mozilla.gecko.util.DrawableUtil;
import org.mozilla.gecko.util.ResourceDrawableUtils;
import org.mozilla.gecko.util.BundleEventListener;
import org.mozilla.gecko.util.EventCallback;
import org.mozilla.gecko.util.GeckoBundle;
import org.mozilla.gecko.util.ThreadUtils;
import org.mozilla.gecko.widget.GeckoPopupMenu;
@@ -34,19 +34,21 @@ import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
import java.util.ArrayList;
+import static org.mozilla.gecko.toolbar.PageActionLayout.PageAction.UUID_PAGE_ACTION_PWA;
+
public class PageActionLayout extends ThemedLinearLayout implements BundleEventListener,
- View.OnClickListener,
- View.OnLongClickListener {
+ View.OnClickListener,
+ View.OnLongClickListener {
private static final String MENU_BUTTON_KEY = "MENU_BUTTON_KEY";
private static final int DEFAULT_PAGE_ACTIONS_SHOWN = 2;
public static final String PREF_PWA_ONBOARDING = GeckoPreferences.NON_PREF_PREFIX + "pref_pwa_onboarding";
private final Context mContext;
private final LinearLayout mLayout;
private final List<PageAction> mPageActionList;
@@ -67,25 +69,25 @@ public class PageActionLayout extends Th
refreshPageActionIcons();
}
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
EventDispatcher.getInstance().registerUiThreadListener(this,
- "PageActions:Add",
- "PageActions:Remove");
+ "PageActions:Add",
+ "PageActions:Remove");
}
@Override
protected void onDetachedFromWindow() {
EventDispatcher.getInstance().unregisterUiThreadListener(this,
- "PageActions:Add",
- "PageActions:Remove");
+ "PageActions:Add",
+ "PageActions:Remove");
super.onDetachedFromWindow();
}
@Override
public void setPrivateMode(boolean isPrivate) {
super.setPrivateMode(isPrivate);
for (int i = 0; i < getChildCount(); i++) {
@@ -118,27 +120,27 @@ public class PageActionLayout extends Th
if ("PageActions:Add".equals(event)) {
final String id = message.getString("id");
boolean alreadyAdded = isPwaAdded(id);
if (alreadyAdded) {
return;
}
- maybeShowOnboarding();
+ maybeShowPwaOnboarding(id);
final String title = message.getString("title");
final String imageURL = message.getString("icon");
final boolean important = message.getBoolean("important");
final boolean useTint = message.getBoolean("useTint");
addPageAction(id, title, imageURL, useTint, new OnPageActionClickListeners() {
@Override
public void onClick(final String id) {
- if (id != null && id.equals(PageAction.UUID_PAGE_ACTION_PWA)) {
+ if (id != null && id.equals(UUID_PAGE_ACTION_PWA)) {
mPwaConfirm = PwaConfirm.show(getContext());
return;
}
final GeckoBundle data = new GeckoBundle(1);
data.putString("id", id);
EventDispatcher.getInstance().dispatch("PageActions:Clicked", data);
}
@@ -151,36 +153,39 @@ public class PageActionLayout extends Th
}
}, important);
} else if ("PageActions:Remove".equals(event)) {
removePageAction(message.getString("id"));
}
}
- private void maybeShowOnboarding() {
- SharedPreferences prefs = GeckoSharedPrefs.forApp(getContext());
- final boolean show = prefs.getBoolean(PREF_PWA_ONBOARDING, true);
- if (!show) {
- PwaOnboarding.show(getContext());
- prefs.edit().putBoolean(PREF_PWA_ONBOARDING, false).apply();
+ private void maybeShowPwaOnboarding(String id) {
+ // only show pwa at normal mode
+ if (id.equals(UUID_PAGE_ACTION_PWA) && Tabs.getInstance().getSelectedTab().isPrivate() == false) {
+ SharedPreferences prefs = GeckoSharedPrefs.forApp(getContext());
+ final boolean show = prefs.getBoolean(PREF_PWA_ONBOARDING, true);
+ if (show) {
+ PwaOnboarding.show(getContext());
+ prefs.edit().putBoolean(PREF_PWA_ONBOARDING, false).apply();
+ }
}
}
private boolean isPwaAdded(String id) {
for (PageAction pageAction : mPageActionList) {
if (pageAction.getID() != null && pageAction.getID().equals(id)) {
return true;
}
}
return false;
}
private void addPageAction(final String id, final String title, final String imageData, final boolean useTint,
- final OnPageActionClickListeners onPageActionClickListeners, boolean important) {
+ final OnPageActionClickListeners onPageActionClickListeners, boolean important) {
ThreadUtils.assertOnUiThread();
final PageAction pageAction = new PageAction(id, title, null, onPageActionClickListeners, important);
int insertAt = mPageActionList.size();
while (insertAt > 0 && mPageActionList.get(insertAt - 1).isImportant()) {
insertAt--;
}
@@ -228,29 +233,29 @@ public class PageActionLayout extends Th
imageButton.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
imageButton.setOnClickListener(this);
imageButton.setOnLongClickListener(this);
return imageButton;
}
@Override
public void onClick(View v) {
- String buttonClickedId = (String)v.getTag();
+ String buttonClickedId = (String) v.getTag();
if (buttonClickedId != null) {
if (buttonClickedId.equals(MENU_BUTTON_KEY)) {
showMenu(v, mPageActionList.size() - mMaxVisiblePageActions + 1);
} else {
getPageActionWithId(buttonClickedId).onClick();
}
}
}
@Override
public boolean onLongClick(View v) {
- String buttonClickedId = (String)v.getTag();
+ String buttonClickedId = (String) v.getTag();
if (buttonClickedId.equals(MENU_BUTTON_KEY)) {
showMenu(v, mPageActionList.size() - mMaxVisiblePageActions + 1);
return true;
} else {
return getPageActionWithId(buttonClickedId).onLongClick();
}
}
@@ -359,23 +364,24 @@ public class PageActionLayout extends Th
MenuItem item = menu.add(Menu.NONE, pageAction.key(), Menu.NONE, pageAction.getTitle());
item.setIcon(pageAction.getDrawable());
}
mPageActionsMenu.show();
}
private static interface OnPageActionClickListeners {
public void onClick(String id);
+
public boolean onLongClick(String id);
}
private void hidePreviousConfirmPrompt() {
if (mPwaConfirm != null) {
if (mPwaConfirm.isAttachedToWindow() || mPwaConfirm.getParent() != null) {
- mPwaConfirm.dismiss();
+ mPwaConfirm.disappear();
}
mPwaConfirm = null;
}
}
public static class PageAction {
public static final String UUID_PAGE_ACTION_PWA = "279c269d-6397-4f86-a6d2-452e26456d4a";
@@ -395,25 +401,16 @@ public class PageActionLayout extends Th
mTitle = title;
mDrawable = image;
mOnPageActionClickListeners = onPageActionClickListeners;
mImportant = important;
key = UUID.fromString(mId.subSequence(1, mId.length() - 2).toString()).hashCode();
}
- public static void showPwaPageAction() {
- GeckoBundle bundle = new GeckoBundle();
- bundle.putString("id", UUID_PAGE_ACTION_PWA);
- bundle.putString("title", "Add PWA Shortcut");
- bundle.putString("icon", "drawable://icon_openinapp");
- bundle.putBoolean("important", true);
- EventDispatcher.getInstance().dispatch("PageActions:Add", bundle);
- }
-
public Drawable getDrawable() {
return mDrawable;
}
public void setDrawable(Drawable d) {
mDrawable = d;
}
@@ -441,15 +438,11 @@ public class PageActionLayout extends Th
public boolean onLongClick() {
if (mOnPageActionClickListeners != null) {
return mOnPageActionClickListeners.onLongClick(mId);
}
return false;
}
- public static void clearPwaPageAction() {
- GeckoBundle bundle = new GeckoBundle();
- bundle.putString("id", UUID_PAGE_ACTION_PWA);
- EventDispatcher.getInstance().dispatch("PageActions:Remove", bundle);
- }
+
}
}
--- a/mobile/android/base/java/org/mozilla/gecko/toolbar/PwaConfirm.java
+++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/PwaConfirm.java
@@ -1,14 +1,16 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; 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.toolbar;
+import android.animation.Animator;
+import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -18,25 +20,63 @@ import android.widget.TextView;
import org.mozilla.gecko.GeckoApplication;
import org.mozilla.gecko.R;
import org.mozilla.gecko.Tab;
import org.mozilla.gecko.Tabs;
public class PwaConfirm extends RelativeLayout {
+ boolean isAnimating = false;
+
+
public static PwaConfirm show(Context context) {
if (context instanceof Activity) {
- final ViewGroup contetView = (ViewGroup) ((Activity) context).findViewById(R.id.main_layout);
+ final ViewGroup contetView = (ViewGroup) ((Activity) context).findViewById(R.id.gecko_layout);
+ final View oldPwaConfirm = contetView.findViewById(R.id.pwa_confirm_root);
+ if ((oldPwaConfirm != null)) {
+ // prevent this view to be added twice.
+ return (PwaConfirm) oldPwaConfirm;
+ }
View parent = LayoutInflater.from(context).inflate(R.layout.pwa_confirm, contetView);
- return (PwaConfirm) parent.findViewById(R.id.pwa_confirm_root);
+ final PwaConfirm pwaConfirm = (PwaConfirm) parent.findViewById(R.id.pwa_confirm_root);
+ pwaConfirm.appear();
+ return pwaConfirm;
}
return null;
}
+ private void appear() {
+
+ setAlpha(0);
+
+ final Animator alphaAnimator = ObjectAnimator.ofFloat(this, "alpha", 1);
+ alphaAnimator.setStartDelay(200);
+ alphaAnimator.setDuration(300);
+
+
+ alphaAnimator.start();
+ }
+
+ public void disappear() {
+ if (isAnimating) {
+ return;
+ }
+
+ isAnimating = true;
+
+ setAlpha(1);
+
+ final Animator alphaAnimator = ObjectAnimator.ofFloat(this, "alpha", 0);
+ alphaAnimator.setDuration(300);
+
+ alphaAnimator.start();
+ dismiss();
+ }
+
public PwaConfirm(Context context) {
super(context);
}
public PwaConfirm(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
@@ -53,38 +93,39 @@ public class PwaConfirm extends Relative
init();
setupBackpress();
}
private void init() {
final OnClickListener dismiss = new OnClickListener() {
@Override
public void onClick(View v) {
- dismiss();
+ disappear();
}
};
final OnClickListener createShortcut = new OnClickListener() {
@Override
public void onClick(View v) {
GeckoApplication.createShortcut();
- dismiss();
+ disappear();
}
};
findViewById(R.id.pwa_confirm_root).setOnClickListener(dismiss);
findViewById(R.id.pwa_confirm_cancel).setOnClickListener(dismiss);
findViewById(R.id.pwa_confirm_action).setOnClickListener(createShortcut);
final Tab selectedTab = Tabs.getInstance().getSelectedTab();
- ((TextView) findViewById(R.id.pwa_confirm_title)).setText(selectedTab.getTitle());
- ((TextView) findViewById(R.id.pwa_confirm_url)).setText(selectedTab.getURL());
- ((ImageView) findViewById(R.id.pwa_confirm_icon)).setImageBitmap(selectedTab.getFavicon());
-
+ if (selectedTab != null) {
+ ((TextView) findViewById(R.id.pwa_confirm_title)).setText(selectedTab.getTitle());
+ ((TextView) findViewById(R.id.pwa_confirm_url)).setText(selectedTab.getURL());
+ ((ImageView) findViewById(R.id.pwa_confirm_icon)).setImageBitmap(selectedTab.getFavicon());
+ }
}
private void setupBackpress() {
setFocusableInTouchMode(true);
requestFocus();
setOnKeyListener(new OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
@@ -92,11 +133,11 @@ public class PwaConfirm extends Relative
dismiss();
}
return true;
}
});
}
public void dismiss() {
- ((ViewGroup) this.getParent()).removeView(this);
+ ((ViewGroup) PwaConfirm.this.getParent()).removeView(PwaConfirm.this);
}
}
--- a/mobile/android/base/java/org/mozilla/gecko/toolbar/PwaOnboarding.java
+++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/PwaOnboarding.java
@@ -8,23 +8,24 @@ import android.app.Activity;
import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
import org.mozilla.gecko.R;
import org.mozilla.gecko.Tabs;
-public class PwaOnboarding extends LinearLayout {
+public class PwaOnboarding extends RelativeLayout {
- static final String LINK_PWA_SUMO = "http://www.mozilla.org";
+ static final String LINK_PWA_SUMO = "https://developer.mozilla.org/en-US/Apps/Progressive";
public static void show(Context context) {
if (context instanceof Activity) {
final ViewGroup contetView = (ViewGroup) ((Activity) context).findViewById(android.R.id.content);
LayoutInflater.from(context).inflate(R.layout.pwa_onboarding, contetView);
}
}
@@ -53,18 +54,18 @@ public class PwaOnboarding extends Linea
public void onClick(View v) {
dismiss();
}
};
final OnClickListener loadSumo = new OnClickListener() {
@Override
public void onClick(View v) {
+ dismiss();
Tabs.getInstance().loadUrlInTab(LINK_PWA_SUMO);
- dismiss();
}
};
findViewById(R.id.pwa_onboarding_root).setOnClickListener(dismiss);
findViewById(R.id.pwa_onboarding_dismiss).setOnClickListener(dismiss);
findViewById(R.id.pwa_onboarding_sumo).setOnClickListener(loadSumo);
}
--- a/mobile/android/base/locales/en-US/android_strings.dtd
+++ b/mobile/android/base/locales/en-US/android_strings.dtd
@@ -848,8 +848,14 @@ is simply hidden from the Activity Strea
<!ENTITY activity_stream_delete_history "Delete from History">
<!ENTITY private_tab_panel_title "Private Browsing + Tracking Protection">
<!ENTITY private_tab_panel_description "&brandShortName; blocks parts of the pages that may track your browsing activity.">
<!ENTITY private_tab_panel_description2 "We won\'t remember any history, but downloaded files and new bookmarks will still be saved to your device.">
<!ENTITY private_tab_learn_more "Want to learn more?">
<!ENTITY fullscreen_warning "Entered full screen">
+
+
+<!ENTITY pwa_add_to_launcher_confirm "+ Add to Home Screen">
+<!ENTITY pwa_add_to_launcher_badge "Add PWA to Home Screen">
+<!ENTITY pwa_continue_to_website "Continue to Website">
+<!ENTITY pwa_onboarding_sumo "You can easily add this website to your Home screen to have instant access and browse faster with an app-like experience.">
\ No newline at end of file
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -924,16 +924,17 @@ gbjar.sources += ['java/org/mozilla/geck
'toolbar/BackButton.java',
'toolbar/BrowserToolbar.java',
'toolbar/BrowserToolbarPhone.java',
'toolbar/BrowserToolbarPhoneBase.java',
'toolbar/CanvasDelegate.java',
'toolbar/NavButton.java',
'toolbar/PageActionLayout.java',
'toolbar/PhoneTabsButton.java',
+ 'toolbar/PwaConfirm.java',
'toolbar/PwaOnboarding.java',
'toolbar/SecurityModeUtil.java',
'toolbar/ShapedButton.java',
'toolbar/ShapedButtonFrameLayout.java',
'toolbar/SiteIdentityPopup.java',
'toolbar/ToolbarEditLayout.java',
'toolbar/ToolbarEditText.java',
'toolbar/ToolbarPrefs.java',
--- a/mobile/android/base/strings.xml.in
+++ b/mobile/android/base/strings.xml.in
@@ -634,9 +634,14 @@
<string name="activity_stream_highlights_empty">&activity_stream_highlights_empty;</string>
<string name="private_tab_panel_title">&private_tab_panel_title;</string>
<string name="private_tab_panel_description">&private_tab_panel_description;</string>
<string name="private_tab_panel_description2">&private_tab_panel_description2;</string>
<string name="private_tab_learn_more">&private_tab_learn_more;</string>
<string name="fullscreen_warning">&fullscreen_warning;</string>
+
+ <string name="pwa_add_to_launcher_confirm">&pwa_add_to_launcher_confirm;</string>
+ <string name="pwa_add_to_launcher_badge">&pwa_add_to_launcher_badge;</string>
+ <string name="pwa_onboarding_sumo">&pwa_onboarding_sumo;</string>
+ <string name="pwa_continue_to_website">&pwa_continue_to_website;</string>
</resources>