From fe7edf01b4b4b01dd60104550dbf8a631c8a9b72 Mon Sep 17 00:00:00 2001 From: Manuel Martin Date: Fri, 3 Jul 2020 12:45:22 +0200 Subject: [PATCH 1/2] Update viewmodel size when placement is updates --- .../org/mozilla/vrbrowser/ui/widgets/WindowWidget.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WindowWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WindowWidget.java index 2732825d7..d8a755c6a 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WindowWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WindowWidget.java @@ -672,6 +672,8 @@ public void setWindowPlacement(@NonNull Windows.WindowPlacement aPlacement) { GleanMetricsService.activePlacementEvent(mWindowPlacement.getValue(), false); } mWindowPlacement = aPlacement; + mViewModel.setWidth(mWidgetPlacement.width); + mViewModel.setHeight(mWidgetPlacement.height); mViewModel.setPlacement(mWindowPlacement); if (mActive) { TelemetryWrapper.activePlacementEvent(mWindowPlacement.getValue(), true); @@ -943,6 +945,8 @@ public void restoreBeforeFullscreenPlacement() { mWindowPlacement = mWindowPlacementBeforeFullscreen; mWidgetPlacement.copyFrom(mPlacementBeforeFullscreen); mWidgetPlacement.composited = composited; + mViewModel.setWidth(mWidgetPlacement.width); + mViewModel.setHeight(mWidgetPlacement.height); } public WidgetPlacement getBeforeFullscreenPlacement() { @@ -955,6 +959,8 @@ public void saveBeforeResizePlacement() { public void restoreBeforeResizePlacement() { mWidgetPlacement.copyFrom(mPlacementBeforeResize); + mViewModel.setWidth(mWidgetPlacement.width); + mViewModel.setHeight(mWidgetPlacement.height); } public WidgetPlacement getBeforeResizePlacement() { From 119b32322af537b3cbeb0a3290b1afa85adb1303 Mon Sep 17 00:00:00 2001 From: Manuel Martin Date: Fri, 3 Jul 2020 12:51:45 +0200 Subject: [PATCH 2/2] Request focus when what's new is clicked --- .../org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java index bad5ac67c..7667c6f15 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java @@ -263,6 +263,7 @@ private void updateUI() { }); mBinding.navigationBarNavigation.whatsNew.setOnClickListener(v -> { + v.requestFocusFromTouch(); SettingsStore.getInstance(getContext()).setRemotePropsVersionName(BuildConfig.VERSION_NAME); RemoteProperties props = mSettingsViewModel.getProps().getValue().get(BuildConfig.VERSION_NAME); if (props != null) {