@Override
 public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
   // TODO Auto-generated method stub
   TeamActive active = mAdapter.getItem(position);
   if (active != null) {
     UIHelper.showTeamActiveDetail(getActivity(), mTeam.getId(), active);
   }
 }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Bundle bundle = getArguments();
    if (bundle != null) {
      mTeam = (Team) bundle.getSerializable(TeamMainActivity.BUNDLE_KEY_TEAM);

      mTeamProject = (TeamProject) bundle.getSerializable(TeamMainActivity.BUNDLE_KEY_PROJECT);

      mTeamId = mTeam.getId();
    }
  }
示例#3
0
  private void tryToShowMetionUser() {
    if (mTeamMemberList == null || mTeamMemberList.isEmpty()) {
      OSChinaApi.getTeamMemberList(
          mTeam.getId(),
          new AsyncHttpResponseHandler() {

            @Override
            public void onSuccess(int arg0, Header[] arg1, byte[] arg2) {
              // TODO Auto-generated method stub
              TeamMemberList memberList = XmlUtils.toBean(TeamMemberList.class, arg2);

              if (memberList != null) {
                mTeamMemberList = memberList.getList();
                showMetionUser();
              } else {
                AppContext.showToast("获取团队成员失败");
              }
            }

            @Override
            public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) {
              // TODO Auto-generated method stub
              AppContext.showToast("获取团队成员失败");
            }

            @Override
            public void onStart() {
              // TODO Auto-generated method stub
              super.onStart();
              showWaitDialog("正在获取团队成员...");
            }

            @Override
            public void onFinish() {
              // TODO Auto-generated method stub
              super.onFinish();
              hideWaitDialog();
            }
          });
    } else {
      showMetionUser();
    }
  }
示例#4
0
  private void handleSubmit() {
    String content = mEtInput.getText().toString();
    if (StringUtils.isEmpty(content) || mTeam == null) return;
    OSChinaTeamApi.pubTeamNewActive(
        mTeam.getId(),
        content,
        imgFile,
        new AsyncHttpResponseHandler() {

          @Override
          public void onSuccess(int arg0, Header[] arg1, byte[] arg2) {
            Result result = XmlUtils.toBean(ResultBean.class, arg2).getResult();
            if (result != null && result.OK()) {
              AppContext.showToast(result.getErrorMessage());
              finish();
            } else {
              AppContext.showToast(result.getErrorMessage());
            }
          }

          @Override
          public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) {
            AppContext.showToast("发表失败,请检查下你的网络");
          }

          @Override
          public void onStart() {
            super.onStart();
            showWaitDialog("提交中...");
          }

          @Override
          public void onFinish() {
            super.onFinish();
            hideWaitDialog();
          }
        });
  }