コード例 #1
0
  @Override
  public void onFriendshipCreated(WeiBoUser targetUser) {
    if (mFriendship != null) mFriendship.getSource().setFollowing(true);

    mUser.setRecentStatusId(targetUser.getRecentStatusId());
    if (mNewUser != null) mNewUser.setRecentStatusId(targetUser.getRecentStatusId());

    mGroupMemberListed = new GroupMemberListed();
    mGroupMemberListed.setLists(new ArrayList<GroupListed>());
    mGroupMemberListed.setUid(mUser.getIdstr());

    setProfileView();

    setGroupList();

    getActivity().invalidateOptionsMenu();

    getAdapter().notifyDataSetChanged();
  }
コード例 #2
0
  @Override
  public void onPrepareOptionsMenu(Menu menu) {
    super.onPrepareOptionsMenu(menu);

    MenuItem mentionItem = menu.findItem(R.id.mention);
    MenuItem createItem = menu.findItem(R.id.create);
    MenuItem destoryItem = menu.findItem(R.id.destory);
    MenuItem followerDestoryItem = menu.findItem(R.id.followDestory);

    if (mUser == null || AppContext.getUser().getIdstr().equals(mUser.getIdstr())) {
      mentionItem.setVisible(false);
      createItem.setVisible(false);
      destoryItem.setVisible(false);
      followerDestoryItem.setVisible(false);
    } else {
      mentionItem.setVisible(true);

      createItem.setVisible(mFriendship != null && !mFriendship.getSource().getFollowing());
      destoryItem.setVisible(mFriendship != null && mFriendship.getSource().getFollowing());

      followerDestoryItem.setVisible(mFriendship != null && mFriendship.getTarget().getFollowing());
    }
  }
コード例 #3
0
 private void loadFriendship() {
   // 加载用户关系
   if (mUser != null && !mUser.getIdstr().equals(AppContext.getUser().getIdstr())) {
     new FriendshipTask().execute();
   }
 }