• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ObjectAdapter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: init

import android.support.v17.leanback.widget.ObjectAdapter; //导入依赖的package包/类
public void init() {
    mRowsAdapter = new ArrayObjectAdapter(new ListRowPresenter());
    setAdapter(mRowsAdapter);

    setBrandColor(ContextCompat.getColor(getContext(), R.color.primary));
    setBadgeDrawable(ContextCompat.getDrawable(getContext(), R.drawable.filmi));

    for (int position = 0; position < HEADERS.length; position++) {
        ObjectAdapter rowContents = new CursorObjectAdapter((new SinglePresenterSelector(new CardPresenter())));
        VideoDataManager manager = new VideoDataManager(getActivity(), getLoaderManager(), VideoItemContract.VideoItem.buildDirUri(), rowContents);
        manager.startDataLoading();

        HeaderItem headerItem = new HeaderItem(position, HEADERS[position]);
        mRowsAdapter.add(new ListRow(headerItem, manager.getItemList()));
    }

    setOnItemViewClickedListener(getDefaultItemViewClickedListener());
    setOnItemViewSelectedListener(getDefaultItemSelectedListener());

    bgHelper = new BackgroundHelper(getActivity());
    bgHelper.prepareBackgroundManager();

}
 
开发者ID:googlecodelabs,项目名称:android-tv-leanback,代码行数:24,代码来源:LeanbackBrowseFragment.java


示例2: init

import android.support.v17.leanback.widget.ObjectAdapter; //导入依赖的package包/类
public void init() {
    mRowsAdapter = new ArrayObjectAdapter(new ListRowPresenter());
    setAdapter(mRowsAdapter);

    setBrandColor(ContextCompat.getColor(getContext(), R.color.primary));
    setBadgeDrawable(ContextCompat.getDrawable(getContext(), R.drawable.filmi));

    for (int position = 0; position < HEADERS.length; position++) {
        ObjectAdapter rowContents = new CursorObjectAdapter((new SinglePresenterSelector(new CardPresenter())));
        VideoDataManager manager = new VideoDataManager(getActivity(), getLoaderManager(), VideoItemContract.VideoItem.buildDirUri(), rowContents);
        manager.startDataLoading();

        HeaderItem headerItem = new HeaderItem(position, HEADERS[position]);
        mRowsAdapter.add(new ListRow(headerItem, manager.getItemList()));
    }

    setOnItemViewClickedListener(getDefaultItemViewClickedListener());

}
 
开发者ID:googlecodelabs,项目名称:android-tv-leanback,代码行数:20,代码来源:LeanbackBrowseFragment.java


示例3: init

import android.support.v17.leanback.widget.ObjectAdapter; //导入依赖的package包/类
public void init() {
    mRowsAdapter = new ArrayObjectAdapter(new ListRowPresenter());
    setAdapter(mRowsAdapter);

    setBrandColor(ContextCompat.getColor(getContext(), R.color.primary));
    setBadgeDrawable(ContextCompat.getDrawable(getContext(), R.drawable.filmi));

    for (int position = 0; position < HEADERS.length; position++) {
        ObjectAdapter rowContents = new CursorObjectAdapter((new SinglePresenterSelector(new CardPresenter())));
        VideoDataManager manager = new VideoDataManager(getActivity(), getLoaderManager(), VideoItemContract.VideoItem.buildDirUri(), rowContents);
        manager.startDataLoading();

        HeaderItem headerItem = new HeaderItem(position, HEADERS[position]);
        mRowsAdapter.add(new ListRow(headerItem, manager.getItemList()));
    }

}
 
开发者ID:googlecodelabs,项目名称:android-tv-leanback,代码行数:18,代码来源:LeanbackBrowseFragment.java


示例4: run

