本文整理匯總了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);
}
示例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);
}
示例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;
}
示例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);
}
}
示例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;
}
示例6: onCreateViewHolder
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
return null;
}
示例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);
}
示例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);
}
示例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);
}
示例10: onCreateViewHolder
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
public abstract RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType);
示例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;
}
示例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);
}
示例13: onBindContentViewHolder
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
protected void onBindContentViewHolder(RecyclerView.ViewHolder holder, int position) {
}
示例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());
}
示例15: onBindViewHolder
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
bindView((MyWalletLogViewHolder) holder, mList.get(position));
}