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

Commit

Permalink
Avoid releasing the voice search widget on config changes (#3630)
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo authored and bluemarvin committed Jul 6, 2020
1 parent cc3f73d commit 27a6bdc
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,6 @@ private void updateUI() {

mBinding.navigationBarNavigation.urlBar.setDelegate(this);

if (mVoiceSearchWidget != null) {
mVoiceSearchWidget.releaseWidget();
mVoiceSearchWidget = null;
}

if (mAttachedWindow != null) {
mBinding.navigationBarNavigation.urlBar.attachToWindow(mAttachedWindow);
}
Expand Down Expand Up @@ -965,6 +960,11 @@ public void onVoiceSearchClicked() {
if (mVoiceSearchWidget == null) {
mVoiceSearchWidget = new VoiceSearchWidget(getContext());
mVoiceSearchWidget.setDelegate(this);
mVoiceSearchWidget.setDelegate(() -> {
mVoiceSearchWidget.hide(UIWidget.REMOVE_WIDGET);
mVoiceSearchWidget.releaseWidget();
mVoiceSearchWidget = null;
});
}

mVoiceSearchWidget.getPlacement().parentHandle = mAttachedWindow.getHandle();
Expand Down

0 comments on commit 27a6bdc

Please sign in to comment.