Home | History | Annotate | Download | only in provider

Lines Matching refs:holder

144     public void onBindViewHolder(final CarListItemViewHolder holder, final int position) {
145 if (holder.getItemViewType() == R.layout.car_list_item_empty) {
146 onBindEmptyPlaceHolder(holder, position);
147 } else if (holder.getItemViewType() == R.layout.car_unavailable_category) {
148 onBindUnavailableCategoryView(holder);
150 onBindNormalView(holder, position);
153 // TODO(b/24163545): holder.itemView.setAlpha() doesn't work all the time,
155 setHolderStatus(holder, false, 0.3f);
157 setHolderStatus(holder, true, 1.0f);
161 holder.itemView.setTag(position);
162 holder.itemView.setOnClickListener(mOnClickListener);
163 holder.itemView.setOnLongClickListener(mOnLongClickListener);
166 setDayNightModeColors(holder);
249 public void onChildChanged(RecyclerView.ViewHolder holder, Bundle bundle) {
251 // The holder will be null if the view has not been bound yet
252 if (holder != null) {
253 int position = holder.getAdapterPosition();
286 CarListItemViewHolder holder = (CarListItemViewHolder) viewHolder;
287 Context context = holder.itemView.getContext();
288 holder.itemView.setBackgroundResource(R.drawable.car_list_item_background);
289 if (holder.getItemViewType() == R.layout.car_unavailable_category) {
290 holder.title.setTextAppearance(context, R.style.CarUnavailableCategory);
291 if (holder.text != null) {
292 holder.text.setTextAppearance(context, R.style.CarUnavailableCategory);
294 holder.icon.setImageTintList(ColorStateList
297 holder.title.setTextAppearance(context, R.style.CarBody1);
298 if (holder.text != null) {
299 holder.text.setTextAppearance(context, R.style.CarBody2);
301 if (holder.rightCheckbox != null) {
302 holder.rightCheckbox.setButtonTintList(
304 } else if (holder.rightImage != null) {
305 Object tag = holder.rightImage.getTag();
307 holder.rightImage.setImageResource((int) tag);
313 private void onBindEmptyPlaceHolder(final CarListItemViewHolder holder, final int position) {
314 maybeSetText(position, KEY_TITLE, holder.title);
316 maybeSetBitmap(position, KEY_LEFTICON, holder.icon);
317 holder.iconContainer.setVisibility(View.VISIBLE);
319 holder.iconContainer.setVisibility(View.GONE);
323 private void onBindUnavailableCategoryView(final CarListItemViewHolder holder) {
325 holder.itemView.setEnabled(false);
328 private void onBindNormalView(final CarListItemViewHolder holder, final int position) {
329 maybeSetText(position, KEY_TITLE, holder.title);
330 maybeSetText(position, KEY_TEXT, holder.text);
342 holder.rightImage.setTag(R.drawable.ic_chevron_right);
343 holder.rightImage.setImageResource(R.drawable.ic_chevron_right);
344 } else if (holder.rightImage != null) {
345 maybeSetBitmap(position, KEY_RIGHTICON, holder.rightImage);
348 if (holder.rightCheckbox != null) {
349 holder.rightCheckbox.setChecked(item.getBoolean(
351 holder.rightCheckbox.setOnClickListener(mOnClickListener);
352 holder.rightCheckbox.setTag(position);
354 if (holder.rightText != null) {
355 maybeSetText(position, KEY_RIGHTTEXT, holder.rightText);
358 maybeSetBitmap(position, KEY_LEFTICON, holder.icon);
359 holder.iconContainer.setVisibility(View.VISIBLE);
361 holder.iconContainer.setVisibility(View.GONE);
364 holder.remoteViewsContainer.setVisibility(View.VISIBLE);
366 View view = views.apply(holder.remoteViewsContainer.getContext(),
367 holder.remoteViewsContainer);
368 holder.remoteViewsContainer.removeAllViews();
369 holder.remoteViewsContainer.addView(view);
371 holder.remoteViewsContainer.removeAllViews();
372 holder.remoteViewsContainer.setVisibility(View.GONE);
375 // Set the view holder size
376 Resources r = holder.itemView.getResources();
377 ViewGroup.LayoutParams params = holder.itemView.getLayoutParams();
381 holder.itemView.setLayoutParams(params);
384 params = holder.iconContainer.getLayoutParams();
424 private void setHolderStatus(final CarListItemViewHolder holder,
426 holder.itemView.setEnabled(isEnabled);
427 if (holder.icon != null) {
428 holder.icon.setAlpha(alpha);
430 if (holder.title != null) {
431 holder.title.setAlpha(alpha);
433 if (holder.text != null) {
434 holder.text.setAlpha(alpha);
436 if (holder.rightCheckbox != null) {
437 holder.rightCheckbox.setAlpha(alpha);
439 if (holder.rightImage != null) {
440 holder.rightImage.setAlpha(alpha);
442 if (holder.rightText != null) {
443 holder.rightText.setAlpha(alpha);