當前位置: 首頁>>代碼示例>>Java>>正文


Java ArrayObjectAdapter.addAll方法代碼示例

本文整理匯總了Java中android.support.v17.leanback.widget.ArrayObjectAdapter.addAll方法的典型用法代碼示例。如果您正苦於以下問題:Java ArrayObjectAdapter.addAll方法的具體用法?Java ArrayObjectAdapter.addAll怎麽用?Java ArrayObjectAdapter.addAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v17.leanback.widget.ArrayObjectAdapter的用法示例。


在下文中一共展示了ArrayObjectAdapter.addAll方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addStreams

import android.support.v17.leanback.widget.ArrayObjectAdapter; //導入方法依賴的package包/類
private void addStreams(CardPresenter cardPresenter, List<LiveConference> liveConferences) {
		if (liveConferences.size() > 0) {
			HeaderItem streamingHeader = new HeaderItem(getString(R.string.livestreams));
			mStreamingSection = new SectionRow(streamingHeader);
			mRowsAdapter.add(0, mStreamingSection);
			for (LiveConference con : liveConferences) {
				if(!con.getConference().equals("Sendeschleife")){
					int i = -1;
					for (i = 0; i < con.getGroups().size(); i++) {
						Group g = con.getGroups().get(i);
						// setup header
						String group = g.getGroup().length() > 0 ? g.getGroup() : con.getConference();
						HeaderItem header = new HeaderItem(group);
						header.setDescription(con.getConference() + " - " + con.getDescription());
						header.setContentDescription(group);
						// setup list
						ArrayObjectAdapter listRowAdapter
								= new ArrayObjectAdapter(cardPresenter);
						listRowAdapter.addAll(listRowAdapter.size(), g.getRooms());
						mRowsAdapter.add(i + 1, new ListRow(header, listRowAdapter));
					}
				}
//				mRowsAdapter.add(i + 1, new DividerRow());
			}
		}
	}
 
開發者ID:NiciDieNase,項目名稱:chaosflix,代碼行數:27,代碼來源:ConferencesBrowseFragment.java

示例2: setupFragment

import android.support.v17.leanback.widget.ArrayObjectAdapter; //導入方法依賴的package包/類
private void setupFragment() {
    VerticalGridPresenter gridPresenter = new VerticalGridPresenter(FocusHighlight.ZOOM_FACTOR_SMALL);
    gridPresenter.setNumberOfColumns(numColumns);
    //gridPresenter.setShadowEnabled(false);
    setGridPresenter(gridPresenter);

    mAdapter = new ArrayObjectAdapter(new CardPresenter());

    List<Contact> contacts = ContactProvider.getContactList();
    mAdapter.addAll(0, contacts);

    setAdapter(mAdapter);

    setOnItemViewClickedListener(new ItemViewClickedListener());
    setOnItemViewSelectedListener(new ItemViewSelectedListener());
}
 
開發者ID:FreeSunny,項目名稱:TvSample,代碼行數:17,代碼來源:VerticalGridFragment1.java

示例3: setupFragment

import android.support.v17.leanback.widget.ArrayObjectAdapter; //導入方法依賴的package包/類
private void setupFragment() {
    VerticalGridPresenter gridPresenter = new VerticalGridPresenter(FocusHighlight.ZOOM_FACTOR_NONE);
    gridPresenter.setNumberOfColumns(numColumns);
    //gridPresenter.setShadowEnabled(false);
    setGridPresenter(gridPresenter);

    mAdapter = new ArrayObjectAdapter(new ContactPresenter());

    List<Contact> contacts = ContactProvider.getContactList();
    mAdapter.addAll(0, contacts);

    setAdapter(mAdapter);

    setOnItemViewClickedListener(new ItemViewClickedListener());
    setOnItemViewSelectedListener(new ItemViewSelectedListener());
}
 
開發者ID:FreeSunny,項目名稱:TvSample,代碼行數:17,代碼來源:VerticalGridFragment.java

示例4: updateRelatedEpisodes

