// Path: chh/src/main/java/com/fei_ke/chiphellclient/bean/User.java
// public class User {
//     private String avatarUrl = "";
//     private String name = "登录";
//     private String info = "";
//     private String formHash;
// 
//     public String getAvatarUrl() {
//         return avatarUrl;
//     }
// 
//     public void setAvatarUrl(String avatarUrl) {
//         this.avatarUrl = avatarUrl;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public String getInfo() {
//         return info;
//     }
// 
//     public void setInfo(String info) {
//         this.info = info;
//     }
// 
//     public String getFormHash() {
//         return formHash;
//     }
// 
//     public void setFormHash(String formHash) {
//         this.formHash = formHash;
//     }
// 
//     @Override
//     public String toString() {
//         return "User [avatarUrl=" + avatarUrl + ", name=" + name + ", info=" + info + "]";
//     }
// 
// }
// 
// Path: chh/src/main/java/com/fei_ke/chiphellclient/constant/Constants.java
// public class Constants {
//     /**
//      * 论坛地址，注意结尾的斜杠
//      */
//     public static String BASE_URL = GlobalSetting.getForumAddress();
//     //显示头像
//     public static DisplayImageOptions avatarDisplayOption = new DisplayImageOptions.Builder()
//             .cacheInMemory(true).cacheOnDisc(true)
//             .showImageForEmptyUri(R.drawable.noavatar)
//             .showImageOnFail(R.drawable.noavatar)
//             .showImageOnLoading(R.drawable.noavatar)
//             .build();
// }


import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Build;
import android.text.Html;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import com.fei_ke.chiphellclient.R;
import com.fei_ke.chiphellclient.bean.User;
import com.fei_ke.chiphellclient.constant.Constants;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener;
import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;
    }

    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    public UserView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    public void bindValue(User user) {
        ImageLoader.getInstance().displayImage(user.getAvatarUrl(), imageViewAvatar, Constants.avatarDisplayOption,
                new SimpleImageLoadingListener() {
                    @Override
                    public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
                        super.onLoadingComplete(imageUri, view, loadedImage);
                        /*if (loadedImage != null) {
                            Bitmap bg = BitmapUtil.fastblur(loadedImage, 30);
                            mainFrame.setBackgroundDrawable(new BitmapDrawable(bg));
                        } else {
                            mainFrame.setBackgroundResource(R.drawable.card_bg_normal);
                        }*/
                    }
                });
        textViewName.setText(user.getName());
        textViewInfo.setText(Html.fromHtml(user.getInfo()));
    }

    public TextView getButtonFavorite() {
        return buttonFavorite;
    }

    public TextView getButtonMyPost() {
// Path: chh/src/main/java/com/fei_ke/chiphellclient/bean/User.java
// public class User {
//     private String avatarUrl = "";
//     private String name = "登录";
//     private String info = "";
//     private String formHash;
// 
//     public String getAvatarUrl() {
//         return avatarUrl;
//     }
// 
//     public void setAvatarUrl(String avatarUrl) {
//         this.avatarUrl = avatarUrl;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public String getInfo() {
//         return info;
//     }
// 
//     public void setInfo(String info) {
//         this.info = info;
//     }
// 
//     public String getFormHash() {
//         return formHash;
//     }
// 
//     public void setFormHash(String formHash) {
//         this.formHash = formHash;
//     }
// 
//     @Override
//     public String toString() {
//         return "User [avatarUrl=" + avatarUrl + ", name=" + name + ", info=" + info + "]";
//     }
// 
// }
// 
// Path: chh/src/main/java/com/fei_ke/chiphellclient/constant/Constants.java
// public class Constants {
//     /**
//      * 论坛地址，注意结尾的斜杠
//      */
//     public static String BASE_URL = GlobalSetting.getForumAddress();
//     //显示头像
//     public static DisplayImageOptions avatarDisplayOption = new DisplayImageOptions.Builder()
//             .cacheInMemory(true).cacheOnDisc(true)
//             .showImageForEmptyUri(R.drawable.noavatar)
//             .showImageOnFail(R.drawable.noavatar)
//             .showImageOnLoading(R.drawable.noavatar)
//             .build();
// }


// Path: chh/src/main/java/com/fei_ke/chiphellclient/ui/customviews/UserView.java
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Build;
import android.text.Html;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import com.fei_ke.chiphellclient.R;
import com.fei_ke.chiphellclient.bean.User;
import com.fei_ke.chiphellclient.constant.Constants;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener;
import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;

    }

    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    public UserView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    public void bindValue(User user) {
        ImageLoader.getInstance().displayImage(user.getAvatarUrl(), imageViewAvatar, Constants.avatarDisplayOption,
                new SimpleImageLoadingListener() {
                    @Override
                    public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
                        super.onLoadingComplete(imageUri, view, loadedImage);
                        /*if (loadedImage != null) {
                            Bitmap bg = BitmapUtil.fastblur(loadedImage, 30);
                            mainFrame.setBackgroundDrawable(new BitmapDrawable(bg));
                        } else {
                            mainFrame.setBackgroundResource(R.drawable.card_bg_normal);
                        }*/
                    }
                });
        textViewName.setText(user.getName());
        textViewInfo.setText(Html.fromHtml(user.getInfo()));
    }

    public TextView getButtonFavorite() {
        return buttonFavorite;
    }

    public TextView getButtonMyPost() {
        return buttonMyPost;