修改bug

This commit is contained in:
wds
2021-08-11 19:03:47 +08:00
parent 2bb442eb55
commit 6aee99ac85
3 changed files with 217 additions and 218 deletions

File diff suppressed because one or more lines are too long

View File

@@ -167,8 +167,8 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
poiEntity.setName(list.get(i).getName());
poiEntity.setAddress(list.get(i).getAddress());
poiEntity.setTelPhone(list.get(i).getTelephone() + "");
poiEntity.setPrecision(list.get(i).getPrice());
poiEntity.setDist(list.get(i).getDist());
poiEntity.setPrecision(list.get(i).getPrice()+"");
poiEntity.setDist(list.get(i).getDist()+"");
poiEntity.setType(Integer.valueOf(list.get(i).getType()));
String geo = list.get(i).getGeo();
Geometry geometry = GeometryTools.createGeometry(geo);

View File

@@ -191,7 +191,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
// ivMessage.setVisibility(View.GONE);
// }
cbMapType = (CheckBox) findViewById(R.id.cb_map_type);
//sliding_layout.setScrollableViewHelper(new NestedScrollableViewHelper());
//sliding_layout.setScrollableViewHelper(new NestedScrollableViewHelper());
//地图转换
cbMapType.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
@@ -315,8 +315,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
poiListEntity.setName(listBean.getName());
poiListEntity.setAddress(listBean.getAddress());
poiListEntity.setTelPhone(listBean.getTelephone() + "");
poiListEntity.setPrecision(listBean.getPrice());
poiListEntity.setDist(listBean.getDist());
poiListEntity.setPrecision(listBean.getPrice() + "");
poiListEntity.setDist(listBean.getDist() + "");
poiListEntity.setDescribe(listBean.getMemo());
poiListEntity.setCreateTime(listBean.getEndDate());
poiListEntity.setType(Integer.valueOf(listBean.getType()));
@@ -356,7 +356,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
private class NestedScrollableViewHelper extends ScrollableViewHelper {
public int getScrollableViewScrollPosition(View mScrollableView, boolean isSlidingUp) {
if (mScrollableView instanceof NestedScrollView) {
if(isSlidingUp){
if (isSlidingUp) {
return mScrollableView.getScrollY();
} else {
NestedScrollView nsv = ((NestedScrollView) mScrollableView);
@@ -395,6 +395,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
Log.d("TAG", "onSuccess: " + response.getCode() + response.getMessage() + "" + response.getBody());
}
}
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();
@@ -423,14 +424,12 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
centerEncode = Geohash.getInstance().encode(mapCenterPoint.latitude, mapCenterPoint.longitude);
}
userEncode = Geohash.getInstance().encode(tencentLocation.getLatitude(), tencentLocation.getLongitude());
long date = System.currentTimeMillis();
OkGo.getInstance().cancelTag(this);
showLoadingDialog();
// 请求方式和请求url
HttpParams httpParams = new HttpParams();
httpParams.put("userGeo", userEncode);
httpParams.put("centerGeo", centerEncode);
httpParams.put("date", date);
httpParams.put("pageSize", Constant.NUMBER);
httpParams.put("pageNum", "1");
httpParams.put("type", task_type);
@@ -446,8 +445,14 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
public void onSuccess(JobSearchBean response, int id) {
dismissLoadingDialog();
JobSearchBean.BodyBean body = response.getBody();
upload =response.getUpload();
upload = response.getBody().getUpload();
if (body != null) {
if (upload != null) {
ivSubmit.setEnabled(true);
} else {
ivSubmit.setEnabled(false);
}
Log.d("TAG", "onSuccess: " + response.getBody().toString() + "sssssssssssss");
for (int i = 0; i < removables.size(); i++) {
removables.get(i).remove();
@@ -466,11 +471,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
if (geometry.getGeometryType().equals("Point")) {//点
latLng = GeometryTools.createLatLng(geo);
} else if (geometry.getGeometryType().equals("LineString")) {//线
BitmapDescriptor bitmapLine=null;
if (Integer.valueOf(listBean.getType())==3){//poi录像
bitmapLine= BitmapDescriptorFactory.fromResource(R.drawable.arrow_down);
}else if (Integer.valueOf(listBean.getType())==4){//道路录像
bitmapLine=BitmapDescriptorFactory.fromResource(R.drawable.arrow_down);
BitmapDescriptor bitmapLine = null;
if (Integer.valueOf(listBean.getType()) == 3) {//poi录像
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.arrow_down);
} else if (Integer.valueOf(listBean.getType()) == 4) {//道路录像
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.arrow_down);
}
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
// 构造 PolylineOpitons
@@ -485,10 +490,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
.arrow(true)
.arrowSpacing(30)
.arrowTexture(bitmapLine);
// 还可以添加描边颜色
//.borderColor(0xffff0000)
// 描边颜色的宽度,线宽还是 25 像素,不过填充的部分宽度为 `width` - 2 * `borderWidth`
//.borderWidth(1);
// 还可以添加描边颜色
//.borderColor(0xffff0000)
// 描边颜色的宽度,线宽还是 25 像素,不过填充的部分宽度为 `width` - 2 * `borderWidth`
//.borderWidth(1);
// 绘制折线
Polyline polyline = tencentMap.addPolyline(polylineOptions);
polyline.setZIndex(3);
@@ -591,6 +596,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
obtain.obj = response;
EventBus.getDefault().post(obtain);
}
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();
@@ -599,6 +605,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
});
dismissDialog();
}
public void initMarker(PoiEntity poiEntity) {
sliding_layout.setPanelHeight(0);
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
@@ -614,11 +621,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
latLng = GeometryTools.createLatLng(geo);
} else if (geometry.getGeometryType().equals("LineString")) {//线
BitmapDescriptor bitmapLine=null;
if (poiEntity.getType()==3){//poi录像
bitmapLine= BitmapDescriptorFactory.fromResource(R.drawable.arrow_down);
}else if (poiEntity.getType()==4){//道路录像
bitmapLine=BitmapDescriptorFactory.fromResource(R.drawable.arrow_down);
BitmapDescriptor bitmapLine = null;
if (poiEntity.getType() == 3) {//poi录像
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.arrow_down);
} else if (poiEntity.getType() == 4) {//道路录像
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.arrow_down);
}
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
// 构造 PolylineOpitons
@@ -732,11 +739,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
if (geometry.getGeometryType().equals("Point")) {//点
latLng = GeometryTools.createLatLng(geo);
} else if (geometry.getGeometryType().equals("LineString")) {//线
BitmapDescriptor bitmapLine =null;
if (type==3){//poi录像
bitmapLine= BitmapDescriptorFactory.fromResource(R.drawable.arrow_down);
}else if (type==4){//道路录像
bitmapLine=BitmapDescriptorFactory.fromResource(R.drawable.arrow_down);
BitmapDescriptor bitmapLine = null;
if (type == 3) {//poi录像
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.arrow_down);
} else if (type == 4) {//道路录像
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.arrow_down);
}
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
// 构造 PolylineOpitons
@@ -1231,14 +1238,14 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
if (gatherGetFragment != null) {
fragmentTransaction.remove(gatherGetFragment);
}
}else if (data.what==Constant.POI_DRAWER){//设置每个点的中心位置
} else if (data.what == Constant.POI_DRAWER) {//设置每个点的中心位置
LatLng latLng = (LatLng) data.obj;
if (latLng!=null){
if (latLng != null) {
MapManager.getInstance().animateMapLocation2TopCenter(latLng, 0.5f, 0.25f);
}
}else if (data.what== Constant.UN_POLY_GEN_TASK){//面妆任务立即采集 领取
if ((boolean)data.obj){
} else if (data.what == Constant.UN_POLY_GEN_TASK) {//面妆任务立即采集 领取
if ((boolean) data.obj) {
frameLayout.setVisibility(View.GONE);
sliding_layout.setPanelHeight(0);
@@ -1306,10 +1313,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
screenPosition = tencentMap.getProjection().toScreenLocation(latLng);
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
//创建Marker对象之前设置属性
if (markerPile!=null){
if (markerPile != null) {
markerPile.setFixingPoint(screenPosition.x, screenPosition.y);
}
}
@Override
public void onCancel() {
}
@@ -1467,6 +1475,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
}
break;
case R.id.iv_submit://弹窗
//分享
CharSequence title = "请选择上报类型";
// 如果当前fragment是筛选则移除该fragment
@@ -1476,12 +1485,31 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
}
DialogSettings.style = DialogSettings.STYLE.STYLE_MIUI;
List<ShareDialog.Item> itemList = new ArrayList<>();
itemList.add(new ShareDialog.Item(getContext(), R.drawable.push_poi, "POI"));
itemList.add(new ShareDialog.Item(getContext(), R.drawable.poi_video, "POI录像"));
itemList.add(new ShareDialog.Item(getContext(), R.drawable.push_road, "道路"));
itemList.add(new ShareDialog.Item(getContext(), R.drawable.push_chongdianzhuang, "充电站"));
itemList.add(new ShareDialog.Item(getContext(), R.drawable.push_qingbao, "其他"));
if (upload.contains(1)) {
itemList.add(new ShareDialog.Item(getContext(), R.drawable.push_poi, "POI"));
} else {
}
if (upload.contains(2)) {
itemList.add(new ShareDialog.Item(getContext(), R.drawable.push_chongdianzhuang, "充电站"));
}else {
}
if (upload.contains(3)) {
itemList.add(new ShareDialog.Item(getContext(), R.drawable.poi_video, "POI录像"));
}else {
}
if (upload.contains(4)) {
itemList.add(new ShareDialog.Item(getContext(), R.drawable.push_road, "道路"));
}else {
}
if (upload.contains(5)) {
itemList.add(new ShareDialog.Item(getContext(), R.drawable.push_qingbao, "其他"));
}else {
}
Bundle bundle = new Bundle();
PoiEntity poiEntity = new PoiEntity();
// 上报时以当前用户位置为准
@@ -1497,34 +1525,28 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
ShareDialog.show((AppCompatActivity) getActivity(), itemList, new ShareDialog.OnItemClickListener() {
@Override
public boolean onClick(ShareDialog shareDialog, int index, ShareDialog.Item item) {
switch (index) {
case 0: // POI
showPoiMarkerByType(1, newPoiLatLng);
PoiFragment poiFragment = PoiFragment.newInstance(bundle);
showSlidingFragment(poiFragment);
break;
case 1: // POI录像
showPoiMarkerByType(2, newPoiLatLng);
poiEntity.setWork_type(1);
bundle.putSerializable("poiEntity", poiEntity);
PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
showSlidingFragment(poiVideoFragment);
break;
case 2://道路录像
showPoiMarkerByType(3, newPoiLatLng);
RoadFragment roadFragment = RoadFragment.newInstance(bundle);
showSlidingFragment(roadFragment);
break;
case 3://充电站
showPoiMarkerByType(4, newPoiLatLng);
ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle);
showSlidingFragment(chargingStationFragment);
break;
case 4://其他
showPoiMarkerByType(5, newPoiLatLng);
OtherFragment otherFragment = OtherFragment.newInstance(bundle);
showSlidingFragment(otherFragment);
break;
if (item.getText().equals("POI")) {
showPoiMarkerByType(1, newPoiLatLng);
PoiFragment poiFragment = PoiFragment.newInstance(bundle);
showSlidingFragment(poiFragment);
} else if (item.getText().equals("充电站")) {
showPoiMarkerByType(4, newPoiLatLng);
ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle);
showSlidingFragment(chargingStationFragment);
} else if (item.getText().equals("POI录像")) {
showPoiMarkerByType(2, newPoiLatLng);
poiEntity.setWork_type(1);
bundle.putSerializable("poiEntity", poiEntity);
PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
showSlidingFragment(poiVideoFragment);
} else if (item.getText().equals("道路")) {
showPoiMarkerByType(3, newPoiLatLng);
RoadFragment roadFragment = RoadFragment.newInstance(bundle);
showSlidingFragment(roadFragment);
} else if (item.getText().equals("其他")) {
showPoiMarkerByType(5, newPoiLatLng);
OtherFragment otherFragment = OtherFragment.newInstance(bundle);
showSlidingFragment(otherFragment);
}
return false;
}
@@ -1544,7 +1566,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
}
}
private void showPoiMarkerByType(int type, LatLng latLng) {
private void showPoiMarkerByType(int type, LatLng latLng) {
if (type == 1) {
markerPoi = tencentMap.addMarker(new MarkerOptions(latLng).icon(bitmapDescriptor1).zIndex(2));
} else if (type == 2) {
@@ -1580,26 +1602,26 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
}
}
if (!(fragment instanceof PoiFragment)) {
PoiFragment poiFragment = (PoiFragment) supportFragmentManager.findFragmentByTag(PoiFragment.class.getName());
if (poiFragment != null) {
fragmentTransaction.hide(poiFragment);
}
PoiFragment poiFragment = (PoiFragment) supportFragmentManager.findFragmentByTag(PoiFragment.class.getName());
if (poiFragment != null) {
fragmentTransaction.hide(poiFragment);
}
if (!(fragment instanceof RoadFragment)) {
RoadFragment roadFragment = (RoadFragment) supportFragmentManager.findFragmentByTag(RoadFragment.class.getName());
if (roadFragment != null) {
fragmentTransaction.hide(roadFragment);
}
}
if (!(fragment instanceof RoadFragment)) {
RoadFragment roadFragment = (RoadFragment) supportFragmentManager.findFragmentByTag(RoadFragment.class.getName());
if (roadFragment != null) {
fragmentTransaction.hide(roadFragment);
}
}
if (!(fragment instanceof PoiVideoFragment)) {
PoiVideoFragment poiVideoFragment = (PoiVideoFragment) supportFragmentManager.findFragmentByTag(PoiVideoFragment.class.getName());
if (poiVideoFragment != null) {
fragmentTransaction.hide(poiVideoFragment);
}
PoiVideoFragment poiVideoFragment = (PoiVideoFragment) supportFragmentManager.findFragmentByTag(PoiVideoFragment.class.getName());
if (poiVideoFragment != null) {
fragmentTransaction.hide(poiVideoFragment);
}
fragmentTransaction.show(fragment);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
}
fragmentTransaction.show(fragment);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
}
/**