Пример #1
0
 @Override
 public void release() {
   super.release();
   Logger.d(TAG, "!--->release-----");
   if (null != mLocalView) {
     mLocalView.release();
   }
 }
Пример #2
0
  @Override
  public void putProtocol(JSONObject jsonProtocol) {
    super.putProtocol(jsonProtocol);
    Logger.d(TAG, "tyz--putProtocol");

    try {
      JSONObject objectData = jsonProtocol.getJSONObject("data");
      Logger.d(TAG, "tyz--putProtocol ; data == " + objectData.toString());

      JSONArray datas = objectData.getJSONArray("locationSearch");
      // category = objectData.getString("category");//Error

      Logger.d(TAG, "tyz--putProtocol----category = " + category + ";--datas == " + datas);
      CallbakeLocalSearch listCallback =
          new CallbakeLocalSearch() {
            @Override
            public void dissMissLocalSessionView(int type, String protocal) {
              //          Message localSearchMsg = new Message();
              if (CALL_BACK_NAVI == type) {
                // localSearchMsg.what = SessionPreference.MESSAGE_START_LOCALSEARCH_NAVI;
                Logger.d(TAG, "!--->onClick()----protocal = " + protocal);
                onUiProtocal(SessionPreference.EVENT_NAME_SELECT_ITEM, protocal);
              } else {
                // localSearchMsg.what = SessionPreference.MESSAGE_START_LOCALSEARCH_CALL;
                // mSessionManagerHandler.sendMessage(localSearchMsg);//消失sessionView的界面,导航页面在主界面
                Logger.d(TAG, "!--->onClick()----protocal = " + protocal);
                onUiProtocal(SessionPreference.EVENT_NAME_SELECT_ITEM, protocal);
              }
            }
          };
      mPickListener =
          new IPickListener() {

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

            }

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

            }

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

            }

            @Override
            public void onItemPicked(int position) {
              if (canBeClick) {
                if (mDataItemProtocalList != null && mDataItemProtocalList.size() > 0) {
                  /* < BUG-2792 XD 20150722 modify Begin */
                  Logger.d(
                      TAG,
                      "!--->onItemPicked()----position = "
                          + position
                          + "; mDataItemProtocalList"
                          + mDataItemProtocalList.size());
                  if (mDataItemProtocalList.size() > position) {
                    String selectedItem = mDataItemProtocalList.get(position);

                    Logger.d(TAG, "!--->onItemPicked()----selectedItem = " + selectedItem);
                    onUiProtocal(
                        SessionPreference.EVENT_NAME_SELECT_LOCALSEARCH_ITEM, selectedItem);
                  } else {
                    Logger.e(TAG, "!--->Error: position >= mDataItemProtocalList size");
                  }
                  /* BUG-2792 XD 20150722 modify End > */
                }
                canBeClick = false;
              }
            }
          };

      mLocalView = new LocalSearchView(mContext);
      mLocalView.setPickListener(mPickListener);
      mLocalView.setListener(listCallback);
      mLocalView.initView(getDatas(datas), category);
      addAnswerView(mLocalView);
    } catch (JSONException e) {
      e.printStackTrace();
    }
  }
Пример #3
0
 public void loadMoreItem() {
   mLocalView.addMoreView();
 }