public static void update(@NonNull Context context, @NonNull User user) { SharedWrapper sharedWrapper = SharedWrapper.with(context, TAG); sharedWrapper.setString(KEY_LOGIN_NAME, user.getLoginName()); sharedWrapper.setString(KEY_AVATAR_URL, user.getAvatarUrl()); sharedWrapper.setInt(KEY_SCORE, user.getScore()); loginName = user.getLoginName(); avatarUrl = user.getAvatarUrl(); score = user.getScore(); }
private void updateUserInfoViews(User user) { Picasso.with(this) .load(user.getAvatarUrl()) .placeholder(R.drawable.image_placeholder) .into(imgAvatar); tvLoginName.setText(user.getLoginName()); if (TextUtils.isEmpty(user.getGithubUsername())) { tvGithubUsername.setVisibility(View.INVISIBLE); tvGithubUsername.setText(null); } else { tvGithubUsername.setVisibility(View.VISIBLE); tvGithubUsername.setText( Html.fromHtml("<u>" + user.getGithubUsername() + "@github.com" + "</u>")); } tvCreateTime.setText( getString(R.string.register_time_$) + user.getCreateAt().toString("yyyy-MM-dd")); tvScore.setText(getString(R.string.score_$) + user.getScore()); }
public void update(@NonNull User user) { fmList.get(0).notifyDataSetChanged(user.getRecentReplies()); fmList.get(1).notifyDataSetChanged(user.getRecentTopics()); }