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

Fixes #3623 Avoid releasing the voice search widget on config changes #3630

Merged
merged 1 commit into from
Jul 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,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 @@ -962,6 +957,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