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();
}
'android source ' 카테고리의 다른 글
내 앱이 화면 전면에 있나 확인하는 법 (0) | 2025.02.25 |
---|---|
res > mipmap > filename 읽기 (0) | 2024.12.10 |
textview touch color 변화 (0) | 2024.10.24 |
Sound, media 대신 ring mode로 설정 (0) | 2024.10.19 |
sub class 에서 localbroadcaster로 main call 하기 (0) | 2024.09.21 |