/** * This function is called when the user clicks submit on a RoboAppDialogFragment. It sends the * command entered in the dialog to the RoboCat and updates the command display. * * @param dialog - the DialogFragment the user interacted with. */ public void onCommandSubmitClick(DialogFragment dialog) { boolean success = true; RoboAppDialogFragment d = (RoboAppDialogFragment) dialog; try { Control.sendManualCommand(d.getData()); } catch (NumberFormatException e) { success = false; } if (success) HWSectionFragment.updateOutput(); }
/** * This function clears the Command Display and the command history. * * @param v - the view of the widget calling this function */ public void resetDisplay(View v) { RoboCatActivity.clearGaitButton(); HWSectionFragment.updateOutput(); // Examples of audio playback in different section of the app // -----From a static context---- // String [] aud = getResources().getStringArray(R.array.audio_files); // try{ // AudioChooser.Play_audio(v.getContext(),"Scream",aud); // } // catch (FileNotFoundException f){ // // } // -----From a non-static context---- // AudioChooser.Play_audio(v.getContext(),"Scream"); }