package com.google.firebase.codelab.friendlychat.mvvm.ui.base;

import com.bumptech.glide.Glide;

import de.hdodenhof.circleimageview.CircleImageView;

/**
 * Created by VTCA on 6/19/2016.
 * keyword: databinding dapter
 */
public class BindingAdapter {

    @android.databinding.BindingAdapter("app:avatar")
    public static void setAvatar(CircleImageView view, String avatar) {
        Glide.with(view.getContext())
                .load(avatar)
                .into(view);
    }
}

@@ -68,32 +68,164 @@
 ort 
-com.bumptech.glide.Glide
+android.support.v4.content.ContextCompat;%0Aimport android.text.TextUtils;%0A%0Aimport com.bumptech.glide.Glide;%0Aimport com.google.firebase.codelab.friendlychat.R
 ;%0A%0Ai
@@ -506,16 +506,197 @@
 atar) %7B%0A
+%0A        if(TextUtils.isEmpty(avatar))%7B%0A            view.setImageDrawable(ContextCompat.getDrawable(view.getContext(), R.drawable.ic_account_circle_black_36dp));%0A        %7Delse%7B%0A    
         
@@ -741,16 +741,20 @@
         
+    
 .load(av
@@ -775,16 +775,20 @@
         
+  
+  
 .into(vi
@@ -792,16 +792,26 @@
 (view);%0A
+        %7D%0A
     %7D%0A%7D%0A

Fix error when Avatar is empty