import android.support.v17.leanback.widget.ArrayObjectAdapter; //導入方法依賴的package包/類
private void updateRelatedEpisodes(Map<String, List<EpisodeBaseModel>> others) {
    boolean updated = false;
    ArrayObjectAdapter adapter = (ArrayObjectAdapter) getAdapter();
    for (Map.Entry<String, List<EpisodeBaseModel>> list : others.entrySet()) {
        String title = list.getKey();
        Log.d(TAG, "More: " + title);
        if (ContentManagerBase.OTHER_EPISODES.equals(title)) {
            otherEpisodes.addAll(otherEpisodes.size(), list.getValue());
        } else {
            ArrayObjectAdapter more = new ArrayObjectAdapter(new CardSelector());
            more.addAll(0, list.getValue());
            adapter.add(new ListRow(new HeaderItem(0, title), more));
        }
        updated = true;
    }
    if (updated) {
        adapter.notifyArrayItemRangeChanged(0, adapter.size());
    }
}
 
開發者ID:nextux,項目名稱:sbs-android-tv,代碼行數:20,代碼來源:DetailsFragment.java

示例5: updateData

import android.support.v17.leanback.widget.ArrayObjectAdapter; //導入方法依賴的package包/類
private void updateData() {
    mCategoriesAdapter = new ArrayObjectAdapter(new ListRowPresenter());
    for (Season season : mTvShow.getSeasons()) {
        ArrayObjectAdapter episodeAdapter = new ArrayObjectAdapter(new EpisodePresenter());
        episodeAdapter.addAll(0, season.getEpisodes());
        if (season.isHasFullSeasonDownloadUrl()) {
            episodeAdapter.add(new Episode("99", getString(R.string.full_season), season, -1, null));
        }
        mCategoriesAdapter.add(new ListRow(new HeaderItem(season.getName()), episodeAdapter));
    }
    setAdapter(mCategoriesAdapter);
}
 
開發者ID:CrazyDude1994,項目名稱:lostfilm-android-client,代碼行數:13,代碼來源:TvShowFragment.java

示例6: addStreams

import android.support.v17.leanback.widget.ArrayObjectAdapter; //導入方法依賴的package包/類
private void addStreams(CardPresenter cardPresenter, List<LiveConference> liveConferences) {
		if (liveConferences.size() > 0) {
			HeaderItem streamingHeader = new HeaderItem(getString(R.string.livestreams));
			mStreamingSection = new SectionRow(streamingHeader);
			mRowsAdapter.add(0, mStreamingSection);
			for (LiveConference con : liveConferences) {
				if(!con.getConference().equals("Sendeschleife") || BuildConfig.DEBUG){
					int i = -1;
					for (i = 0; i < con.getGroups().size(); i++) {
						Group g = con.getGroups().get(i);
						// setup header
						String group = g.getGroup().length() > 0 ? g.getGroup() : con.getConference();
						HeaderItem header = new HeaderItem(group);
						header.setDescription(con.getConference() + " - " + con.getDescription());
						header.setContentDescription(group);
						// setup list
						ArrayObjectAdapter listRowAdapter
								= new ArrayObjectAdapter(cardPresenter);
						listRowAdapter.addAll(listRowAdapter.size(), g.getRooms());
						mRowsAdapter.add(i + 1, new ListRow(header, listRowAdapter));
					}
				}
//				mRowsAdapter.add(i + 1, new DividerRow());

			}
		}
	}
 
開發者ID:NiciDieNase,項目名稱:chaosflix-leanback,代碼行數:28,代碼來源:ConferencesBrowseFragment.java

示例7: getRow

import android.support.v17.leanback.widget.ArrayObjectAdapter; //導入方法依賴的package包/類
private ListRow getRow(Map<String, List<Conference>> conferences, CardPresenter cardPresenter, String tag, String description) {
	ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(cardPresenter);
	listRowAdapter.addAll(0, conferences.get(tag));
	HeaderItem header = new HeaderItem(ConferencesWrapper.getStringForTag(tag));
	header.setDescription(description);
	return new ListRow(header, listRowAdapter);
}
 
