Skip to content

Commit

Permalink
Stop having findInPage and Panel opened at same time
Browse files Browse the repository at this point in the history
Extend the commit
a23e2cf
here

Signed-off-by: Songlin Jiang <[email protected]>
  • Loading branch information
HollowMan6 committed Oct 17, 2023
1 parent 04864ea commit 57ef2bf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ public MutableLiveData<ObservableBoolean> getIsFindInPage() {
}

public void setIsFindInPage(boolean isFindInPage) {
this.isFindInPage.postValue(new ObservableBoolean(isFindInPage));
this.isFindInPage.setValue(new ObservableBoolean(isFindInPage));
}

@NonNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ public void onSendTab() {
@Override
public void onFindInPage() {
hideMenu();
mAttachedWindow.hidePanel();
mAttachedWindow.hideAllPanel();

mViewModel.setIsFindInPage(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,10 @@ int getSelectedPanel() {
return mLibrary.getSelectedPanelType();
}

public void hideAllPanel() {
hideAllPanel(true);
}

private void hideAllPanel(boolean switchSurface) {
if (mViewModel.getIsLibraryVisible().getValue().get()) {
hidePanel(switchSurface);
Expand Down Expand Up @@ -663,6 +667,7 @@ private void showDownloadsPanel(boolean switchSurface) {
if (mView == null) {
setView(mDownloads, switchSurface);
mDownloads.onShow();
mViewModel.setIsFindInPage(false);
mViewModel.setIsDownloadsVisible(true);
showPanelCommonAction();

Expand Down Expand Up @@ -694,6 +699,7 @@ private void showWebAppsPanel(boolean switchSurface) {
if (mView == null) {
setView(mWebApps, switchSurface);
mWebApps.onShow();
mViewModel.setIsFindInPage(false);
mViewModel.setIsWebAppsVisible(true);
showPanelCommonAction();

Expand Down Expand Up @@ -725,6 +731,7 @@ private void showAddonsPanel(boolean switchSurface) {
if (mView == null) {
setView(mAddons, switchSurface);
mAddons.onShow();
mViewModel.setIsFindInPage(false);
mViewModel.setIsAddonsVisible(true);
showPanelCommonAction();

Expand Down

0 comments on commit 57ef2bf

Please sign in to comment.