-1
我有一個片段容器中的列表視圖。安卓佈局在動畫移動後重新設置重繪
列表中的每個視圖都有一個手勢檢測器,該手勢檢測器在手勢上使列表無效以重繪。
的項目選擇後,我的動畫片段容器屏幕
ObjectAnimator x = ObjectAnimator.ofInt(ListLayout, "left", ListLayout.getLeft(), ListLayout.getLeft() - 336);
x.setDuration(500);
x.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
View ListLayout = findViewById(R.id.fragment_list_container);
Log.d(TAG, "ListLayout x after move completed = " + ListLayout.getLeft());
}
});
x.start();
都好到這個地步的另一部分。
但是,如果我從列表中選擇另一個項目(列表不應該移動,所以動畫不會被調用),當檢測到手勢並且列表失效時,它會恢復到原始位置?
如果我getLeft在初始動畫移動之前和之後它返回正確的位置。
任何幫助或洞察力感激地接受, 滑