Ejemplo n.º 1
0
  private void initListener() {
    mDataManager.addAutoLoginListener(
        new AutoLoginListener() {

          @Override
          public void onAutoLoginEnd() {
            // TODO Auto-generated method stub
            for (int i = 0; i < mListView.getChildCount(); i++) {
              mListView.setItemChecked(i, false);
            }
            mListView.setItemChecked(mDataManager.getCurrentPosition(), true);
          }

          @Override
          public void autoLogin() {
            // TODO Auto-generated method stub

          }
        });
    mDataManager.addUserGroupListener(
        new UserGroupListener() {

          @Override
          public void onGroupChangeEnd() {
            // TODO Auto-generated method stub

            updateList();
          }

          @Override
          public void onAddUser() {
            // TODO Auto-generated method stub

          }

          @Override
          public void deleteUser(int index) {
            // TODO Auto-generated method stub

          }
        });
  }
Ejemplo n.º 2
0
  @Override
  public void onItemClick(AdapterView<?> parent, View view, final int position, long id) {
    profileImageView = (ImageView) view.findViewById(R.id.user_group_img_profile);

    mDataManager.getUserListControlListener().onUserListDismiss();
    mDataManager.setCurrentPosition(position);

    mDataManager.doLoadingStart("登录...");

    mDataManager
        .getWechatManager()
        .login(
            position,
            false,
            true,
            new OnActionFinishListener() {

              @Override
              public void onFinish(int code, Object object) {
                // TODO Auto-generated method stub
                mDataManager
                    .getWechatManager()
                    .getUserProfile(
                        true,
                        true,
                        position,
                        new OnActionFinishListener() {

                          @Override
                          public void onFinish(int code, Object object) {
                            // TODO Auto-generated method stub
                            String referer = (String) object;

                            mDataManager
                                .getWechatManager()
                                .getUserImgWithReferer(
                                    position,
                                    true,
                                    profileImageView,
                                    new OnActionFinishListener() {

                                      @Override
                                      public void onFinish(int code, Object object) {
                                        // TODO
                                        // Auto-generated
                                        // method stub

                                        mDataManager
                                            .getWechatManager()
                                            .getMassData(
                                                position,
                                                true,
                                                new OnActionFinishListener() {

                                                  @Override
                                                  public void onFinish(int code, Object object) {
                                                    // TODO
                                                    // Auto-generated
                                                    // method
                                                    // stub

                                                    mDataManager
                                                        .getWechatManager()
                                                        .getNewMessageList(
                                                            true,
                                                            position,
                                                            new OnActionFinishListener() {

                                                              @Override
                                                              public void onFinish(
                                                                  int code, Object object) {
                                                                // TODO
                                                                // Auto-generated
                                                                // method
                                                                // stub
                                                                Boolean changed = (Boolean) object;
                                                                mDataManager.doMessageGet(changed);
                                                              }
                                                            });
                                                  }
                                                });
                                      }
                                    },
                                    referer);
                          }
                        });
              }
            });
  }