Skip to content

Commit

Permalink
Force voice search widget recreation after a language update (#3126)
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed Apr 7, 2020
1 parent ebc1ff4 commit bd03af2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Expand Up @@ -363,6 +363,11 @@ 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 @@ -26,6 +26,7 @@
import com.mozilla.speechlibrary.STTResult;

import org.mozilla.vrbrowser.R;
import org.mozilla.vrbrowser.VRBrowserActivity;
import org.mozilla.vrbrowser.browser.SettingsStore;
import org.mozilla.vrbrowser.browser.engine.EngineProvider;
import org.mozilla.vrbrowser.browser.engine.SessionStore;
Expand Down Expand Up @@ -105,6 +106,7 @@ public void updateUI() {

// Inflate this data binding layout
mBinding = DataBindingUtil.inflate(inflater, R.layout.voice_search_dialog, this, true);
mBinding.setLifecycleOwner((VRBrowserActivity)getContext());

Drawable mVoiceInputBackgroundDrawable = getResources().getDrawable(R.drawable.ic_voice_search_volume_input_black, getContext().getTheme());
mVoiceInputClipDrawable = new ClipDrawable(getContext().getDrawable(R.drawable.ic_voice_search_volume_input_clip), Gravity.START, ClipDrawable.HORIZONTAL);
Expand Down

0 comments on commit bd03af2

Please sign in to comment.