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


Java RecyclerView.ViewHolder方法代碼示例

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


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

示例1: onCreateViewHolder

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    if (viewType == TYPE_REFRESH_HEADER) {
        return new SimpleViewHolder(mRefreshHeader);
    } else if (isHeaderType(viewType)) {
        return new SimpleViewHolder(getHeaderViewByType(viewType));
    } else if (viewType == TYPE_FOOTER) {
        return new SimpleViewHolder(mFootView);
    }
    return adapter.onCreateViewHolder(parent, viewType);
}
 
開發者ID:monkeywiiu,項目名稱:Discover,代碼行數:12,代碼來源:XRecyclerView.java

示例2: onBindViewHolder

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    if (isShowLoadMore(position)) {
        if (mOnLoadMoreListener != null && !isLoading) {
            isLoading = true;
            Log.e("onBindViewHolder",isLoading+" "+position);
            mOnLoadMoreListener.onLoadMoreRequested();
        }
        return;
    }
    mInnerAdapter.onBindViewHolder(holder, position);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:13,代碼來源:LoadMoreWrapper2.java

示例3: clearView

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
public void clearView(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
    super.clearView(recyclerView, viewHolder);
    viewHolder.itemView.setAlpha(ALPHA_FULL);
    if (viewHolder instanceof ItemTouchHelperViewHolder) {
        // Tell the view holder it's time to restore the idle state
        ItemTouchHelperViewHolder itemViewHolder = (ItemTouchHelperViewHolder) viewHolder;
        itemViewHolder.onItemClear();
    }
    if (dragFrom != -1 && dragTo != -1 && dragFrom != dragTo) {
        mAdapter.onDropped(dragFrom, dragTo, viewHolder);
    }

    dragFrom = dragTo = -1;
}
 
開發者ID:nhocga1995s,項目名稱:MyCalendar,代碼行數:16,代碼來源:ItemTouchHelperCallback.java

示例4: onDetached

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public void onDetached(@NonNull final RecyclerView.ViewHolder viewHolder) {
    if (isLifecycleCallbacks(viewHolder)) {
        final LifecycleCallbacks lifecycleCallbacks = (LifecycleCallbacks) viewHolder;
        mLifecycleComposite.unregisterLifecycleCallbacks(lifecycleCallbacks);
    }
}
 
開發者ID:GlobusLTD,項目名稱:recyclerview-android,代碼行數:11,代碼來源:LifecycleBehavior.java

示例5: animateAdd

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
public boolean animateAdd(RecyclerView.ViewHolder viewHolder) {
  if (viewHolder.getItemViewType() == FeedAdapter.VIEW_TYPE_DEFAULT) {
    if (viewHolder.getLayoutPosition() > lastAddAnimatedItem) {
      lastAddAnimatedItem++;
      runEnterAnimation((FeedAdapter.CellFeedViewHolder) viewHolder);
      return false;
    }
  }

  dispatchAddFinished(viewHolder);
  return false;
}
 
開發者ID:softonic,項目名稱:instamaterial,代碼行數:14,代碼來源:FeedItemAnimator.java

示例6: onCreateViewHolder

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    return null;
}
 
開發者ID:wp521,項目名稱:MyFire,代碼行數:5,代碼來源:BaseReclyerViewAdapter.java

示例7: onBindItemViewHolder

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
protected void onBindItemViewHolder(RecyclerView.ViewHolder holder, String item, int position) {
  ItemViewHolder viewHolder = (ItemViewHolder) holder;
  viewHolder.titleTextView.setText(item);
}
 
開發者ID:kimkevin,項目名稱:androidpack,代碼行數:6,代碼來源:SampleRecyclerViewAdapter.java

示例8: onCreateViewHolder

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view = LayoutInflater.from(context).inflate(R.layout.item_main, parent, false);
    return new MyHolder(view);
}
 
開發者ID:BigSea001,項目名稱:PhotoPickApp,代碼行數:6,代碼來源:MainActivity.java

示例9: onBindViewHolder

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
protected void onBindViewHolder(@NonNull List<AppUpdateData> items, int position,
                                @NonNull RecyclerView.ViewHolder holder, @NonNull List<Object> payloads) {
    UpdateableApp app = (UpdateableApp) items.get(position);
    ((UpdateableAppListItemController) holder).bindModel(app.app);
}
 
開發者ID:uhuru-mobile,項目名稱:mobile-store,代碼行數:7,代碼來源:UpdateableApp.java

示例10: onCreateViewHolder

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
public abstract RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType);
 
開發者ID:tomoya92,項目名稱:android-apps,代碼行數:3,代碼來源:MyRecylerViewAdapter.java

示例11: onMove

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
    // not enabled
    return false;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:6,代碼來源:SimpleSwipeCallback.java

示例12: onMoved

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
public void onMoved(RecyclerView recyclerView, RecyclerView.ViewHolder source, int fromPos, RecyclerView.ViewHolder target, int toPos, int x, int y) {
    super.onMoved(recyclerView, source, fromPos, target, toPos, x, y);
    mAdapter.onItemDragMoving(source, target);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:6,代碼來源:ItemDragAndSwipeCallback.java

示例13: onBindContentViewHolder

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
protected void onBindContentViewHolder(RecyclerView.ViewHolder holder, int position) {
}
 
開發者ID:aliyun,項目名稱:aliyun-cloudphotos-android-demo,代碼行數:4,代碼來源:CategoryAdapter.java

示例14: onLongClick

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
public boolean onLongClick(View v) {
    RecyclerView.ViewHolder holder = (RecyclerView.ViewHolder) v.getTag();
    return onLongClick(holder.getAdapterPosition(), holder.getItemId());
}
 
開發者ID:coding-dream,項目名稱:TPlayer,代碼行數:6,代碼來源:MovieAdapter.java

示例15: onBindViewHolder

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    bindView((MyWalletLogViewHolder) holder, mList.get(position));

}
 
開發者ID:linsir6,項目名稱:TripBuyer,代碼行數:6,代碼來源:MeRewardAdapter.java


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