import android.support.v17.leanback.widget.ObjectAdapter; //导入依赖的package包/类
@Override
public void run() {
    // Retrieve the result adapter
    ObjectAdapter adapter = mProvider.getResultsAdapter();
    if (adapter != mResultAdapter) {
        boolean firstTime = mResultAdapter == null;
        releaseAdapter();
        mResultAdapter = adapter;
        if (mResultAdapter != null) {
            mResultAdapter.registerObserver(mAdapterObserver);
        }
        if (null != mRowsSupportFragment) {
            // delay the first time to avoid setting a empty result adapter
            // until we got first onChange() from the provider
            if (!(firstTime && (mResultAdapter == null || mResultAdapter.size() == 0))) {
                mRowsSupportFragment.setAdapter(mResultAdapter);
            }
            executePendingQuery();
        }
        updateSearchBarNextFocusId();
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:23,代码来源:SearchSupportFragment.java


示例5: run

import android.support.v17.leanback.widget.ObjectAdapter; //导入依赖的package包/类
@Override
public void run() {
    // Retrieve the result adapter
    ObjectAdapter adapter = mProvider.getResultsAdapter();
    if (adapter != mResultAdapter) {
        boolean firstTime = mResultAdapter == null;
        releaseAdapter();
        mResultAdapter = adapter;
        if (mResultAdapter != null) {
            mResultAdapter.registerObserver(mAdapterObserver);
        }
        if (null != mRowsFragment) {
            // delay the first time to avoid setting a empty result adapter
            // until we got first onChange() from the provider
            if (!(firstTime && (mResultAdapter == null || mResultAdapter.size() == 0))) {
                mRowsFragment.setAdapter(mResultAdapter);
            }
            executePendingQuery();
        }
        updateSearchBarNextFocusId();
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:23,代码来源:SearchFragment.java


示例6: isEmptyViewRow

import android.support.v17.leanback.widget.ObjectAdapter; //导入依赖的package包/类
/**
 * @param adapter
 * @return true if the adapter is an ArrayObjectAdapter containing just one EmptyView object
 */
private boolean isEmptyViewRow(ObjectAdapter adapter) {
    if (adapter instanceof ArrayObjectAdapter) {
        ArrayObjectAdapter arrayObjectAdapter = (ArrayObjectAdapter)adapter;
        if (arrayObjectAdapter.size()==1) {
            if (arrayObjectAdapter.get(0) instanceof EmptyView) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:16,代码来源:MainFragment.java


示例7: IconListRow

import android.support.v17.leanback.widget.ObjectAdapter; //导入依赖的package包/类
public IconListRow(long id, HeaderItem headerItem, ObjectAdapter adapter) {
    super(id, headerItem, adapter);

    // Make sure the adapter contain only Icon objects
    for (int i=0; i<adapter.size(); i++) {
        Object o = adapter.get(i);
        if ( !(adapter.get(i) instanceof Icon) ) {
            throw new IllegalArgumentException("IconListRow must contain only Icon objects! not this: "+adapter.get(i));
        }
    }
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:12,代码来源:IconListRow.java


示例8: assertContentsInOrder

import android.support.v17.leanback.widget.ObjectAdapter; //导入依赖的package包/类
private static void assertContentsInOrder(ObjectAdapter adapter, Object... contents) {
    int ex = contents.length;
    assertEquals("size", ex, adapter.size());
    for (int i = 0; i < ex; i++) {
        assertEquals("element " + 1, contents[i], adapter.get(i));
    }
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:8,代码来源:SortedArrayAdapterTest.java


示例9: VideoDataManager

import android.support.v17.leanback.widget.ObjectAdapter; //导入依赖的package包/类
public VideoDataManager(Context mContext, LoaderManager mLoaderManager, Uri mRowUri, ObjectAdapter rowContents) {
    this.mLoaderManager = mLoaderManager;
    this.mRowUri = mRowUri;
    this.mContext = mContext;
    mItemList = rowContents;
    LOADER_ID = Double.valueOf(Math.random() * Integer.MAX_VALUE).intValue();
    mMapper = new VideoItemMapper();
    ((CursorObjectAdapter) mItemList).setMapper(mMapper);

}
 
开发者ID:googlecodelabs,项目名称:android-tv-leanback,代码行数:11,代码来源:VideoDataManager.java


示例10: addOtherRows

import android.support.v17.leanback.widget.ObjectAdapter; //导入依赖的package包/类
private void addOtherRows() {
    ObjectAdapter rowContents = new CursorObjectAdapter((new SinglePresenterSelector(new CardPresenter())));
    VideoDataManager manager = new VideoDataManager(getActivity(), getLoaderManager(), VideoItemContract.VideoItem.buildDirUri(), rowContents);
    manager.startDataLoading();

    HeaderItem headerItem = new HeaderItem(0, "You may also like");
    mRowsAdapter.add(new ListRow(headerItem, manager.getItemList()));
}
 
开发者ID:googlecodelabs,项目名称:android-tv-leanback,代码行数:9,代码来源:PlaybackOverlayFragment.java


示例11: onLoadFinished

import android.support.v17.leanback.widget.ObjectAdapter; //导入依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
    int id = loader.getId();
    ObjectAdapter adapter = getAdapter();
    ListRow row = (ListRow) adapter.get(id);
    CursorObjectAdapter rowAdapter = (CursorObjectAdapter) row
        .getAdapter();
    rowAdapter.swapCursor(cursor);
}
 
开发者ID:emmby,项目名称:easy-a,代码行数:10,代码来源:MainFragment.java


示例12: onLoaderReset

import android.support.v17.leanback.widget.ObjectAdapter; //导入依赖的package包/类
@Override
public void onLoaderReset(Loader<Cursor> loader) {
    // This is called when the last Cursor provided to
    // onLoadFinished()
    // above is about to be closed. We need to make sure we are no
    // longer using it.
    int id = loader.getId();
    ObjectAdapter adapter = getAdapter();
    ListRow row = (ListRow) adapter.get(id);
    CursorObjectAdapter rowAdapter = (CursorObjectAdapter) row
        .getAdapter();
    rowAdapter.swapCursor(null);
}
 
开发者ID:emmby,项目名称:easy-a,代码行数:14,代码来源:MainFragment.java


示例13: setAdapter

import android.support.v17.leanback.widget.ObjectAdapter; //导入依赖的package包/类
/**
 * Sets the list of rows for the fragment.
 */
@Override
public void setAdapter(ObjectAdapter adapter) {
    if (getAdapter() != null) {
        getAdapter().unregisterObserver(mObserver);
    }
    super.setAdapter(adapter);
    if (adapter != null) {
        adapter.registerObserver(mObserver);
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:14,代码来源:PlaybackOverlaySupportFragment.java


示例14: setAdapter

import android.support.v17.leanback.widget.ObjectAdapter; //导入依赖的package包/类
/**
 * Sets the list of rows for the fragment.
 */
public void setAdapter(ObjectAdapter adapter) {
    mAdapter = adapter;
    if (mRowsSupportFragment != null) {
        mRowsSupportFragment.setAdapter(adapter);
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:10,代码来源:DetailsSupportFragment.java


示例15: setAdapter

import android.support.v17.leanback.widget.ObjectAdapter; //导入依赖的package包/类
/**
 * Sets the list of rows for the fragment.
 */
public void setAdapter(ObjectAdapter adapter) {
    mAdapter = adapter;
    if (mRowsFragment != null) {
        mRowsFragment.setAdapter(adapter);
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:10,代码来源:DetailsFragment.java


示例16: reloadAdapters

import android.support.v17.leanback.widget.ObjectAdapter; //导入依赖的package包/类
private void reloadAdapters() {
    for (int i = 0; i < mAdapter.size(); i++) {
        ListRow listRow = (ListRow) mAdapter.get(i);
        ObjectAdapter objectAdapter = listRow.getAdapter();
        if (objectAdapter instanceof ArrayObjectAdapter) {
            ArrayObjectAdapter arrayObjectAdapter = ((ArrayObjectAdapter) objectAdapter);
            arrayObjectAdapter.notifyArrayItemRangeChanged(0, arrayObjectAdapter.size());
        }
    }
}
 
开发者ID:jerrellmardis,项目名称:Amphitheatre,代码行数:11,代码来源:BrowseFragment.java


示例17: getResultsAdapter

import android.support.v17.leanback.widget.ObjectAdapter; //导入依赖的package包/类
@Override
public ObjectAdapter getResultsAdapter() {
    return mRowsAdapter;
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:5,代码来源:SearchFragment.java


示例18: getResultsAdapter

import android.support.v17.leanback.widget.ObjectAdapter; //导入依赖的package包/类
@Override
public ObjectAdapter getResultsAdapter() {
    Log.d(TAG, "getResultsAdapter()");
    return mRowsAdapter;
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:6,代码来源:ManualScrappingSearchFragment.java


示例19: ShadowLessListRow

import android.support.v17.leanback.widget.ObjectAdapter; //导入依赖的package包/类
public ShadowLessListRow(HeaderItem headerItem, ObjectAdapter adapter) {
    super(headerItem, adapter);
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:4,代码来源:ShadowLessListRow.java


示例20: SelectableListRow

import android.support.v17.leanback.widget.ObjectAdapter; //导入依赖的package包/类
public SelectableListRow(HeaderItem header, ObjectAdapter adapter) {
    super(header, adapter);
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:4,代码来源:SelectableListRow.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JsonWriter类代码示例发布时间:2022-05-21
下一篇:
Java TiledSprite类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap