Java 类android.support.v17.leanback.widget.OnItemViewClickedListener 实例源码

项目:leanback-homescreen-channels    文件:TvSearchFragment.java   
private OnItemViewClickedListener getDefaultItemClickedListener() {
    return new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
                RowPresenter.ViewHolder rowViewHolder, Row row) {
            if (item instanceof Clip) {
                Toast.makeText(getActivity(), "** toggle selected **",
                        Toast.LENGTH_LONG).show();
            } else {
                Toast.makeText(getActivity(), "** add as playlist **",
                        Toast.LENGTH_LONG).show();

            }
        }
    };
}
项目:aos-Video    文件:ListingFragment.java   
protected void setupEventListeners() {
    setOnItemViewClickedListener(new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, Row row) {
            if (item instanceof MetaFile2) {
                MetaFile2 file = (MetaFile2) item;
                if (file.isDirectory()) {
                    openDirectory(file);
                } else {
                    String mimeType = MimeUtils.guessMimeTypeFromExtension(file.getExtension());
                    PlayUtils.openAnyFile(file, getActivity());

                }
            } else if (item instanceof Video) {
                openDetailsActivity((Video) item, itemViewHolder);
            } else {
                throw new IllegalArgumentException("Click on an unexpected item type " + item);
            }
        }
    });
}
项目:leanback-showcase    文件:PageAndListRowFragment.java   
private void setupAdapter() {
    VerticalGridPresenter presenter = new VerticalGridPresenter(ZOOM_FACTOR);
    presenter.setNumberOfColumns(COLUMNS);
    setGridPresenter(presenter);

    CardPresenterSelector cardPresenter = new CardPresenterSelector(getActivity());
    mAdapter = new ArrayObjectAdapter(cardPresenter);
    setAdapter(mAdapter);

    setOnItemViewClickedListener(new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(
                Presenter.ViewHolder itemViewHolder,
                Object item,
                RowPresenter.ViewHolder rowViewHolder,
                Row row) {
            Card card = (Card)item;
            Toast.makeText(getActivity(),
                    "Clicked on "+card.getTitle(),
                    Toast.LENGTH_SHORT).show();
        }
    });
}
项目:leanback-showcase    文件:PageAndListRowFragment.java   
public SampleFragmentB() {
    mRowsAdapter = new ArrayObjectAdapter(new ShadowRowPresenterSelector());

    setAdapter(mRowsAdapter);
    setOnItemViewClickedListener(new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(
                Presenter.ViewHolder itemViewHolder,
                Object item,
                RowPresenter.ViewHolder rowViewHolder,
                Row row) {
            Toast.makeText(getActivity(), "Implement click handler", Toast.LENGTH_SHORT)
                    .show();
        }
    });
}
项目:sbs-android-tv    文件:DetailsFragment.java   
private OnItemViewClickedListener getItemClickedListener() {
    return new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, Row row) {
            Log.d(TAG, "Clicked item:" + item);
            if (item instanceof EpisodeBaseModel) {
                EpisodeBaseModel ep = (EpisodeBaseModel) item;
                Intent intent = new Intent(getActivity(), getPlayerActivityClass());
                intent.putExtra(ContentManagerBase.CONTENT_ID, ep);
                String[] others = getOtherEpisodeUrls().toArray(new String[getOtherEpisodeUrls().size()]);
                intent.putExtra(ContentManagerBase.OTHER_EPISODES, others);
                startActivity(intent);
            }
        }
    };
}
项目:danish-media-license    文件:PlaybackFragment.java   
private void initUi() {
  PlaybackControlsRowPresenter presenter = mediaControllerHelper.createControlsRowAndPresenter();
  rows = new ArrayObjectAdapter(presenter);
  rows.add(mediaControllerHelper.getControlsRow());
  setAdapter(rows);
  setOnItemViewClickedListener(new OnItemViewClickedListener() {

    @Override
    public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
                              RowPresenter.ViewHolder rowViewHolder, Row row) {
      if (item instanceof Action) {
        mediaControllerHelper.onActionClicked((Action) item);
      }
    }
  });
}
项目:MediaBrowser.AndroidTv    文件:MySearchFragment.java   
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mRowsAdapter = new ArrayObjectAdapter(new ListRowPresenter());
    setSearchResultProvider(this);
    setOnItemViewClickedListener(new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, Row row) {
            if (!(item instanceof BaseRowItem)) return;
            ItemLauncher.launch((BaseRowItem) item, TvApp.getApplication(), getActivity(), itemViewHolder);
        }
    });
    mDelayedLoad = new SearchRunnable();

    prepareBackgroundManager();
}
项目:iview-android-tv    文件:DetailsFragment.java   
private OnItemViewClickedListener getItemClickedListener() {
    return new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, Row row) {
            Log.d(TAG, "Clicked item:" + item);
            if (item instanceof EpisodeBaseModel) {
                EpisodeBaseModel ep = (EpisodeBaseModel) item;
                Intent intent = new Intent(getActivity(), getPlayerActivityClass());
                intent.putExtra(ContentManagerBase.CONTENT_ID, ep);
                String[] others = getOtherEpisodeUrls().toArray(new String[getOtherEpisodeUrls().size()]);
                intent.putExtra(ContentManagerBase.OTHER_EPISODES, others);
                startActivity(intent);
            }
        }
    };
}
项目:BuildingForAndroidTV    文件:CustomRowsFragment.java   
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    loadVideoData();
    setCustomPadding();
    setOnItemViewClickedListener(new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, Row row) {
            Movie movie = (Movie) item;
            Intent intent = new Intent(getActivity(), MovieDetailsActivity.class);
            intent.putExtra(MovieDetailsActivity.MOVIE, movie);

            Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(
                    getActivity(),
                    ((ImageCardView) itemViewHolder.view).getMainImageView(),
                    MovieDetailsActivity.SHARED_ELEMENT_NAME).toBundle();
            getActivity().startActivity(intent, bundle);
        }
    });
}
项目:aos-Video    文件:ManualScrappingSearchFragment.java   
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mScraper = new Scraper(getActivity());
    mSearchExecutor = new SerialExecutor();

    ClassPresenterSelector rowsPresenterSelector = new ClassPresenterSelector();
    rowsPresenterSelector.addClassPresenter(ListRow.class, new ListRowPresenter());
    rowsPresenterSelector.addClassPresenter(ShadowLessListRow.class, new ShadowLessRowPresenter());
    mRowsAdapter = new ArrayObjectAdapter(rowsPresenterSelector);

    setBadgeDrawable(getResources().getDrawable(R.mipmap.video2));
    setSearchResultProvider(this);
    setOnItemViewClickedListener(new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, Row row) {
            if (item instanceof BaseTags) {
                saveTagsAndFinish((BaseTags) item);
            }
        }
    });
    mSpeechRecognitionCallback = new SpeechRecognitionCallback() {

        @Override
        public void recognizeSpeech() {

            // ACTION_RECOGNIZE_SPEECH
            try{
                startActivityForResult(getRecognizerIntent(), SEARCH_REQUEST_CODE);
            }catch (ActivityNotFoundException e){/*non google device*/}
        }
    };
    setSpeechRecognitionCallback(mSpeechRecognitionCallback);
}
项目:aos-Video    文件:TvshowMoreDetailsFragment.java   
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setTopOffsetRatio(0.6f);

    final Intent intent = getActivity().getIntent();
    mShowId = intent.getLongExtra(EXTRA_TVSHOW_ID, -1);
    mColor = ContextCompat.getColor(getActivity(), R.color.leanback_details_background);
    mOverviewRowPresenter = new DetailsOverviewRowPresenter(new TvshowMoreDetailsDescriptionPresenter());
    mOverviewRowPresenter.setSharedElementEnterTransition(getActivity(), SHARED_ELEMENT_NAME, 1000);
    mOverviewRowPresenter.setBackgroundColor(getResources().getColor(R.color.leanback_details_background));
    mOverviewRowPresenter.setStyleLarge(false);
    mOverviewRowPresenter.setOnActionClickedListener(null);



    setOnItemViewClickedListener(new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, Row row) {
            if (item instanceof ScraperImage) {
                if (row == mPostersRow) {
                    mShowPosterSaverTask = new ShowPosterSaverTask().execute((ScraperImage) item);
                }
                else if (row == mBackdropsRow) {
                    mBackdropSaverTask = new BackdropSaverTask().execute((ScraperImage) item);
                }
            }
            else if (item instanceof WebPageLink) {
                WebPageLink link = (WebPageLink)item;
                WebUtils.openWebLink(getActivity(), link.getUrl());
            }
        }
    });

    // WORKAROUND: at least one instance of BackdropTask must be created soon in the process (onCreate ?)
    // else it does not work later.
    // --> This instance of BackdropTask() will not be used but it must be created here!
    mBackdropTask = new BackdropTask(getActivity(), VideoInfoCommonClass.getDarkerColor(mColor));
}
项目:aos-Video    文件:MyVerticalGridFragment.java   
/**
 * Sets an item clicked listener.
 */
