@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.product_item_top_rl:
startAnimation(v);
break;
}
}
private void startAnimation(final View v) {
int height = v.getHeight();
ValueAnimator va = ValueAnimator.ofInt(0, height);
va.setDuration(1000);
va.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
public void onAnimationUpdate(ValueAnimator animation) {
Log.d(TAG, "animation : " + animation.getAnimatedValue());
v.getLayoutParams().height = (Integer) animation.getAnimatedValue();
v.requestLayout();
}
});
va.start();
}
D/ChooseProductFragment: animation : 150
D/ChooseProductFragment: animation : 150
문제가 해결되었습니다. 어제 UI 자동화 테스트에 에스프레소를 사용하기 위해 설정에서 "창 애니메이션 크기 조정", "과도한 애니메이션 크기 조정", "애니메이션 프로그램 지속 시간 조정" 세 가지 애니메이션을 꺼두었기 때문입니다. 이러한 애니메이션을 다시 활성화하면 정상적으로 작동됩니다.
애니메이션 반복 횟수와 방법을 지정하지 않았습니다.
를 추가해야 합니다. 으아악