diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/ChargingStationFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/ChargingStationFragment.java index bfd1f7d..d81adfb 100644 --- a/app/src/main/java/com/navinfo/outdoor/fragment/ChargingStationFragment.java +++ b/app/src/main/java/com/navinfo/outdoor/fragment/ChargingStationFragment.java @@ -211,6 +211,54 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. chargingPileDao = poiDatabase.getChargingPileDao(); checkBoxLife = findViewById(R.id.check_pot_life); checkBoxRight = findViewById(R.id.check_pot_right); + //添加桩 + linearChargingPile = findViewById(R.id.linear_charging_pile); + linearChargingPile.setOnClickListener(this::onClick); + btnSaveLocal = findViewById(R.id.btn_save_local); + btnSaveLocal.setOnClickListener(this::onClick); + btnUploading = findViewById(R.id.btn_uploading); + btnUploading.setOnClickListener(this::onClick); + editNameContent = findViewById(R.id.tv_name_content); + editSiteContent = findViewById(R.id.tv_site_content); + tvExamine = findViewById(R.id.tv_examine); + tvExamine.setOnClickListener(this::onClick); + editDescribe = findViewById(R.id.edit_describe); + ivPanorama = findViewById(R.id.iv_panorama); + ivName = findViewById(R.id.iv_name); + linearContact = findViewById(R.id.linear_contact); + ivInternal = findViewById(R.id.iv_internal); + ivElse = findViewById(R.id.iv_else); + ivScutcheon = findViewById(R.id.iv_scutcheon); + rlPanorama = findViewById(R.id.rl_panorama); + rlPanorama.setOnClickListener(this::onClick); + rlName = findViewById(R.id.rl_name); + rlName.setOnClickListener(this::onClick); + rlInternalPhotos = findViewById(R.id.rl_internal_photos); + rlInternalPhotos.setOnClickListener(this::onClick); + rlElse = findViewById(R.id.rl_else); + rlElse.setOnClickListener(this::onClick); + rlScutcheon = findViewById(R.id.rl_scutcheon); + rlScutcheon.setOnClickListener(this::onClick); + + /* recyclerPhone = findViewById(R.id.recycler_phone); + recyclerPhone.setLayoutManager(new LinearLayoutManager(getContext())); + recyclerPhone.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL)); + poiRecycleAdapter = new PoiRecycleAdapter(getContext()); + recyclerPhone.setAdapter(poiRecycleAdapter);*/ + recyclerStation = findViewById(R.id.recycler_station); + recyclerStation.setLayoutManager(new GridLayoutManager(getContext(), 3)); + chargingPileAdapter = new ChargingPileAdapter(getContext()); + recyclerStation.setAdapter(chargingPileAdapter); + chargingPileAdapter.setOnLickItem(new ChargingPileAdapter.onLickItem() { + @Override + public void item(ChargingPileEntity chargingPileEntity) { + Message obtains = Message.obtain(); + obtains.what = Constant.CHARGING_STATION_ITEM; + obtains.obj = chargingPileEntity; + EventBus.getDefault().post(obtains); + } + }); + checkBoxLife.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { @@ -271,12 +319,23 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. public void onItemSelected(AdapterView parent, View view, int position, long id) { switch (position) { case 0: + rlInternalPhotos.setVisibility(View.VISIBLE); + rlElse.setVisibility(View.VISIBLE); + rlScutcheon.setVisibility(View.VISIBLE); existence = 0; break; case 1: + + rlInternalPhotos.setVisibility(View.GONE); + rlElse.setVisibility(View.GONE); + rlScutcheon.setVisibility(View.GONE); existence = 1; break; case 2: + + rlInternalPhotos.setVisibility(View.GONE); + rlElse.setVisibility(View.GONE); + rlScutcheon.setVisibility(View.GONE); existence = 2; break; } @@ -286,53 +345,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. public void onNothingSelected(AdapterView parent) { } }); - //添加桩 - linearChargingPile = findViewById(R.id.linear_charging_pile); - linearChargingPile.setOnClickListener(this::onClick); - btnSaveLocal = findViewById(R.id.btn_save_local); - btnSaveLocal.setOnClickListener(this::onClick); - btnUploading = findViewById(R.id.btn_uploading); - btnUploading.setOnClickListener(this::onClick); - editNameContent = findViewById(R.id.tv_name_content); - editSiteContent = findViewById(R.id.tv_site_content); - tvExamine = findViewById(R.id.tv_examine); - tvExamine.setOnClickListener(this::onClick); - editDescribe = findViewById(R.id.edit_describe); - ivPanorama = findViewById(R.id.iv_panorama); - ivName = findViewById(R.id.iv_name); - linearContact = findViewById(R.id.linear_contact); - ivInternal = findViewById(R.id.iv_internal); - ivElse = findViewById(R.id.iv_else); - ivScutcheon = findViewById(R.id.iv_scutcheon); - rlPanorama = findViewById(R.id.rl_panorama); - rlPanorama.setOnClickListener(this::onClick); - rlName = findViewById(R.id.rl_name); - rlName.setOnClickListener(this::onClick); - rlInternalPhotos = findViewById(R.id.rl_internal_photos); - rlInternalPhotos.setOnClickListener(this::onClick); - rlElse = findViewById(R.id.rl_else); - rlElse.setOnClickListener(this::onClick); - rlScutcheon = findViewById(R.id.rl_scutcheon); - rlScutcheon.setOnClickListener(this::onClick); - /* recyclerPhone = findViewById(R.id.recycler_phone); - recyclerPhone.setLayoutManager(new LinearLayoutManager(getContext())); - recyclerPhone.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL)); - poiRecycleAdapter = new PoiRecycleAdapter(getContext()); - recyclerPhone.setAdapter(poiRecycleAdapter);*/ - recyclerStation = findViewById(R.id.recycler_station); - recyclerStation.setLayoutManager(new GridLayoutManager(getContext(), 3)); - chargingPileAdapter = new ChargingPileAdapter(getContext()); - recyclerStation.setAdapter(chargingPileAdapter); - chargingPileAdapter.setOnLickItem(new ChargingPileAdapter.onLickItem() { - @Override - public void item(ChargingPileEntity chargingPileEntity) { - Message obtains = Message.obtain(); - obtains.what = Constant.CHARGING_STATION_ITEM; - obtains.obj = chargingPileEntity; - EventBus.getDefault().post(obtains); - } - }); //数据展示 initShowPoi(); //禁用所有可操作控件 @@ -380,31 +393,28 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. poiBeans.add(new PhoneBean("电话", "", "", R.drawable.icon_add_bg)); } } else { - if (!StringUtils.isEmpty(phones[i])) { - if (phones[i].contains("-")) { // 包含区号数据的电话 - String[] split = phones[i].split("-"); - if (split!=null&&split.length>1) { - poiBeans.add(new PhoneBean("", split[1] + "", split[0] + "", R.drawable.icon_del_bg)); - } else { - poiBeans.add(new PhoneBean("", "", "", R.drawable.icon_del_bg)); - } - } else { - if (phones[i]!=null) { - poiBeans.add(new PhoneBean("", phones[i] + "", "", R.drawable.icon_del_bg)); - } else { - poiBeans.add(new PhoneBean("", "", "", R.drawable.icon_del_bg)); - } - } + if (phones[i]!=null) { + poiBeans.add(new PhoneBean("电话", phones[i] + "", "", R.drawable.icon_add_bg)); + } else { + poiBeans.add(new PhoneBean("电话", "", "", R.drawable.icon_add_bg)); } } } } else { if (!StringUtils.isEmpty(phones[i])) { - String[] split = phones[i].split("-"); - if (split[0] == phones[i]) { - poiBeans.add(new PhoneBean("", phones[i], "", R.drawable.icon_del_bg)); + if (phones[i].contains("-")) { // 包含区号数据的电话 + String[] split = phones[i].split("-"); + if (split!=null&&split.length>1) { + poiBeans.add(new PhoneBean("", split[1] + "", split[0] + "", R.drawable.icon_del_bg)); + } else { + poiBeans.add(new PhoneBean("", "", "", R.drawable.icon_del_bg)); + } } else { - poiBeans.add(new PhoneBean("", split[1], split[0], R.drawable.icon_del_bg)); + if (phones[i]!=null) { + poiBeans.add(new PhoneBean("", phones[i] + "", "", R.drawable.icon_del_bg)); + } else { + poiBeans.add(new PhoneBean("", "", "", R.drawable.icon_del_bg)); + } } } } @@ -416,7 +426,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. } else { poiBeans.add(new PhoneBean("电话*", "", Constant.CODE, R.drawable.icon_add_bg)); } - } body = showPoiEntity.getBodyId(); contactView = new ContactView(getActivity(), linearContact, poiBeans); @@ -768,24 +777,15 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View. infoPhoto.add(new Info(tagName)); } String tagInternal = (String) ivInternal.getTag(); - if (tagInternal == null) { - Toast.makeText(getActivity(), "请拍照 服务说明", Toast.LENGTH_SHORT).show(); - return; - } else { + if (tagInternal != null) { infoPhoto.add(new Info(tagInternal)); } String tagElse = (String) ivElse.getTag(); - if (tagElse == null) { - Toast.makeText(getActivity(), "请拍照 充电站指引牌", Toast.LENGTH_SHORT).show(); - return; - } else { + if (tagElse != null) { infoPhoto.add(new Info(tagElse)); } String tagScutcheon = (String) ivScutcheon.getTag(); - if (tagScutcheon == null) { - Toast.makeText(getActivity(), "请拍照 停车收费标牌", Toast.LENGTH_SHORT).show(); - return; - } else { + if (tagScutcheon != null) { infoPhoto.add(new Info(tagScutcheon)); } poiEntity.setExistence(existence); diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/OtherFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/OtherFragment.java index 83be4fe..926da09 100644 --- a/app/src/main/java/com/navinfo/outdoor/fragment/OtherFragment.java +++ b/app/src/main/java/com/navinfo/outdoor/fragment/OtherFragment.java @@ -73,7 +73,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis private Spinner spinnerOther; - String[] others = new String[]{"门牌", "公交", "情报"};// //门牌:6 公交:7 情报:8 现在其他任务类型里就这三种 + String[] others = new String[]{"门牌", "公交", "情报"};// //门牌:5 公交:6 情报:7 现在其他任务类型里就这三种 private EditText editTaskName, editOtherDescribe; private RelativeLayout rlPicture; private ImageView ivPicture; @@ -85,7 +85,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis private PoiDao poiDao; private PoiEntity showPoiEntity; private LatLng latLng; - private int station_type = 6; + private int station_type = 5; private String takePhotoPath; @@ -160,13 +160,13 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis public void onItemSelected(AdapterView parent, View view, int position, long id) { switch (position) { case 0: - station_type = 6; + station_type = 5; break; case 1: - station_type = 7; + station_type = 6; break; case 2: - station_type = 8; + station_type = 7; break; } } @@ -276,6 +276,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis } } } + //判断是否是已完成作业并保存成功 if (showPoiEntity.getTaskStatus()==3){ disables(); } diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/PoiVideoFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/PoiVideoFragment.java index e0ef386..940af5b 100644 --- a/app/src/main/java/com/navinfo/outdoor/fragment/PoiVideoFragment.java +++ b/app/src/main/java/com/navinfo/outdoor/fragment/PoiVideoFragment.java @@ -225,8 +225,9 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick } } } + //判断是否是已做完任务并保存成功 if (showPoiEntity.getTaskStatus() == 3){ - disables(); + disables();//禁用所有可操作的控件 } } @@ -499,26 +500,31 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick public void onSuccess(PoiVideoBean poiVideoBean, int id) { dismissLoadingDialog(); Integer poiVideoBody = poiVideoBean.getBody(); - poiEntity.setBodyId(poiVideoBody); - poiEntity.setTaskStatus(3); - new Thread(new Runnable() { - @Override - public void run() { - InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity); - getActivity().runOnUiThread(new Runnable() { - @Override - public void run() { - if (isLocal){ - poiVideoUpload(poiVideoBody,fileZip); - }else { - Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show(); - onBackPressed(); + if (poiVideoBody!=null&&poiVideoBody!=0){ + poiEntity.setBodyId(poiVideoBody); + poiEntity.setTaskStatus(3); + new Thread(new Runnable() { + @Override + public void run() { + InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity); + getActivity().runOnUiThread(new Runnable() { + @Override + public void run() { + if (isLocal){ + poiVideoUpload(poiVideoBody,fileZip); + }else { + Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show(); + onBackPressed(); + } } - } - }); - } - }).start(); - Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show(); + }); + } + }).start(); + Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show(); + }else { + Toast.makeText(getActivity(), "没有获取到具体位置", Toast.LENGTH_SHORT).show(); + } + } @Override diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/RoadFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/RoadFragment.java index 0437a2f..52b7194 100644 --- a/app/src/main/java/com/navinfo/outdoor/fragment/RoadFragment.java +++ b/app/src/main/java/com/navinfo/outdoor/fragment/RoadFragment.java @@ -71,7 +71,7 @@ import java.util.List; public class RoadFragment extends BaseDrawerFragment implements View.OnClickListener { private TextView tvPictures; - private TextView etRoadName; + private EditText etRoadName; private ImageView ivRoadPicture; private RadioButton rbCar; private RadioButton rbBicycle; @@ -140,7 +140,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList poiDao = poiDatabase.getPoiDao(); tvPictures = (TextView) findViewById(R.id.tv_pictures); tvPictures.setOnClickListener(this::onClick); - etRoadName = (TextView) findViewById(R.id.et_road_name); + etRoadName = (EditText) findViewById(R.id.et_road_name); ivRoadPicture = (ImageView) findViewById(R.id.iv_road_picture); // Glide.with(getContext()).load(getLocalVideoBitmap(String.valueOf(R.drawable.bg_01))).into(ivRoadPicture); rbCar = (RadioButton) findViewById(R.id.rb_car); @@ -480,26 +480,32 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList public void onSuccess(RoadSaveBean roadSaveBean, int id) { dismissLoadingDialog(); Integer poiVideoBody = roadSaveBean.getBody(); - poiEntity.setBodyId(poiVideoBody); - poiEntity.setTaskStatus(3); - new Thread(new Runnable() { - @Override - public void run() { - InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity); - getActivity().runOnUiThread(new Runnable() { - @Override - public void run() { - if (isLocal) { - poiVideoUpload(poiVideoBody, fileZip); - } else { - Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show(); - } - } - }); - } - }).start(); - Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show(); - onBackPressed(); + if (poiVideoBody!=null&&poiVideoBody!=0){ + poiEntity.setBodyId(poiVideoBody); + poiEntity.setTaskStatus(3); + new Thread(new Runnable() { + @Override + public void run() { + InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity); + getActivity().runOnUiThread(new Runnable() { + @Override + public void run() { + if (isLocal) { + poiVideoUpload(poiVideoBody, fileZip); + } else { + Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show(); + } + } + }); + } + }).start(); + Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show(); + onBackPressed(); + }else { + Toast.makeText(getActivity(), "没获取到具体的位置", Toast.LENGTH_SHORT).show(); + } + + } @Override diff --git a/app/src/main/java/com/navinfo/outdoor/fragment/TreasureFragment.java b/app/src/main/java/com/navinfo/outdoor/fragment/TreasureFragment.java index 68911d0..ac05a08 100644 --- a/app/src/main/java/com/navinfo/outdoor/fragment/TreasureFragment.java +++ b/app/src/main/java/com/navinfo/outdoor/fragment/TreasureFragment.java @@ -570,7 +570,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen removablesLocality.add(roadMarker); break; case 5://其他 - BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_have_bg); + BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_have_bag); Marker otherMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(otherDescriptor).alpha(0.9f) .flat(true) .clockwise(false)); @@ -580,7 +580,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen removablesLocality.add(otherMarker); break; case 6://面状任务 - BitmapDescriptor Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_have_bg); + BitmapDescriptor Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_have_bag); Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Descriptor).alpha(0.9f) .clockwise(false) .flat(true)); diff --git a/app/src/main/java/com/navinfo/outdoor/room/PoiEntity.java b/app/src/main/java/com/navinfo/outdoor/room/PoiEntity.java index 6477897..3f3dce0 100644 --- a/app/src/main/java/com/navinfo/outdoor/room/PoiEntity.java +++ b/app/src/main/java/com/navinfo/outdoor/room/PoiEntity.java @@ -34,14 +34,14 @@ public class PoiEntity implements Serializable { //ROOM不支持直接存储集合 @TypeConverters(PhotoInfoConverter.class) private List photoInfo;//照片信息 - private int existence;//是否存在 不存在对应 0 存在对应 1 + private int existence;//是否存在 不存在对应 0 存在对应 1 无法验证对应 2 private String x;//经度 private String y;//纬度 private String detail;//深度信息 private String dist;//距离用户位置 private int taskStatus;//任务状态 0.未领取 1.已领取,2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功),4已上传(结束采集), private int type;//1 "POI"2 "充电站"3 "POI录像"4 "道路录像"5 "其他"6 "面状任务" - private int station_type;//1."全部"2 "POI"3 "充电站"4 "POI录像"5 "道路录像", "门牌:6 公交:7 情报:8 + private int station_type;//1."充电站"2 "充换电站"3 "充电桩组"4 "换电站"5 "门牌", "公交:6 情报:7 private int isLocalData;//是否是本地数据 0,服务 1,本地 private int isExclusive;//任务类型 0.普通任务,1.专属任务 private int bodyId;//保存本地的bodyId diff --git a/app/src/main/res/drawable/marker_other_have_bag.png b/app/src/main/res/drawable/marker_other_have_bag.png index 72ffdad..3f9d470 100644 Binary files a/app/src/main/res/drawable/marker_other_have_bag.png and b/app/src/main/res/drawable/marker_other_have_bag.png differ diff --git a/app/src/main/res/drawable/marker_other_have_bg.png b/app/src/main/res/drawable/marker_other_have_bg.png deleted file mode 100644 index 3f9d470..0000000 Binary files a/app/src/main/res/drawable/marker_other_have_bg.png and /dev/null differ diff --git a/app/src/main/res/drawable/marker_poi_video_have_bag.png b/app/src/main/res/drawable/marker_poi_video_have_bag.png deleted file mode 100644 index 03fee1d..0000000 Binary files a/app/src/main/res/drawable/marker_poi_video_have_bag.png and /dev/null differ diff --git a/app/src/main/res/layout/fragment_road.xml b/app/src/main/res/layout/fragment_road.xml index 137de58..11590c4 100644 --- a/app/src/main/res/layout/fragment_road.xml +++ b/app/src/main/res/layout/fragment_road.xml @@ -51,11 +51,11 @@ android:textColor="@color/black" android:textSize="15sp" /> - @@ -130,7 +130,7 @@ diff --git a/app/src/main/res/layout/withdraw_fragment.xml b/app/src/main/res/layout/withdraw_fragment.xml index cd4d403..d3a9907 100644 --- a/app/src/main/res/layout/withdraw_fragment.xml +++ b/app/src/main/res/layout/withdraw_fragment.xml @@ -84,7 +84,7 @@ android:id="@+id/tv_text" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:drawableRight="@drawable/ic_baseline_arrow_forward" + android:drawableRight="@drawable/ic_baseline_navigate" android:text="提现纪录" app:layout_constraintBottom_toBottomOf="@+id/tv_unit" app:layout_constraintEnd_toEndOf="parent"