Search in sources :

Example 1 with CustomMediaRouteActionProvider

use of com.simplecity.amp_library.ui.views.CustomMediaRouteActionProvider in project Shuttle by timusus.

the class BaseFragment method setupCastMenu.

protected void setupCastMenu(Menu menu) {
    if (getActivity() instanceof BaseCastActivity) {
        BaseCastManager castManager = ((BaseCastActivity) getActivity()).castManager;
        castManager.addMediaRouterButton(menu, R.id.media_route_menu_item);
        MenuItem mediaRouteMenuItem = menu.findItem(R.id.media_route_menu_item);
        ((CustomMediaRouteActionProvider) MenuItemCompat.getActionProvider(mediaRouteMenuItem)).setActivity(getActivity());
    }
}
Also used : CustomMediaRouteActionProvider(com.simplecity.amp_library.ui.views.CustomMediaRouteActionProvider) BaseCastActivity(com.simplecity.amp_library.ui.activities.BaseCastActivity) MenuItem(android.view.MenuItem) BaseCastManager(com.google.android.libraries.cast.companionlibrary.cast.BaseCastManager)

Aggregations

MenuItem (android.view.MenuItem)1 BaseCastManager (com.google.android.libraries.cast.companionlibrary.cast.BaseCastManager)1 BaseCastActivity (com.simplecity.amp_library.ui.activities.BaseCastActivity)1 CustomMediaRouteActionProvider (com.simplecity.amp_library.ui.views.CustomMediaRouteActionProvider)1