Class AccessibleDialogBuilder

  • java.lang.Object
    • uk.ac.qmul.eecs.ccmi.accessibility.AccessibleDialogBuilder


  • public class AccessibleDialogBuilder
    extends java.lang.Object
    • Constructor Detail

      • AccessibleDialogBuilder

        public AccessibleDialogBuilder(FragmentManager fragmentManager)
    • Method Detail

      • setAccessibilityService

        public void setAccessibilityService(AccessibilityService accessibilityService)
        Sets the AccessibilityService for the dialogs. The call to this method must happen before any dialog is displayed. The dialogs will be then accessible through a LayoutSonifier.
        Parameters:
        accessibilityService - the AccessibilityService instance for this class.
      • getAccessibilityService

        public AccessibilityService getAccessibilityService()
        Returns the instance of accessibility service in use. This can be useful to the client of this class to play speech and sound when showing and dismissing dialogs.
        Returns:
        a reference to the AccessibilityService class in use
      • displayDialog

        public void displayDialog(int type,
                                  java.lang.String tag,
                                  AccessibleDialogBuilder.ButtonClickListener buttonClickListener)
        Displays an accessible dialog
        Parameters:
        type - ID for an XML layout resource to load (e.g., R.layout.main_page)
        tag - the tag for this dialog. It's also used uttered out through the speech synthesizer to notify the user the dialog has been displayed
        buttonClickListener - a listener that will be called when any of the buttons of the dialog will be pressed
      • displayTextDialog

        public void displayTextDialog(java.lang.String tag,
                                      java.lang.String text,
                                      AccessibleDialogBuilder.ButtonClickListener buttonClickListener)
        Displays an accessible text dialog. The dialog has one text field for text input, and buttons to confirm or cancel your input.
        Parameters:
        tag - the tag for this dialog. It's also used uttered out through the speech synthesizer to notify the user the dialog has been displayed
        text - optional text to set in the text field before shoing the dialog
        buttonClickListener - a listener that will be called when any of the buttons of the dialog will be pressed
      • displaySelectionDialog

        public void displaySelectionDialog(java.lang.String tag,
                                           java.lang.String[] values,
                                           AccessibleDialogBuilder.ButtonClickListener buttonClickListener)
        Displays an accessible selection dialog. The dialog has one selection box for selection input, and buttons to confirm or cancel your input.
        Parameters:
        tag - tag the tag for this dialog. It's also used uttered out through the speech synthesizer to notify the user the dialog has been displayed
        values - the possible values of the selection box
        buttonClickListener - a listener that will be called when any of the buttons of the dialog will be pressed
      • displayCheckDialog

        public void displayCheckDialog(java.lang.String tag,
                                       java.lang.String[] values,
                                       boolean[] checks,
                                       AccessibleDialogBuilder.ButtonClickListener buttonClickListener)
        Displays an accessible check box dialog. The dialog has one check box for selection input, and buttons to confirm or cancel your input.
        Parameters:
        tag - tag the tag for this dialog. It's also used uttered out through the speech synthesizer to notify the user the dialog has been displayed
        values - the possible values that can be checked
        checks - The initial checks. If valueChecks[i] is true then values[i] will be checked when displayed to the user
        buttonClickListener - a listener that will be called when any of the buttons of the dialog will be pressed