android - FirebaseRecyclerAdapter blinks my row when it's updated -


i'm using firebase create chat app. i'm using recycleview , firebaserecycleradapter firebase-ui display messages. problem when message (as can see below) entire layout blinks. happens if change message on firebase console well. in view holder update heart image view according model. i'm using version 0.6.2 still happens on 1.0.0.

about adapter, extend firebaserecycleradapter , because i'm using viewtypes i've overridden following methods:

  • getitemviewtype
  • populateviewholder
  • oncreateviewholder

enter image description here

class chatmessageoutviewholder extends recyclerview.viewholder {      @bindview(r.id.message_out_content)     textview messengerview;      @bindview(r.id.message_out_heart)     imageview heartview;      @bindview(r.id.message_out_heart_likes)     textview likesview;      @bindview(r.id.message_out_time)     textview timeview;      chatmessageoutviewholder(view v) {         super(v);         butterknife.bind(this, v);     }      void apply(final chatmessage model) {         messengerview.settext(model.content);         likesview.settext(model.likes == null ? "" : string.valueof(model.likes.size()));          drawable image = contextcompat.getdrawable(mcontext, r.drawable.ic_fav_1);         if (model.likes != null && model.likes.contains(muserid)) {             image = contextcompat.getdrawable(mcontext, r.drawable.ic_fav_2);         }          heartview.setimagedrawable(image);         simpledateformat simpledateformat = new simpledateformat("hh:mm", locale.getdefault());         timeview.settext(simpledateformat.format(new date(model.gettimestamp())));          heartview.setonclicklistener(new view.onclicklistener() {             @override             public void onclick(view v) {                 if (mlistener != null) {                     mlistener.onheartclick(model);                 }             }         });     } } 

i figured out!! it's not bug on firebaserecycleradapter. it's sounds default behaviour of recyclerview. solve add following lines after setup local reference.

recyclerview.itemanimator animator = mrecyclerview.getitemanimator(); if (animator instanceof simpleitemanimator) {     ((simpleitemanimator) animator).setsupportschangeanimations(false); } 

Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -