public static void clear(View v) { ViewCompat.setAlpha(v, 1); ViewCompat.setScaleY(v, 1); ViewCompat.setScaleX(v, 1); ViewCompat.setTranslationY(v, 0); ViewCompat.setTranslationX(v, 0); ViewCompat.setRotation(v, 0); ViewCompat.setRotationY(v, 0); ViewCompat.setRotationX(v, 0); ViewCompat.setPivotY(v, v.getMeasuredHeight() / 2); ViewCompat.setPivotX(v, v.getMeasuredWidth() / 2); ViewCompat.animate(v).setInterpolator(null).setStartDelay(0); } }
/** * binds the data of this item onto the viewHolder * * @param viewHolder the viewHolder of this item */ @Override public void bindView(ViewHolder viewHolder, List<Object> payloads) { super.bindView(viewHolder, payloads); //get the context Context ctx = viewHolder.itemView.getContext(); //set the background for the item viewHolder.view.clearAnimation(); ViewCompat.setBackground(viewHolder.view, FastAdapterUIUtils.getSelectableBackground(ctx, Color.RED, true)); //set the text for the name StringHolder.applyTo(name, viewHolder.name); //set the text for the description or hide StringHolder.applyToOrHide(description, viewHolder.description); if (getSubItems() == null || getSubItems().size() == 0) { viewHolder.icon.setVisibility(View.GONE); } else { viewHolder.icon.setVisibility(View.VISIBLE); } if (isExpanded()) { ViewCompat.setRotation(viewHolder.icon, 0); } else { ViewCompat.setRotation(viewHolder.icon, 180); } }