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

Commit

Permalink
Fix pb tray button state (#3535)
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo authored Jun 24, 2020
1 parent fa52ca1 commit 2bc1a31
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ public void detachFromWindow() {
mViewModel.getIsBookmarksVisible().removeObserver(mIsBookmarksVisible);
mViewModel.getIsHistoryVisible().removeObserver(mIsHistoryVisible);
mViewModel.getIsDownloadsVisible().removeObserver(mIsDownloadsVisible);
mViewModel.getIsPrivateSession().removeObserver(mIsPrivateSession);
mViewModel = null;
}

Expand All @@ -411,6 +412,7 @@ public void attachToWindow(@NonNull WindowWidget aWindow) {
mViewModel.getIsBookmarksVisible().observe((VRBrowserActivity)getContext(), mIsBookmarksVisible);
mViewModel.getIsHistoryVisible().observe((VRBrowserActivity)getContext(), mIsHistoryVisible);
mViewModel.getIsDownloadsVisible().observe((VRBrowserActivity)getContext(), mIsDownloadsVisible);
mViewModel.getIsPrivateSession().observe((VRBrowserActivity)getContext(), mIsPrivateSession);

mBinding.setViewmodel(mViewModel);

Expand Down Expand Up @@ -453,6 +455,17 @@ public void attachToWindow(@NonNull WindowWidget aWindow) {
}
};

private Observer<ObservableBoolean> mIsPrivateSession = aBoolean -> {
if (mBinding.privateButton.isHovered()) {
return;
}
if (aBoolean.get()) {
animateViewPadding(mBinding.privateButton, mMaxPadding, mMinPadding, ICON_ANIMATION_DURATION);
} else {
animateViewPadding(mBinding.privateButton, mMinPadding, mMaxPadding, ICON_ANIMATION_DURATION);
}
};

public void toggleSettingsDialog() {
toggleSettingsDialog(SettingsView.SettingViewType.MAIN);
}
Expand Down

0 comments on commit 2bc1a31

Please sign in to comment.