欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

怎么在RecyclerView中使用SnapHelper實現(xiàn)一個無限循環(huán)篩選控件

怎么在RecyclerView中使用SnapHelper實現(xiàn)一個無限循環(huán)篩選控件?針對這個問題,這篇文章詳細(xì)介紹了相對應(yīng)的分析和解答,希望可以幫助更多想解決這個問題的小伙伴找到更簡單易行的方法。

建網(wǎng)站原本是網(wǎng)站策劃師、網(wǎng)絡(luò)程序員、網(wǎng)頁設(shè)計師等,應(yīng)用各種網(wǎng)絡(luò)程序開發(fā)技術(shù)和網(wǎng)頁設(shè)計技術(shù)配合操作的協(xié)同工作。創(chuàng)新互聯(lián)專業(yè)提供成都做網(wǎng)站、成都網(wǎng)站制作,網(wǎng)頁設(shè)計,網(wǎng)站制作(企業(yè)站、成都響應(yīng)式網(wǎng)站建設(shè)、電商門戶網(wǎng)站)等服務(wù),從網(wǎng)站深度策劃、搜索引擎友好度優(yōu)化到用戶體驗的提升,我們力求做到極致!

FilterWheelView.java

private void initData(){
    if (filterItemEntity != null) {
      if (!TextUtils.isEmpty(filterItemEntity.getTitle())) {
        filtrationType.setText(filterItemEntity.getTitle());
      }
      if (filterItemEntity.getOptions() != null) {
        mAdapter = new ADA_FilterWheel(mContext, filterItemEntity.getOptions());
      }
      mLoopRecyclerView.setAdapter(mAdapter);
      if (adaItemCallback!=null){
        adaItemCallback.sendItems(mAdapter.getItemRawCount());
      }
      //設(shè)置滾動監(jiān)聽
      mLoopRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
        @Override
        public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
          super.onScrollStateChanged(recyclerView, newState);
          //滾動停止時,獲取recycler顯示的第一項的position
          if (newState == RecyclerView.SCROLL_STATE_IDLE) {
            int items = mAdapter.getItemRawCount();
            int firstItemPosition =linearManager.findFirstVisibleItemPosition();
            //高亮顯示最左邊的item
            mAdapter.highlightItem(firstItemPosition % items);
          }
          //滾動過程中,釋放選中狀態(tài)
          if (newState == RecyclerView.SCROLL_STATE_DRAGGING) {
            mAdapter.reset();
          }
        }

        @Override
        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
          super.onScrolled(recyclerView, dx, dy);
        }
      });
      //找到當(dāng)前選中的實體
      for (int i = 0; i < filterItemEntity.getOptions().size(); i++) {
        FilterOptionsEntity bean = filterItemEntity.getOptions().get(i);
        if (bean.isCheck()) {
          // 當(dāng)前選中實體類
          currentBean = bean;
          break;
        }
      }
    }
  }

關(guān)于怎么在RecyclerView中使用SnapHelper實現(xiàn)一個無限循環(huán)篩選控件問題的解答就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道了解更多相關(guān)知識。

名稱欄目:怎么在RecyclerView中使用SnapHelper實現(xiàn)一個無限循環(huán)篩選控件
瀏覽地址:http://chinadenli.net/article4/giicoe.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供建站公司微信小程序、域名注冊電子商務(wù)、服務(wù)器托管

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站托管運營