public void setOnItemViewClickedListener(OnItemViewClickedListener listener) {
    mOnItemViewClickedListener = listener;
    if (mGridPresenter != null) {
        mGridPresenter.setOnItemViewClickedListener(mOnItemViewClickedListener);
    }
}
项目:popcorn-android    文件:PTVSearchFragment.java   
protected OnItemViewClickedListener getDefaultItemClickedListener() {
    return new OnItemViewClickedListener() {
        @Override public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object object, RowPresenter.ViewHolder rowViewHolder,
                Row row) {
            if (object instanceof MediaCardPresenter.MediaCardItem) {
                MediaCardPresenter.MediaCardItem item = (MediaCardPresenter.MediaCardItem) object;
                Media media = item.getMedia();
                PTVMediaDetailActivity.startActivity(getActivity(), media);
            }
        }
    };
}
项目:leanback-showcase    文件:CardExampleFragment.java   
private void setupUi() {
    setHeadersState(HEADERS_ENABLED);
    setHeadersTransitionOnBackEnabled(true);
    setTitle(getString(R.string.card_examples_title));
    setOnSearchClickedListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Toast.makeText(getActivity(), getString(R.string.implement_search),
                    Toast.LENGTH_LONG).show();
        }
    });
    setOnItemViewClickedListener(new OnItemViewClickedListener() {

        @Override
        public void onItemClicked(Presenter.ViewHolder viewHolder, Object item, RowPresenter.ViewHolder viewHolder1, Row row) {
            if (!(item instanceof Card)) return;
            if (!(viewHolder.view instanceof ImageCardView)) return;

            ImageView imageView = ((ImageCardView) viewHolder.view).getMainImageView();
            Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(getActivity(),
                    imageView, DetailViewExampleFragment.TRANSITION_NAME).toBundle();
            Intent intent = new Intent(getActivity().getBaseContext(),
                    DetailViewExampleActivity.class);
            Card card = (Card) item;
            int imageResId = card.getLocalImageResourceId(getContext());
            intent.putExtra(DetailViewExampleFragment.EXTRA_CARD, imageResId);
            startActivity(intent, bundle);
        }

    });

    prepareEntranceTransition();
}
项目:leanback-showcase    文件:ListenerModule.java   
@PerFragment
@Provides
@IntoMap
@ListenerModuleKey(LiveDataFragment.class)
public OnItemViewClickedListener provideOnItemViewClickListenerForLiveDataFragment(
        final Activity currentActivity) {
    return new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
                RowPresenter.ViewHolder rowViewHolder, Row row) {
            Intent intent;
            Long videoItemId = ((VideoEntity) item).getId();
            intent = new Intent(currentActivity, LiveDataDetailActivity.class);
            intent.putExtra(LiveDataDetailActivity.VIDEO_ID, videoItemId);

            VideoEntity cachedBundle = (VideoEntity) item;

            intent.putExtra(LiveDataDetailActivity.CACHED_CONTENT, cachedBundle);

            // enable the scene transition animation when the detail's activity is launched
            Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(
                    currentActivity,
                    ((ImageCardView) itemViewHolder.view).getMainImageView(),
                    LiveDataDetailActivity.SHARED_ELEMENT_NAME).toBundle();
            currentActivity.startActivity(intent, bundle);
        }
    };
}
项目:leanback-showcase    文件:ListenerModule.java   
@PerFragment
@Provides
@IntoMap
@ListenerModuleKey(SearchFragment.class)
public OnItemViewClickedListener provideOnItemViewClickListenerForLiveDataDetailFragmentSearch(
        final Activity currentActivity) {
    return new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
                RowPresenter.ViewHolder rowViewHolder, Row row) {
            if (item instanceof VideoEntity) {
                Intent intent;
                Long videoItemId = ((VideoEntity) item).getId();
                intent = new Intent(currentActivity, LiveDataDetailActivity.class);
                intent.putExtra(LiveDataDetailActivity.VIDEO_ID, videoItemId);

                VideoEntity cachedBundle = (VideoEntity) item;

                intent.putExtra(LiveDataDetailActivity.CACHED_CONTENT, cachedBundle);

                // enable the scene transition animation when the detail's activity is launched
                Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(
                        currentActivity,
                        ((ImageCardView) itemViewHolder.view).getMainImageView(),
                        LiveDataDetailActivity.SHARED_ELEMENT_NAME).toBundle();
                currentActivity.startActivity(intent, bundle);
            }
        }
    };
}
项目:leanback-showcase    文件:ListenerModule.java   
@PerFragment
@Provides
@IntoMap
@ListenerModuleKey(LiveDataDetailViewWithVideoBackgroundFragment.class)
public OnItemViewClickedListener provideOnItemViewClickListenerForLiveDataDetailFragment(
        final Activity currentActivity) {
    return new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
                RowPresenter.ViewHolder rowViewHolder, Row row) {
            if (item instanceof VideoEntity) {
                Intent intent;
                Long videoItemId = ((VideoEntity) item).getId();
                intent = new Intent(currentActivity, LiveDataDetailActivity.class);
                intent.putExtra(LiveDataDetailActivity.VIDEO_ID, videoItemId);

                VideoEntity cachedBundle = (VideoEntity) item;

                intent.putExtra(LiveDataDetailActivity.CACHED_CONTENT, cachedBundle);

                // enable the scene transition animation when the detail's activity is launched
                Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(
                        currentActivity,
                        ((ImageCardView) itemViewHolder.view).getMainImageView(),
                        LiveDataDetailActivity.SHARED_ELEMENT_NAME).toBundle();
                currentActivity.startActivity(intent, bundle);
            }
        }
    };
}
项目:leanback-showcase    文件:ListenerFactory.java   
@Inject
public ListenerFactory(Map<Class, OnItemViewClickedListener> onItemViewClickedListenerMap,
        Map<Class, OnItemViewSelectedListener> onItemViewSelectedListenerMap,
        Map<Class, View.OnClickListener> viewOnClickListenerMap) {
    mOnItemViewClickedListenerMap = onItemViewClickedListenerMap;
    mOnItemViewSelectedListenerMap = onItemViewSelectedListenerMap;
    mViewOnClickListenerMap = viewOnClickListenerMap;

}
项目:leanback-showcase    文件:GridFragment.java   
/**
 * Sets an item clicked listener.
 */
