use of com.rideread.rideread.data.result.FollowUser in project ride-read-android by Ride-Read.
the class FollowUserAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(RecyclerView.ViewHolder tHolder, int position) {
UserViewHolder holder = (UserViewHolder) tHolder;
FollowUser user = mUserList.get(position);
if (isFans) {
ImgLoader.getInstance().displayImage(user.getFollowerFaceUrl(), holder.mImgAvatar);
holder.mTvName.setText(user.getFollowerUsername());
holder.mTvSignature.setText(user.getFollowerSignature());
holder.mBtnAttention.setVisibility(View.VISIBLE);
holder.mTvTime.setVisibility(View.GONE);
// holder.mTvTime.setText(getFriendlyTimeSpanByNow(((UserInfo) user).getCreatedAt()));
holder.mBtnAttention.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ApiUtils.follow(user.getTid(), new BaseCallback<BaseModel<DefJsonResult>>() {
@Override
protected void onSuccess(BaseModel<DefJsonResult> model) throws Exception {
holder.mBtnAttention.setVisibility(View.GONE);
}
});
}
});
} else {
ImgLoader.getInstance().displayImage(user.getFollowedFaceUrl(), holder.mImgAvatar);
holder.mTvName.setText(user.getFollowedUsername());
holder.mTvSignature.setText(user.getFollowedSignature());
holder.mBtnAttention.setVisibility(View.GONE);
holder.mTvTime.setVisibility(View.VISIBLE);
// holder.mTvTime.setText(getFriendlyTimeSpanByNow(((UserInfo) user).getCreatedAt()));
}
holder.mImgAvatar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Bundle bundle = new Bundle();
bundle.putInt(UserMomentsActivity.SELECTED_UID, isFans ? user.getFid() : user.getTid());
bundle.putString(UserMomentsActivity.SELECTED_USERNAME, isFans ? user.getFollowerUsername() : user.getFollowedUsername());
mActivity.gotoActivity(UserMomentsActivity.class, bundle);
}
});
// holder.setIsRecyclable(false);
}
use of com.rideread.rideread.data.result.FollowUser in project ride-read-android by Ride-Read.
the class SearchUserAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(RecyclerView.ViewHolder tHolder, int position) {
UserViewHolder holder = (UserViewHolder) tHolder;
FollowUser user = mUserList.get(position);
if (0 == user.getTid()) {
//粉丝
ImgLoader.getInstance().displayImage(user.getFollowerFaceUrl(), holder.mImgAvatar);
holder.mTvName.setText(user.getFollowerUsername());
holder.mTvSignature.setText(user.getFollowerSignature());
holder.mBtnAttention.setVisibility(View.VISIBLE);
holder.mTvTime.setVisibility(View.GONE);
// holder.mTvTime.setText(getFriendlyTimeSpanByNow(((UserInfo) user).getCreatedAt()));
holder.mBtnAttention.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ApiUtils.follow(user.getTid(), new BaseCallback<BaseModel<DefJsonResult>>() {
@Override
protected void onSuccess(BaseModel<DefJsonResult> model) throws Exception {
holder.mBtnAttention.setVisibility(View.GONE);
}
});
}
});
} else {
ImgLoader.getInstance().displayImage(user.getFollowedFaceUrl(), holder.mImgAvatar);
holder.mTvName.setText(user.getFollowedUsername());
holder.mTvSignature.setText(user.getFollowedSignature());
holder.mBtnAttention.setVisibility(View.GONE);
holder.mTvTime.setVisibility(View.VISIBLE);
// holder.mTvTime.setText(getFriendlyTimeSpanByNow(((UserInfo) user).getCreatedAt()));
}
holder.mImgAvatar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Bundle bundle = new Bundle();
bundle.putInt(UserMomentsActivity.SELECTED_UID, 0 != user.getTid() ? user.getTid() : user.getFid());
bundle.putString(UserMomentsActivity.SELECTED_USERNAME, 0 != user.getTid() ? user.getFollowerUsername() : user.getFollowedUsername());
mActivity.gotoActivity(UserMomentsActivity.class, bundle);
}
});
// holder.setIsRecyclable(false);
}
Aggregations