当前位置: 首页>>代码示例>>Java>>正文


Java RowPresenter类代码示例

本文整理汇总了Java中android.support.v17.leanback.widget.RowPresenter的典型用法代码示例。如果您正苦于以下问题:Java RowPresenter类的具体用法?Java RowPresenter怎么用?Java RowPresenter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RowPresenter类属于android.support.v17.leanback.widget包,在下文中一共展示了RowPresenter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import android.support.v17.leanback.widget.RowPresenter; //导入依赖的package包/类
@Override
public void onCreate(ItemBridgeAdapter.ViewHolder vh) {
    VerticalGridView listView = getVerticalGridView();
    if (listView != null && ((RowPresenter) vh.getPresenter()).canDrawOutOfBounds()) {
        listView.setClipChildren(false);
    }
    setupSharedViewPool(vh);
    mViewsCreated = true;
    vh.setExtraObject(new RowViewHolderExtra(vh));
    // selected state is initialized to false, then driven by grid view onChildSelected
    // events.  When there is rebind, grid view fires onChildSelected event properly.
    // So we don't need do anything special later in onBind or onAttachedToWindow.
    setRowViewSelected(vh, false, true);
    if (mExternalAdapterListener != null) {
        mExternalAdapterListener.onCreate(vh);
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:18,代码来源:RowsSupportFragment.java

示例2: onItemClicked

import android.support.v17.leanback.widget.RowPresenter; //导入依赖的package包/类
@Override
public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
                          RowPresenter.ViewHolder rowViewHolder, Row row) {

    if (item instanceof Movie) {
        Movie movie = (Movie) item;
        Log.d(TAG, "Item: " + item.toString());
        Intent intent = new Intent(getActivity(), DetailsActivity.class);
        intent.putExtra(getResources().getString(R.string.movie), mSelectedMovie);
        intent.putExtra(getResources().getString(R.string.should_start), true);
        startActivity(intent);


        Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(
                getActivity(),
                ((ImageCardView) itemViewHolder.view).getMainImageView(),
                DetailsActivity.SHARED_ELEMENT_NAME).toBundle();
        getActivity().startActivity(intent, bundle);
    }
}
 
开发者ID:bassaer,项目名称:HelloTV,代码行数:21,代码来源:VideoDetailsFragment.java

示例3: onItemClicked

import android.support.v17.leanback.widget.RowPresenter; //导入依赖的package包/类
@Override
public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
                          RowPresenter.ViewHolder rowViewHolder, Row row) {

    if (item instanceof Movie) {
        Log.d(TAG, "Item: " + item.toString());
        Intent intent = new Intent(getActivity(), DetailsActivity.class);
        intent.putExtra(getResources().getString(R.string.movie), mSelectedMovie);

        Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(
                getActivity(),
                ((ImageCardView) itemViewHolder.view).getMainImageView(),
                DetailsActivity.SHARED_ELEMENT_NAME).toBundle();
        getActivity().startActivity(intent, bundle);
    }
}
 
开发者ID:alphater,项目名称:garras,代码行数:17,代码来源:VideoDetailsFragment.java

示例4: onItemClicked