public void setOnItemViewClickedListener(OnItemViewClickedListener listener) {
    mOnItemViewClickedListener = listener;
    if (mGridPresenter != null) {
        mGridPresenter.setOnItemViewClickedListener(mOnItemViewClickedListener);
    }
}
项目:sbs-android-tv    文件:SearchFragment.java   
private OnItemViewClickedListener getItemClickedListener() {
    return new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, Row row) {
            if (item instanceof EpisodeBaseModel) {
                Intent intent = new Intent(getActivity(), getDetailsActivityClass());
                intent.putExtra(ContentManagerBase.CONTENT_ID, (EpisodeBaseModel) item);
                startActivity(intent);
            }
        }
    };
}
项目:sbs-android-tv    文件:CategoryFragment.java   
private OnItemViewClickedListener getItemClickedListener() {
    return new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, Row row) {
            if (item instanceof EpisodeBaseModel) {
                Intent intent = new Intent(getActivity(), getDetailsActivityClass());
                intent.putExtra(ContentManagerBase.CONTENT_ID, (EpisodeBaseModel) item);
                startActivity(intent);
            }
        }
    };
}
项目:danish-media-license    文件:DetailsFragment.java   
private void initListeners() {
  setOnItemViewClickedListener(new OnItemViewClickedListener() {
    @Override
    public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
                              RowPresenter.ViewHolder rowViewHolder, Row row) {
      if (row instanceof DetailsOverviewRow) {
        onDetailsRowClicked((DetailsOverviewRow) row, item);
      } else {
        Log.w(TAG, "Unhandled row: " + row);
      }
    }
  });
}
项目:android-tv-leanback    文件:LeanbackBrowseFragment.java   
protected OnItemViewClickedListener getDefaultItemViewClickedListener() {
    return new OnItemViewClickedListener() {

        @Override
        public void onItemClicked(Presenter.ViewHolder viewHolder, Object o, RowPresenter.ViewHolder viewHolder2, Row row) {

            Intent intent = new Intent(getActivity(), VideoDetailsActivity.class);
            intent.putExtra(Video.INTENT_EXTRA_VIDEO, (Serializable) o);
            startActivity(intent);

        }
    };
}
项目:android-tv-leanback    文件:LeanbackBrowseFragment.java   
protected OnItemViewClickedListener getDefaultItemViewClickedListener() {
    return new OnItemViewClickedListener() {

        @Override
        public void onItemClicked(Presenter.ViewHolder viewHolder, Object o, RowPresenter.ViewHolder viewHolder2, Row row) {

            Intent intent = new Intent(getActivity(), VideoDetailsActivity.class);
            intent.putExtra(Video.INTENT_EXTRA_VIDEO, (Serializable) o);
            startActivity(intent);

        }
    };
}
项目:android-tv-leanback    文件:LeanbackBrowseFragment.java   
protected OnItemViewClickedListener getDefaultItemViewClickedListener() {
    return new OnItemViewClickedListener() {

        @Override
        public void onItemClicked(Presenter.ViewHolder viewHolder, Object o, RowPresenter.ViewHolder viewHolder2, Row row) {

            Intent intent = new Intent(getActivity(), VideoDetailsActivity.class);
            intent.putExtra(Video.INTENT_EXTRA_VIDEO, (Serializable) o);
            startActivity(intent);

        }
    };
}
项目:android-tv-leanback    文件:LeanbackBrowseFragment.java   
protected OnItemViewClickedListener getDefaultItemViewClickedListener() {
    return new OnItemViewClickedListener() {

        @Override
        public void onItemClicked(Presenter.ViewHolder viewHolder, Object o, RowPresenter.ViewHolder viewHolder2, Row row) {

            Intent intent = new Intent(getActivity(), VideoDetailsActivity.class);
            intent.putExtra(Video.INTENT_EXTRA_VIDEO, (Serializable) o);
            startActivity(intent);

        }
    };
}
项目:VCL-Android    文件:SearchFragment.java   
protected OnItemViewClickedListener getDefaultItemClickedListener() {
    return new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, Row row) {
            if (item instanceof MediaWrapper) {
                TvUtil.openMedia(mActivity, (MediaWrapper) item, row);
            }
        }
    };
}
项目:spotify-tv    文件:ArtistsDetailsFragment.java   
private void setupFragment() {
    mRowsAdapter = new ArrayObjectAdapter(new ListRowPresenter());
    setAdapter(mRowsAdapter);

    setupTopTracksRow();

    setupAlbumsRows();

    setupRelatedArtistsRows();

    setOnItemViewClickedListener(new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, Row row) {
            if (item instanceof Track) {
                String trackUri = ((Track) item).uri;
                SpotifyPlayerController spotifyPlayerController = SpotifyTvApplication.getInstance().getSpotifyPlayerController();
                if (spotifyPlayerController.getPlayingState().isCurrentTrack(trackUri)) {
                    spotifyPlayerController.togglePauseResume();
                } else {
                    // get song and following ones
                    List<String> trackUris = new ArrayList<>();
                    List<TrackSimple> tracks = new ArrayList<TrackSimple>();
                    for (int i = mTopTrackAdapter.indexOf(item); i < mTopTrackAdapter.size() && i < Constants.MAX_SONGS_PLAYED; i++) {
                        tracks.add((TrackSimple) mTopTrackAdapter.get(i));
                        trackUris.add(((Track) mTopTrackAdapter.get(i)).uri);
                    }
                    spotifyPlayerController.play(trackUri, trackUris, tracks);
                }
            } else {
                SpotifyTvApplication.getInstance().launchDetailScreen(getActivity(), item);
            }
        }
    });
}
项目:spotify-tv    文件:TracksDetailsFragment.java   
private void setupFragment() {
    mDetailsPresenter = new DetailsOverviewRowPresenter(getDetailsPresenter());
    mDetailsPresenter.setStyleLarge(false);

    ClassPresenterSelector ps = new ClassPresenterSelector();
    ps.addClassPresenter(DetailsOverviewRow.class, mDetailsPresenter);
    ps.addClassPresenter(TracksHeaderRow.class, new TracksHeaderRowPresenter());

    OnItemViewClickedListener onTrackRowItemClicked = new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, Row row) {
            if (item instanceof TrackSimple) {
                playFromTrack(((TrackSimple) item));
            }
        }
    };

    ps.addClassPresenter(TrackRow.class, getTrackRowPresenter(onTrackRowItemClicked));

    mRowsAdapter = new ArrayObjectAdapter(ps);

    setAdapter(mRowsAdapter);

    setOnActionClickedListener(new OnActionClickedListener() {
        @Override
        public void onActionClicked(Action action) {
            TracksDetailsFragment.this.onActionClicked(action);
        }
    });
}
项目:spotify-tv    文件:CategoryFragment.java   
private void setupFragment() {
    mAdapter = new ArrayObjectAdapter(new PlaylistSimpleCardPresenter());

    setAdapter(mAdapter);

    setOnItemViewClickedListener(new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, Row row) {
            SpotifyTvApplication.getInstance().launchDetailScreen(getActivity(), item);
        }
    });
}
项目:iview-android-tv    文件:SearchFragment.java   
private OnItemViewClickedListener getItemClickedListener() {
    return new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, Row row) {
            if (item instanceof EpisodeBaseModel) {
                Intent intent = new Intent(getActivity(), getDetailsActivityClass());
                intent.putExtra(ContentManagerBase.CONTENT_ID, (EpisodeBaseModel) item);
                startActivity(intent);
            }
        }
    };
}
项目:iview-android-tv    文件:CategoryFragment.java   
private OnItemViewClickedListener getItemClickedListener() {
    return new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, Row row) {
            if (item instanceof EpisodeBaseModel) {
                Intent intent = new Intent(getActivity(), getDetailsActivityClass());
                intent.putExtra(ContentManagerBase.CONTENT_ID, (EpisodeBaseModel) item);
                startActivity(intent);
            }
        }
    };
}
项目:vlc-android    文件:MusicFragment.java   
@Override
protected void onPostExecute(String title) {
    ((BrowserActivity)getActivity()).showProgress(false);
    setTitle(title);
    setOnItemViewClickedListener(new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
                                  RowPresenter.ViewHolder rowViewHolder, Row row) {
            ListItem listItem = (ListItem) item;
            Intent intent;
            if (CATEGORY_ARTISTS == mCategory) {
                intent = new Intent(mContext, VerticalGridActivity.class);
                intent.putExtra(MainTvActivity.BROWSER_TYPE, MainTvActivity.HEADER_CATEGORIES);
                intent.putExtra(AUDIO_CATEGORY, CATEGORY_ALBUMS);
                intent.putExtra(MEDIA_SECTION, FILTER_ARTIST);
                intent.putExtra(AUDIO_FILTER, listItem.mediaList.get(0).getArtist());
            } else if (CATEGORY_GENRES == mCategory) {
                intent = new Intent(mContext, VerticalGridActivity.class);
                intent.putExtra(MainTvActivity.BROWSER_TYPE, MainTvActivity.HEADER_CATEGORIES);
                intent.putExtra(AUDIO_CATEGORY, CATEGORY_ALBUMS);
                intent.putExtra(MEDIA_SECTION, FILTER_GENRE);
                intent.putExtra(AUDIO_FILTER, listItem.mediaList.get(0).getGenre());
            } else {
                if (CATEGORY_ALBUMS == mCategory)
                    Collections.sort(listItem.mediaList, MediaComparators.byTrackNumber);
                intent = new Intent(mContext, AudioPlayerActivity.class);
                intent.putExtra(AudioPlayerActivity.MEDIA_LIST, listItem.mediaList);
            }
            startActivity(intent);
        }
    });
}
项目:vlc-android    文件:SearchFragment.java   
protected OnItemViewClickedListener getDefaultItemClickedListener() {
    return new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item, RowPresenter.ViewHolder rowViewHolder, Row row) {
            if (item instanceof MediaWrapper) {
                TvUtil.openMedia(mActivity, (MediaWrapper) item, row);
            }
        }
    };
}
项目:adt-leanback-support    文件:VerticalGridSupportFragment.java   
/**
 * Sets an item clicked listener.
 */
