任务搜索 删选界面的数据处理

This commit is contained in:
wds 2021-07-02 18:37:00 +08:00
parent 04b17b37b6
commit db74ba9dc9
21 changed files with 532 additions and 214 deletions

@ -52,7 +52,6 @@ dependencies {
implementation 'androidx.navigation:navigation-ui:2.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation files('libs\\jts-1.13.jar')
implementation files('libs\\jts-1.13.jar')
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

@ -12,6 +12,9 @@ import androidx.recyclerview.widget.RecyclerView;
import com.navinfo.outdoor.R;
import com.navinfo.outdoor.room.PoiEntity;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;
@ -20,7 +23,7 @@ import java.util.List;
*/
public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder> {
private Context context;
private List<PoiEntity> allPoi=new ArrayList<>();
private List<PoiEntity> allPoi = new ArrayList<>();
public FilterAdapter(Context context) {
this.context = context;
@ -42,32 +45,60 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
PoiEntity poiEntity = allPoi.get(position);
holder.tvName.setText(poiEntity.getName());
holder.tvTaskId.setText(poiEntity.getTaskId()+"");
holder.tvMoney.setText(poiEntity.getPrecision()+"");
holder.tvDistance.setText(poiEntity.getDescribe()+"");
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (itemCLick!=null){
itemCLick.item(poiEntity);
}
}
});
if (poiEntity.getTaskStatus()==0){
if (poiEntity.getTaskId()!=0){
holder.tvTaskId.setText("任务id:" + poiEntity.getTaskId());
}else {
holder.tvTaskId.setText("任务id:" + 0);
}
if (poiEntity.getPrecision()!=null){
holder.tvMoney.setText("" + poiEntity.getPrecision());
}else {
holder.tvMoney.setText("" + 0);
}
if (poiEntity.getDist()!=null){
holder.tvDistance.setText("距离:" +format2(Double.valueOf(poiEntity.getDist())/1000)+"km");
}else {
holder.tvDistance.setText("距离:" +0);
}
if (poiEntity.getTaskStatus() == 0) {
holder.tvGit.setVisibility(View.GONE);
holder.tvSubmit.setVisibility(View.VISIBLE);
}else if (poiEntity.getTaskStatus()==1){
holder.tvSubmit.setVisibility(View.GONE);
} else if (poiEntity.getTaskStatus() == 1) {
holder.tvSubmit.setVisibility(View.GONE);
holder.tvGit.setVisibility(View.VISIBLE);
}
if (poiEntity.getType()==0){
if (poiEntity.getType() == 1) {
holder.tvForm.setText("poi");
}else if (poiEntity.getType()==1){
holder.tvForm.setText("道路");
}else if (poiEntity.getType()==2){
} else if (poiEntity.getType() == 2) {
holder.tvForm.setText("充电站");
}else if (poiEntity.getType()==3){
} else if (poiEntity.getType() == 3) {
holder.tvForm.setText("POI录像");
} else if (poiEntity.getType() == 4) {
holder.tvForm.setText("道路录像");
} else if (poiEntity.getType() == 5) {
holder.tvForm.setText("其他");
} else if (poiEntity.getType() == 6) {
holder.tvForm.setText("面状任务");
}
if (poiEntity.getIsLocalData() == 1) {
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (itemCLick != null) {
itemCLick.item(poiEntity, true);
}
}
});
} else {
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (itemCLick != null) {
itemCLick.item(poiEntity, false);
}
}
});
}
}
@ -78,25 +109,71 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder
}
public class ViewHolder extends RecyclerView.ViewHolder {
TextView tvName,tvForm,tvTaskId,tvMoney,tvDistance,tvGit,tvSubmit;
TextView tvName, tvForm, tvTaskId, tvMoney, tvDistance, tvGit, tvSubmit;
public ViewHolder(@NonNull View itemView) {
super(itemView);
tvName=itemView.findViewById(R.id.tv_name);
tvForm=itemView.findViewById(R.id.tv_form);
tvTaskId=itemView.findViewById(R.id.tv_task_id);
tvMoney=itemView.findViewById(R.id.tv_money);
tvDistance=itemView.findViewById(R.id.tv_distance);
tvGit=itemView.findViewById(R.id.tv_git);
tvSubmit=itemView.findViewById(R.id.tv_submit);
tvName = itemView.findViewById(R.id.tv_name);
tvForm = itemView.findViewById(R.id.tv_form);
tvTaskId = itemView.findViewById(R.id.tv_task_id);
tvMoney = itemView.findViewById(R.id.tv_money);
tvDistance = itemView.findViewById(R.id.tv_distance);
tvGit = itemView.findViewById(R.id.tv_git);
tvSubmit = itemView.findViewById(R.id.tv_submit);
}
}
ItemCLick itemCLick;
public void setItemCLick(ItemCLick itemCLick) {
this.itemCLick = itemCLick;
}
public interface ItemCLick{
void item(PoiEntity poiEntity);
public interface ItemCLick {
void item(PoiEntity poiEntity, boolean a);
}
/**
* 保存小数点后两位
*
* @param value
* @return
*/
public static String format2(double value) {
DecimalFormat df = new DecimalFormat("0.00");
df.setRoundingMode(RoundingMode.HALF_UP);
return df.format(value);
}
public static String format3(double value) {
NumberFormat nf = NumberFormat.getNumberInstance();
nf.setMaximumFractionDigits(2);
/** setMinimumFractionDigits设置成2
* 如果不这么做那么当value的值是100.00的时候返回100
* 而不是100.00
*/
nf.setMinimumFractionDigits(2);
nf.setRoundingMode(RoundingMode.HALF_UP);
/*
如果想输出的格式用逗号隔开可以设置成true
*/
nf.setGroupingUsed(false);
return nf.format(value);
}
public static String format5(double value) {
return String.format("%.2f", value).toString();
}
}

