Diolor / Swipecards

A Tinder-like Android library to create the swipe cards effect. You can swipe left or right to like or dislike the content.
Apache License 2.0
2.34k stars 583 forks source link

White flash / flickers displaying new cards #150

Closed JeffIden closed 8 years ago

JeffIden commented 8 years ago

Hi,

I use this component for a job-dating app and just after a card has been swiped and the new card is displayed, I have a white flash on the new card when it refreshes (with getView function).

Maybe it's not the component but the use of NetworkImageView with Volley. Has anyone encountered this behavior before ?

Thanks, Jeff

alexwalterbos commented 8 years ago

You could check if the view has not been inflated in the getView call. Do you tamper with the View visibility? Haven't encountered such behavior.

JeffIden commented 8 years ago

Yes, I do inflate the view in the getView call : ViewHolder vh = null; LayoutInflater mInflater = (LayoutInflater) mContext .getSystemService(Activity.LAYOUT_INFLATER_SERVICE); if (convertView == null) { convertView = mInflater.inflate(R.layout.item, parent, false); vh = new ViewHolder(); vh.mOpportunityPic = (NetworkImageView) convertView.findViewById(R.id.cardPic);

            vh.mSmallIcon = (ImageView) convertView.findViewById(R.id.smallIcon);

            vh.sTitle = "";
            convertView.setTag(vh);
        }

        vh = (ViewHolder) convertView.getTag();

I didn't touch the View visibility.

JeffIden commented 8 years ago

I just replaced my Volley call by Glide.with(context) .load("http://inthecheesefactory.com/uploads/source/glidepicasso/cover.jpg") .into(ivImg);

and it works !

I close the ticket :)