import android.support.v17.leanback.widget.RowPresenter; //导入依赖的package包/类
@Override
public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
                          RowPresenter.ViewHolder rowViewHolder, Row row) {

    if (item instanceof Video) {
        Video video = (Video) item;
        Intent intent = new Intent(getActivity(), PlaybackOverlayActivity.class);
        intent.putExtra(VideoDetailsActivity.VIDEO, video);

        Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(
                getActivity(),
                ((ImageCardView) itemViewHolder.view).getMainImageView(),
                VideoDetailsActivity.SHARED_ELEMENT_NAME).toBundle();
        getActivity().startActivity(intent, bundle);
    }
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:17,代码来源:PlaybackOverlayFragment.java

示例5: onItemClicked

import android.support.v17.leanback.widget.RowPresenter; //导入依赖的package包/类
@Override
public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
                          RowPresenter.ViewHolder rowViewHolder, Row row) {

    if (item instanceof Video) {
        Video video = (Video) item;
        Intent intent = new Intent(getActivity(), VideoDetailsActivity.class);
        intent.putExtra(VideoDetailsActivity.VIDEO, video);

        Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(
                getActivity(),
                ((ImageCardView) itemViewHolder.view).getMainImageView(),
                VideoDetailsActivity.SHARED_ELEMENT_NAME).toBundle();
        getActivity().startActivity(intent, bundle);
    }
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:17,代码来源:VideoDetailsFragment.java

示例6: onItemClicked

import android.support.v17.leanback.widget.RowPresenter; //导入依赖的package包/类
@Override
public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
                          RowPresenter.ViewHolder rowViewHolder, Row row) {

    if (item instanceof Video) {
        Video video = (Video) item;
        Intent intent = new Intent(getActivity(), VideoDetailsActivity.class);
        intent.putExtra(VideoDetailsActivity.VIDEO, video);

        Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(
                getActivity(),
                ((ImageCardView) itemViewHolder.view).getMainImageView(),
                VideoDetailsActivity.SHARED_ELEMENT_NAME).toBundle();
        getActivity().startActivity(intent, bundle);
    } else {
        Toast.makeText(getActivity(), ((String) item), Toast.LENGTH_SHORT).show();
    }
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:19,代码来源:SearchFragment.java

示例7: onItemClicked

import android.support.v17.leanback.widget.RowPresenter; //导入依赖的package包/类
@Override
public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
                          RowPresenter.ViewHolder rowViewHolder, Row row) {

    if (item instanceof Video) {
        Video video = (Video) item;

        Intent intent = new Intent(getActivity(), VideoDetailsActivity.class);
        intent.putExtra(VideoDetailsActivity.VIDEO, video);

        Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(
                getActivity(),
                ((ImageCardView) itemViewHolder.view).getMainImageView(),
                VideoDetailsActivity.SHARED_ELEMENT_NAME).toBundle();
        getActivity().startActivity(intent, bundle);
    }
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:18,代码来源:VerticalGridFragment.java

示例8: onItemClicked

import android.support.v17.leanback.widget.RowPresenter; //导入依赖的package包/类
@Override
public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
        RowPresenter.ViewHolder rowViewHolder, Row row) {
    if (isAdded()) {
        if (item instanceof Clip) {
            Clip clip = (Clip) item;
            Intent intent = new Intent(getActivity(), PlaybackActivity.class);
            intent.putExtra(PlaybackActivity.EXTRA_CLIP, clip);
            startActivity(intent);
            final long programId = clip.getProgramId();
            if (programId != 0) {
                // This clip is published as a program. Increment the view count for the
                // program to demonstrate updating.
                new SetViewCountInBackground(programId, clip.incrementViewCount());
            }
        }
    }
}
 
开发者ID:googlesamples,项目名称:leanback-homescreen-channels,代码行数:19,代码来源:MainFragment.java

示例9: getDefaultItemClickedListener

import android.support.v17.leanback.widget.RowPresenter; //导入依赖的package包/类
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();

            }
        }
    };
}
 
开发者ID:googlesamples,项目名称:leanback-homescreen-channels,代码行数:17,代码来源:TvSearchFragment.java

示例10: setupEventListeners

import android.support.v17.leanback.widget.RowPresenter; //导入依赖的package包/类
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);
            }
        }
    });
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:22,代码来源:ListingFragment.java

示例11: createRowViewHolder

import android.support.v17.leanback.widget.RowPresenter; //导入依赖的package包/类
@Override
protected RowPresenter.ViewHolder createRowViewHolder(ViewGroup parent) {
    mR = parent.getResources();

    // We create the base class view holder first
    ViewHolder fullWidthViewHolder = (ViewHolder)super.createRowViewHolder(parent);

    // We expand the info view and put it inside the parent fullwidth container
    ViewGroup fullwidthContainer = (ViewGroup)fullWidthViewHolder.getMainContainer();
    View detailsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.androidtv_details_text_only_group, fullwidthContainer, false);
    fullwidthContainer.addView(detailsView);

    fullwidthContainer.setBackgroundColor(mColor);

    return new FullTextRowViewHolder(fullWidthViewHolder, detailsView);
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:17,代码来源:FullTextRowPresenter.java

示例12: createRowViewHolder

import android.support.v17.leanback.widget.RowPresenter; //导入依赖的package包/类
@Override
protected RowPresenter.ViewHolder createRowViewHolder(ViewGroup parent) {
    mR = parent.getResources();

    // We create the base class view holder first
    FullWidthRowPresenter.ViewHolder fullWidthViewHolder = (FullWidthRowPresenter.ViewHolder)super.createRowViewHolder(parent);

    // We expand the info view and put it inside the parent fullwidth container
    ViewGroup fullwidthContainer = (ViewGroup)fullWidthViewHolder.getMainContainer();
    View detailsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.androidtv_detailled_info_group, fullwidthContainer, false);
    fullwidthContainer.addView(detailsView);

    fullwidthContainer.setBackgroundColor(mColor);

    return new FileDetailsViewHolder(fullWidthViewHolder, detailsView);
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:17,代码来源:FileDetailsRowPresenter.java

示例13: createRowViewHolder

import android.support.v17.leanback.widget.RowPresenter; //导入依赖的package包/类
@Override
protected RowPresenter.ViewHolder createRowViewHolder(ViewGroup parent) {
    mR = parent.getResources();

    // We create the base class view holder first
    ViewHolder fullWidthViewHolder = (ViewHolder)super.createRowViewHolder(parent);

    // We expand the info view and put it inside the parent fullwidth container
    ViewGroup fullwidthContainer = (ViewGroup)fullWidthViewHolder.getMainContainer();
    View detailsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.leanback_details_plot_and_genres_group, fullwidthContainer, false);
    fullwidthContainer.addView(detailsView);

    fullwidthContainer.setBackgroundColor(mColor);

    return new PlotAndGenresViewHolder(fullWidthViewHolder, detailsView);
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:17,代码来源:PlotAndGenresRowPresenter.java

示例14: onBindRowViewHolder

import android.support.v17.leanback.widget.RowPresenter; //导入依赖的package包/类
@Override
protected void onBindRowViewHolder(RowPresenter.ViewHolder holder, Object item) {
    super.onBindRowViewHolder(holder, item);
    PlotAndGenresViewHolder vh = (PlotAndGenresViewHolder) holder;
    vh.mFullWidthViewHolder.getMainContainer().setBackgroundColor(mColor);

    PlotAndGenresRow row = (PlotAndGenresRow) item;

    vh.mPlotTv.setText(row.getPlot());

    if (row.getGenres()!=null && !row.getGenres().isEmpty()) {
        vh.mGenresTv.setText(row.getGenres());
        vh.mGenresTv.setVisibility(View.VISIBLE);
    } else {
        vh.mGenresTv.setVisibility(View.GONE);
    }
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:18,代码来源:PlotAndGenresRowPresenter.java

示例15: createRowViewHolder

import android.support.v17.leanback.widget.RowPresenter; //导入依赖的package包/类
@Override
protected RowPresenter.ViewHolder createRowViewHolder(ViewGroup parent) {
    mR = parent.getResources();

    // We create the base class view holder first
    ViewHolder fullWidthViewHolder = (ViewHolder)super.createRowViewHolder(parent);

    // We expand the info view and put it inside the parent fullwidth container
    ViewGroup fullwidthContainer = (ViewGroup)fullWidthViewHolder.getMainContainer();
    View detailsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.leanback_details_director_and_cast_group, fullwidthContainer, false);
    fullwidthContainer.addView(detailsView);

    fullwidthContainer.setBackgroundColor(mColor);

    return new CastViewHolder(fullWidthViewHolder, detailsView);
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:17,代码来源:CastRowPresenter.java


注:本文中的android.support.v17.leanback.widget.RowPresenter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。