public void bindView(View view, int position) { synchronized (mState.mLock) { if (position >= mItems.size()) { // List must have changed since we last reported its // size... ignore here, we will be doing a data changed // to refresh the entire list. return; } ViewHolder vh = (ViewHolder) view.getTag(); RunningState.MergedItem item = mItems.get(position); ActiveItem ai = vh.bind(mState, item, mBuilder); mActiveItems.put(view, ai); } }
@Override public final View getView(int position, View convertView, ViewGroup parent) { V obj = getItem(position); ViewHolder<V> holder; View view; if (convertView == null || convertView.getTag() == null) { holder = createHolder(obj); view = holder.init(obj, parent, context); view.setTag(holder); holders.add(holder); } else { holder = (ViewHolder<V>) convertView.getTag(); view = convertView; } holder.bind(obj, position, context); return view; }
@Override public void onBindViewHolder(ViewHolder holder, int position) { holder.bind(tiles.get(position)); }
protected void onBindViewHolder(ViewHolder<V> holder, V obj, int position, Context context) { holder.bind(obj, position, context); }
@Override public void onBindViewHolder(ViewHolder holder, int index) { ViewHolder h = holder; h.bind(index); }