Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Vision Glass] Voice button can be used for search and text input #1449

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

felipeerias
Copy link
Contributor

Set up the connection to the Huawei Speech Recognition service.

The voice button on the phone UI will perform a search if the user is not currently writing on a text field (and therefore the keyboard is not visible).

When the keyboard is visible, the voice button will capture text which will be entered into the text field that the user is editing.

This PR also fixes a couple of crashes when the voice recogniser could not be properly initialised.

It is a bit inconvenient that the implementation of this functionality is split between the hvr and visionglass flavours. Maybe this is something that we could improve in the future.

Move the implementation of each system functionality to a separate
package, so it is easier to integrate them in other flavours.
Set up the connection to the Huawei Speech Recognition service.

The voice button on the phone UI will perform a search if the user
is not currently writing on a text field (and therefore the keyboard
is not visible).

When the keyboard is visible, the voice button will capture text which
will be entered into the text field that the user is editing.
Copy link
Member

@svillar svillar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just have some minor nits to fix before landing

mSupportedLanguages = Collections.emptyList();
} else {
mSupportedLanguages = speechRecognizer.getSupportedLanguages();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as it's just an assignment I think we can just use the ternary operator and do it in one line

@@ -503,6 +508,27 @@ private void updateDisplays() {
mViewModel.updateConnectionState(PhoneUIViewModel.ConnectionState.DISPLAY_UNAVAILABLE);
}

private void initializeAGConnect() {
Log.e(LOGTAG, "initializeAGConnect");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed, and not an error anyway.

@@ -7,7 +7,6 @@ public abstract class PlatformActivityPlugin {
public interface PlatformActivityPluginListener {
void onPlatformScrollEvent(float distanceX, float distanceY);
}
abstract void onKeyboardVisibilityChange(boolean isVisible);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice that we can remove this, I've never really liked it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants