Created
July 20, 2018 12:12
-
-
Save zerogdev/b6b4fd4bab0949189745cbfe4d5e4f62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position, @NonNull List<Object> payloads) { | |
if (payloads.isEmpty()) { | |
super.onBindViewHolder(holder, position, payloads); | |
} else { | |
for (Object payload : payloads) { | |
if (payload instanceof String) { | |
String type = (String) payload; | |
if (holder instanceof TextHolder) { | |
TextHolder textHolder = (TextHolder) holder; | |
if (TextUtils.equals(type, "click1")) { | |
startAnim(textHolder.mFavorite1); | |
} else if (TextUtils.equals(type, "click2")) { | |
startAnim(textHolder.mFavorite2); | |
} else if (TextUtils.equals(type, "click3")) { | |
startAnim(textHolder.mFavorite3); | |
} | |
} | |
} | |
} | |
} | |
} | |
private void startAnim(ImageView imageView) { | |
imageView.setVisibility(View.VISIBLE); | |
imageView.setAlpha(0f); | |
imageView.setScaleX(0f); | |
imageView.setScaleY(0f); | |
imageView.animate() | |
.scaleX(1f) | |
.scaleY(1f) | |
.alpha(1f) | |
.setInterpolator(new OvershootInterpolator()) | |
.setDuration(300); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment