android source
TextView clicked animation
리오파파
2024. 12. 3. 20:53
textview click 시 잠시 color 변경
private void upDownClicked(View ta) {
AnimatorSet animatorSet = new AnimatorSet();
ObjectAnimator scaleX = ObjectAnimator.ofFloat(ta, "scaleX", 1f, 1.1f, 1f);
ObjectAnimator scaleY = ObjectAnimator.ofFloat(ta, "scaleY", 1f, 1.1f, 1f);
ObjectAnimator colorChange = ObjectAnimator.ofInt(ta, "backgroundColor",
ContextCompat.getColor(mContext, R.color.button_color),
Color.LTGRAY,
ContextCompat.getColor(mContext, R.color.button_color));
colorChange.setEvaluator(new ArgbEvaluator());
int duration = 200;
scaleX.setDuration(duration);
scaleY.setDuration(duration);
colorChange.setDuration(duration);
animatorSet.playTogether(scaleX, scaleY, colorChange);
animatorSet.start();
}