Class ScalingModeSelectionDialogFragment

All Implemented Interfaces:
ComponentCallbacks, ComponentCallbacks2, DialogInterface.OnCancelListener, DialogInterface.OnClickListener, DialogInterface.OnDismissListener, View.OnCreateContextMenuListener

public class ScalingModeSelectionDialogFragment extends AbstractSelectionDialog<Integer>
This is a utility class that allows you to create a DialogFragment that can be used to switch scaling modes (see PlayerView.setScalingMode(int)). See the various newInstance methods on how to customize the dialog.

Note that the hosting activity that starts the dialog should implement the PlayerViewProvider interface as the dialog needs to be able to access the underlying IPlayerView to retrieve its data and apply the selection even when the system disposes and recreates the dialog.

Since:
3.0.0
  • Constructor Details

    • ScalingModeSelectionDialogFragment

      public ScalingModeSelectionDialogFragment()
  • Method Details

    • newInstance

      public static ScalingModeSelectionDialogFragment newInstance(IPlayerView playerView, String title)
      Creates a new dialog fragment that shows the available scaling modes and allows selecting the new mode.
      Parameters:
      playerView - The player view
      title - the dialog title
      Returns:
      The dialog fragment
    • newInstance

      public static ScalingModeSelectionDialogFragment newInstance(IPlayerView playerView, String title, Converter<Integer,String> converter)
      Creates a new dialog fragment that shows the available scaling modes and allows selecting the new mode.
      Parameters:
      playerView - The player view
      title - the dialog title
      converter - The converter that is used to translate the existing scaling modes to string representations
      Returns:
      The dialog fragment