From 5a794b673a100d926b7a94c46c8f572aa16be53f Mon Sep 17 00:00:00 2001 From: Manuel Martin Date: Fri, 10 Jul 2020 21:11:29 +0200 Subject: [PATCH] Refresh send tab on configuration changed (#3667) --- .../org/mozilla/vrbrowser/VRBrowserActivity.java | 2 ++ .../ui/widgets/dialogs/ClearHistoryDialogWidget.java | 2 -- .../ui/widgets/dialogs/SendTabDialogWidget.java | 10 ++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java b/app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java index 62d13c4e7..6dc23bf7b 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java @@ -76,6 +76,7 @@ import org.mozilla.vrbrowser.ui.widgets.Windows; import org.mozilla.vrbrowser.ui.widgets.dialogs.CrashDialogWidget; import org.mozilla.vrbrowser.ui.widgets.dialogs.PromptDialogWidget; +import org.mozilla.vrbrowser.ui.widgets.dialogs.SendTabDialogWidget; import org.mozilla.vrbrowser.ui.widgets.dialogs.WhatsNewWidget; import org.mozilla.vrbrowser.ui.widgets.menus.VideoProjectionMenuWidget; import org.mozilla.vrbrowser.utils.BitmapCache; @@ -552,6 +553,7 @@ public void onConfigurationChanged(Configuration newConfig) { SessionStore.get().onConfigurationChanged(newConfig); mWidgets.forEach((i, widget) -> widget.onConfigurationChanged(newConfig)); + SendTabDialogWidget.getInstance(this).onConfigurationChanged(newConfig); super.onConfigurationChanged(newConfig); } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/ClearHistoryDialogWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/ClearHistoryDialogWidget.java index 54e605392..7fdf67b8c 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/ClearHistoryDialogWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/ClearHistoryDialogWidget.java @@ -36,8 +36,6 @@ public ClearHistoryDialogWidget(Context aContext) { @Override protected void initialize(Context aContext) { super.initialize(aContext); - - } @Override diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/SendTabDialogWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/SendTabDialogWidget.java index f50cb3112..0b8b901c3 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/SendTabDialogWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/dialogs/SendTabDialogWidget.java @@ -6,6 +6,7 @@ package org.mozilla.vrbrowser.ui.widgets.dialogs; import android.content.Context; +import android.content.res.Configuration; import android.view.LayoutInflater; import android.view.View; @@ -63,8 +64,6 @@ private SendTabDialogWidget(@NonNull Context aContext) { protected void initialize(@NonNull Context aContext) { super.initialize(aContext); - updateUI(); - mAccounts = ((VRBrowserApplication)getContext().getApplicationContext()).getAccounts(); } @@ -96,6 +95,13 @@ public void updateUI() { } } + @Override + public void onConfigurationChanged(Configuration newConfig) { + super.onConfigurationChanged(newConfig); + + updateUI(); + } + @Override public void show(int aShowFlags) { mAccounts.addAccountListener(this);