コード例 #1
0
  @Override
  public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    outState.putSerializable("mNewUser", mNewUser);
    outState.putSerializable("user", mUser);
    outState.putSerializable("friendship", mFriendship);
    outState.putSerializable("groupListed", mGroupMemberListed);
  }
コード例 #2
0
  @Override
  protected void initRefreshList(Bundle savedInstanceState) {
    super.initRefreshList(savedInstanceState);

    ListView listView = (ListView) getRefreshView();
    viewProfile = View.inflate(getActivity(), R.layout.lay_profile_v2, null);
    AisenUtil.setAlpha(viewProfile);
    listView.addHeaderView(viewProfile);
  }
コード例 #3
0
  @Override
  public void onResume() {
    super.onResume();

    setProfileView();

    BaiduAnalyzeUtils.onPageStart("个人微博");

    // 分组发生改变
    if (ActivityHelper.getInstance().getBooleanShareData("ChanneSortHasChanged", false)
        || ActivityHelper.getInstance().getBooleanShareData("offlineChanneChanged", false)) {
      setGroupList();
    }
  }
コード例 #4
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());
    }
  }
コード例 #5
0
  @Override
  protected void layoutInit(LayoutInflater inflater, Bundle savedInstanceSate) {

    super.layoutInit(inflater, savedInstanceSate);

    getActivity().getActionBar().setDisplayHomeAsUpEnabled(true);
    getActivity().getActionBar().setTitle(R.string.title_user_profile);

    mNewUser =
        savedInstanceSate == null
            ? (WeiBoUser) getArguments().getSerializable("newUser")
            : (WeiBoUser) savedInstanceSate.getSerializable("mNewUser");
    if (mNewUser != null) {
      mUser = mNewUser;
    } else {
      mUser =
          savedInstanceSate == null
              ? (WeiBoUser) getArguments().getSerializable("user")
              : (WeiBoUser) savedInstanceSate.getSerializable("user");
    }
    mFriendship =
        savedInstanceSate == null
            ? (FriendshipShow) getArguments().getSerializable("friendship")
            : (FriendshipShow) savedInstanceSate.getSerializable("friendship");
    mGroupMemberListed =
        savedInstanceSate == null
            ? (GroupMemberListed) getArguments().getSerializable("groupListed")
            : (GroupMemberListed) savedInstanceSate.getSerializable("groupListed");

    viewProfile = getRootView();

    if (savedInstanceSate == null) {
      loadFriendship();
    }

    setHasOptionsMenu(true);
  }
コード例 #6
0
  @Override
  public void onPause() {
    super.onPause();

    BaiduAnalyzeUtils.onPageEnd("个人微博");
  }
コード例 #7
0
  @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);

    inflater.inflate(R.menu.profile, menu);
  }
コード例 #8
0
  @Override
  protected void config(RefreshConfig config) {
    super.config(config);

    config.savePosition = false;
  }