Java 类android.support.v7.widget.RecyclerView.ItemAnimator 实例源码

项目:DominionPicker    文件:FragmentPicker.java   
/** Called to create this fragment's view for the first time.  */
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_picker, container, false);
    ButterKnife.bind(this, view);
    card_list.setLayoutManager(new LinearLayoutManager(getContext()));
    card_list.addItemDecoration(new ListDivider(getContext()));

    // Disable flicker animation when an item changes
    // (otherwise items will flicker when selection state changes)
    ItemAnimator animator = card_list.getItemAnimator();
    if (animator instanceof SimpleItemAnimator)
        ((SimpleItemAnimator) animator).setSupportsChangeAnimations(false);

    final SharedPreferences pref = Pref.get(getContext());
    adapter = new AdapterCardsFilter(card_list, pref.getString(Pref.FILT_CARD, ""),
                                                pref.getString(Pref.REQ_CARDS, ""));
    card_list.setAdapter(adapter);
    updateView();
    return view;
}
项目:letv    文件:ItemTouchHelper.java   
private void postDispatchSwipe(final RecoverAnimation anim, final int swipeDir) {
    this.mRecyclerView.post(new Runnable() {
        public void run() {
            if (ItemTouchHelper.this.mRecyclerView != null && ItemTouchHelper.this.mRecyclerView.isAttachedToWindow() && !anim.mOverridden && anim.mViewHolder.getAdapterPosition() != -1) {
                ItemAnimator animator = ItemTouchHelper.this.mRecyclerView.getItemAnimator();
                if ((animator == null || !animator.isRunning(null)) && !ItemTouchHelper.this.hasRunningRecoverAnim()) {
                    ItemTouchHelper.this.mCallback.onSwiped(anim.mViewHolder, swipeDir);
                } else {
                    ItemTouchHelper.this.mRecyclerView.post(this);
                }
            }
        }
    });
}
项目:boohee_v5.6    文件:ItemTouchHelper.java   
private void postDispatchSwipe(final RecoverAnimation anim, final int swipeDir) {
    this.mRecyclerView.post(new Runnable() {
        public void run() {
            if (ItemTouchHelper.this.mRecyclerView != null && ItemTouchHelper.this.mRecyclerView.isAttachedToWindow() && !anim.mOverridden && anim.mViewHolder.getAdapterPosition() != -1) {
                ItemAnimator animator = ItemTouchHelper.this.mRecyclerView.getItemAnimator();
                if ((animator == null || !animator.isRunning(null)) && !ItemTouchHelper.this.hasRunningRecoverAnim()) {
                    ItemTouchHelper.this.mCallback.onSwiped(anim.mViewHolder, swipeDir);
                } else {
                    ItemTouchHelper.this.mRecyclerView.post(this);
                }
            }
        }
    });
}
项目:letv    文件:ItemTouchHelper.java   
public long getAnimationDuration(RecyclerView recyclerView, int animationType, float animateDx, float animateDy) {
    ItemAnimator itemAnimator = recyclerView.getItemAnimator();
    return itemAnimator == null ? animationType == 8 ? 200 : 250 : animationType == 8 ? itemAnimator.getMoveDuration() : itemAnimator.getRemoveDuration();
}
项目:boohee_v5.6    文件:ItemTouchHelper.java   
public long getAnimationDuration(RecyclerView recyclerView, int animationType, float animateDx, float animateDy) {
    ItemAnimator itemAnimator = recyclerView.getItemAnimator();
    return itemAnimator == null ? animationType == 8 ? 200 : 250 : animationType == 8 ? itemAnimator.getMoveDuration() : itemAnimator.getRemoveDuration();
}