android.support.v7.app.MediaRouteChooserDialogFragment Java Examples

The following examples show how to use android.support.v7.app.MediaRouteChooserDialogFragment. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RemoteMediaPlayerController.java    From delion with Apache License 2.0 6 votes vote down vote up
private void showMediaRouteDialog(MediaStateListener player, MediaRouteController controller,
        Activity activity) {

    FragmentManager fm = ((FragmentActivity) activity).getSupportFragmentManager();
    if (fm == null) {
        throw new IllegalStateException("The activity must be a subclass of FragmentActivity");
    }

    MediaRouteDialogFactory factory = new MediaRouteChooserDialogFactory(player, controller,
            activity);

    if (fm.findFragmentByTag(
            "android.support.v7.mediarouter:MediaRouteChooserDialogFragment") != null) {
        Log.w(TAG, "showDialog(): Route chooser dialog already showing!");
        return;
    }
    MediaRouteChooserDialogFragment f = factory.onCreateChooserDialogFragment();

    f.setRouteSelector(controller.buildMediaRouteSelector());
    f.show(fm, "android.support.v7.mediarouter:MediaRouteChooserDialogFragment");
}
 
Example #2
Source File: RemoteMediaPlayerController.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
private void showMediaRouteDialog(MediaStateListener player, MediaRouteController controller,
        Activity activity) {

    FragmentManager fm = ((FragmentActivity) activity).getSupportFragmentManager();
    if (fm == null) {
        throw new IllegalStateException("The activity must be a subclass of FragmentActivity");
    }

    MediaRouteDialogFactory factory = new MediaRouteChooserDialogFactory(player, controller,
            activity);

    if (fm.findFragmentByTag(
            "android.support.v7.mediarouter:MediaRouteChooserDialogFragment") != null) {
        Log.w(TAG, "showDialog(): Route chooser dialog already showing!");
        return;
    }
    MediaRouteChooserDialogFragment f = factory.onCreateChooserDialogFragment();

    f.setRouteSelector(controller.buildMediaRouteSelector());
    f.show(fm, "android.support.v7.mediarouter:MediaRouteChooserDialogFragment");
}
 
Example #3
Source File: RemoteMediaPlayerController.java    From 365browser with Apache License 2.0 6 votes vote down vote up
private void showMediaRouteDialog(MediaStateListener player, MediaRouteController controller,
        Activity activity) {

    FragmentManager fm = ((FragmentActivity) activity).getSupportFragmentManager();
    if (fm == null) {
        throw new IllegalStateException("The activity must be a subclass of FragmentActivity");
    }

    MediaRouteDialogFactory factory = new MediaRouteChooserDialogFactory(player, controller,
            activity);

    if (fm.findFragmentByTag(
            "android.support.v7.mediarouter:MediaRouteChooserDialogFragment") != null) {
        Log.w(TAG, "showDialog(): Route chooser dialog already showing!");
        return;
    }
    MediaRouteChooserDialogFragment f = factory.onCreateChooserDialogFragment();

    f.setRouteSelector(controller.buildMediaRouteSelector());
    f.show(fm, "android.support.v7.mediarouter:MediaRouteChooserDialogFragment");
}
 
Example #4
Source File: MediaRouteChooserDialogFactory.java    From delion with Apache License 2.0 4 votes vote down vote up
@Override
public MediaRouteChooserDialogFragment onCreateChooserDialogFragment() {
    return new Fragment(mController, mPlayer);
}
 
Example #5
Source File: MediaRouteChooserDialogFactory.java    From AndroidChromium with Apache License 2.0 4 votes vote down vote up
@Override
public MediaRouteChooserDialogFragment onCreateChooserDialogFragment() {
    return new Fragment(mController, mPlayer);
}
 
Example #6
Source File: MediaRouteChooserDialogFactory.java    From 365browser with Apache License 2.0 4 votes vote down vote up
@Override
public MediaRouteChooserDialogFragment onCreateChooserDialogFragment() {
    return new Fragment(mController, mPlayer);
}
 
Example #7
Source File: CustomMediaRouteDialogFactory.java    From Popeens-DSub with GNU General Public License v3.0 4 votes vote down vote up
@Override
public MediaRouteChooserDialogFragment onCreateChooserDialogFragment() {
	return new CustomMediaRouteChooserDialogFragment();
}