-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
base: main
Are you sure you want to change the base?
Conversation
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.
There was a problem hiding this 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(); | ||
} |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
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
andvisionglass
flavours. Maybe this is something that we could improve in the future.