@ -1,7 +1,11 @@
package com.navinfo.outdoor.api;
import com.navinfo.outdoor.R;
import com.navinfo.outdoor.bean.JobSearchBean;
import com.navinfo.outdoor.util.SdkFolderCreate;
import com.tencent.map.geolocation.TencentLocation;
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptorFactory;
/**
* 常量
@ -59,6 +63,8 @@ public class Constant {
public static final int OTHER_WORD = 25;//地图页面marker 的经纬都回传
public static final int CHARGING_STATION_PILE = 26;//跳转到充电桩 传给数据
public static final int JOB_SEARCH_WORD = 28;//任务搜索的数据
public static String USER_ATTESTATION_NAME; //实名认证姓名 银行卡
public static int NUMBER =200; //任务个数
@ -73,5 +79,15 @@ public class Constant {
public static double markerLatitude;
public static double markerLongitude;
//marker 图标
public static BitmapDescriptor POI_ICON = BitmapDescriptorFactory.fromResource(R.drawable.poi_icons);
public static BitmapDescriptor ROAD_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bg);
public static BitmapDescriptor STATION_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bg);
public static BitmapDescriptor PLANAR_TASK_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg);
public static JobSearchBean jobSearchBean;//数据
}

@ -1,8 +1,9 @@
package com.navinfo.outdoor.bean;
import java.io.Serializable;
import java.util.List;
public class JobSearchBean {
public class JobSearchBean implements Serializable {
/**
* status : 0
* msg : 成功

@ -388,7 +388,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
latLng.setLongitude(Double.parseDouble(split[1]));
}
String memo = chargingPileEntity.getMemo();
if (memo != null) {
if (memo != null&&!memo.equals("")) {
editDescribe.setText(memo);
}
int fid = chargingPileEntity.getFid();
@ -760,57 +760,57 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
chargingPileEntity.setP(latLng.latitude+","+latLng.longitude);
}
String name = editNameContent.getText().toString().trim();//名称
if (name != null ||!name.equals("")) {
if (name != null &&!name.equals("")) {
chargingPileEntity.setName(name);
}
if (cp_floor != 0) {
chargingPileEntity.setCp_floor(cp_floor);
}
String tagPanorama = (String) ivPanorama.getTag();
if (tagPanorama != null) {
if (tagPanorama != null &&!tagPanorama.equals("")) {
photo.add(tagPanorama);
}
String tagCoding = (String) ivCoding.getTag();
if (tagCoding != null) {
if (tagCoding != null&&!tagCoding.equals("")) {
photo.add(tagCoding);
}
String tagEquipment = (String) ivEquipment.getTag();
if (tagEquipment != null) {
if (tagEquipment != null&&!tagEquipment.equals("")) {
photo.add(tagEquipment);
}
String tagFacility = (String) ivFacility.getTag();
if (tagFacility != null) {
if (tagFacility != null&&!tagFacility.equals("")) {
photo.add(tagFacility);
}
String tagScutcheon = (String) ivScutcheon.getTag();
if (tagScutcheon != null) {
if (tagScutcheon != null&&!tagScutcheon.equals("")) {
photo.add(tagScutcheon);
}
String tagDevice = (String) ivDevice.getTag();
if (tagDevice != null) {
if (tagDevice != null&&!tagDevice.equals("")) {
photo.add(tagDevice);
}
String tagUsable = (String) ivUsable.getTag();
if (tagUsable != null ) {
if (tagUsable != null &&!tagUsable.equals("")) {
photo.add(tagUsable);
}
String tagAvailable = (String) ivAvailable.getTag();
if (tagAvailable != null) {
if (tagAvailable != null&&!tagAvailable.equals("")) {
photo.add(tagAvailable);
}
String tagParking = (String) ivParking.getTag();
if (tagParking != null) {
if (tagParking != null&&!tagParking.equals("")) {
photo.add(tagPanorama);
}
String tagNumber = (String) ivNumber.getTag();
if (tagNumber != null) {
if (tagNumber != null&&!tagNumber.equals("")) {
photo.add(tagNumber);
}
chargingPileEntity.setPhotos(photo);
chargingPileEntity.setSign_exist(sign_exist);
chargingPileEntity.setCp_availableState(cp_availableState);
String describe = editDescribe.getText().toString().trim();
if (describe != null || !describe.equals("")) {
if (describe != null && !describe.equals("")) {
chargingPileEntity.setMemo(describe);
}
if (pid != 0) {

@ -309,11 +309,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
showPoiEntity = (PoiEntity) getArguments().getSerializable("poiEntity");
if (showPoiEntity != null) {
String name = showPoiEntity.getName();//名称
if (name != null) {
if (name != null &&!name.equals("")) {
editNameContent.setText(name + "");
}
String address = showPoiEntity.getAddress();//地址
if (address != null) {
if (address != null&&! address.equals("")) {
editSiteContent.setText(address);
}
String x = showPoiEntity.getX();
@ -324,11 +324,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
latLng.setLongitude(Double.parseDouble(x));
}
String describe = showPoiEntity.getDescribe();//任务描述
if (describe != null) {
if (describe != null&&!describe.equals("")) {
editDescribe.setText(describe);
}
String telPhone = showPoiEntity.getTelPhone();
if (telPhone != null) {
if (telPhone != null&&!telPhone.equals("")) {
phoneData.add(showPoiEntity.getTelPhone());
poiBeans.add(new PoiBean("电话*", telPhone, R.drawable.icon_add_bg));
poiRecycleAdapter.setList(poiBeans);
@ -554,7 +554,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
String format = formatter.format(calendar.getTime());
poiEntity.setCreateTime(format);
poiEntity.setType(2);
poiEntity.setTaskStatus(0);
poiEntity.setTaskStatus(1);
poiEntity.setIsLocalData(1);
new Thread(new Runnable() {
@Override
public void run() {
@ -628,11 +630,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
PoiEntity poiEntity = new PoiEntity();
List<Info> infoPhoto = new ArrayList<>();
String name = editNameContent.getText().toString().trim();//名称
if (name != null || !name.equals("")) {
if (name != null && !name.equals("")) {
poiEntity.setName(name);
}
String site = editSiteContent.getText().toString().trim();
if (site != null || !site.equals("")) {
if (site != null && !site.equals("")) {
poiEntity.setAddress(site);
}
if (latLng != null) {
@ -640,30 +642,30 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
poiEntity.setY(String.valueOf(latLng.latitude));
}
String describe = editDescribe.getText().toString().trim();
if (describe != null || !describe.equals("")) {
if (describe != null && !describe.equals("")) {
poiEntity.setDescribe(describe);
}
if (phoneData.size() > 0) {
poiEntity.setTelPhone(phoneData.get(0));
}
String tagPanorama = (String) ivPanorama.getTag();
if (tagPanorama != null) {
if (tagPanorama != null&&!tagPanorama.equals("")) {
infoPhoto.add(new Info(tagPanorama));
}
String tagName = (String) ivName.getTag();
if (tagName != null) {
if (tagName != null&&!tagName.equals("")) {
infoPhoto.add(new Info(tagName));
}
String tagInternal = (String) ivInternal.getTag();
if (tagInternal != null) {
if (tagInternal != null&&!tagInternal.equals("")) {
infoPhoto.add(new Info(tagInternal));
}
String tagElse = (String) ivElse.getTag();
if (tagElse != null) {
if (tagElse != null&&!tagElse.equals("")) {
infoPhoto.add(new Info(tagElse));
}
String tagScutcheon = (String) ivScutcheon.getTag();
if (tagScutcheon != null) {
if (tagScutcheon != null&&!tagScutcheon.equals("")) {
infoPhoto.add(new Info(tagScutcheon));
}
poiEntity.setPhotoInfo(infoPhoto);
@ -674,7 +676,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
String format = formatter.format(calendar.getTime());
poiEntity.setCreateTime(format);
poiEntity.setType(2);
poiEntity.setTaskStatus(0);
poiEntity.setTaskStatus(1);
poiEntity.setIsLocalData(1);
new Thread(new Runnable() {
@Override
public void run() {
@ -713,11 +716,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
PoiEntity poiEntity = new PoiEntity();
List<Info> infoPhoto = new ArrayList<>();
String name = editNameContent.getText().toString().trim();//名称
if (name != null || !name.equals("")) {
if (name != null && !name.equals("")) {
poiEntity.setName(name);
}
String site = editSiteContent.getText().toString().trim();
if (site != null || !site.equals("")) {
if (site != null && !site.equals("")) {
poiEntity.setAddress(site);
}
if (latLng != null) {
@ -725,30 +728,30 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
poiEntity.setY(String.valueOf(latLng.latitude));
}
String describe = editDescribe.getText().toString().trim();
if (describe != null || !describe.equals("")) {
if (describe != null && !describe.equals("")) {
poiEntity.setDescribe(describe);
}
if (phoneData.size() > 0) {
poiEntity.setTelPhone(phoneData.get(0));
}
String tagPanorama = (String) ivPanorama.getTag();
if (tagPanorama != null) {
if (tagPanorama != null&&!tagPanorama.equals("")) {
infoPhoto.add(new Info(tagPanorama));
}
String tagName = (String) ivName.getTag();
if (tagName != null) {
if (tagName != null&&!tagName.equals("")) {
infoPhoto.add(new Info(tagName));
}
String tagInternal = (String) ivInternal.getTag();
if (tagInternal != null) {
if (tagInternal != null&&!tagInternal.equals("")) {
infoPhoto.add(new Info(tagInternal));
}
String tagElse = (String) ivElse.getTag();
if (tagElse != null) {
if (tagElse != null&&!tagElse.equals("")) {
infoPhoto.add(new Info(tagElse));
}
String tagScutcheon = (String) ivScutcheon.getTag();
if (tagScutcheon != null) {
if (tagScutcheon != null&&!tagScutcheon.equals("")) {
infoPhoto.add(new Info(tagScutcheon));
}
poiEntity.setPhotoInfo(infoPhoto);
@ -759,7 +762,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
String format = formatter.format(calendar.getTime());
poiEntity.setCreateTime(format);
poiEntity.setType(2);
poiEntity.setTaskStatus(0);
poiEntity.setTaskStatus(1);
poiEntity.setIsLocalData(1);
new Thread(new Runnable() {
@Override
public void run() {

@ -20,10 +20,18 @@ import com.navinfo.outdoor.R;
import com.navinfo.outdoor.adapter.FilterAdapter;
import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.base.BaseDrawerFragment;
import com.navinfo.outdoor.bean.JobSearchBean;
import com.navinfo.outdoor.room.PoiDao;
import com.navinfo.outdoor.room.PoiDatabase;
import com.navinfo.outdoor.room.PoiEntity;
import com.navinfo.outdoor.util.GeometryTools;
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
import com.vividsolutions.jts.geom.Geometry;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@ -78,7 +86,14 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
});
}
}
@Override
public void onStart() {
super.onStart();
if (!EventBus.getDefault().isRegistered(this)) {//加上判断
EventBus.getDefault().register(this);
}
}
@Override
public void onResume() {
super.onResume();
@ -159,15 +174,77 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
});
filterAdapter.setItemCLick(new FilterAdapter.ItemCLick() {
@Override
public void item(PoiEntity poiEntity) {
Message obtain = Message.obtain();
obtain.what = Constant.FILTER_LIST_ITEM;
obtain.obj = poiEntity;
EventBus.getDefault().post(obtain);
public void item(PoiEntity poiEntity,boolean aBoolean) {
if (aBoolean){
Message obtain = Message.obtain();
obtain.what = Constant.GATHER_GET;
obtain.obj = poiEntity;
EventBus.getDefault().post(obtain);
}else {
Message obtain = Message.obtain();
obtain.what = Constant.FILTER_LIST_ITEM;
obtain.obj = poiEntity;
EventBus.getDefault().post(obtain);
}
}
});
}
@Subscribe
public void onEvent(Message data) {
if (data.what == Constant.JOB_SEARCH_WORD) {
/*
* id : 0
* name :
* address : http://10.130.23.166:8080/cbt/img/blue.png
* telephone : 11
* geo : 标题11
* price : 通过
* type :
* dist :
**/
new Thread(new Runnable() {
@Override
public void run() {
List<PoiEntity> allPoi = poiDao.getAllPoi();
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
Log.d("TAG", "run: " + allPoi.toString());
poiEntities.clear();
JobSearchBean jobSearchBean = (JobSearchBean) data.obj;
List<JobSearchBean.BodyBean.ListBean> list = jobSearchBean.getBody().getList();
for (int i = 0; i < list.size(); i++) {
PoiEntity poiEntity = new PoiEntity();
poiEntity.setTaskId(list.get(i).getId());
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.setType(Integer.valueOf(list.get(i).getType()));
String geo = list.get(i).getGeo();
Geometry geometry = GeometryTools.createGeometry(geo);
if ( geometry.getGeometryType().equals("Point")){//
LatLng latLng = GeometryTools.createLatLng(geo);
poiEntity.setX(latLng.longitude+"");
poiEntity.setY(latLng.altitude+"");
}else if ( geometry.getGeometryType().equals("LineString")){//线
}else if ( geometry.getGeometryType().equals("Polygon")) {//
}
poiEntities.add(poiEntity);
}
poiEntities.addAll(allPoi);
filterAdapter.setAllPoi(poiEntities);
}
});
}
}).start();
}
}
@Override
@ -186,6 +263,29 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
public void run() {
Log.d("TAG", "run: " + allPoi.toString());
poiEntities.clear();
JobSearchBean jobSearchBean = (JobSearchBean) getArguments().getSerializable("body");
List<JobSearchBean.BodyBean.ListBean> list = jobSearchBean.getBody().getList();
for (int i = 0; i < list.size(); i++) {
PoiEntity poiEntity = new PoiEntity();
poiEntity.setTaskId(list.get(i).getId());
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.setType(Integer.valueOf(list.get(i).getType()));
String geo = list.get(i).getGeo();
Geometry geometry = GeometryTools.createGeometry(geo);
if ( geometry.getGeometryType().equals("Point")){//
LatLng latLng = GeometryTools.createLatLng(geo);
poiEntity.setX(latLng.longitude+"");
poiEntity.setY(latLng.altitude+"");
}else if ( geometry.getGeometryType().equals("LineString")){//线
}else if ( geometry.getGeometryType().equals("Polygon")) {//
}
poiEntities.add(poiEntity);
}
poiEntities.addAll(allPoi);
filterAdapter.setAllPoi(poiEntities);
}
@ -240,4 +340,11 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
});
}
}
@Override
public void onDestroy() {
if (EventBus.getDefault().isRegistered(this))//加上判断
EventBus.getDefault().unregister(this);
super.onDestroy();
}
}

