public void recycleView(View v) { ViewHolder holder = (ViewHolder) v.getTag(); holder.iconView.setImageBitmap(mRecentTasksLoader.getDefaultIcon()); holder.iconView.setVisibility(INVISIBLE); holder.iconView.animate().cancel(); holder.iconView.setAlpha(1f); holder.iconView.setTranslationX(0f); holder.iconView.setTranslationY(0f); holder.taskDescription = null; holder.loadedThumbnailAndIcon = false; }
public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = createView(parent); } ViewHolder holder = (ViewHolder) convertView.getTag(); // index is reverse since most recent appears at the bottom... final int index = position; final TaskDescription td = mRecentTaskDescriptions.get(index); // holder.thumbnailView.setContentDescription(td.getLabel()); holder.loadedThumbnailAndIcon = td.isLoaded(); if (td.isLoaded()) { updateIcon(holder, td.getIcon(), true, false); } if (index == 0) { if (mAnimateIconOfFirstTask) { if (mItemToAnimateInWhenWindowAnimationIsFinished != null) { holder.iconView.setAlpha(1f); holder.iconView.setTranslationX(0f); holder.iconView.setTranslationY(0f); } mItemToAnimateInWhenWindowAnimationIsFinished = holder; final int translation = -getResources() .getDimensionPixelSize(R.dimen.status_bar_recents_app_icon_translate_distance); final Configuration config = getResources().getConfiguration(); if (config.orientation == Configuration.ORIENTATION_PORTRAIT) { holder.iconView.setAlpha(0f); holder.iconView.setTranslationX(translation); } else { holder.iconView.setAlpha(0f); holder.iconView.setTranslationY(translation); } if (!mWaitingForWindowAnimation) { animateInIconOfFirstTask(); } } } holder.taskDescription = td; holder.position = index; RecentsScrollView scrollView = (RecentsScrollView) mRecentsContainer; final View animView = scrollView.getChildContentView(convertView); animView.setAlpha(1f); animView.setTranslationY(0f); return convertView; }