private void initDiscountCardsRecyclerView() { cardsRecyclerView.setHasFixedSize(true); layoutManager = new LinearLayoutManager(getActivity()); cardsRecyclerView.setLayoutManager(layoutManager); Customer customer = new Select().from(Customer.class).executeSingle(); List<DiscountCard> records = customer.discountCards(); adapter = new DiscountCardsListAdapter(records); cardsRecyclerView.setAdapter(adapter); cardsRecyclerView.setItemAnimator(cardsRecyclerView.getItemAnimator()); cardsRecyclerView.addItemDecoration( new HorizontalDividerItemDecoration.Builder(getContext()).build()); cardsRecyclerView.setItemAnimator(new FadeInAnimator()); cardsRecyclerView.getItemAnimator().setRemoveDuration(1000); cardsRecyclerView.setDefaultOnRefreshListener( () -> new Handler() .postDelayed( () -> { // insert things to adapter cardsRecyclerView.setRefreshing(false); layoutManager.scrollToPosition(0); }, 1000)); }
private void addExpandableFeatures() { ultimateRecyclerView.getItemAnimator().setAddDuration(100); ultimateRecyclerView.getItemAnimator().setRemoveDuration(100); ultimateRecyclerView.getItemAnimator().setMoveDuration(200); ultimateRecyclerView.getItemAnimator().setChangeDuration(100); }