開發者ID:NiciDieNase,項目名稱:chaosflix-leanback,代碼行數:8,代碼來源:ConferencesBrowseFragment.java

示例8: run

import android.support.v17.leanback.widget.ArrayObjectAdapter; //導入方法依賴的package包/類
@Override
public void run() {
    // Search for query and collate results.
    mRowsAdapter.clear();
    ArrayObjectAdapter searchRowAdapter =
            new ArrayObjectAdapter(new SearchPresenterSelector());
    searchRowAdapter.add(new AddPlaylistButton());
    searchRowAdapter.addAll(1, SampleClipApi.getSearchResults(mQuery));
    HeaderItem header =
            new HeaderItem(0, getResources().getString(R.string.search_results));
    mRowsAdapter.add(new ListRow(header, searchRowAdapter));

}
 
開發者ID:googlesamples,項目名稱:leanback-homescreen-channels,代碼行數:14,代碼來源:TvSearchFragment.java

示例9: updateRow

import android.support.v17.leanback.widget.ArrayObjectAdapter; //導入方法依賴的package包/類
private void updateRow(){
    if ((mSearchResults==null||mSearchResults.isEmpty())&&mNfoTags==null) {
        ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(new EmptyViewPresenter());
        listRowAdapter.add(new EmptyView(getEmptyText()));
        mRowsAdapter.clear();
        mRowsAdapter.add(new ShadowLessListRow(new HeaderItem(getString(R.string.search_results)), listRowAdapter));
    }
    else {
        // Prepare the result list widget
        ClassPresenterSelector classPresenter = new ClassPresenterSelector();
        classPresenter.addClassPresenter(SearchResult.class, new ScraperSearchResultPresenter()); // for initial search result
        classPresenter.addClassPresenter(BaseTags.class, new ScraperBaseTagsPresenter()); // for detailed result info


        mResultsAdapter = new ArrayObjectAdapter(classPresenter);
        if(mNfoTags!=null) {
            mResultsAdapter.add(0, mNfoTags);
            mOffset=1;
        }
        if(mSearchResults!=null)
            mResultsAdapter.addAll(mOffset, mSearchResults);
        ListRow listRow = new ListRow(new HeaderItem(getResultsHeaderText()), mResultsAdapter);

        mRowsAdapter.clear();
        mRowsAdapter.add(listRow);
        if(mSearchResults!=null) {
            // Launch the details task to get posters, etc.
            SearchResult[] array = mSearchResults.toArray(new SearchResult[mSearchResults.size()]);
            mDetailsTask = new ScraperDetailsFetchTask().executeOnExecutor(mSearchExecutor,array);
        }
    }
}
 
開發者ID:archos-sa,項目名稱:aos-Video,代碼行數:33,代碼來源:ManualScrappingSearchFragment.java

示例10: onLoadFinish

import android.support.v17.leanback.widget.ArrayObjectAdapter; //導入方法依賴的package包/類
@Override
public void onLoadFinish(List<Video> start_movies, List<Video> start_tvshows) {


    HeaderItem header_movies = new HeaderItem(0, "MOVIES");
    HeaderItem header_tvshows = new HeaderItem(1, "TV SHOWS");
    HeaderItem header_settings = new HeaderItem(1, "SETTINGS");



    ArrayObjectAdapter movies = new ArrayObjectAdapter(new CardPresenter(getActivity()));
    ArrayObjectAdapter tvshows = new ArrayObjectAdapter(new CardPresenter(getActivity()));
    ArrayObjectAdapter settings = new ArrayObjectAdapter(new GridItemPresenter());
    movies.addAll(movies.size(), start_movies);
    tvshows.addAll(tvshows.size(), start_tvshows);

    settings.add("Preferences");

    mCategoryRowAdapter.add(new ListRow(header_movies, movies));
    prepareMoreMovieButtons(mCategoryRowAdapter.size());
    mCategoryRowAdapter.add(new ListRow(header_tvshows, tvshows));
    prepareMoreTVShowButtons(mCategoryRowAdapter.size());

    // HACK - remove init row
    for(int i = 0; i < mCategoryRowAdapter.size(); i++) {
        ListRow lr = (ListRow) mCategoryRowAdapter.get(i);
        if(lr.getHeaderItem().getName().equals("HACKINIT")) {
            mCategoryRowAdapter.removeItems(i, 1);
        }
    }

    mCategoryRowAdapter.add(new ListRow(header_settings, settings));


    startEntranceTransition();
}
 
