/** inint */
  private void inint() {
    EventBus.getDefault().register(this);
    mContext = this;
    mNetWork = new NetWork(this);
    mSign = TeamMeetingApp.getMyself().getmAuthorization();

    mIMM =
        (InputMethodManager) MainActivity.this.getSystemService(MainActivity.INPUT_METHOD_SERVICE);

    mRlMain = (RelativeLayout) findViewById(R.id.rl_main);
    mCreateRoom = (EditText) findViewById(R.id.et_create_room);
    mRoomCancel = (TextView) findViewById(R.id.tv_cancel_create_room);
    mListView = (ListView) findViewById(R.id.lv_listView);

    mGetRoom = (Button) findViewById(R.id.btn_get_room);
    mGetRoom.setOnClickListener(mOnClickListener);
    mRoomCancel.setOnClickListener(mOnClickListener);

    mRoomData = TeamMeetingApp.getMyself().getmRoomList();
    mAdapter = new SwipeListAdapter(mContext, mRoomData, mSwipeListOnClick);
    mListView.setAdapter(mAdapter);

    mRlMain
        .getViewTreeObserver()
        .addOnGlobalLayoutListener(
            new OnGlobalLayoutListener() {
              @Override
              public void onGlobalLayout() {

                if (isKeyboardShown(mRlMain.getRootView())) {
                  if (mDebug) Log.e(TAG, "isKeyboardShown open keyboard");
                  mSoftInputFlag = true;
                } else {
                  if (mDebug) Log.e(TAG, "isKeyboardShown close keyboard");
                  if (mReNameFlag && mSoftInputFlag) {
                    mUIHandler.sendEmptyMessageDelayed(UPDATE_RENAME_END, 500);
                    mReNameFlag = false;
                    mRoomData.get(mPosition).setmMeetType2(1);
                  }

                  if (mSoftInputFlag) {
                    mCreateRoom.setVisibility(View.GONE);
                    mRoomCancel.setVisibility(View.GONE);
                    mSoftInputFlag = false;
                  }
                }
              }
            });
  }
Beispiel #2
0
  @Override
  public void onClick(View v) {
    // TODO Auto-generated method stub
    super.onClick(v);

    switch (v.getId()) {
      case R.id.btn_left:
        this.getActivity().getSupportFragmentManager().popBackStack();
        break;
      case R.id.fs_about_us:
        ((BaseActivity) this.getActivity())
            .addFragmentToStack(R.id.ami_content, UsIndexFragment.newInstance(), true);
        break;

      case R.id.fs_btn_logout:
        // 注销
        Ion.getDefault(mContext).getCookieMiddleware().clear();
        EventBus.getDefault().post(new NDEvent(NDEvent.E_LOGOUT));
        this.getActivity().getSupportFragmentManager().popBackStack();
        break;
    }
  }
 @Override
 protected void onDestroy() {
   // TODO Auto-generated method stub
   super.onDestroy();
   EventBus.getDefault().unregister(this);
 }