Ejemplo n.º 1
0
  /** onActivityResult */
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {

    super.onActivityResult(requestCode, resultCode, data);

    String sign;
    int position;
    String meetingId;

    switch (resultCode) {
      case ExtraType.RESULT_CODE_ROOM_SETTING_MESSAGE_INVITE:
        break;
      case ExtraType.RESULT_CODE_ROOM_SETTING_WEIXIN_INVITE:
        break;
      case ExtraType.RESULT_CODE_ROOM_SETTING_COPY_LINK:
        mCopyLinkDialog = new CopyLinkDialog(this);
        mCopyLinkDialog.show();
        mUIHandler.sendEmptyMessageDelayed(UPDATE_COPY_LINK, 3000);
        break;
      case ExtraType.RESULT_CODE_ROOM_SETTING_NOTIFICATION:
        break;
      case ExtraType.RESULT_CODE_ROOM_SETTING_RENAME:
        mReNameFlag = true;
        sign = TeamMeetingApp.getMyself().getmAuthorization();
        position = data.getIntExtra("position", 0);
        mPosition = position;
        meetingId = data.getStringExtra("meetingId");
        String meetingName = data.getStringExtra("meetingName");
        listViewSetScroll(position);
        Message msg = new Message();
        msg.what = UPDATE_RENAME_SHOW;
        Bundle bundle = new Bundle();
        bundle.putInt("position", position);
        msg.setData(bundle);
        mUIHandler.sendMessageDelayed(msg, 3000);
        // mUIHandler.sendEmptyMessageDelayed(UPDATE_RENAME_SHOW, 5500);

        break;
      case ExtraType.RESULT_CODE_ROOM_SETTING_DELETE:
        sign = TeamMeetingApp.getMyself().getmAuthorization();
        position = data.getIntExtra("position", 0);
        meetingId = data.getStringExtra("meetingId");

        mNetWork.deleteRoom(sign, meetingId);
        mRoomData.remove(position);
        mAdapter.notifyDataSetChanged();

        break;

      default:
        break;
    }
  };
Ejemplo n.º 2
0
        @Override
        public void onItemClickListener(View v, int position) {
          // TODO Auto-generated method stub

          String sign;
          String meetingId;
          String meetingName;

          if (hideKeyboard()) {
            return;
          }

          Intent intent;
          switch (v.getId()) {
            case R.id.fl_front:
              meetingName = mRoomData.get(position).getmMeetName();
              intent = new Intent(mContext, MeetingActivity.class);
              intent.putExtra("meetingName", meetingName);
              mContext.startActivity(intent);
              break;

            case R.id.btn_delete:
              sign = TeamMeetingApp.getMyself().getmAuthorization();
              meetingId = mRoomData.get(position).getmMeetingId();
              mNetWork.deleteRoom(sign, meetingId);
              mRoomData.remove(position);
              mAdapter.notifyDataSetChanged();
              break;

            case R.id.imgbtn_more_setting:
              intent = new Intent(mContext, RoomSettingActivity.class);
              meetingName = mRoomData.get(position).getmMeetName();
              meetingId = mRoomData.get(position).getmMeetingId();
              intent.putExtra("meetingName", meetingName);
              intent.putExtra("meetingId", meetingId);
              intent.putExtra("position", position);
              startActivityForResult(intent, ExtraType.REQUEST_CODE_ROOM_SETTING);
              ((Activity) mContext)
                  .overridePendingTransition(R.anim.activity_open_enter, R.anim.activity_open_exit);

              break;
            case R.id.et_rename:
              EditText reName = (EditText) v.findViewById(R.id.et_rename);
              String newName = reName.getText().toString();
              String oldName = mRoomData.get(position).getmMeetName();

              if (!newName.equals(oldName)) {

                sign = TeamMeetingApp.getMyself().getmAuthorization();
                meetingId = mRoomData.get(position).getmMeetingId();
                mNetWork.updateMeetRoomName(sign, meetingId, newName);

                mRoomData.get(position).setmMeetName(newName);
              }

              mRoomData.get(position).setmMeetType2(1);
              mIMM.hideSoftInputFromWindow(reName.getWindowToken(), 0);
              mUIHandler.sendEmptyMessageDelayed(UPDATE_RENAME_END, 500);
              mReNameFlag = false;
              break;

            default:
              break;
          }
        }