Class SubtitleSelectionDialogFragment

    • Constructor Detail

      • SubtitleSelectionDialogFragment

        public SubtitleSelectionDialogFragment()
    • Method Detail

      • newInstance

        public static SubtitleSelectionDialogFragment newInstance​(IPlayerView playerView,
                                                                  String title)
        Creates a new dialog fragment that shows the available subtitle tracks and allows selecting the new track.

        By default, this dialog will allow to disable the subtitle track.

        The default string representation of the subtitle track is its label (see SubtitleTrack.getLabel()).

        Parameters:
        playerView - The player view
        title - The dialog title
        Returns:
        The dialog fragment
      • newInstance

        public static SubtitleSelectionDialogFragment newInstance​(IPlayerView playerView,
                                                                  String title,
                                                                  boolean allowDisable)
        Creates a new dialog fragment that shows the available subtitle tracks and allows selecting the new track.

        The default string representation of the subtitle track is its label (see SubtitleTrack.getLabel()).

        Parameters:
        playerView - The player view
        title - The dialog title
        allowDisable - If true, the dialog will allow to disable the subtitle track. If you need to specify a custom label for the "disable" entry, use newInstance(IPlayerView, String, boolean, Converter) and specify a custom converter
        Returns:
        The dialog fragment
      • newInstance

        public static SubtitleSelectionDialogFragment newInstance​(IPlayerView playerView,
                                                                  String title,
                                                                  boolean allowDisable,
                                                                  Converter<SubtitleTrack,​String> converter)
        Creates a new dialog fragment that shows the available subtitle tracks and allows selecting the new track.
        Parameters:
        playerView - The player view
        title - The dialog title
        allowDisable - If true, the dialog will allow to disable the subtitle track.
        converter - The converter that is used to translate SubtitleTrack instanced to Strings that are used as labels in the dialog. Note that the converter should translate null to the string representation of the "disable" item if allowDisable is set to true.
        Returns:
        The dialog fragment