diff --git a/app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java b/app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java
index 6fd11ee7d0..5728fc89c5 100644
--- a/app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java
+++ b/app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java
@@ -65,6 +65,7 @@
import org.mozilla.vrbrowser.ui.widgets.WindowWidget;
import org.mozilla.vrbrowser.ui.widgets.Windows;
import org.mozilla.vrbrowser.ui.widgets.dialogs.CrashDialogWidget;
+import org.mozilla.vrbrowser.ui.widgets.dialogs.WhatsNewWidget;
import org.mozilla.vrbrowser.ui.widgets.prompts.ConfirmPromptWidget;
import org.mozilla.vrbrowser.utils.ConnectivityReceiver;
import org.mozilla.vrbrowser.utils.DeviceType;
@@ -315,6 +316,13 @@ public void onWindowClosed() {
attachToWindow(mWindows.getFocusedWindow(), null);
addWidgets(Arrays.asList(mRootWidget, mNavigationBar, mKeyboard, mTray));
+
+ // Show the what's upp dialog if we haven't showed it yet and this is v6.
+ if (!SettingsStore.getInstance(this).isWhatsNewDisplayed() && BuildConfig.VERSION_NAME.equals("6")) {
+ WhatsNewWidget whatsNew = new WhatsNewWidget(this);
+ whatsNew.getPlacement().parentHandle = mWindows.getFocusedWindow().getHandle();
+ whatsNew.show(UIWidget.REQUEST_FOCUS);
+ }
}
private void attachToWindow(@NonNull WindowWidget aWindow, @Nullable WindowWidget aPrevWindow) {
diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/SettingsStore.java b/app/src/common/shared/org/mozilla/vrbrowser/browser/SettingsStore.java
index a6a43269f0..960ecc5b3c 100644
--- a/app/src/common/shared/org/mozilla/vrbrowser/browser/SettingsStore.java
+++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/SettingsStore.java
@@ -78,6 +78,7 @@ SettingsStore getInstance(final @NonNull Context aContext) {
public final static boolean TELEMETRY_STATUS_UPDATE_SENT_DEFAULT = false;
public final static boolean BOOKMARKS_SYNC_DEFAULT = true;
public final static boolean HISTORY_SYNC_DEFAULT = true;
+ public final static boolean WHATS_NEW_DISPLAYED = false;
// Enable telemetry by default (opt-out).
public final static boolean CRASH_REPORTING_DEFAULT = false;
@@ -623,5 +624,15 @@ public boolean isHistorySyncEnabled() {
return mPrefs.getBoolean(mContext.getString(R.string.settings_key_history_sync), HISTORY_SYNC_DEFAULT);
}
+ public void setWhatsNewDisplayed(boolean isEnabled) {
+ SharedPreferences.Editor editor = mPrefs.edit();
+ editor.putBoolean(mContext.getString(R.string.settings_key_whats_new_displayed), isEnabled);
+ editor.commit();
+ }
+
+ public boolean isWhatsNewDisplayed() {
+ return mPrefs.getBoolean(mContext.getString(R.string.settings_key_whats_new_displayed), WHATS_NEW_DISPLAYED);
+ }
+
}
diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/WhatsNewWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/WhatsNewWidget.java
new file mode 100644
index 0000000000..488bd229b2
--- /dev/null
+++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/WhatsNewWidget.java
@@ -0,0 +1,102 @@
+/* -*- 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.vrbrowser.ui.widgets.dialogs;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+
+import androidx.databinding.DataBindingUtil;
+
+import org.mozilla.geckoview.GeckoSessionSettings;
+import org.mozilla.vrbrowser.R;
+import org.mozilla.vrbrowser.VRBrowserApplication;
+import org.mozilla.vrbrowser.browser.Accounts;
+import org.mozilla.vrbrowser.browser.SettingsStore;
+import org.mozilla.vrbrowser.browser.engine.SessionStore;
+import org.mozilla.vrbrowser.databinding.WhatsNewBinding;
+import org.mozilla.vrbrowser.ui.widgets.WidgetManagerDelegate;
+import org.mozilla.vrbrowser.ui.widgets.WidgetPlacement;
+import org.mozilla.vrbrowser.utils.UIThreadExecutor;
+
+public class WhatsNewWidget extends UIDialog {
+
+ private WhatsNewBinding mBinding;
+ private Accounts mAccounts;
+
+ public WhatsNewWidget(Context aContext) {
+ super(aContext);
+ initialize();
+ }
+
+ public WhatsNewWidget(Context aContext, AttributeSet aAttrs) {
+ super(aContext, aAttrs);
+ initialize();
+ }
+
+ public WhatsNewWidget(Context aContext, AttributeSet aAttrs, int aDefStyle) {
+ super(aContext, aAttrs, aDefStyle);
+ initialize();
+ }
+
+ @SuppressLint("ClickableViewAccessibility")
+ private void initialize() {
+ LayoutInflater inflater = LayoutInflater.from(getContext());
+
+ mAccounts = ((VRBrowserApplication)getContext().getApplicationContext()).getAccounts();
+
+ // Inflate this data binding layout
+ mBinding = DataBindingUtil.inflate(inflater, R.layout.whats_new, this, true);
+
+ mBinding.signInButton.setOnClickListener(v -> signIn());
+ mBinding.startBrowsingButton.setOnClickListener(v -> onDismiss());
+ }
+
+ @Override
+ protected void initializeWidgetPlacement(WidgetPlacement aPlacement) {
+ aPlacement.visible = false;
+ aPlacement.width = WidgetPlacement.dpDimension(getContext(), R.dimen.whats_new_width);
+ aPlacement.height = WidgetPlacement.dpDimension(getContext(), R.dimen.whats_new_height);
+ aPlacement.parentAnchorX = 0.5f;
+ aPlacement.parentAnchorY = 0.0f;
+ aPlacement.anchorX = 0.5f;
+ aPlacement.anchorY = 0.5f;
+ aPlacement.translationY = WidgetPlacement.unitFromMeters(getContext(), R.dimen.settings_world_y) -
+ WidgetPlacement.unitFromMeters(getContext(), R.dimen.window_world_y);
+ aPlacement.translationZ = WidgetPlacement.unitFromMeters(getContext(), R.dimen.settings_world_z) -
+ WidgetPlacement.unitFromMeters(getContext(), R.dimen.window_world_z);
+ }
+
+ @Override
+ public void show(@ShowFlags int aShowFlags) {
+ super.show(aShowFlags);
+
+ mWidgetManager.pushWorldBrightness(this, WidgetManagerDelegate.DEFAULT_DIM_BRIGHTNESS);
+ }
+
+ @Override
+ public void hide(@HideFlags int aHideFlags) {
+ super.hide(aHideFlags);
+
+ SettingsStore.getInstance(getContext()).setWhatsNewDisplayed(true);
+
+ mWidgetManager.popWorldBrightness(this);
+ }
+
+ private void signIn() {
+ mAccounts.getAuthenticationUrlAsync().thenAcceptAsync((url) -> {
+ if (url != null) {
+ mAccounts.setLoginOrigin(Accounts.LoginOrigin.SETTINGS);
+ mWidgetManager.openNewTabForeground(url);
+ mWidgetManager.getFocusedWindow().getSession().setUaMode(GeckoSessionSettings.USER_AGENT_MODE_VR);
+ mWidgetManager.getFocusedWindow().getSession().loadUri(url);
+ onDismiss();
+ }
+ }, new UIThreadExecutor());
+ }
+
+}
diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/ContentLanguageOptionsView.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/ContentLanguageOptionsView.java
index e68c56e7c3..ceec75edbd 100644
--- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/ContentLanguageOptionsView.java
+++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/settings/ContentLanguageOptionsView.java
@@ -26,7 +26,7 @@
import java.util.Arrays;
-class ContentLanguageOptionsView extends SettingsView {
+public class ContentLanguageOptionsView extends SettingsView {
private OptionsLanguageContentBinding mBinding;
private LanguagesAdapter mPreferredAdapter;
diff --git a/app/src/main/res/drawable/ic_asset_image_accounts.xml b/app/src/main/res/drawable/ic_asset_image_accounts.xml
new file mode 100644
index 0000000000..f723fbfa78
--- /dev/null
+++ b/app/src/main/res/drawable/ic_asset_image_accounts.xml
@@ -0,0 +1,292 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/whats_new.xml b/app/src/main/res/layout/whats_new.xml
new file mode 100644
index 0000000000..08bc20a969
--- /dev/null
+++ b/app/src/main/res/layout/whats_new.xml
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/values/dimen.xml b/app/src/main/res/values/dimen.xml
index a9f1048812..7825204185 100644
--- a/app/src/main/res/values/dimen.xml
+++ b/app/src/main/res/values/dimen.xml
@@ -201,6 +201,7 @@
14sp
12sp
11sp
+ 8sp
20sp
14sp
@@ -298,4 +299,8 @@
300dp
60dp
30dp
+
+
+ 450dp
+ 340dp
\ No newline at end of file
diff --git a/app/src/main/res/values/non_L10n.xml b/app/src/main/res/values/non_L10n.xml
index e717d6cd99..215b66be03 100644
--- a/app/src/main/res/values/non_L10n.xml
+++ b/app/src/main/res/values/non_L10n.xml
@@ -48,6 +48,7 @@
settings_key_telemetry_status_update_sent
settings_key_bookmarks_sync
settings_key_history_sync
+ settings_key_whats_new_displayed
https://github.com/MozillaReality/FirefoxReality/wiki/Environments
https://www.mozilla.org/privacy/firefox/
https://mixedreality.mozilla.org/fxr/report?src=browser-fxr&label=browser-firefox-reality&url=%1$s
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 46ebe8b1fa..275fb6f97e 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1267,4 +1267,24 @@ the Select` button. When clicked it closes all the previously selected tabs -->
Send
+
+
+ Now You Can Sign In!
+
+
+ Sign in or create an account to send a tab from Firefox on your desktop or mobile device to Firefox Reality in your VR headset.
+
+
+ Synchronize your bookmarks, history, tabs, passwords, add-ons, and preferences across all your devices.
+
+
+ Sign In
+
+
+ Start Browsing