@ -23,7 +23,7 @@ import org.greenrobot.eventbus.Subscribe;
public class GatherGetFragment extends BaseFragment implements View.OnClickListener {
private Button btnBank;
private TextView tvTitle, tvMoney, tvTime, tvLength, tvDistance, tvDescribe;
private TextView tvTitle, tvMoney, tvTime, tvDistance, tvDescribe;
private PoiEntity poiEntity;
public static GatherGetFragment newInstance(Bundle bundle) {
@ -72,9 +72,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
tvTitle.setText(poiEntity.getName());
tvMoney.setText("3.5元");
tvTime.setText("到期时间:" + poiEntity.getCreateTime());
tvLength.setText("长度:" + poiEntity.getDetail());
tvDescribe.setText("任务描述:" + poiEntity.getDescribe());
tvDistance.setText("距离:" + poiEntity.getX());
tvDistance.setText("距离:" + poiEntity.getDist());
}
}
@ -89,7 +88,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
tvTitle = findViewById(R.id.tv_title);
tvMoney = findViewById(R.id.tv_money);
tvTime = findViewById(R.id.tv_time);
tvLength = findViewById(R.id.tv_length);
tvDistance = findViewById(R.id.tv_distance);
tvDescribe = findViewById(R.id.tv_describe);
btnBank = findViewById(R.id.btn_bank);
@ -99,15 +97,12 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
if (arguments!=null) {
poiEntity = (PoiEntity) arguments.getSerializable("poiEntity");
tvTitle.setText(poiEntity.getName());
tvMoney.setText("3.5元");
tvMoney.setText(""+poiEntity.getPrecision());
tvTime.setText("到期时间:" + poiEntity.getCreateTime());
tvLength.setText("长度:" + poiEntity.getDetail());
tvDescribe.setText("任务描述:" + poiEntity.getDescribe());
tvDistance.setText("距离:" );
tvDistance.setText("距离:"+format5(Double.valueOf(poiEntity.getDist())/1000)+"km");
}
}
@Override
@ -126,7 +121,10 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
}
}
public static String format5(double value) {
return String.format("%.2f", value).toString();
}
@Override
public void onDestroy() {
if (EventBus.getDefault().isRegistered(this))//加上判断

@ -210,7 +210,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
showPoiEntity = (PoiEntity) getArguments().getSerializable("poiEntity");
if (showPoiEntity != null) {
String name = showPoiEntity.getName();//名称
if (name != null) {
if (name != null&&!name.equals("")) {
editTaskName.setText(name + "");
}
String x = showPoiEntity.getX();
@ -221,7 +221,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
latLng.setLatitude(Double.parseDouble(y));
}
String describe = showPoiEntity.getDescribe();//任务描述
if (describe != null) {
if (describe != null &&!describe.equals("")) {
editOtherDescribe.setText(describe);
}
if (showPoiEntity.getPhotoInfo() != null) {
@ -307,8 +307,9 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
calendar.setTimeInMillis(System.currentTimeMillis());
String format = formatter.format(calendar.getTime());
poiEntity.setCreateTime(format);
poiEntity.setType(3);
poiEntity.setTaskStatus(0);
poiEntity.setType(5);
poiEntity.setTaskStatus(1);
poiEntity.setIsLocalData(1);
new Thread(new Runnable() {
@Override
public void run() {
@ -353,7 +354,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
PoiEntity poiEntity = new PoiEntity();
ArrayList<Info> arrayList = new ArrayList<>();
String name = editTaskName.getText().toString().trim();//名称
if (name != null || !name.equals("")) {
if (name != null && !name.equals("")) {
poiEntity.setName(name);
}
@ -362,15 +363,15 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
poiEntity.setY(String.valueOf(latLng.latitude));
}
String describe = editOtherDescribe.getText().toString().trim();
if (describe != null || !describe.equals("")) {
if (describe != null && !describe.equals("")) {
poiEntity.setDescribe(describe);
}
String tagPicture = (String) ivPicture.getTag();
if (tagPicture != null) {
if (tagPicture != null &&!tagPicture.equals("")) {
arrayList.add(new Info(tagPicture));
}
String tagPictures = (String) ivPictures.getTag();
if (tagPictures != null) {
if (tagPictures != null&&!tagPictures.equals("")) {
arrayList.add(new Info(tagPictures));
}
poiEntity.setPhotoInfo(arrayList);
@ -379,8 +380,9 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
calendar.setTimeInMillis(System.currentTimeMillis());
String format = formatter.format(calendar.getTime());
poiEntity.setCreateTime(format);
poiEntity.setType(3);
poiEntity.setTaskStatus(0);
poiEntity.setType(5);
poiEntity.setTaskStatus(1);
poiEntity.setIsLocalData(1);
String newPoiEntity = new Gson().toJson(poiEntity);
//以键值对的形式添加新值
edit.putString("poiEntity", newPoiEntity);

@ -223,11 +223,11 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
showPoiEntity = (PoiEntity) getArguments().getSerializable("poiEntity");
if (showPoiEntity != null) {
String name = showPoiEntity.getName();//名称
if (name != null) {
if (name != null && !name.equals("")) {
editNameContent.setText(name + "");
}
String address = showPoiEntity.getAddress();//地址
if (address != null) {
if (address != null && !address.equals("")) {
editSiteContent.setText(address);
}
String x = showPoiEntity.getX();
@ -238,11 +238,11 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
latLng.setLongitude(Double.parseDouble(x));
}
String describe = showPoiEntity.getDescribe();//任务描述
if (describe != null) {
if (describe != null&&!describe.equals("")) {
editDescribe.setText(describe);
}
String telPhone = showPoiEntity.getTelPhone();
if (telPhone != null) {
if (telPhone != null&&!telPhone.equals("")) {
phoneData.add(showPoiEntity.getTelPhone());
poiBeans.add(new PoiBean("电话*", telPhone, R.drawable.icon_add_bg));
poiRecycleAdapter.setList(poiBeans);
@ -390,8 +390,9 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
calendar.setTimeInMillis(System.currentTimeMillis());
String format = formatter.format(calendar.getTime());
poiEntity.setCreateTime(format);
poiEntity.setType(0);
poiEntity.setTaskStatus(0);
poiEntity.setType(1);
poiEntity.setTaskStatus(1);
poiEntity.setIsLocalData(1);
new Thread(new Runnable() {
@Override
public void run() {
@ -470,11 +471,11 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
PoiEntity poiEntity = new PoiEntity();
ArrayList<Info> infoPhoto = new ArrayList<>();
String name = editNameContent.getText().toString().trim();//名称
if (name != null || !name.equals("")) {
if (name != null && !name.equals("")) {
poiEntity.setName(name);
}
String site = editSiteContent.getText().toString().trim();
if (site != null || !site.equals("")) {
if (site != null && !site.equals("")) {
poiEntity.setAddress(site);
}
if (latLng != null) {
@ -482,30 +483,30 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
poiEntity.setY(String.valueOf(latLng.latitude));
}
String describe = editDescribe.getText().toString().trim();
if (describe!= null || !describe.equals("")) {
if (describe!= null && !describe.equals("")) {
poiEntity.setDescribe(describe);
}
if (phoneData.size() > 0) {
poiEntity.setTelPhone(phoneData.get(0));
}
String tagPanorama = (String) ivPanorama.getTag();
if (tagPanorama!=null) {
if (tagPanorama!=null&&!tagPanorama.equals("")) {
infoPhoto.add(new Info(tagPanorama));
}
String tagName = (String) ivName.getTag();
if (tagName!= null) {
if (tagName!= null&&!tagName.equals("")) {
infoPhoto.add(new Info(tagName));
}
String tagInternal = (String) ivInternal.getTag();
if (tagInternal!= null) {
if (tagInternal!= null&&!tagInternal.equals("")) {
infoPhoto.add(new Info(tagInternal));
}
String tagElse = (String) ivElse.getTag();
if (tagElse!=null) {
if (tagElse!=null&&!tagElse.equals("")) {
infoPhoto.add(new Info(tagElse));
}
String tagCard = (String) ivCard.getTag();
if (tagCard != null) {
if (tagCard != null&&!tagCard.equals("")) {
infoPhoto.add(new Info(tagCard));
}
poiEntity.setPhotoInfo(infoPhoto);
@ -514,8 +515,9 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
calendar.setTimeInMillis(System.currentTimeMillis());
String format = formatter.format(calendar.getTime());
poiEntity.setCreateTime(format);
poiEntity.setType(0);
poiEntity.setTaskStatus(0);
poiEntity.setType(1);
poiEntity.setTaskStatus(1);
poiEntity.setIsLocalData(1);
String newPoiEntity = new Gson().toJson(poiEntity);
//以键值对的形式添加新值
edit.putString("poiEntity", newPoiEntity);

@ -134,17 +134,17 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
showPoiEntity = (PoiEntity) getArguments().getSerializable("poiEntity");
if (showPoiEntity != null) {
String name = showPoiEntity.getName();//名称
if (name != null || !name.equals("")) {
if (name != null && !name.equals("")) {
etRoadName.setText(name + "");
}
String extend = showPoiEntity.getExtend();
if (extend!=null||!extend.equals("")){
if (extend!=null&&!extend.equals("")){
RoadExtend roadExtend = new Gson().fromJson(extend, RoadExtend.class);
int type= roadExtend.getType();
showPictureType(type);
}
String describe = showPoiEntity.getDescribe();//任务描述
if (describe != null || !describe.equals("")) {
if (describe != null && !describe.equals("")) {
etDesc.setText(describe);
}
}
@ -225,6 +225,9 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
calendar.setTimeInMillis(System.currentTimeMillis());
String format = formatter.format(calendar.getTime());
poiEntity.setCreateTime(format);
poiEntity.setType(3);
poiEntity.setTaskStatus(1);
poiEntity.setIsLocalData(1);
new Thread(new Runnable() {
@Override
public void run() {
@ -278,7 +281,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
PoiEntity poiEntity = new PoiEntity();
String roadName = etRoadName.getText().toString().trim();
if (roadName != null || !roadName.equals("")) {
if (roadName != null && !roadName.equals("")) {
poiEntity.setName(roadName);
}
RoadExtend roadExtend = new RoadExtend();
@ -290,7 +293,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
poiEntity.setExtend(roadExtendJson);
}
String desc = etDesc.getText().toString().trim();
if (desc != null || !desc.equals("")) {
if (desc != null && !desc.equals("")) {
poiEntity.setDescribe(desc);
}
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@ -298,7 +301,9 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
calendar.setTimeInMillis(System.currentTimeMillis());
String format = formatter.format(calendar.getTime());
poiEntity.setCreateTime(format);
poiEntity.setType(4);
poiEntity.setType(3);
poiEntity.setTaskStatus(1);
poiEntity.setIsLocalData(1);
String newPoiEntity = new Gson().toJson(poiEntity);
//以键值对的形式添加新值
edit.putString("poiEntity", newPoiEntity);

@ -139,17 +139,17 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
showPoiEntity = (PoiEntity) getArguments().getSerializable("poiEntity");
if (showPoiEntity != null) {
String name = showPoiEntity.getName();//名称
if (name != null || !name.equals("")) {
if (name != null && !name.equals("")) {
etRoadName.setText(name + "");
}
String extend = showPoiEntity.getExtend();
if (extend!=null||!extend.equals("")){
if (extend!=null&& !extend.equals("")){
RoadExtend roadExtend = new Gson().fromJson(extend, RoadExtend.class);
int type= roadExtend.getType();
showPictureType(type);
}
String describe = showPoiEntity.getDescribe();//任务描述
if (describe != null || !describe.equals("")) {
if (describe != null && !describe.equals("")) {
etDesc.setText(describe);
}
}
@ -231,7 +231,9 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
calendar.setTimeInMillis(System.currentTimeMillis());
String format = formatter.format(calendar.getTime());
poiEntity.setCreateTime(format);
poiEntity.setType(1);
poiEntity.setType(4);
poiEntity.setTaskStatus(1);
poiEntity.setIsLocalData(1);
new Thread(new Runnable() {
@Override
public void run() {
@ -286,7 +288,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
PoiEntity poiEntity = new PoiEntity();
String roadName = etRoadName.getText().toString().trim();
if (roadName != null || !roadName.equals("")) {
if (roadName != null && !roadName.equals("")) {
poiEntity.setName(roadName);
}
RoadExtend roadExtend = new RoadExtend();
@ -298,7 +300,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
poiEntity.setExtend(roadExtendJson);
}
String desc = etDesc.getText().toString().trim();
if (desc != null || !desc.equals("")) {
if (desc != null && !desc.equals("")) {
poiEntity.setDescribe(desc);
}
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@ -306,7 +308,9 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
calendar.setTimeInMillis(System.currentTimeMillis());
String format = formatter.format(calendar.getTime());
poiEntity.setCreateTime(format);
poiEntity.setType(1);
poiEntity.setType(4);
poiEntity.setTaskStatus(1);
poiEntity.setIsLocalData(1);
String newPoiEntity = new Gson().toJson(poiEntity);
//以键值对的形式添加新值
edit.putString("poiEntity", newPoiEntity);

@ -89,6 +89,8 @@ import org.greenrobot.eventbus.Subscribe;
import java.util.ArrayList;
import java.util.List;
import okhttp3.OkHttpClient;
/**
* 寻宝的Fragment
* 2021-5-25
@ -120,6 +122,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
private ChargingPileEntity chargingPileEntity;
private String userEncode;
private String centerEncode;
private JobSearchBean body;
public static TreasureFragment newInstance(Bundle bundle) {
TreasureFragment fragment = new TreasureFragment();
@ -181,6 +184,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
tencentMap.setMapStyle(2);
//启用3d视图
tencentMap.setBuilding3dEffectEnable(true);
tencentMap.setOnCameraChangeListener(cameraChangeListener);
//获取地图UI 设置对象
UiSettings uiSettings = tencentMap.getUiSettings();
//设置logo的大小
@ -191,21 +196,41 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
initSharePre();
//数据库
initThread();
}
private TencentMap.OnCameraChangeListener cameraChangeListener = new TencentMap.OnCameraChangeListener() {
@Override
public void onCameraChange(CameraPosition cameraPosition) { // 地图移动中
}
@Override
public void onCameraChangeFinished(CameraPosition cameraPosition) { // 地图移动结束
if (Constant.currentLocation != null) {
initList(Constant.currentLocation);
}
}
};
private void initList(TencentLocation tencentLocation) {
//获取中心点位置
LatLng mapCenterPoint = getMapCenterPoint();
ArrayList<Removable> removables = new ArrayList<>();
if (removables.size() != 0) {
for (int i = 0; i < removables.size(); i++) {
removables.get(i).remove();
}
removables.clear();
}
if (mapCenterPoint != null) {
centerEncode = Geohash.getInstance().encode(mapCenterPoint.latitude, mapCenterPoint.longitude);
}
userEncode = Geohash.getInstance().encode(tencentLocation.getLatitude(),tencentLocation.getLongitude());
userEncode = Geohash.getInstance().encode(tencentLocation.getLatitude(), tencentLocation.getLongitude());
long date = System.currentTimeMillis();
// showLoadingDialog();
OkGo.getInstance().cancelTag(this);
// 请求方式和请求url
OkGo.<JobSearchBean>get(HttpInterface.TASK_LIST)
.tag(this)
@ -215,66 +240,100 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
.params("date", date)
.params("pageSize", Constant.NUMBER)
.params("pageNum", "1")
// .client(new OkHttpClient())
.execute(new DialogCallback<JobSearchBean>(JobSearchBean.class) {
@Override
public void onSuccess(Response<JobSearchBean> response) {
dismissLoadingDialog();
body = response.body();
Log.d("TAG", "onSuccess: " + response.body().toString() + "sssssssssssss");
if (removables.size() > 0) {
if (removables.size() != 0) {
for (int i = 0; i < removables.size(); i++) {
removables.get(i).remove();
}
removables.clear();
}
List<JobSearchBean.BodyBean.ListBean> list = response.body().getBody().getList();
for (int i = 0; i < list.size(); i++) {
String geo = list.get(i).getGeo();
Log.d("TAG", "onSuccess: " + geo);
Geometry geometry = GeometryTools.createGeometry(geo);
if ( geometry.getGeometryType().equals("Point")){//
LatLng latLng = GeometryTools.createLatLng(geo);
BitmapDescriptor custom = BitmapDescriptorFactory.fromResource(R.drawable.marker_road);
Marker marker = tencentMap.addMarker(new MarkerOptions(latLng));
marker.setClickable(true);
removables.add(marker);
} else {
List<JobSearchBean.BodyBean.ListBean> list = response.body().getBody().getList();
for (int i = 0; i < list.size(); i++) {
String geo = list.get(i).getGeo();
Log.d("TAG", "onSuccess: " + geo);
Geometry geometry = GeometryTools.createGeometry(geo);
if (geometry.getGeometryType().equals("Point")) {//
LatLng latLng = GeometryTools.createLatLng(geo);
switch (Integer.valueOf(list.get(i).getType())) {
case 1://poi
Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.POI_ICON).alpha(0.5f)
.flat(true)
.clockwise(false));
removables.add(poiMarker);
}else if ( geometry.getGeometryType().equals("LineString")){//线
List<LatLng> latLineString= GeometryTools.getLatLngs(geo);
// 构造 PolylineOpitons
PolylineOptions polylineOptions = new PolylineOptions()
.addAll(latLineString)
// 折线设置圆形线头
.lineCap(true)
// 折线的颜色为绿色
.color(0xff00ff00)
// 折线宽度为5像素
.width(5)
// 还可以添加描边颜色
.borderColor(0xffff0000)
// 描边颜色的宽度线宽还是 25 像素不过填充的部分宽度为 `width` - 2 * `borderWidth`
.borderWidth(1);
// 绘制折线
Polyline polyline = tencentMap.addPolyline(polylineOptions);
removables.add(polyline);
}else if ( geometry.getGeometryType().equals("Polygon")){//
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
Polygon polygon = tencentMap.addPolygon(new PolygonOptions().
//连接封闭图形的点
addAll(latPolygon).
//填充颜色为红色
fillColor(Color.parseColor("#97E0E7EC")).
//边线颜色为黑色
strokeColor(0xff000000).
//边线宽度15像素
strokeWidth(5));
removables.add(polygon);
break;
case 2://充电站
Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.STATION_ICON).alpha(0.7f)
.flat(true)
.clockwise(false));
removables.add(stationMarker);
break;
case 3://poi录像
break;
case 4://道路录像
Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.ROAD_ICON).alpha(0.7f)
.flat(true)
.clockwise(false));
removables.add(roadMarker);
break;
case 5://其他
break;
case 6://面状任务
Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.PLANAR_TASK_ICON).alpha(0.7f)
.flat(true)
.clockwise(false));
removables.add(planarMarker);
break;
}
} else if (geometry.getGeometryType().equals("LineString")) {//线
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
// 构造 PolylineOpitons
PolylineOptions polylineOptions = new PolylineOptions()
.addAll(latLineString)
// 折线设置圆形线头
.lineCap(true)
// 折线的颜色为绿色
.color(0xff00ff00)
// 折线宽度为5像素
.width(5)
// 还可以添加描边颜色
.borderColor(0xffff0000)
// 描边颜色的宽度线宽还是 25 像素不过填充的部分宽度为 `width` - 2 * `borderWidth`
.borderWidth(1);
// 绘制折线
Polyline polyline = tencentMap.addPolyline(polylineOptions);
removables.add(polyline);
} else if (geometry.getGeometryType().equals("Polygon")) {//
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
Polygon polygon = tencentMap.addPolygon(new PolygonOptions().
//连接封闭图形的点
addAll(latPolygon).
//填充颜色为红色
fillColor(Color.parseColor("#97E0E7EC")).
//边线颜色为黑色
strokeColor(0xff000000).
//边线宽度15像素
strokeWidth(5));
removables.add(polygon);
}
}
}
Message obtain = Message.obtain();
obtain.what = Constant.JOB_SEARCH_WORD;
obtain.obj = body;
EventBus.getDefault().post(obtain);
}
@Override
public void onError(Response<JobSearchBean> response) {
super.onError(response);
dismissLoadingDialog();
Log.d("TAG", "onError: " + response.message());
}
});
@ -421,8 +480,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
public void onEvent(Message data) {
if (data.what == Constant.FILTER_LIST_ITEM) { // 点击筛选的item
PoiEntity poiEntity = (PoiEntity) data.obj;
LatLng position = new LatLng(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX()));
tencentMap.addMarker(new MarkerOptions(position));
if (poiEntity.getX() != null && poiEntity.getY() != null) {
LatLng position = new LatLng(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX()));
tencentMap.addMarker(new MarkerOptions(position));
}
sliding_layout.setPanelHeight(0);
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
frameLayout.setVisibility(View.VISIBLE);
@ -437,26 +498,30 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
Bundle bundle = new Bundle();
bundle.putBoolean("isSliding", false); // 通知抽屉不收回
bundle.putSerializable("poiEntity", poiEntity);
frameLayout.setVisibility(View.GONE);
fragmentTransaction.remove(gatherGetFragment);
switch (poiEntity.getType()) {
case 0:
case 1:
PoiFragment poiFragment = PoiFragment.newInstance(bundle);
showSlidingFragment(poiFragment);
break;
case 1:
RoadFragment roadFragment = RoadFragment.newInstance(bundle);
showSlidingFragment(roadFragment);
break;
case 2:
ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle);
showSlidingFragment(chargingStationFragment);
break;
case 3:
PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
showSlidingFragment(poiVideoFragment);
break;
case 4:
RoadFragment roadFragment = RoadFragment.newInstance(bundle);
showSlidingFragment(roadFragment);
break;
case 5:
OtherFragment otherFragment = OtherFragment.newInstance(bundle);
showSlidingFragment(otherFragment);
break;
}
frameLayout.setVisibility(View.GONE);
fragmentTransaction.remove(gatherGetFragment);
} else if (data.what == Constant.FILTER_LIST) { // 筛选列表所有数据地图显示
List<PoiEntity> poiEntities = (List<PoiEntity>) data.obj;
initFilterMarker(poiEntities);
@ -493,6 +558,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
} else {
setMainButtonVisiable(View.VISIBLE);
frameLayout.setVisibility(View.GONE);
fragmentTransaction.remove(gatherGetFragment);
}
} else if (data.what == Constant.CHARGING_STATION) {//充电站的充电桩
Bundle bundle = new Bundle();
@ -731,13 +798,19 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
}).setTitle(title);
break;
case R.id.iv_filter:
FilterFragment filterFragment = FilterFragment.newInstance(new Bundle());
Bundle bundle = new Bundle();
if (body != null) {
bundle.putSerializable("body", body);
}
FilterFragment filterFragment = FilterFragment.newInstance(bundle);
showSlidingFragment(filterFragment);
break;
case R.id.iv_message:
Intent messageIntent = new Intent(getContext(), FragmentManagement.class);
messageIntent.putExtra("tag", 35);
startActivity(messageIntent);
break;
}
}
@ -879,9 +952,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
location.setAccuracy(tencentLocation.getAccuracy());
locationChangedListener.onLocationChanged(location);
locationStyle = locationStyle.myLocationType(MyLocationStyle.LOCATION_TYPE_FOLLOW_NO_CENTER);
if (Constant.currentLocation == null) {
initList(tencentLocation);
}
Constant.currentLocation = tencentLocation;
Constant.markerCurrentLocation = tencentLocation;
Constant.markerLatitude = tencentLocation.getLatitude();

@ -26,7 +26,7 @@ public class PoiEntity implements Serializable {
private String address;//地址
private String telPhone;//电话
private String memo;//备注
private double precision;//金额
private String precision;//金额
private String photo;//照片信息
private String extend;//添加字段
private boolean checked;
@ -54,9 +54,27 @@ public class PoiEntity implements Serializable {
private String x;//经度
private String y;//纬度
private String detail;//深度信息
private int taskStatus;//任务状态 0.待提交1.已提交,2 已领取
private int type;//0.poi,1.道路2.充电站3.其他 ,4,poi录像
private int station_type;//0.全部1.poi,2.道路3.充电站4.其他
private String dist;//距离用户位置
private int taskStatus;//任务状态 1.待提交2.已提交,3已领取
private int type;//1 "POI"2 "充电站"3 "POI录像"4 "道路录像"5 "其他"6 "面状任务"
private int station_type;//1 "POI"2 "充电站"3 "POI录像"4 "道路录像"5 "其他"6 "面状任务"
private int isLocalData;//是否是本地数据 0,服务 1,本地
public int getIsLocalData() {
return isLocalData;
}
public void setIsLocalData(int isLocalData) {
this.isLocalData = isLocalData;
}
public String getDist() {
return dist;
}
public void setDist(String dist) {
this.dist = dist;
}
public int getStation_type() {
return station_type;
@ -162,11 +180,11 @@ public class PoiEntity implements Serializable {
this.memo = memo;
}
public double getPrecision() {
public String getPrecision() {
return precision;
}
public void setPrecision(double precision) {
public void setPrecision(String precision) {
this.precision = precision;
}

Binary file not shown.

After

(image error) Size: 387 KiB

Binary file not shown.

After

(image error) Size: 815 B

Binary file not shown.

After

(image error) Size: 155 KiB

Binary file not shown.

After

(image error) Size: 454 KiB

@ -41,29 +41,26 @@
app:layout_constraintStart_toStartOf="@+id/tv_title"
app:layout_constraintTop_toBottomOf="@+id/tv_title" />
<TextView
android:id="@+id/tv_length"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="长度:"
android:textSize="15sp"
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#BFB8B8"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
app:layout_constraintBottom_toBottomOf="@+id/tv_time"
app:layout_constraintEnd_toStartOf="@+id/tv_distance"
app:layout_constraintStart_toEndOf="@+id/tv_time"
app:layout_constraintTop_toTopOf="@+id/tv_time" />
app:layout_constraintTop_toTopOf="@+id/tv_describe" />
<TextView
android:id="@+id/tv_distance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_marginEnd="20dp"
android:maxLength="10"
android:text="距离:"
android:textSize="15sp"
android:maxLength="10"
app:layout_constraintBottom_toBottomOf="@+id/tv_length"
app:layout_constraintBottom_toBottomOf="@+id/tv_time"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/tv_length" />
app:layout_constraintTop_toTopOf="@+id/tv_time" />
<TextView
android:id="@+id/tv_describe"
@ -83,15 +80,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_describe">
<Button
android:id="@+id/btn_bank"
style="@style/user_data_style"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:layout_weight="1"
android:text="立即采集" />
<Button
android:id="@+id/btn_draw"
style="@style/user_data_style"
@ -100,6 +88,14 @@
android:layout_margin="20dp"
android:layout_weight="1"
android:text="领取任务" />
<Button
android:id="@+id/btn_bank"
style="@style/user_data_style"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:layout_weight="1"
android:text="立即采集" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="10dp"
android:layout_height="10dp">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:background="@drawable/marker_poi_bg"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -13,7 +13,9 @@
android:layout_margin="20dp"
android:text="测试彼此"
android:textColor="#333"
android:textSize="25sp"
android:textSize="18sp"
android:maxLength="15"
android:lines="1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@ -74,14 +76,14 @@
android:id="@+id/tv_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginRight="10dp"
android:text="¥3.5"
android:textColor="#000"
android:textSize="25sp"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/tv_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/tv_name" />
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_distance"