public void setOnItemViewClickedListener(OnItemViewClickedListener listener) {
    mOnItemViewClickedListener = listener;
    if (mGridPresenter != null) {
        mGridPresenter.setOnItemViewClickedListener(mOnItemViewClickedListener);
    }
}
项目:adt-leanback-support    文件:RowsSupportFragment.java   
/**
 * Sets an item clicked listener on the fragment.
 * OnItemViewClickedListener will override {@link View.OnClickListener} that
 * item presenter sets during {@link Presenter#onCreateViewHolder(ViewGroup)}.
 * So in general,  developer should choose one of the listeners but not both.
 */
public void setOnItemViewClickedListener(OnItemViewClickedListener listener) {
    mOnItemViewClickedListener = listener;
    if (mViewsCreated) {
        throw new IllegalStateException(
                "Item clicked listener must be set before views are created");
    }
}
项目:adt-leanback-support    文件:DetailsSupportFragment.java   
/**
 * Sets an item Clicked listener.
 */
public void setOnItemViewClickedListener(OnItemViewClickedListener listener) {
    mOnItemViewClickedListener = listener;
    if (mRowsSupportFragment != null) {
        mRowsSupportFragment.setOnItemViewClickedListener(listener);
    }
}
项目:adt-leanback-support    文件:DetailsFragment.java   
/**
 * Sets an item Clicked listener.
 */
