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

Commit

Permalink
Fixes #3607 Fixes #3606 What's new fixes (#3614)
Browse files Browse the repository at this point in the history
* Update viewmodel size when placement is updates

* Request focus when what's new is clicked
  • Loading branch information
keianhzo authored and bluemarvin committed Jul 6, 2020
1 parent 07a9c9a commit ccc192f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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() {
Expand All @@ -955,6 +959,8 @@ public void saveBeforeResizePlacement() {

public void restoreBeforeResizePlacement() {
mWidgetPlacement.copyFrom(mPlacementBeforeResize);
mViewModel.setWidth(mWidgetPlacement.width);
mViewModel.setHeight(mWidgetPlacement.height);
}

public WidgetPlacement getBeforeResizePlacement() {
Expand Down

0 comments on commit ccc192f

Please sign in to comment.