開發者ID:ad-on-is,項目名稱:chilly,代碼行數:37,代碼來源:MainFragment.java

示例11: onGetSeasons

import android.support.v17.leanback.widget.ArrayObjectAdapter; //導入方法依賴的package包/類
@Override
public void onGetSeasons(List<Video> seasons) {
    ArrayObjectAdapter seasonAdapter = new ArrayObjectAdapter(new CardPresenter());
    HeaderItem header = new HeaderItem(0, getActivity().getString(R.string.tvshow_seasons));
    seasonAdapter.addAll(seasonAdapter.size(), seasons);
    mAdapter.add(new ListRow(header, seasonAdapter));
}
 
開發者ID:ad-on-is,項目名稱:chilly,代碼行數:8,代碼來源:VideoDetailsFragment.java

示例12: showCats

import android.support.v17.leanback.widget.ArrayObjectAdapter; //導入方法依賴的package包/類
/**
 * Method implementations from SearchContentMvpView
 */

@Override
public void showCats(List<Cat> cats) {
    final ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(new CardPresenter());
    listRowAdapter.addAll(0, cats);
    HeaderItem header = new HeaderItem(0, getString(R.string.header_title_cats));
    mRowsAdapter.add(new ListRow(header, listRowAdapter));
}
 
開發者ID:hitherejoe,項目名稱:AndroidTvBoilerplate,代碼行數:12,代碼來源:ContentFragment.java

示例13: addRow

import android.support.v17.leanback.widget.ArrayObjectAdapter; //導入方法依賴的package包/類
private void addRow(String title, List<MediaCardPresenter.MediaCardItem> items) {
	mRowsAdapter.remove(mLoadingRow);

	HeaderItem header = new HeaderItem(0, title);
	ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(new MediaCardPresenter(getActivity()));
	listRowAdapter.addAll(0, items);
	mRowsAdapter.add(new ListRow(header, listRowAdapter));
}
 
開發者ID:PTCE,項目名稱:popcorn-android,代碼行數:9,代碼來源:PTVSearchFragment.java

示例14: showVideos

import android.support.v17.leanback.widget.ArrayObjectAdapter; //導入方法依賴的package包/類
public void showVideos() {
    List<Video> videos = new ArrayList<>();
    videos.add(new Video(0, "Lake", "Lake Time-lapse", R.drawable.lake, R.raw.lake));
    videos.add(new Video(1, "NYC", "New York City Time-lapse", R.drawable.nyc, R.raw.nyc));

    final ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(new CardPresenter());
    listRowAdapter.addAll(0, videos);
    HeaderItem header = new HeaderItem(0, getString(R.string.header_title_videos));
    mRowsAdapter.add(new ListRow(header, listRowAdapter));
}
 
開發者ID:hitherejoe,項目名稱:PictureInPicturePlayground,代碼行數:11,代碼來源:ContentFragment.java

示例15: loadData

import android.support.v17.leanback.widget.ArrayObjectAdapter; //導入方法依賴的package包/類
protected void loadData(String path) throws IOException {
    List<Media> list = browser.listFiles(path);
    rowsAdapter = new ArrayObjectAdapter(new CardPresenter(browser));
    rowsAdapter.addAll(0, list);

    //Update list on ui thread
    getActivity().runOnUiThread(new Runnable() {
        @Override
        public void run() {
            setAdapter(rowsAdapter);
        }
    });
}
 
開發者ID:irtimmer,項目名稱:itplayer,代碼行數:14,代碼來源:BrowserFragment.java


注:本文中的android.support.v17.leanback.widget.ArrayObjectAdapter.addAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。