public void setOnItemViewClickedListener(OnItemViewClickedListener listener) {
    mOnItemViewClickedListener = listener;
    if (mRowsFragment != null) {
        mRowsFragment.setOnItemViewClickedListener(listener);
    }
}
项目:adt-leanback-support    文件:RowsFragment.java   
/**
 * Sets an item clicked listener on the fragment.
 * OnItemViewClickedListener will override {@link View.OnClickListener} that
 * item presenter sets during {@link Presenter#onCreateViewHolder(ViewGroup)}.
 * So in general,  developer should choose one of the listeners but not both.
 */
public void setOnItemViewClickedListener(OnItemViewClickedListener listener) {
    mOnItemViewClickedListener = listener;
    if (mViewsCreated) {
        throw new IllegalStateException(
                "Item clicked listener must be set before views are created");
    }
}
项目:adt-leanback-support    文件:BrowseFragment.java   
/**
 * Sets an item clicked listener on the fragment.
 * OnItemViewClickedListener will override {@link View.OnClickListener} that
 * item presenter sets during {@link Presenter#onCreateViewHolder(ViewGroup)}.
 * So in general,  developer should choose one of the listeners but not both.
 */
public void setOnItemViewClickedListener(OnItemViewClickedListener listener) {
    mOnItemViewClickedListener = listener;
    if (mRowsFragment != null) {
        mRowsFragment.setOnItemViewClickedListener(listener);
    }
}