コード例 #1
0
 public static void login(
     @NonNull Context context, @NonNull String accessToken, @NonNull Result.Login loginInfo) {
   SharedWrapper sharedWrapper = SharedWrapper.with(context, TAG);
   sharedWrapper.setString(KEY_ACCESS_TOKEN, accessToken);
   sharedWrapper.setString(KEY_ID, loginInfo.getId());
   sharedWrapper.setString(KEY_LOGIN_NAME, loginInfo.getLoginName());
   sharedWrapper.setString(KEY_AVATAR_URL, loginInfo.getAvatarUrl());
   LoginShared.accessToken = accessToken;
   id = loginInfo.getId();
   loginName = loginInfo.getLoginName();
   avatarUrl = loginInfo.getAvatarUrl();
 }
コード例 #2
0
 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();
 }