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


Java StickyHeadersBuilder類代碼示例

本文整理匯總了Java中com.eowise.recyclerview.stickyheaders.StickyHeadersBuilder的典型用法代碼示例。如果您正苦於以下問題:Java StickyHeadersBuilder類的具體用法?Java StickyHeadersBuilder怎麽用?Java StickyHeadersBuilder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: initViews

import com.eowise.recyclerview.stickyheaders.StickyHeadersBuilder; //導入依賴的package包/類
private void initViews() {
//        mSearchKeyEditText.setHint(R.string.caption_input_brand_name);
        mTitleView.setText("選擇汽車品牌");
        mRightView.setVisibility(View.GONE);
        if (mUserCarInfo != null) {
            mRightView.setVisibility(View.VISIBLE);
            mRightView.setText("刪除");
        } else {
            mRightView.setVisibility(View.GONE);
        }

        mCarBrandRecyclerView.setLayoutManager(new LinearLayoutManager(this));

        mCatalogAdapter = new LetterCatalogAdapter();
        mCatalogRecyclerView.setLayoutManager(new GridLayoutManager(this, 7));
        int spacingInPixels = getResources().getDimensionPixelSize(R.dimen.spacing_10);
        mCatalogRecyclerView.addItemDecoration(new GridSpacingItemDecoration(spacingInPixels));
        mCatalogRecyclerView.setAdapter(mCatalogAdapter);

        mCacheCarBrands = CarBrandRepo.getCacheCarBrands();
        if (mCacheCarBrands != null) {
            mCarBrands.addAll(mCacheCarBrands);
        }
        mCarBrandAdapter = new CarBrandAdapter(mCarBrands);
        mCarBrandAdapter.setOnItemClickListener(this);
        mCarBrandAdapter.setHasStableIds(true);
        mHeader = new StickyHeadersBuilder()
                .setAdapter(mCarBrandAdapter)
                .setRecyclerView(mCarBrandRecyclerView)
                .setStickyHeadersAdapter(new InitialHeaderAdapter(mCarBrands))
                .build();
        mCarBrandRecyclerView.setAdapter(mCarBrandAdapter);
        mCarBrandRecyclerView.addItemDecoration(mHeader);
    }
 
開發者ID:LegendKe,項目名稱:MyTravelingDiary,代碼行數:35,代碼來源:ChooseCarBrandActivity.java

示例2: buildHeaderDecor

import com.eowise.recyclerview.stickyheaders.StickyHeadersBuilder; //導入依賴的package包/類
private StickyHeadersItemDecoration buildHeaderDecor() {
  return new StickyHeadersBuilder()
      .setAdapter(mListAdapter)
      .setRecyclerView(mRecyclerView)
      .setStickyHeadersAdapter(new FontListHeaderAdapter(mFontList), true)
      .build();
}
 
開發者ID:ItsPriyesh,項目名稱:Fontster,代碼行數:8,代碼來源:FontListFragment.java

示例3: initView

import com.eowise.recyclerview.stickyheaders.StickyHeadersBuilder; //導入依賴的package包/類
private void initView() {
    searchView = new MySearchView(this);
    searchView.setQueryHint(getResources().getString(R.string.search_hint));
    searchView.setOnQueryTextListener(query -> {
        dialog.show();
        searchView.clearFocus();
        Single.defer(() -> ZhihuDailyPurifyServer.searchForKeyword(query))
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(this);
        return true;
    });

    RelativeLayout relative = new RelativeLayout(this);
    relative.addView(searchView);

    toolbar.addView(relative);

    setSupportActionBar(toolbar);
    Optional.ofNullable(getSupportActionBar())
            .ifPresent(ab -> ab.setDisplayHomeAsUpEnabled(true));

    RecyclerView recyclerView = findViewById(R.id.search_result_list);
    recyclerView.setHasFixedSize(true);
    LinearLayoutManager llm = new LinearLayoutManager(this);

    llm.setOrientation(LinearLayoutManager.VERTICAL);
    recyclerView.setLayoutManager(llm);
    adapter = new NewsAdapter();
    headerAdapter = new DateHeaderAdapter();

    StickyHeadersItemDecoration header = new StickyHeadersBuilder()
            .setAdapter(adapter)
            .setRecyclerView(recyclerView)
            .setStickyHeadersAdapter(headerAdapter)
            .build();

    recyclerView.setAdapter(adapter);
    recyclerView.addItemDecoration(header);
}
 
開發者ID:izzyleung,項目名稱:ZhihuDailyPurify,代碼行數:41,代碼來源:SearchActivity.java


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