Open priya-zha opened 1 year ago
Fixed solution: (getstarted page)
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == SPEECH_REQUEST_CODE && resultCode == Activity.RESULT_OK && data != null) {
ArrayList<String> matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
if (matches != null && !matches.isEmpty()) {
String recognizedText = matches.get(0).toLowerCase();
if (recognizedText.equals("start")) {
// User said "start"
start.setBackgroundColor(Color.parseColor("#FF0000"));
navigateToSecondPage();
}
}
}
Steps to reproduce: Say start on the getstarted page and notice that the background color of the start button doesn't change its color unlike the voice selection screen
Actual Result: The background color of the button doesn't update when user says 'start' or 'next' in getstarted page and in the help page, to show that the user voice was successfully taken by the application in a similar way how it is shown on the voice selection page where UI button element gets to red when user chooses a male/female voice
Expected Result: The UI background of the 'start' and 'next' button in getstarted and help page should change its color to red like that of the voiceselection page
Before fixing:
https://github.com/priya-zha/Software-Engineering-Project/assets/34065075/ca6c411d-7c2d-4880-b6df-c0f6045a4bf8
After fixing:
https://github.com/priya-zha/Software-Engineering-Project/assets/34065075/99b050c7-d3a6-49d0-87f1-4afc0f8912ca