/** * 构造函数 * * @param mapView * @param dynView */ public QueryResultPopup(MapView mapView, DynamicView dynView) { mMapView = mapView; mMapControl = mapView.getMapControl(); mDynView = dynView; mInflater = LayoutInflater.from(mMapControl.getContext()); mTrackingLayer = mMapView.getMapControl().getMap().getTrackingLayer(); loadView(); setContentView(mContentView); setWidth(MyApplication.dp2px(350)); setHeight(MyApplication.dp2px(530)); mResultList.setAdapter(new QueryResultAdapter()); this.setOutsideTouchable(true); }
private void initView() { // 避免软键盘遮挡 getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); // 初始化MapControl m_MapView = (MapView) findViewById(R.id.mapview); mMapControl = m_MapView.getMapControl(); // 初始化放大缩小按钮 btnZoomin = (Button) findViewById(R.id.zoomin); btnZoomout = (Button) findViewById(R.id.zoomout); btnZoomin.setOnClickListener(new zoominBtnlistener()); btnZoomout.setOnClickListener(new zoomoutBtnlistener()); btnFullScreen = (Button) findViewById(R.id.fullscreen); btnFullScreen.setOnClickListener(new fullScreenBtnListener()); btnMultiMedia = (Button) findViewById(R.id.multi_media); btnPlot = (Button) findViewById(R.id.plot); btnSendMessage = (Button) findViewById(R.id.send_message); btnConsultMessage = (Button) findViewById(R.id.consult_message); btnMessageSwitch = (Button) findViewById(R.id.message_switch); btnLocate = (Button) findViewById(R.id.locate); btnPositionUpload = (Button) findViewById(R.id.position_upload); btnTextMessage = (Button) findViewById(R.id.text_message); btnDelete = (Button) findViewById(R.id.delete); btnDelete.setOnClickListener(this); btnNewMessage = (TextView) findViewById(R.id.new_message); btnClear = (Button) findViewById(R.id.clear); btnClear.setOnClickListener(this); btnMultiMedia.setOnClickListener(this); btnPlot.setOnClickListener(this); btnSendMessage.setOnClickListener(this); btnConsultMessage.setOnClickListener(this); btnMessageSwitch.setOnClickListener(this); btnLocate.setOnClickListener(this); btnPositionUpload.setOnClickListener(this); btnTextMessage.setOnClickListener(this); // 文本消息初始化 m_popupTextMessage = new TextMessagePopup(btnTextMessage.getRootView(), getApplicationContext(), this); }