FileDocCategorySizeDatePackage
MediaRouteChooserDialogFragment.javaAPI DocAndroid 5.1 API3351Thu Mar 12 22:22:10 GMT 2015com.android.internal.app

MediaRouteChooserDialogFragment

public class MediaRouteChooserDialogFragment extends android.app.DialogFragment
Media route chooser dialog fragment.

Creates a {@link MediaRouteChooserDialog}. The application may subclass this dialog fragment to customize the media route chooser dialog.

TODO: Move this back into the API, as in the support library media router.

Fields Summary
private final String
ARGUMENT_ROUTE_TYPES
private View.OnClickListener
mExtendedSettingsClickListener
Constructors Summary
public MediaRouteChooserDialogFragment()
Creates a media route chooser dialog fragment.

All subclasses of this class must also possess a default constructor.


                             
      
        setCancelable(true);
        setStyle(STYLE_NORMAL, android.R.style.Theme_DeviceDefault_Dialog);
    
Methods Summary
public intgetRouteTypes()

        Bundle args = getArguments();
        return args != null ? args.getInt(ARGUMENT_ROUTE_TYPES) : 0;
    
public MediaRouteChooserDialogonCreateChooserDialog(android.content.Context context, android.os.Bundle savedInstanceState)
Called when the chooser dialog is being created.

Subclasses may override this method to customize the dialog.

        return new MediaRouteChooserDialog(context, getTheme());
    
public android.app.DialogonCreateDialog(android.os.Bundle savedInstanceState)

        MediaRouteChooserDialog dialog = onCreateChooserDialog(getActivity(), savedInstanceState);
        dialog.setRouteTypes(getRouteTypes());
        dialog.setExtendedSettingsClickListener(mExtendedSettingsClickListener);
        return dialog;
    
public voidsetExtendedSettingsClickListener(View.OnClickListener listener)

        if (listener != mExtendedSettingsClickListener) {
            mExtendedSettingsClickListener = listener;

            MediaRouteChooserDialog dialog = (MediaRouteChooserDialog)getDialog();
            if (dialog != null) {
                dialog.setExtendedSettingsClickListener(listener);
            }
        }
    
public voidsetRouteTypes(int types)

        if (types != getRouteTypes()) {
            Bundle args = getArguments();
            if (args == null) {
                args = new Bundle();
            }
            args.putInt(ARGUMENT_ROUTE_TYPES, types);
            setArguments(args);

            MediaRouteChooserDialog dialog = (MediaRouteChooserDialog)getDialog();
            if (dialog != null) {
                dialog.setRouteTypes(types);
            }
        }