Esempio n. 1
0
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

          mSearchBar.updateCursorState(false);

          Node curNode = adapter.getItem(position);

          if (!curNode.isDept()) {

            if (adapter.getItem(position).getId() == EngineConst.uId) {
              EmployeeDetailActivity.launch(mContext);

            } else {
              Intent intent = new Intent(mContext, DialogueActivity.class);
              Bundle data = new Bundle();
              data.putInt("cid", EngineConst.cId);
              data.putInt("uid", curNode.getId());
              data.putString("name", curNode.getNodeData().nodeName);
              data.putBoolean("sex", curNode.getNodeData().isBoy);

              LogFactory.d(
                  "data",
                  "cid="
                      + EngineConst.cId
                      + "  uid ="
                      + curNode.getId()
                      + "  mName= "
                      + curNode.getNodeData().nodeName);

              Integer myMsgUserid = curNode.getId();
              if (!IMOApp.sendMsgUserId.isEmpty()) {
                if (IMOApp.sendMsgUserId.contains(curNode.getId())) {
                  IMOApp.sendMsgUserId.remove(myMsgUserid);
                  System.out.println("剩余的 msg id-----" + IMOApp.sendMsgUserId);
                  if (IMOApp.sendMsgUserId.isEmpty()) {
                    MainActivityGroup.getActivityGroup().mHandler.sendEmptyMessage(0);
                  }
                }
              }
              startActivity(intent.putExtras(data));
            }
          } else {

            mStructNavView.setVisibility(View.VISIBLE);
            adapter.showChildNodes(curNode);
            mListView.setSelection(0); // / for selected first node
            if (mStructNavView.getViewGroupChildCount() == 0) {
              mStructNavView.addItem(rootNodeDept.getNodeData().nodeName, rootNodeDept);
            }
            mStructNavView.addItem(curNode.getNodeData().nodeName, curNode);
            // 实现导航点击事件的封装。
            mStructNavView.setOnItemClickListener(adapter);
          }
        }
Esempio n. 2
0
  /** 更新显示List的状态 */
  private void update2State(boolean state) {

    mSearchBar.updateCursorState(state);
    // state = !state;
    if (!state) {
      organizeView.setVisibility(View.VISIBLE);
      mSearchRestltListView.setVisibility(View.GONE);
    } else {
      // 显示搜索结果状态
      mSearchRestltListView.setVisibility(View.VISIBLE);
      organizeView.setVisibility(View.GONE);
    }
  }