This commit is contained in:
lixiaopeng
2020-01-15 15:41:52 +08:00
parent 0b8f4c85fd
commit 90e4ff805b
4 changed files with 20 additions and 22 deletions

View File

@@ -66,15 +66,14 @@ public class LaucherShareDialog extends Dialog implements View.OnClickListener {
@Override
public void onClick(View view) {
int id = view.getId();
if (id == R.id.btn_block_layout) {
if (id == R.id.btn_block_layout) { //拥堵
sendShareReceiver("1");
} else if (id == R.id.oil_price_layout) {
//TODO
} else if (id == R.id.traffic_check_layout) {
sendShareReceiver("2");
} else if (id == R.id.road_closure_layout) {
} else if (id == R.id.traffic_check_layout) { //交通检查
sendShareReceiver("2");
} else if (id == R.id.road_closure_layout) { //封路
sendShareReceiver("3");
}
dismiss();

View File

@@ -507,7 +507,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
public void onClick(View view) {
int id = view.getId();
if (id == R.id.tv_previous_res) { //上一个
// 判断是图片还是视频,第一个时,上一个不可点击
//判断是图片还是视频,第一个时,上一个不可点击
Logger.d(TAG, " tv_previous_res --1-> currentPosition =" + currentPosition + ">> size= " + markerExploreWayList.size());
if (currentPosition < 0) {
return;
@@ -518,11 +518,6 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
handleData(markerExploreWayList.get(currentPosition));
}
// getRoadLineData();
// getVoiceControlRoadData("中关村");
// getNavigationLineData();
// getNaviRoadLineInfo();
} else if (id == R.id.tv_next_res) { //下一个
//判断是图片还是视频,最后一个时,下一个不可点击
Logger.d(TAG, " tv_next_res --1-> currentPosition =" + currentPosition + ">> size= " + markerExploreWayList.size());
@@ -652,7 +647,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
public void onCompleted(Bitmap bitmap) {
autoZoomInImageView.setImageBitmap(bitmap);
//动画
// handleImageAnimation();
handleImageAnimation();
}
@Override
@@ -803,7 +798,14 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
@Subscribe(threadMode = ThreadMode.MAIN)
public void onMarkerInfo(final MarkerInfo event) {
Logger.d(TAG, "onMarkerInfo ------>");
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_search_poi_location);
if (event.type.equals("1")) { //上报路况
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_block_up);
} else if (event.type.equals("2")) { //交通检查
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_traffic_check);
} else if (event.type.equals("3")) { //封路
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_road_closure);
}
mogoImageloader.downloadImage(getActivity(), event.imageUrl, new IMogoImageLoaderListener() {
@Override
public void onStart() {
@@ -819,10 +821,9 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
.owner(TanluConstants.MODEL_NAME)
.longitude(event.lon);
IMogoMarker marker = mMarkerManager.addMarker(TanluConstants.MODEL_NAME, options);
IMogoMarker marker = mMarkerManager.addMarker("share_tag", options);
//TODO 请求分享接口
}
@Override
@@ -934,7 +935,6 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
speakSuccessVoice(o.getInformations(), discription == null ? "" : discription);
List<Information> informationList = o.getInformations();
//移动
MogoLatLng latLng = new MogoLatLng(lat, lon);
mMApUIController.moveToCenter(latLng);
@@ -962,7 +962,6 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
optionList.add(options);
}
mMarkerManager.addMarkers(TanluConstants.MODEL_NAME, optionList, true);
//直接使用当前数据list作为切换的数据源

View File

@@ -8,12 +8,12 @@ import java.io.Serializable;
* @since 2020-01-08
*/
public class MarkerInfo implements Serializable {
public int type; //封路,还是上报
public String type; //封路,还是上报
public String imageUrl;
public Long lon; //经度
public Long lat; //纬度
public MarkerInfo(int type, String imageUrl, Long lon, Long lat) {
public MarkerInfo(String type, /*String imageUrl,*/ Long lon, Long lat) {
this.type = type;
this.imageUrl = imageUrl;
this.lon = lon;

View File

@@ -13,11 +13,11 @@ import org.greenrobot.eventbus.EventBus
class MarkerInfoReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
if (intent.action == "com.zhidao.roadcondition.marker.info"){
var imageUrl = intent.getStringExtra("imageUrl")
var type = intent.getStringExtra("type")
var lat = intent.getLongExtra("lat",0)
var lon = intent.getLongExtra("lon",0) //经度
Log.d("MarkerInfoReceiver", "imageUrl = $imageUrl ---->lat = $lat ---->lon = $lon")
EventBus.getDefault().post(MarkerInfo(1, imageUrl, lon, lat))
Log.d("MarkerInfoReceiver", "type = $type ---->lat = $lat ---->lon = $lon")
EventBus.getDefault().post(MarkerInfo(type, lon, lat))
}
}
}