BakerJQ / Android-InfiniteCards

An infinite card switching UI for Android, support custom animation 自定义实现神奇动效的卡片切换视图
Apache License 2.0
1.73k stars 204 forks source link

How can i replace an element in an array keeping style? #19

Closed archaeopterix closed 4 years ago

archaeopterix commented 4 years ago

Hi, I need to replace the already seen cards with new ones without seeing the discard animation. Need replace, delete or add an element in the array "resId"

findViewById(R.id.next).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                if (mIsAdapter1) {

                    resId[1] = R.mipmap.pic10; // Replace item

                    mAdapter1.notifyDataSetChanged(); // here lost CardSizeRatio

                    //mCardView.setCardSizeRatio(1);  //It does not work fine
                    //setStyle2();  //It does not work fine
                    //mCardView.bringCardToFront(mAdapter1.getCount() - 1);

                }
                mCardView.bringCardToFront(1);
            }
        });

Thanks