Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Refresh send tab on configuration changed (#3667)
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo authored and bluemarvin committed Jul 10, 2020
1 parent eb0dc05 commit 5a794b6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ public ClearHistoryDialogWidget(Context aContext) {
@Override
protected void initialize(Context aContext) {
super.initialize(aContext);


}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -63,8 +64,6 @@ private SendTabDialogWidget(@NonNull Context aContext) {
protected void initialize(@NonNull Context aContext) {
super.initialize(aContext);

updateUI();

mAccounts = ((VRBrowserApplication)getContext().getApplicationContext()).getAccounts();
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5a794b6

Please sign in to comment.