Merge branch 'master' of gitee.com:navinfo-out-door/navinfo-out-door-data-collect
@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
|
|||||||
android {
|
android {
|
||||||
compileSdkVersion 29
|
compileSdkVersion 29
|
||||||
buildToolsVersion '29.0.2'
|
buildToolsVersion '29.0.2'
|
||||||
ndkVersion '21.1.6352462'
|
//ndkVersion '23.0.7123448'
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.navinfo.outdoor"
|
applicationId "com.navinfo.outdoor"
|
||||||
|
@ -45,7 +45,8 @@ public class Constant {
|
|||||||
|
|
||||||
//message word 值
|
//message word 值
|
||||||
public static final int TREASURE_FRAGMENT = 100;//抽屉界面的展示和隐藏
|
public static final int TREASURE_FRAGMENT = 100;//抽屉界面的展示和隐藏
|
||||||
public static final int TREASURE_WORD = 0;//poi 对地图页面marker 的一个展示
|
public static final int TREASURE_WORD = 0;//poi 对地图页面marker 的一个展示 编辑
|
||||||
|
public static final int TREASURE_CHECKED_WORD = 40;//poi 对地图页面marker 的一个展示 确定
|
||||||
public static final int CAPACITY_EVALUATION_PAGE = 1;//能力测评的页数
|
public static final int CAPACITY_EVALUATION_PAGE = 1;//能力测评的页数
|
||||||
public static final int POI_WORD = 2;//地图页面marker 的经纬都回传
|
public static final int POI_WORD = 2;//地图页面marker 的经纬都回传
|
||||||
public static final int FILTER_LIST = 4;//筛选列表所有数据地图显示
|
public static final int FILTER_LIST = 4;//筛选列表所有数据地图显示
|
||||||
@ -56,13 +57,16 @@ public class Constant {
|
|||||||
public static final int MAIN_HEADER = 9; // 控制主界面各个header
|
public static final int MAIN_HEADER = 9; // 控制主界面各个header
|
||||||
public static final int MAIN_REMOVE = 10; // 控制主界面各个header移除
|
public static final int MAIN_REMOVE = 10; // 控制主界面各个header移除
|
||||||
public static final int GATHER_GET_RETURN = 11;//参加领取的返回
|
public static final int GATHER_GET_RETURN = 11;//参加领取的返回
|
||||||
public static final int MAIN_CHARGING_STATION = 13;//充电站的Fragment 对地图页面marker 的一个展示
|
public static final int MAIN_CHARGING_STATION = 13;//充电站的Fragment 对地图页面marker 的一个展示 编辑
|
||||||
|
public static final int MAIN_CHARGING_CHECKED_STATION = 43;//充电站的Fragment 对地图页面marker 的一个展示 确定
|
||||||
public static final int CHARGING_STATION_WORD = 15;//地图页面marker 的经纬都回传
|
public static final int CHARGING_STATION_WORD = 15;//地图页面marker 的经纬都回传
|
||||||
public static final int CHARGING_STATION = 16;//跳转到充电桩
|
public static final int CHARGING_STATION = 16;//跳转到充电桩
|
||||||
public static final int MAIN_CHARGING_PILE = 18;//充电桩的Fragment 对地图页面marker 的一个展示
|
public static final int MAIN_CHARGING_PILE = 18;//充电桩的Fragment 对地图页面marker 的一个展示 编辑
|
||||||
|
public static final int MAIN_CHARGING_CHECKED_PILE = 49;//充电桩的Fragment 对地图页面marker 的一个展示 确定
|
||||||
public static final int CHARGING_PILE_WORD = 20;//地图页面marker 的经纬都回传
|
public static final int CHARGING_PILE_WORD = 20;//地图页面marker 的经纬都回传
|
||||||
public static final int CHARGING_PILE_STATION = 22;//将充电桩的数据回传给充电站
|
public static final int CHARGING_PILE_STATION = 22;//将充电桩的数据回传给充电站
|
||||||
public static final int MAIN_OTHER = 23;//其他的Fragment 对地图页面marker 的一个展示
|
public static final int MAIN_OTHER = 23;//其他的Fragment 对地图页面marker 的一个展示 编辑
|
||||||
|
public static final int MAIN_CHECKED_OTHER = 24;//其他的Fragment 对地图页面marker 的一个展示 确定
|
||||||
public static final int OTHER_WORD = 25;//地图页面marker 的经纬都回传
|
public static final int OTHER_WORD = 25;//地图页面marker 的经纬都回传
|
||||||
public static final int CHARGING_STATION_PILE = 26;//跳转到充电桩 传给数据
|
public static final int CHARGING_STATION_PILE = 26;//跳转到充电桩 传给数据
|
||||||
public static final int JOB_SEARCH_WORD = 28;//任务搜索的网络数据
|
public static final int JOB_SEARCH_WORD = 28;//任务搜索的网络数据
|
||||||
@ -85,7 +89,7 @@ public class Constant {
|
|||||||
public static LatLng markerLatlng;
|
public static LatLng markerLatlng;
|
||||||
//marker 图标
|
//marker 图标
|
||||||
|
|
||||||
public static BitmapDescriptor POI_ICON = BitmapDescriptorFactory.fromResource(R.drawable.poi_icons);
|
public static final BitmapDescriptor POI_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bg);
|
||||||
public static BitmapDescriptor ROAD_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bg);
|
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 STATION_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bg);
|
||||||
public static BitmapDescriptor PLANAR_TASK_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg);
|
public static BitmapDescriptor PLANAR_TASK_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg);
|
||||||
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.navinfo.outdoor.bean;
|
||||||
|
|
||||||
|
public class ChargingStationBean {
|
||||||
|
|
||||||
|
private Integer code;
|
||||||
|
private String message;
|
||||||
|
private Integer body;
|
||||||
|
|
||||||
|
public Integer getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(Integer code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessage(String message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getBody() {
|
||||||
|
return body;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBody(Integer body) {
|
||||||
|
this.body = body;
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,8 @@
|
|||||||
package com.navinfo.outdoor.bean;
|
package com.navinfo.outdoor.bean;
|
||||||
|
|
||||||
public class Info {
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class Info implements Serializable {
|
||||||
/**
|
/**
|
||||||
* photo :
|
* photo :
|
||||||
* x :
|
* x :
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
package com.navinfo.outdoor.bean;
|
||||||
|
|
||||||
|
public class OtherUploadPicBean {
|
||||||
|
|
||||||
|
private Integer code;
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
public Integer getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(Integer code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessage(String message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
}
|
157
app/src/main/java/com/navinfo/outdoor/bean/ReceivedBean.java
Normal file
@ -0,0 +1,157 @@
|
|||||||
|
package com.navinfo.outdoor.bean;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ReceivedBean {
|
||||||
|
|
||||||
|
private Integer code;
|
||||||
|
private String message;
|
||||||
|
private BodyBean body;
|
||||||
|
|
||||||
|
public Integer getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(Integer code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessage(String message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BodyBean getBody() {
|
||||||
|
return body;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBody(BodyBean body) {
|
||||||
|
this.body = body;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class BodyBean {
|
||||||
|
private Integer sptype;
|
||||||
|
private List<CsTaskListBean> csTaskList;
|
||||||
|
private String address;
|
||||||
|
private String telephone;
|
||||||
|
private String geo;
|
||||||
|
private Double price;
|
||||||
|
private Integer type;
|
||||||
|
private String name;
|
||||||
|
private Integer isExclusive;
|
||||||
|
|
||||||
|
public Integer getSptype() {
|
||||||
|
return sptype;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSptype(Integer sptype) {
|
||||||
|
this.sptype = sptype;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CsTaskListBean> getCsTaskList() {
|
||||||
|
return csTaskList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCsTaskList(List<CsTaskListBean> csTaskList) {
|
||||||
|
this.csTaskList = csTaskList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddress(String address) {
|
||||||
|
this.address = address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTelephone() {
|
||||||
|
return telephone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTelephone(String telephone) {
|
||||||
|
this.telephone = telephone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGeo() {
|
||||||
|
return geo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGeo(String geo) {
|
||||||
|
this.geo = geo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getPrice() {
|
||||||
|
return price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrice(Double price) {
|
||||||
|
this.price = price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(Integer type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getIsExclusive() {
|
||||||
|
return isExclusive;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsExclusive(Integer isExclusive) {
|
||||||
|
this.isExclusive = isExclusive;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class CsTaskListBean {
|
||||||
|
private String address;
|
||||||
|
private String geo;
|
||||||
|
private Double price;
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddress(String address) {
|
||||||
|
this.address = address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGeo() {
|
||||||
|
return geo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGeo(String geo) {
|
||||||
|
this.geo = geo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getPrice() {
|
||||||
|
return price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrice(Double price) {
|
||||||
|
this.price = price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,8 @@
|
|||||||
package com.navinfo.outdoor.bean;
|
package com.navinfo.outdoor.bean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*普通任务
|
||||||
|
*/
|
||||||
public class ReceivedPoiBean {
|
public class ReceivedPoiBean {
|
||||||
|
|
||||||
private Integer code;
|
private Integer code;
|
||||||
|
@ -0,0 +1,42 @@
|
|||||||
|
package com.navinfo.outdoor.bean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 面状任务-结束领取
|
||||||
|
* 面妆任务-立即采集
|
||||||
|
* 面妆任务-结束采集
|
||||||
|
*/
|
||||||
|
public class UnPolygonTaskBean {
|
||||||
|
/**
|
||||||
|
* code : 200
|
||||||
|
* message : 成功
|
||||||
|
* body : 1
|
||||||
|
*/
|
||||||
|
|
||||||
|
private int code;
|
||||||
|
private String message;
|
||||||
|
private int body;
|
||||||
|
|
||||||
|
public int getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(int code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessage(String message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBody() {
|
||||||
|
return body;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBody(int body) {
|
||||||
|
this.body = body;
|
||||||
|
}
|
||||||
|
}
|
@ -51,6 +51,8 @@ import com.navinfo.outdoor.room.ChargingPileEntity;
|
|||||||
import com.navinfo.outdoor.room.PoiDao;
|
import com.navinfo.outdoor.room.PoiDao;
|
||||||
import com.navinfo.outdoor.room.PoiDatabase;
|
import com.navinfo.outdoor.room.PoiDatabase;
|
||||||
import com.navinfo.outdoor.room.PoiEntity;
|
import com.navinfo.outdoor.room.PoiEntity;
|
||||||
|
import com.navinfo.outdoor.util.Geohash;
|
||||||
|
import com.navinfo.outdoor.util.GeometryTools;
|
||||||
import com.navinfo.outdoor.util.PhotoPathUtil;
|
import com.navinfo.outdoor.util.PhotoPathUtil;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||||
|
|
||||||
@ -89,6 +91,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
private int pid;
|
private int pid;
|
||||||
private String station;
|
private String station;
|
||||||
private LatLng latLng;
|
private LatLng latLng;
|
||||||
|
private LatLng poiLatLng;
|
||||||
|
|
||||||
public static ChargingPileFragment newInstance(Bundle bundle) {
|
public static ChargingPileFragment newInstance(Bundle bundle) {
|
||||||
ChargingPileFragment fragment = new ChargingPileFragment();
|
ChargingPileFragment fragment = new ChargingPileFragment();
|
||||||
@ -152,10 +155,17 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
checkBoxLife.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
checkBoxLife.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
Message obtain = Message.obtain();
|
if (isChecked){
|
||||||
obtain.what = Constant.MAIN_CHARGING_PILE;
|
Message obtain = Message.obtain();
|
||||||
obtain.obj = isChecked;
|
obtain.what = Constant.MAIN_CHARGING_PILE;
|
||||||
EventBus.getDefault().post(obtain);
|
obtain.obj = poiLatLng;
|
||||||
|
EventBus.getDefault().post(obtain);
|
||||||
|
}else {
|
||||||
|
Message obtain = Message.obtain();
|
||||||
|
obtain.what = Constant.MAIN_CHARGING_CHECKED_PILE;
|
||||||
|
obtain.obj = true;
|
||||||
|
EventBus.getDefault().post(obtain);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
checkBoxRight.setVisibility(View.GONE);
|
checkBoxRight.setVisibility(View.GONE);
|
||||||
@ -361,7 +371,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
editDescribe = findViewById(R.id.edit_describe);
|
editDescribe = findViewById(R.id.edit_describe);
|
||||||
btnSaveLocal = findViewById(R.id.btn_save_local);
|
btnSaveLocal = findViewById(R.id.btn_save_local);
|
||||||
btnSaveLocal.setOnClickListener(this::onClick);
|
btnSaveLocal.setOnClickListener(this::onClick);
|
||||||
|
|
||||||
//展示数据
|
//展示数据
|
||||||
initShowPileSharePre();
|
initShowPileSharePre();
|
||||||
|
|
||||||
@ -372,6 +381,14 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
if (station!=null){
|
if (station!=null){
|
||||||
PoiEntity poiEntity = new Gson().fromJson(station, PoiEntity.class);
|
PoiEntity poiEntity = new Gson().fromJson(station, PoiEntity.class);
|
||||||
pid = poiEntity.getTaskId();
|
pid = poiEntity.getTaskId();
|
||||||
|
String x = poiEntity.getX();
|
||||||
|
String y = poiEntity.getY();
|
||||||
|
if (x != null && y != null) {
|
||||||
|
poiLatLng = new LatLng();
|
||||||
|
poiLatLng.setLatitude(Double.parseDouble(y));
|
||||||
|
poiLatLng.setLongitude(Double.parseDouble(x));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// 添加信息:
|
// 添加信息:
|
||||||
ChargingPileEntity chargingPileEntity = (ChargingPileEntity) getArguments().getSerializable("chargingPileEntity");
|
ChargingPileEntity chargingPileEntity = (ChargingPileEntity) getArguments().getSerializable("chargingPileEntity");
|
||||||
@ -382,10 +399,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
}
|
}
|
||||||
String p = chargingPileEntity.getP();
|
String p = chargingPileEntity.getP();
|
||||||
if (p != null) {
|
if (p != null) {
|
||||||
String[] split = p.split(",");
|
latLng = GeometryTools.createLatLng(p);
|
||||||
latLng = new LatLng();
|
|
||||||
latLng.setLatitude(Double.parseDouble(split[0]));
|
|
||||||
latLng.setLongitude(Double.parseDouble(split[1]));
|
|
||||||
}
|
}
|
||||||
String memo = chargingPileEntity.getMemo();
|
String memo = chargingPileEntity.getMemo();
|
||||||
if (memo != null&&!memo.equals("")) {
|
if (memo != null&&!memo.equals("")) {
|
||||||
@ -559,7 +573,8 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
chargingPileEntity.setP(latLng.latitude+","+latLng.longitude);
|
String encode = Geohash.getInstance().encode(latLng.latitude,latLng.longitude);
|
||||||
|
chargingPileEntity.setP(encode);
|
||||||
}
|
}
|
||||||
String name = editNameContent.getText().toString().trim();//名称
|
String name = editNameContent.getText().toString().trim();//名称
|
||||||
if (name == null || name.equals("")) {
|
if (name == null || name.equals("")) {
|
||||||
|
@ -38,18 +38,25 @@ import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
|
|||||||
import com.kongzue.dialog.util.BaseDialog;
|
import com.kongzue.dialog.util.BaseDialog;
|
||||||
import com.kongzue.dialog.util.DialogSettings;
|
import com.kongzue.dialog.util.DialogSettings;
|
||||||
import com.kongzue.dialog.v3.MessageDialog;
|
import com.kongzue.dialog.v3.MessageDialog;
|
||||||
|
import com.lzy.okgo.model.HttpParams;
|
||||||
import com.navinfo.outdoor.R;
|
import com.navinfo.outdoor.R;
|
||||||
import com.navinfo.outdoor.adapter.ChargingPileAdapter;
|
import com.navinfo.outdoor.adapter.ChargingPileAdapter;
|
||||||
import com.navinfo.outdoor.adapter.PoiRecycleAdapter;
|
import com.navinfo.outdoor.adapter.PoiRecycleAdapter;
|
||||||
import com.navinfo.outdoor.api.Constant;
|
import com.navinfo.outdoor.api.Constant;
|
||||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||||
|
import com.navinfo.outdoor.bean.ChargingStationBean;
|
||||||
import com.navinfo.outdoor.bean.Info;
|
import com.navinfo.outdoor.bean.Info;
|
||||||
import com.navinfo.outdoor.bean.PoiBean;
|
import com.navinfo.outdoor.bean.PoiBean;
|
||||||
|
import com.navinfo.outdoor.bean.PoiSaveBean;
|
||||||
|
import com.navinfo.outdoor.http.Callback;
|
||||||
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
import com.navinfo.outdoor.room.ChargingPileDao;
|
import com.navinfo.outdoor.room.ChargingPileDao;
|
||||||
import com.navinfo.outdoor.room.ChargingPileEntity;
|
import com.navinfo.outdoor.room.ChargingPileEntity;
|
||||||
import com.navinfo.outdoor.room.PoiDao;
|
import com.navinfo.outdoor.room.PoiDao;
|
||||||
import com.navinfo.outdoor.room.PoiDatabase;
|
import com.navinfo.outdoor.room.PoiDatabase;
|
||||||
import com.navinfo.outdoor.room.PoiEntity;
|
import com.navinfo.outdoor.room.PoiEntity;
|
||||||
|
import com.navinfo.outdoor.util.Geohash;
|
||||||
import com.navinfo.outdoor.util.PhotoPathUtil;
|
import com.navinfo.outdoor.util.PhotoPathUtil;
|
||||||
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
|
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||||
@ -57,6 +64,7 @@ import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
|||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@ -89,8 +97,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
private CheckBox checkBoxRight;
|
private CheckBox checkBoxRight;
|
||||||
private String phone = null;
|
private String phone = null;
|
||||||
private Spinner spinnerType;
|
private Spinner spinnerType;
|
||||||
String[] ctype = new String[]{"全部", "poi", "充电站", "POI录像", "道路录像"};//1."全部"2 "POI"3 "充电站"4 "POI录像"5 "道路录像",
|
String[] ctype = new String[]{ "充电站", "充换电站", "充电桩组", "换电站"};//1."充电站"2 "充换电站"3 "充电桩组"4 "换电站"5 ,
|
||||||
String[] spinner = new String[]{"存在","不存在","无法验证"};
|
String[] spinner = new String[]{"存在", "不存在", "无法验证"};
|
||||||
private ArrayAdapter<String> adapter;
|
private ArrayAdapter<String> adapter;
|
||||||
private LinearLayout linearChargingPile;
|
private LinearLayout linearChargingPile;
|
||||||
private RecyclerView recyclerStation;
|
private RecyclerView recyclerStation;
|
||||||
@ -200,10 +208,18 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
checkBoxLife.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
checkBoxLife.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
Message obtain = Message.obtain();
|
if (isChecked) {
|
||||||
obtain.what = Constant.MAIN_CHARGING_STATION;
|
Message obtain = Message.obtain();
|
||||||
obtain.obj = isChecked;
|
obtain.what = Constant.MAIN_CHARGING_STATION;
|
||||||
EventBus.getDefault().post(obtain);
|
obtain.obj = latLng;
|
||||||
|
EventBus.getDefault().post(obtain);
|
||||||
|
} else {
|
||||||
|
Message obtain = Message.obtain();
|
||||||
|
obtain.what = Constant.MAIN_CHARGING_CHECKED_STATION;
|
||||||
|
obtain.obj = true;
|
||||||
|
EventBus.getDefault().post(obtain);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
checkBoxRight.setVisibility(View.GONE);
|
checkBoxRight.setVisibility(View.GONE);
|
||||||
@ -216,20 +232,18 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
switch (position) {
|
switch (position) {
|
||||||
case 0:
|
case 0:
|
||||||
station_type = 0;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
station_type = 1;
|
station_type = 1;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 1:
|
||||||
station_type = 2;
|
station_type = 2;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 2:
|
||||||
station_type = 3;
|
station_type = 3;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 3:
|
||||||
station_type = 4;
|
station_type = 4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -332,84 +346,82 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
private void initShowPoi() {
|
private void initShowPoi() {
|
||||||
// 添加信息:
|
// 添加信息:
|
||||||
showPoiEntity = (PoiEntity) getArguments().getSerializable("poiEntity");
|
showPoiEntity = (PoiEntity) getArguments().getSerializable("poiEntity");
|
||||||
if (showPoiEntity != null) {
|
String name = showPoiEntity.getName();//名称
|
||||||
String name = showPoiEntity.getName();//名称
|
if (name != null && !name.equals("")) {
|
||||||
if (name != null &&!name.equals("")) {
|
editNameContent.setText(name + "");
|
||||||
editNameContent.setText(name + "");
|
}
|
||||||
}
|
String address = showPoiEntity.getAddress();//地址
|
||||||
String address = showPoiEntity.getAddress();//地址
|
if (address != null && !address.equals("")) {
|
||||||
if (address != null&&! address.equals("")) {
|
editSiteContent.setText(address);
|
||||||
editSiteContent.setText(address);
|
}
|
||||||
}
|
String x = showPoiEntity.getX();
|
||||||
String x = showPoiEntity.getX();
|
String y = showPoiEntity.getY();
|
||||||
String y = showPoiEntity.getY();
|
if (x != null && y != null) {
|
||||||
if (x != null && y != null) {
|
latLng = new LatLng();
|
||||||
latLng = new LatLng();
|
latLng.setLatitude(Double.parseDouble(y));
|
||||||
latLng.setLatitude(Double.parseDouble(y));
|
latLng.setLongitude(Double.parseDouble(x));
|
||||||
latLng.setLongitude(Double.parseDouble(x));
|
}
|
||||||
}
|
String describe = showPoiEntity.getDescribe();//任务描述
|
||||||
String describe = showPoiEntity.getDescribe();//任务描述
|
if (describe != null && !describe.equals("")) {
|
||||||
if (describe != null&&!describe.equals("")) {
|
editDescribe.setText(describe);
|
||||||
editDescribe.setText(describe);
|
}
|
||||||
}
|
int station_type = showPoiEntity.getStation_type();
|
||||||
int station_type = showPoiEntity.getStation_type();
|
spinnerType.setSelection(station_type, true);
|
||||||
spinnerType.setSelection(station_type,true);
|
String telPhone = showPoiEntity.getTelPhone();
|
||||||
String telPhone = showPoiEntity.getTelPhone();
|
if (telPhone != null && !telPhone.equals("")) {
|
||||||
if (telPhone != null&&!telPhone.equals("")) {
|
phoneData.add(showPoiEntity.getTelPhone());
|
||||||
phoneData.add(showPoiEntity.getTelPhone());
|
poiBeans.add(new PoiBean("电话*", telPhone, R.drawable.icon_add_bg));
|
||||||
poiBeans.add(new PoiBean("电话*", telPhone, R.drawable.icon_add_bg));
|
} else {
|
||||||
poiRecycleAdapter.setList(poiBeans);
|
poiBeans.add(new PoiBean("电话*", "", R.drawable.icon_add_bg));
|
||||||
}
|
}
|
||||||
linearExist.setVisibility(View.VISIBLE);
|
poiRecycleAdapter.setList(poiBeans);
|
||||||
if (showPoiEntity.getPhotoInfo() != null) {
|
linearExist.setVisibility(View.VISIBLE);
|
||||||
for (int i = 0; i < showPoiEntity.getPhotoInfo().size(); i++) {
|
if (showPoiEntity.getPhotoInfo() != null) {
|
||||||
String photo = showPoiEntity.getPhotoInfo().get(i).getPhoto();
|
for (int i = 0; i < showPoiEntity.getPhotoInfo().size(); i++) {
|
||||||
String[] split = photo.split("/");
|
String photo = showPoiEntity.getPhotoInfo().get(i).getPhoto();
|
||||||
if (split[split.length - 1].startsWith("a")) {
|
String[] split = photo.split("/");
|
||||||
Glide.with(getActivity()).load(photo).into(ivPanorama);
|
if (split[split.length - 1].startsWith("a")) {
|
||||||
ivPanorama.setTag(photo);
|
Glide.with(getActivity()).load(photo).into(ivPanorama);
|
||||||
} else if (split[split.length - 1].startsWith("b")) {
|
ivPanorama.setTag(photo);
|
||||||
Glide.with(getActivity()).load(photo).into(ivName);
|
} else if (split[split.length - 1].startsWith("b")) {
|
||||||
ivName.setTag(photo);
|
Glide.with(getActivity()).load(photo).into(ivName);
|
||||||
} else if (split[split.length - 1].startsWith("c")) {
|
ivName.setTag(photo);
|
||||||
Glide.with(getActivity()).load(photo).into(ivInternal);
|
} else if (split[split.length - 1].startsWith("c")) {
|
||||||
ivInternal.setTag(photo);
|
Glide.with(getActivity()).load(photo).into(ivInternal);
|
||||||
} else if (split[split.length - 1].startsWith("d")) {
|
ivInternal.setTag(photo);
|
||||||
Glide.with(getActivity()).load(photo).into(ivElse);
|
} else if (split[split.length - 1].startsWith("d")) {
|
||||||
ivElse.setTag(photo);
|
Glide.with(getActivity()).load(photo).into(ivElse);
|
||||||
} else if (split[split.length - 1].startsWith("e")) {
|
ivElse.setTag(photo);
|
||||||
Glide.with(getActivity()).load(photo).into(ivScutcheon);
|
} else if (split[split.length - 1].startsWith("e")) {
|
||||||
ivScutcheon.setTag(photo);
|
Glide.with(getActivity()).load(photo).into(ivScutcheon);
|
||||||
}
|
ivScutcheon.setTag(photo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ArrayList<ChargingPileEntity> chargingPileEntities = new ArrayList<>();
|
}
|
||||||
|
ArrayList<ChargingPileEntity> chargingPileEntities = new ArrayList<>();
|
||||||
new Thread(new Runnable() {
|
|
||||||
@Override
|
new Thread(new Runnable() {
|
||||||
public void run() {
|
@Override
|
||||||
List<ChargingPileEntity> chargingPile = chargingPileDao.getChargingPile();
|
public void run() {
|
||||||
for (int i = 0; i < chargingPile.size(); i++) {
|
List<ChargingPileEntity> chargingPile = chargingPileDao.getChargingPile();
|
||||||
ChargingPileEntity chargingPileEntity = chargingPile.get(i);
|
for (int i = 0; i < chargingPile.size(); i++) {
|
||||||
if (showPoiEntity.getTaskId() == chargingPileEntity.getFid()) {
|
ChargingPileEntity chargingPileEntity = chargingPile.get(i);
|
||||||
chargingPileEntities.add(chargingPileEntity);
|
if (showPoiEntity.getTaskId() == chargingPileEntity.getFid()) {
|
||||||
}
|
chargingPileEntities.add(chargingPileEntity);
|
||||||
}
|
}
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
}
|
||||||
@Override
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
public void run() {
|
@Override
|
||||||
chargingPileAdapter.setChargingPileEntities(chargingPileEntities);
|
public void run() {
|
||||||
}
|
chargingPileAdapter.setChargingPileEntities(chargingPileEntities);
|
||||||
});
|
}
|
||||||
|
});
|
||||||
}
|
|
||||||
}).start();
|
}
|
||||||
|
}).start();
|
||||||
} else {
|
if (showPoiEntity.getTaskId()!=0){
|
||||||
poiBeans.add(new PoiBean("电话*", phone, R.drawable.icon_add_bg));
|
initPile();
|
||||||
poiRecycleAdapter.setList(poiBeans);
|
|
||||||
}
|
}
|
||||||
initPile();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initPile() {
|
private void initPile() {
|
||||||
@ -497,7 +509,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
public void onGranted(List<String> permissions, boolean all) {
|
public void onGranted(List<String> permissions, boolean all) {
|
||||||
if (all) {
|
if (all) {
|
||||||
//保存数据库:
|
//保存数据库:
|
||||||
PoiEntity poiEntity = new PoiEntity();
|
PoiEntity poiEntity = showPoiEntity;
|
||||||
List<Info> infoPhoto = new ArrayList<>();
|
List<Info> infoPhoto = new ArrayList<>();
|
||||||
String name = editNameContent.getText().toString().trim();//名称
|
String name = editNameContent.getText().toString().trim();//名称
|
||||||
if (name == null || name.equals("")) {
|
if (name == null || name.equals("")) {
|
||||||
@ -517,6 +529,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
String encode = Geohash.getInstance().encode(latLng.latitude,latLng.longitude);
|
||||||
|
poiEntity.setGeoWkt(encode);
|
||||||
poiEntity.setX(String.valueOf(latLng.longitude));
|
poiEntity.setX(String.valueOf(latLng.longitude));
|
||||||
poiEntity.setY(String.valueOf(latLng.latitude));
|
poiEntity.setY(String.valueOf(latLng.latitude));
|
||||||
}
|
}
|
||||||
@ -578,11 +592,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
} else {
|
} else {
|
||||||
aBoolean = false;
|
aBoolean = false;
|
||||||
}
|
}
|
||||||
if (showPoiEntity!=null){
|
|
||||||
if (showPoiEntity.getTaskId()!=0){
|
|
||||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||||
@ -594,17 +603,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
List<PoiEntity> allPoi = poiDao.getAllPoi();
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
poiEntity.setTaskId(allPoi.size() + 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
poiDao.insertPoiEntity(poiEntity);
|
poiDao.insertPoiEntity(poiEntity);
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
onBackPressed();
|
chargingStationSaveByWork(poiEntity);
|
||||||
|
// onBackPressed();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
@ -626,6 +629,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
obtain.what = Constant.TREASURE_FRAGMENT;
|
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||||
obtain.obj = false;
|
obtain.obj = false;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
|
ArrayList<File> chargingStationList = new ArrayList<>();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case R.id.tv_examine:
|
case R.id.tv_examine:
|
||||||
Toast.makeText(getContext(), editNameContent.getText().toString(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), editNameContent.getText().toString(), Toast.LENGTH_SHORT).show();
|
||||||
@ -660,8 +665,42 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void chargingStationSaveByWork(PoiEntity poiEntity) {
|
||||||
|
showLoadingDialog();
|
||||||
|
HttpParams httpParams = new HttpParams();
|
||||||
|
httpParams.put("id",poiEntity.getTaskId());
|
||||||
|
httpParams.put("sptype", poiEntity.getStation_type());
|
||||||
|
httpParams.put("name", poiEntity.getName());
|
||||||
|
httpParams.put("address", poiEntity.getAddress());
|
||||||
|
httpParams.put("telephone", poiEntity.getTelPhone());
|
||||||
|
httpParams.put("memo", poiEntity.getMemo());
|
||||||
|
httpParams.put("geo",poiEntity.getGeoWkt());
|
||||||
|
OkGoBuilder.getInstance()
|
||||||
|
.Builder(getActivity())
|
||||||
|
.url(HttpInterface.SUBMIT_CTASK)
|
||||||
|
.method(OkGoBuilder.GET)
|
||||||
|
.cls(ChargingStationBean.class)
|
||||||
|
.params(httpParams)
|
||||||
|
.callback(new Callback<ChargingStationBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(ChargingStationBean chargingStationBean, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
|
||||||
|
// body = poiSaveBean.getBody();
|
||||||
|
Log.d("TAG", " 其他其他其他其他"+chargingStationBean.getBody());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}).build();
|
||||||
|
}
|
||||||
|
|
||||||
private String initShowStation() {
|
private String initShowStation() {
|
||||||
PoiEntity poiEntity = new PoiEntity();
|
PoiEntity poiEntity = showPoiEntity;
|
||||||
List<Info> infoPhoto = new ArrayList<>();
|
List<Info> infoPhoto = new ArrayList<>();
|
||||||
String name = editNameContent.getText().toString().trim();//名称
|
String name = editNameContent.getText().toString().trim();//名称
|
||||||
if (name != null && !name.equals("")) {
|
if (name != null && !name.equals("")) {
|
||||||
@ -683,27 +722,27 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
poiEntity.setTelPhone(phoneData.get(0));
|
poiEntity.setTelPhone(phoneData.get(0));
|
||||||
}
|
}
|
||||||
String tagPanorama = (String) ivPanorama.getTag();
|
String tagPanorama = (String) ivPanorama.getTag();
|
||||||
if (tagPanorama != null&&!tagPanorama.equals("")) {
|
if (tagPanorama != null && !tagPanorama.equals("")) {
|
||||||
infoPhoto.add(new Info(tagPanorama));
|
infoPhoto.add(new Info(tagPanorama));
|
||||||
}
|
}
|
||||||
String tagName = (String) ivName.getTag();
|
String tagName = (String) ivName.getTag();
|
||||||
if (tagName != null&&!tagName.equals("")) {
|
if (tagName != null && !tagName.equals("")) {
|
||||||
infoPhoto.add(new Info(tagName));
|
infoPhoto.add(new Info(tagName));
|
||||||
}
|
}
|
||||||
String tagInternal = (String) ivInternal.getTag();
|
String tagInternal = (String) ivInternal.getTag();
|
||||||
if (tagInternal != null&&!tagInternal.equals("")) {
|
if (tagInternal != null && !tagInternal.equals("")) {
|
||||||
infoPhoto.add(new Info(tagInternal));
|
infoPhoto.add(new Info(tagInternal));
|
||||||
}
|
}
|
||||||
String tagElse = (String) ivElse.getTag();
|
String tagElse = (String) ivElse.getTag();
|
||||||
if (tagElse != null&&!tagElse.equals("")) {
|
if (tagElse != null && !tagElse.equals("")) {
|
||||||
infoPhoto.add(new Info(tagElse));
|
infoPhoto.add(new Info(tagElse));
|
||||||
}
|
}
|
||||||
String tagScutcheon = (String) ivScutcheon.getTag();
|
String tagScutcheon = (String) ivScutcheon.getTag();
|
||||||
if (tagScutcheon != null&&!tagScutcheon.equals("")) {
|
if (tagScutcheon != null && !tagScutcheon.equals("")) {
|
||||||
infoPhoto.add(new Info(tagScutcheon));
|
infoPhoto.add(new Info(tagScutcheon));
|
||||||
}
|
}
|
||||||
if (showPoiEntity!=null){
|
if (showPoiEntity != null) {
|
||||||
if (showPoiEntity.getTaskId()!=0){
|
if (showPoiEntity.getTaskId() != 0) {
|
||||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -717,18 +756,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
poiEntity.setType(2);
|
poiEntity.setType(2);
|
||||||
poiEntity.setTaskStatus(2);
|
poiEntity.setTaskStatus(2);
|
||||||
poiEntity.setIsLocalData(1);
|
poiEntity.setIsLocalData(1);
|
||||||
/* new Thread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
List<PoiEntity> allPoi = poiDao.getAllPoi();
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
poiEntity.setTaskId(allPoi.size() + 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}).start();*/
|
|
||||||
String newPoiEntity = new Gson().toJson(poiEntity);
|
String newPoiEntity = new Gson().toJson(poiEntity);
|
||||||
return newPoiEntity;
|
return newPoiEntity;
|
||||||
}
|
}
|
||||||
@ -752,7 +779,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
SharedPreferences.Editor edit = poi.edit();
|
SharedPreferences.Editor edit = poi.edit();
|
||||||
//根据要保存的数据的类型,调用对应的put方法,
|
//根据要保存的数据的类型,调用对应的put方法,
|
||||||
|
|
||||||
PoiEntity poiEntity = new PoiEntity();
|
PoiEntity poiEntity = showPoiEntity;
|
||||||
List<Info> infoPhoto = new ArrayList<>();
|
List<Info> infoPhoto = new ArrayList<>();
|
||||||
String name = editNameContent.getText().toString().trim();//名称
|
String name = editNameContent.getText().toString().trim();//名称
|
||||||
if (name != null && !name.equals("")) {
|
if (name != null && !name.equals("")) {
|
||||||
@ -774,27 +801,27 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
poiEntity.setTelPhone(phoneData.get(0));
|
poiEntity.setTelPhone(phoneData.get(0));
|
||||||
}
|
}
|
||||||
String tagPanorama = (String) ivPanorama.getTag();
|
String tagPanorama = (String) ivPanorama.getTag();
|
||||||
if (tagPanorama != null&&!tagPanorama.equals("")) {
|
if (tagPanorama != null && !tagPanorama.equals("")) {
|
||||||
infoPhoto.add(new Info(tagPanorama));
|
infoPhoto.add(new Info(tagPanorama));
|
||||||
}
|
}
|
||||||
String tagName = (String) ivName.getTag();
|
String tagName = (String) ivName.getTag();
|
||||||
if (tagName != null&&!tagName.equals("")) {
|
if (tagName != null && !tagName.equals("")) {
|
||||||
infoPhoto.add(new Info(tagName));
|
infoPhoto.add(new Info(tagName));
|
||||||
}
|
}
|
||||||
String tagInternal = (String) ivInternal.getTag();
|
String tagInternal = (String) ivInternal.getTag();
|
||||||
if (tagInternal != null&&!tagInternal.equals("")) {
|
if (tagInternal != null && !tagInternal.equals("")) {
|
||||||
infoPhoto.add(new Info(tagInternal));
|
infoPhoto.add(new Info(tagInternal));
|
||||||
}
|
}
|
||||||
String tagElse = (String) ivElse.getTag();
|
String tagElse = (String) ivElse.getTag();
|
||||||
if (tagElse != null&&!tagElse.equals("")) {
|
if (tagElse != null && !tagElse.equals("")) {
|
||||||
infoPhoto.add(new Info(tagElse));
|
infoPhoto.add(new Info(tagElse));
|
||||||
}
|
}
|
||||||
String tagScutcheon = (String) ivScutcheon.getTag();
|
String tagScutcheon = (String) ivScutcheon.getTag();
|
||||||
if (tagScutcheon != null&&!tagScutcheon.equals("")) {
|
if (tagScutcheon != null && !tagScutcheon.equals("")) {
|
||||||
infoPhoto.add(new Info(tagScutcheon));
|
infoPhoto.add(new Info(tagScutcheon));
|
||||||
}
|
}
|
||||||
if (showPoiEntity!=null){
|
if (showPoiEntity != null) {
|
||||||
if (showPoiEntity.getTaskId()!=0){
|
if (showPoiEntity.getTaskId() != 0) {
|
||||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -808,18 +835,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
poiEntity.setType(2);
|
poiEntity.setType(2);
|
||||||
poiEntity.setTaskStatus(2);
|
poiEntity.setTaskStatus(2);
|
||||||
poiEntity.setIsLocalData(1);
|
poiEntity.setIsLocalData(1);
|
||||||
/* new Thread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
List<PoiEntity> allPoi = poiDao.getAllPoi();
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
poiEntity.setTaskId(allPoi.size() + 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}).start();*/
|
|
||||||
String newPoiEntity = new Gson().toJson(poiEntity);
|
String newPoiEntity = new Gson().toJson(poiEntity);
|
||||||
//以键值对的形式添加新值。
|
//以键值对的形式添加新值。
|
||||||
edit.putString("poiEntity", newPoiEntity);
|
edit.putString("poiEntity", newPoiEntity);
|
||||||
|
@ -176,10 +176,12 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onEvent(Message data) {
|
public void onEvent(Message data) {
|
||||||
if (data.what == Constant.JOB_SEARCH_WORD) {
|
if (data.what == Constant.JOB_SEARCH_POI_WORD) {
|
||||||
|
allPoi = (List<PoiEntity>) data.obj;
|
||||||
|
} else if (data.what == Constant.JOB_SEARCH_WORD) {
|
||||||
poiEntities.clear();
|
poiEntities.clear();
|
||||||
JobSearchBean jobSearchBean = (JobSearchBean) data.obj;
|
JobSearchBean jobSearchBean = (JobSearchBean) data.obj;
|
||||||
if (jobSearchBean!=null){
|
if (jobSearchBean != null) {
|
||||||
List<JobSearchBean.BodyBean.ListBean> list = jobSearchBean.getBody().getList();
|
List<JobSearchBean.BodyBean.ListBean> list = jobSearchBean.getBody().getList();
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
PoiEntity poiEntity = new PoiEntity();
|
PoiEntity poiEntity = new PoiEntity();
|
||||||
@ -203,13 +205,11 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
poiEntities.add(poiEntity);
|
poiEntities.add(poiEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (allPoi!=null){
|
if (allPoi != null) {
|
||||||
poiEntities.addAll(allPoi);
|
poiEntities.addAll(allPoi);
|
||||||
}
|
}
|
||||||
filterAdapter.setAllPoi(poiEntities);
|
filterAdapter.setAllPoi(poiEntities);
|
||||||
|
|
||||||
} else if (data.what == Constant.JOB_SEARCH_POI_WORD) {
|
|
||||||
allPoi = (List<PoiEntity>) data.obj;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,23 +222,58 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
clNumber = findViewById(R.id.cl_number);
|
clNumber = findViewById(R.id.cl_number);
|
||||||
clNumber.setOnClickListener(this::onClick);
|
clNumber.setOnClickListener(this::onClick);
|
||||||
tvNumber = findViewById(R.id.tv_number);
|
tvNumber = findViewById(R.id.tv_number);
|
||||||
|
tvNumber.setText(Constant.NUMBER+"");
|
||||||
clPhotograph = findViewById(R.id.cl_photograph);
|
clPhotograph = findViewById(R.id.cl_photograph);
|
||||||
clPhotograph.setOnClickListener(this::onClick);
|
clPhotograph.setOnClickListener(this::onClick);
|
||||||
tvPhotograph = findViewById(R.id.tv_photograph);
|
tvPhotograph = findViewById(R.id.tv_photograph);
|
||||||
|
if (Constant.LIMIT_TTPE == -1) {//"全部", "普通任务", "专属任务"
|
||||||
|
tvPhotograph.setText("全部");
|
||||||
|
} else if (Constant.LIMIT_TTPE == 0) {
|
||||||
|
tvPhotograph.setText("普通任务");
|
||||||
|
} else if (Constant.LIMIT_TTPE == 1) {
|
||||||
|
tvPhotograph.setText("专属任务");
|
||||||
|
}
|
||||||
clExclusive = findViewById(R.id.cl_exclusive);
|
clExclusive = findViewById(R.id.cl_exclusive);
|
||||||
clExclusive.setOnClickListener(this::onClick);
|
clExclusive.setOnClickListener(this::onClick);
|
||||||
tvExclusive = findViewById(R.id.tv_exclusive);
|
tvExclusive = findViewById(R.id.tv_exclusive);
|
||||||
|
if (Constant.TASK_TYPE == -1) {//"全部", "poi", "充电站", "POI录像", "道路录像", "其他", "面状任务"
|
||||||
|
tvExclusive.setText("全部");
|
||||||
|
} else if (Constant.TASK_TYPE == 1) {
|
||||||
|
tvExclusive.setText("poi");
|
||||||
|
} else if (Constant.TASK_TYPE == 2) {
|
||||||
|
tvExclusive.setText("充电站");
|
||||||
|
} else if (Constant.TASK_TYPE == 3) {
|
||||||
|
tvExclusive.setText("POI录像");
|
||||||
|
} else if (Constant.TASK_TYPE == 4) {
|
||||||
|
tvExclusive.setText("道路录像");
|
||||||
|
} else if (Constant.TASK_TYPE == 5) {
|
||||||
|
tvExclusive.setText("其他");
|
||||||
|
} else if (Constant.TASK_TYPE == 6) {
|
||||||
|
tvExclusive.setText("面状任务");
|
||||||
|
}
|
||||||
clType = findViewById(R.id.cl_type);
|
clType = findViewById(R.id.cl_type);
|
||||||
clType.setOnClickListener(this::onClick);
|
clType.setOnClickListener(this::onClick);
|
||||||
tvType = findViewById(R.id.tv_type);
|
tvType = findViewById(R.id.tv_type);
|
||||||
|
if (Constant.TASK_STASTUS == -1) {
|
||||||
|
tvType.setText("全部");
|
||||||
|
} else if (Constant.TASK_STASTUS == 1) {
|
||||||
|
tvType.setText("已领取");
|
||||||
|
} else if (Constant.TASK_STASTUS == 2) {
|
||||||
|
tvType.setText("待提交");
|
||||||
|
} else if (Constant.TASK_STASTUS == 3) {
|
||||||
|
tvType.setText("未领取");
|
||||||
|
}
|
||||||
|
|
||||||
btnFilter = findViewById(R.id.btn_filter);
|
btnFilter = findViewById(R.id.btn_filter);
|
||||||
btnFilter.setOnClickListener(this::onClick);
|
btnFilter.setOnClickListener(this::onClick);
|
||||||
recyclerFilter = findViewById(R.id.recycler_filter);
|
recyclerFilter = findViewById(R.id.recycler_filter);
|
||||||
|
|
||||||
//设置下划线
|
//设置下划线
|
||||||
recyclerFilter.setLayoutManager(new LinearLayoutManager(getActivity()));
|
recyclerFilter.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
recyclerFilter.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
|
recyclerFilter.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
|
||||||
recyclerFilter.setRefreshProgressStyle(ProgressStyle.SemiCircleSpin);
|
recyclerFilter.setRefreshProgressStyle(ProgressStyle.SemiCircleSpin);
|
||||||
recyclerFilter.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
|
recyclerFilter.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
|
||||||
|
|
||||||
//取消上啦加载下拉刷新
|
//取消上啦加载下拉刷新
|
||||||
recyclerFilter.setPullRefreshEnabled(false);
|
recyclerFilter.setPullRefreshEnabled(false);
|
||||||
recyclerFilter.setLoadingMoreEnabled(false);
|
recyclerFilter.setLoadingMoreEnabled(false);
|
||||||
@ -249,30 +284,29 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
recyclerFilter.setLoadingListener(new XRecyclerView.LoadingListener() {
|
recyclerFilter.setLoadingListener(new XRecyclerView.LoadingListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onRefresh() {
|
public void onRefresh() {
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onLoadMore() {
|
public void onLoadMore() {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
filterAdapter.setItemCLick(new FilterAdapter.ItemCLick() {
|
filterAdapter.setItemCLick(new FilterAdapter.ItemCLick() {
|
||||||
@Override
|
@Override
|
||||||
public void item(PoiEntity poiEntity, boolean aBoolean) {
|
public void item(PoiEntity poiEntity, boolean aBoolean) {
|
||||||
if (aBoolean) {
|
if (aBoolean) {//本地
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.GATHER_GET;
|
obtain.what = Constant.GATHER_GET;
|
||||||
obtain.obj = poiEntity;
|
obtain.obj = poiEntity;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
} else {
|
} else {//服务
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.FILTER_LIST_ITEM;
|
obtain.what = Constant.FILTER_LIST_ITEM;
|
||||||
obtain.obj = poiEntity;
|
obtain.obj = poiEntity;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -306,7 +340,6 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
obtain.what = Constant.JOB_WORD_MONITOR;
|
obtain.what = Constant.JOB_WORD_MONITOR;
|
||||||
obtain.obj = true;
|
obtain.obj = true;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
@ -334,13 +367,15 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 1 "POI"
|
1 "POI"
|
||||||
* 2 "充电站"
|
2 "充电站"
|
||||||
* 3 "POI录像"
|
3 "POI录像"
|
||||||
* 4 "道路录像"
|
4 "道路录像"
|
||||||
* 5 "其他"
|
5 "其他"
|
||||||
* 6 "面状任务"
|
6 "面状任务"
|
||||||
*/
|
*/
|
||||||
case R.id.cl_exclusive:
|
case R.id.cl_exclusive:
|
||||||
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"全部", "poi", "充电站", "POI录像", "道路录像", "其他", "面状任务"}, new OnMenuItemClickListener() {
|
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"全部", "poi", "充电站", "POI录像", "道路录像", "其他", "面状任务"}, new OnMenuItemClickListener() {
|
||||||
|
@ -7,14 +7,21 @@ import android.view.KeyEvent;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.lzy.okgo.model.HttpParams;
|
||||||
import com.navinfo.outdoor.R;
|
import com.navinfo.outdoor.R;
|
||||||
import com.navinfo.outdoor.api.Constant;
|
import com.navinfo.outdoor.api.Constant;
|
||||||
import com.navinfo.outdoor.base.BaseFragment;
|
import com.navinfo.outdoor.base.BaseFragment;
|
||||||
|
import com.navinfo.outdoor.bean.PolygonTaskBean;
|
||||||
|
import com.navinfo.outdoor.bean.ReceivedBean;
|
||||||
import com.navinfo.outdoor.bean.ReceivedPoiBean;
|
import com.navinfo.outdoor.bean.ReceivedPoiBean;
|
||||||
|
import com.navinfo.outdoor.bean.UnPolygonTaskBean;
|
||||||
import com.navinfo.outdoor.http.Callback;
|
import com.navinfo.outdoor.http.Callback;
|
||||||
import com.navinfo.outdoor.http.HttpInterface;
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
|
import com.navinfo.outdoor.room.ChargingPileDao;
|
||||||
|
import com.navinfo.outdoor.room.ChargingPileEntity;
|
||||||
import com.navinfo.outdoor.room.PoiDao;
|
import com.navinfo.outdoor.room.PoiDao;
|
||||||
import com.navinfo.outdoor.room.PoiDatabase;
|
import com.navinfo.outdoor.room.PoiDatabase;
|
||||||
import com.navinfo.outdoor.room.PoiEntity;
|
import com.navinfo.outdoor.room.PoiEntity;
|
||||||
@ -24,6 +31,8 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 领取采集的fragment
|
* 领取采集的fragment
|
||||||
*/
|
*/
|
||||||
@ -32,19 +41,19 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
private TextView tvTitle, tvMoney, tvTime, tvDistance, tvDescribe;
|
private TextView tvTitle, tvMoney, tvTime, tvDistance, tvDescribe;
|
||||||
private PoiEntity poiEntity;
|
private PoiEntity poiEntity;
|
||||||
private PoiDao poiDao;
|
private PoiDao poiDao;
|
||||||
private PoiEntity poiListEntity;
|
private ChargingPileDao chargingPileDao;
|
||||||
private int aSave;
|
|
||||||
|
|
||||||
public static GatherGetFragment newInstance(Bundle bundle) {
|
public static GatherGetFragment newInstance(Bundle bundle) {
|
||||||
GatherGetFragment fragment = new GatherGetFragment();
|
GatherGetFragment fragment = new GatherGetFragment();
|
||||||
fragment.setArguments(bundle);
|
fragment.setArguments(bundle);
|
||||||
return fragment;
|
return fragment;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
getFocus();
|
getFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
//主界面获取焦点
|
//主界面获取焦点
|
||||||
private void getFocus() {
|
private void getFocus() {
|
||||||
getView().setFocusableInTouchMode(true);
|
getView().setFocusableInTouchMode(true);
|
||||||
@ -64,15 +73,18 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayout() {
|
protected int getLayout() {
|
||||||
return R.layout.fragment_gather_get;
|
return R.layout.fragment_gather_get;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
PoiDatabase poiDatabase = PoiDatabase.getInstance(getContext());
|
PoiDatabase poiDatabase = PoiDatabase.getInstance(getContext());
|
||||||
poiDao = poiDatabase.getPoiDao();
|
poiDao = poiDatabase.getPoiDao();
|
||||||
|
chargingPileDao = poiDatabase.getChargingPileDao();
|
||||||
tvTitle = findViewById(R.id.tv_title);
|
tvTitle = findViewById(R.id.tv_title);
|
||||||
tvMoney = findViewById(R.id.tv_money);
|
tvMoney = findViewById(R.id.tv_money);
|
||||||
tvTime = findViewById(R.id.tv_time);
|
tvTime = findViewById(R.id.tv_time);
|
||||||
@ -87,194 +99,445 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
btnFinishGather = findViewById(R.id.btn_finish_gather);//结束采集
|
btnFinishGather = findViewById(R.id.btn_finish_gather);//结束采集
|
||||||
btnFinishGather.setOnClickListener(this::onClick);
|
btnFinishGather.setOnClickListener(this::onClick);
|
||||||
Bundle arguments = getArguments();
|
Bundle arguments = getArguments();
|
||||||
if (arguments != null) {
|
if (arguments != null) {//poiEntity
|
||||||
poiEntity = (PoiEntity) arguments.getSerializable("poiEntity");
|
poiEntity = (PoiEntity) arguments.getSerializable("poiEntity");
|
||||||
aSave = arguments.getInt("aSave", 0);
|
if (poiEntity != null) {
|
||||||
if (aSave == 1) {//普通任务
|
tvTitle.setText(poiEntity.getName());
|
||||||
if (poiEntity != null) {
|
if (poiEntity.getPrecision() == null) {
|
||||||
tvTitle.setText(poiEntity.getName());
|
tvMoney.setText("¥" + 0);
|
||||||
if (poiEntity.getPrecision() == null) {
|
} else {
|
||||||
tvMoney.setText("¥" + 0);
|
tvMoney.setText("¥" + poiEntity.getPrecision());
|
||||||
} else {
|
|
||||||
tvMoney.setText("¥" + poiEntity.getPrecision());
|
|
||||||
}
|
|
||||||
tvTime.setText("到期时间:" + poiEntity.getCreateTime());
|
|
||||||
tvDescribe.setText("任务描述:" + poiEntity.getDescribe());
|
|
||||||
if (poiEntity.getDist() != null) {
|
|
||||||
tvDistance.setText("距离:" + format5(Double.valueOf(poiEntity.getDist()) / 1000) + "km");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
int taskStatus = poiEntity.getTaskStatus();
|
tvTime.setText("到期时间:" + poiEntity.getCreateTime());
|
||||||
switch (taskStatus) {
|
tvDescribe.setText("任务描述:" + poiEntity.getDescribe());
|
||||||
case 0://未领取
|
if (poiEntity.getDist() != null) {
|
||||||
btnCancelGet.setVisibility(View.GONE);
|
tvDistance.setText("距离:" + format5(Double.valueOf(poiEntity.getDist()) / 1000) + "km");
|
||||||
btnGetTask.setVisibility(View.VISIBLE);
|
|
||||||
btnGather.setVisibility(View.VISIBLE);
|
|
||||||
btnFinishGather.setVisibility(View.GONE);
|
|
||||||
break;
|
|
||||||
case 1://已领取
|
|
||||||
btnCancelGet.setVisibility(View.VISIBLE);
|
|
||||||
btnGetTask.setVisibility(View.GONE);
|
|
||||||
btnGather.setVisibility(View.VISIBLE);
|
|
||||||
btnFinishGather.setVisibility(View.GONE);
|
|
||||||
break;
|
|
||||||
case 2://已保存
|
|
||||||
btnCancelGet.setVisibility(View.GONE);
|
|
||||||
btnGetTask.setVisibility(View.GONE);
|
|
||||||
btnGather.setVisibility(View.VISIBLE);
|
|
||||||
btnFinishGather.setVisibility(View.VISIBLE);
|
|
||||||
break;
|
|
||||||
case 3://已提交
|
|
||||||
btnCancelGet.setVisibility(View.GONE);
|
|
||||||
btnGetTask.setVisibility(View.GONE);
|
|
||||||
btnGather.setVisibility(View.GONE);
|
|
||||||
btnFinishGather.setVisibility(View.GONE);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else if (aSave == 2) {//面妆任务
|
|
||||||
if (poiEntity != null) {
|
|
||||||
tvTitle.setText(poiEntity.getName());
|
|
||||||
if (poiEntity.getPrecision() == null) {
|
|
||||||
tvMoney.setText("¥" + 0);
|
|
||||||
} else {
|
|
||||||
tvMoney.setText("¥" + poiEntity.getPrecision());
|
|
||||||
}
|
|
||||||
tvTime.setText("到期时间:" + poiEntity.getCreateTime());
|
|
||||||
tvDescribe.setText("任务描述:" + poiEntity.getDescribe());
|
|
||||||
if (poiEntity.getDist() != null) {
|
|
||||||
tvDistance.setText("距离:" + format5(Double.valueOf(poiEntity.getDist())/1000) + "km");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int taskStatus = poiEntity.getTaskStatus();
|
|
||||||
switch (taskStatus) {
|
|
||||||
case 0://未领取
|
|
||||||
btnCancelGet.setVisibility(View.GONE);
|
|
||||||
btnGetTask.setVisibility(View.VISIBLE);
|
|
||||||
btnGather.setVisibility(View.VISIBLE);
|
|
||||||
btnFinishGather.setVisibility(View.GONE);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 1://已领取
|
|
||||||
btnCancelGet.setVisibility(View.VISIBLE);
|
|
||||||
btnGetTask.setVisibility(View.GONE);
|
|
||||||
btnGather.setVisibility(View.VISIBLE);
|
|
||||||
btnFinishGather.setVisibility(View.GONE);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2://已保存
|
|
||||||
btnCancelGet.setVisibility(View.GONE);
|
|
||||||
btnGetTask.setVisibility(View.GONE);
|
|
||||||
btnGather.setVisibility(View.VISIBLE);
|
|
||||||
btnFinishGather.setVisibility(View.VISIBLE);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 3://已提交
|
|
||||||
btnCancelGet.setVisibility(View.GONE);
|
|
||||||
btnGetTask.setVisibility(View.GONE);
|
|
||||||
btnGather.setVisibility(View.GONE);
|
|
||||||
btnFinishGather.setVisibility(View.GONE);
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
int taskStatus = poiEntity.getTaskStatus();
|
||||||
|
switch (taskStatus) {
|
||||||
|
case 0://未领取
|
||||||
|
btnCancelGet.setVisibility(View.GONE);
|
||||||
|
btnGetTask.setVisibility(View.VISIBLE);
|
||||||
|
btnGather.setVisibility(View.VISIBLE);
|
||||||
|
btnFinishGather.setVisibility(View.GONE);
|
||||||
|
break;
|
||||||
|
case 1://已领取
|
||||||
|
btnCancelGet.setVisibility(View.VISIBLE);
|
||||||
|
btnGetTask.setVisibility(View.GONE);
|
||||||
|
btnGather.setVisibility(View.VISIBLE);
|
||||||
|
btnFinishGather.setVisibility(View.GONE);
|
||||||
|
break;
|
||||||
|
case 2://已保存
|
||||||
|
btnCancelGet.setVisibility(View.GONE);
|
||||||
|
btnGetTask.setVisibility(View.GONE);
|
||||||
|
btnGather.setVisibility(View.VISIBLE);
|
||||||
|
btnFinishGather.setVisibility(View.VISIBLE);
|
||||||
|
break;
|
||||||
|
case 3://已提交
|
||||||
|
btnCancelGet.setVisibility(View.GONE);
|
||||||
|
btnGetTask.setVisibility(View.GONE);
|
||||||
|
btnGather.setVisibility(View.GONE);
|
||||||
|
btnFinishGather.setVisibility(View.GONE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
case R.id.btn_cancel_get://结束领取
|
case R.id.btn_cancel_get://结束领取
|
||||||
poiEntity.setTaskStatus(0);
|
|
||||||
btnGetTask.setVisibility(View.VISIBLE);
|
|
||||||
btnCancelGet.setVisibility(View.GONE);
|
|
||||||
new Thread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (poiListEntity!=null){
|
|
||||||
poiDao.deletePoiEntity(poiListEntity);
|
|
||||||
}else {
|
|
||||||
poiDao.deletePoiEntity(poiEntity);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
break;
|
|
||||||
case R.id.btn_get_task://领取任务
|
|
||||||
poiEntity.setTaskStatus(1);
|
|
||||||
btnGetTask.setVisibility(View.GONE);
|
|
||||||
btnCancelGet.setVisibility(View.VISIBLE);
|
|
||||||
//网络请求:
|
|
||||||
if (poiEntity != null) {
|
if (poiEntity != null) {
|
||||||
if (poiEntity.getType() == 1) {//poi的领取类型
|
int type = poiEntity.getType();
|
||||||
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK+"/"+poiEntity.getTaskId() + "", false);
|
if (type == 6) {
|
||||||
} else if (poiEntity.getType() == 5) {
|
initUnPolygonTask(HttpInterface.UNRECEIVED_POLYGON_TASK, poiEntity.getTaskId());
|
||||||
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK+"/"+poiEntity.getTaskId() + "", false);
|
} else {
|
||||||
|
poiEntity.setTaskStatus(0);
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case R.id.btn_gather://立即采集
|
case R.id.btn_get_task://领取任务
|
||||||
if (poiEntity != null) {
|
if (poiEntity != null) {
|
||||||
|
int type = poiEntity.getType();
|
||||||
|
if (type == 6) {
|
||||||
|
initPolygonTask(HttpInterface.RECEIVED_POLYGON_TASK, poiEntity.getTaskId(), false);
|
||||||
|
} else {
|
||||||
|
btnGetTask.setVisibility(View.GONE);
|
||||||
|
btnCancelGet.setVisibility(View.VISIBLE);
|
||||||
|
//网络请求:
|
||||||
if (poiEntity.getType() == 1) {//poi的领取类型
|
if (poiEntity.getType() == 1) {//poi的领取类型
|
||||||
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK+"/"+poiEntity.getTaskId() + "", true);
|
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK , poiEntity.getTaskId(), false);
|
||||||
} else if (poiEntity.getType() == 5) {
|
} else if (poiEntity.getType() == 5) {//其他的领取类型
|
||||||
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK+"/"+poiEntity.getTaskId() + "", true);
|
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK , poiEntity.getTaskId(), false);
|
||||||
|
} else if (poiEntity.getType() == 2) {//充电站的领取类型
|
||||||
|
chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity.getTaskId(),false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case R.id.btn_gather://立即采集
|
||||||
|
if (poiEntity != null) {
|
||||||
|
int type = poiEntity.getType();
|
||||||
|
if (type == 6) {
|
||||||
|
int taskStatus = poiEntity.getTaskStatus();
|
||||||
|
if (taskStatus != 1) {
|
||||||
|
initPolygonTask(HttpInterface.RECEIVED_POLYGON_TASK, poiEntity.getTaskId(), true);
|
||||||
|
} else {
|
||||||
|
initCompleteTask(HttpInterface.COMPLETE, poiEntity.getTaskId());
|
||||||
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
if (poiEntity.getType() == 1) {//poi的领取类型
|
||||||
|
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK , poiEntity.getTaskId(), true);
|
||||||
|
} else if (poiEntity.getType() == 5) {//其他的领取类型
|
||||||
|
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK, poiEntity.getTaskId(), true);
|
||||||
|
}else if (poiEntity.getType() == 2){//充电站的领取类型
|
||||||
|
chargingTaskByWork(HttpInterface.RECEIVED_CTASK, poiEntity.getTaskId(),true);
|
||||||
|
}
|
||||||
|
btnFinishGather.setVisibility(View.VISIBLE);
|
||||||
|
btnGather.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case R.id.btn_finish_gather://结束采集
|
case R.id.btn_finish_gather://结束采集
|
||||||
btnFinishGather.setVisibility(View.VISIBLE);
|
if (poiEntity != null) {
|
||||||
new Thread(new Runnable() {
|
int type = poiEntity.getType();
|
||||||
@Override
|
if (type == 6) {
|
||||||
public void run() {
|
initSubmitPolygonTask(HttpInterface.SUBMIT_POLYGON_TASK, poiEntity.getTaskId());
|
||||||
if (poiListEntity!=null){
|
} else {
|
||||||
poiDao.deletePoiEntity(poiListEntity);
|
btnGather.setVisibility(View.VISIBLE);
|
||||||
}else {
|
btnFinishGather.setVisibility(View.GONE);
|
||||||
poiDao.deletePoiEntity(poiEntity);
|
new Thread(new Runnable() {
|
||||||
}
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
}
|
}
|
||||||
}).start();
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param url 不同任务类型对应的url
|
* @param url 筛选充电站领取任务
|
||||||
*/
|
*/
|
||||||
private void receivedTaskByNet(String url, boolean isSaver) {
|
private void chargingTaskByWork(String url,int taskId, boolean isSaver) {
|
||||||
|
showLoadingDialog();
|
||||||
|
OkGoBuilder.getInstance()
|
||||||
|
.Builder(getActivity())
|
||||||
|
.url(url+"/"+taskId)
|
||||||
|
.method(OkGoBuilder.GET)
|
||||||
|
.cls(ReceivedBean.class)
|
||||||
|
.callback(new Callback<ReceivedBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(ReceivedBean response, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
ReceivedBean.BodyBean listBean = response.getBody();
|
||||||
|
PoiEntity chargingListEntity = new PoiEntity();
|
||||||
|
chargingListEntity.setTaskId(taskId);
|
||||||
|
chargingListEntity.setStation_type(listBean.getSptype());
|
||||||
|
chargingListEntity.setName(listBean.getName());
|
||||||
|
chargingListEntity.setPrecision(listBean.getPrice() + "");
|
||||||
|
chargingListEntity.setAddress(listBean.getAddress());
|
||||||
|
chargingListEntity.setTelPhone(listBean.getTelephone() + "");
|
||||||
|
chargingListEntity.setType(Integer.valueOf(listBean.getType()));
|
||||||
|
String geo = listBean.getGeo();
|
||||||
|
chargingListEntity.setGeoWkt(geo);
|
||||||
|
Geometry geometry = GeometryTools.createGeometry(geo);
|
||||||
|
if (geometry.getGeometryType().equals("Point")) {//点
|
||||||
|
LatLng latLng = GeometryTools.createLatLng(geo);
|
||||||
|
chargingListEntity.setX(latLng.longitude + "");
|
||||||
|
chargingListEntity.setY(latLng.latitude + "");
|
||||||
|
} else if (geometry.getGeometryType().equals("LineString")) {//线
|
||||||
|
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
||||||
|
chargingListEntity.setX(latLineString.get(0).longitude + "");
|
||||||
|
chargingListEntity.setY(latLineString.get(0).latitude + "");
|
||||||
|
} else if (geometry.getGeometryType().equals("Polygon")) {//面
|
||||||
|
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
|
||||||
|
chargingListEntity.setX(latPolygon.get(0).longitude + "");
|
||||||
|
chargingListEntity.setY(latPolygon.get(0).latitude + "");
|
||||||
|
}
|
||||||
|
//充电桩
|
||||||
|
List<ReceivedBean.BodyBean.CsTaskListBean> csTaskList = response.getBody().getCsTaskList();
|
||||||
|
for (int i = 0; i < csTaskList.size(); i++) {
|
||||||
|
ChargingPileEntity chargingPileEntity = new ChargingPileEntity();
|
||||||
|
chargingPileEntity.setFid(taskId);
|
||||||
|
chargingPileEntity.setName(csTaskList.get(i).getName());
|
||||||
|
chargingPileEntity.setMemo(csTaskList.get(i).getAddress());
|
||||||
|
chargingPileEntity.setP(csTaskList.get(i).getGeo());
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
chargingPileDao.insertChargingPileEntity(chargingPileEntity);
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
poiDao.insertPoiEntity(chargingListEntity);
|
||||||
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
btnFinishGather.setVisibility(View.VISIBLE);
|
||||||
|
if (isSaver) {
|
||||||
|
Message obtain = Message.obtain();
|
||||||
|
obtain.what = Constant.GATHER_GET_MAP;
|
||||||
|
obtain.obj = chargingListEntity;
|
||||||
|
EventBus.getDefault().post(obtain);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}).build();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param url 面妆任务领取任务
|
||||||
|
*/
|
||||||
|
private void initPolygonTask(String url, int taskId, boolean aBoolean) {
|
||||||
|
if (taskId == 0) {
|
||||||
|
Toast.makeText(getContext(), "无此任务", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
showLoadingDialog();
|
||||||
|
OkGoBuilder.getInstance()
|
||||||
|
.Builder(getActivity())
|
||||||
|
.url(url + "/" + taskId)
|
||||||
|
.method(OkGoBuilder.GET)
|
||||||
|
.cls(PolygonTaskBean.class)
|
||||||
|
.callback(new Callback<PolygonTaskBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(PolygonTaskBean response, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
if (response.getCode() == 200) {
|
||||||
|
PolygonTaskBean.BodyBean listBean = response.getBody();
|
||||||
|
PoiEntity polygonEntity = new PoiEntity();
|
||||||
|
polygonEntity.setTaskId(listBean.getId());
|
||||||
|
polygonEntity.setName(listBean.getName());
|
||||||
|
polygonEntity.setType(Integer.valueOf(listBean.getType()));
|
||||||
|
String geo = listBean.getGeo();
|
||||||
|
polygonEntity.setGeoWkt(geo);
|
||||||
|
Geometry geometry = GeometryTools.createGeometry(geo);
|
||||||
|
if (geometry.getGeometryType().equals("Point")) {//点
|
||||||
|
LatLng latLng = GeometryTools.createLatLng(geo);
|
||||||
|
polygonEntity.setX(latLng.longitude + "");
|
||||||
|
polygonEntity.setY(latLng.latitude + "");
|
||||||
|
} else if (geometry.getGeometryType().equals("LineString")) {//线
|
||||||
|
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
||||||
|
polygonEntity.setX(latLineString.get(0).longitude + "");
|
||||||
|
polygonEntity.setY(latLineString.get(0).latitude + "");
|
||||||
|
} else if (geometry.getGeometryType().equals("Polygon")) {//面
|
||||||
|
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
|
||||||
|
polygonEntity.setX(latPolygon.get(0).longitude + "");
|
||||||
|
polygonEntity.setY(latPolygon.get(0).latitude + "");
|
||||||
|
}
|
||||||
|
polygonEntity.setTaskStatus(1);
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
poiDao.insertPoiEntity(polygonEntity);
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
btnGetTask.setVisibility(View.GONE);
|
||||||
|
btnCancelGet.setVisibility(View.VISIBLE);
|
||||||
|
if (aBoolean) {
|
||||||
|
initCompleteTask(HttpInterface.COMPLETE, poiEntity.getTaskId());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
Toast.makeText(getContext(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param url 面妆任务结束领取 ,结束采集
|
||||||
|
*/
|
||||||
|
private void initUnPolygonTask(String url, int taskId) {
|
||||||
|
if (taskId == 0) {
|
||||||
|
Toast.makeText(getContext(), "无此任务", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
showLoadingDialog();
|
||||||
|
OkGoBuilder.getInstance()
|
||||||
|
.Builder(getActivity())
|
||||||
|
.url(url + "/" + taskId)
|
||||||
|
.method(OkGoBuilder.GET)
|
||||||
|
.cls(UnPolygonTaskBean.class)
|
||||||
|
.callback(new Callback<UnPolygonTaskBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(UnPolygonTaskBean response, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
if (response.getCode() == 200) {
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
PoiEntity poiEntity = poiDao.getPoiEntity(taskId);
|
||||||
|
poiDao.deletePoiEntity(poiEntity);
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
btnGetTask.setVisibility(View.VISIBLE);
|
||||||
|
btnCancelGet.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
Toast.makeText(getContext(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param url 面妆任务立即采集
|
||||||
|
*/
|
||||||
|
private void initCompleteTask(String url, int taskId) {
|
||||||
|
if (taskId == 0) {
|
||||||
|
Toast.makeText(getContext(), "无此任务", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
showLoadingDialog();
|
||||||
|
OkGoBuilder.getInstance()
|
||||||
|
.Builder(getActivity())
|
||||||
|
.url(url + "/" + taskId)
|
||||||
|
.method(OkGoBuilder.GET)
|
||||||
|
.cls(UnPolygonTaskBean.class)
|
||||||
|
.callback(new Callback<UnPolygonTaskBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(UnPolygonTaskBean response, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
if (response.getCode() == 200) {
|
||||||
|
btnGather.setVisibility(View.GONE);
|
||||||
|
btnFinishGather.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
Toast.makeText(getContext(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param url 面妆任务 结束采集
|
||||||
|
*/
|
||||||
|
private void initSubmitPolygonTask(String url, int taskId) {
|
||||||
|
if (taskId == 0) {
|
||||||
|
Toast.makeText(getContext(), "无此任务", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
showLoadingDialog();
|
showLoadingDialog();
|
||||||
OkGoBuilder.getInstance()
|
OkGoBuilder.getInstance()
|
||||||
.Builder(getActivity())
|
.Builder(getActivity())
|
||||||
.url(url)
|
.url(url)
|
||||||
.method(OkGoBuilder.GET)
|
.method(OkGoBuilder.GET)
|
||||||
|
.params(new HttpParams("id", String.valueOf(taskId)))
|
||||||
|
.cls(UnPolygonTaskBean.class)
|
||||||
|
.callback(new Callback<UnPolygonTaskBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(UnPolygonTaskBean response, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
if (response.getCode() == 200) {
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
PoiEntity poiEntity = poiDao.getPoiEntity(taskId);
|
||||||
|
poiDao.deletePoiEntity(poiEntity);
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
btnGather.setVisibility(View.VISIBLE);
|
||||||
|
btnFinishGather.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
Toast.makeText(getContext(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param url 不同任务类型对应的url
|
||||||
|
*/
|
||||||
|
private void receivedTaskByNet(String url,int taskId ,boolean isSaver) {
|
||||||
|
showLoadingDialog();
|
||||||
|
OkGoBuilder.getInstance()
|
||||||
|
.Builder(getActivity())
|
||||||
|
.url(url+"/"+taskId)
|
||||||
|
.method(OkGoBuilder.GET)
|
||||||
.cls(ReceivedPoiBean.class)
|
.cls(ReceivedPoiBean.class)
|
||||||
.callback(new Callback<ReceivedPoiBean>() {
|
.callback(new Callback<ReceivedPoiBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(ReceivedPoiBean response, int id) {
|
public void onSuccess(ReceivedPoiBean response, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
ReceivedPoiBean.BodyBean listBean = response.getBody();
|
ReceivedPoiBean.BodyBean listBean = response.getBody();
|
||||||
poiListEntity = new PoiEntity();
|
PoiEntity poiListEntity = new PoiEntity();
|
||||||
poiListEntity.setTaskId(listBean.getId());
|
poiListEntity.setTaskId(listBean.getId());
|
||||||
poiListEntity.setName(listBean.getName());
|
poiListEntity.setName(listBean.getName());
|
||||||
poiListEntity.setAddress(listBean.getAddress());
|
poiListEntity.setAddress(listBean.getAddress());
|
||||||
poiListEntity.setTelPhone(listBean.getTelephone() + "");
|
poiListEntity.setTelPhone(listBean.getTelephone() + "");
|
||||||
poiListEntity.setType(Integer.valueOf(listBean.getType()));
|
poiListEntity.setType(Integer.valueOf(listBean.getType()));
|
||||||
String geo = listBean.getGeo();
|
String geo = listBean.getGeo();
|
||||||
|
poiListEntity.setGeoWkt(geo);
|
||||||
Geometry geometry = GeometryTools.createGeometry(geo);
|
Geometry geometry = GeometryTools.createGeometry(geo);
|
||||||
if (geometry.getGeometryType().equals("Point")) {//点
|
if (geometry.getGeometryType().equals("Point")) {//点
|
||||||
LatLng latLng = GeometryTools.createLatLng(geo);
|
LatLng latLng = GeometryTools.createLatLng(geo);
|
||||||
poiListEntity.setX(latLng.longitude + "");
|
poiListEntity.setX(latLng.longitude + "");
|
||||||
poiListEntity.setY(latLng.latitude + "");
|
poiListEntity.setY(latLng.latitude + "");
|
||||||
} else if (geometry.getGeometryType().equals("LineString")) {//线
|
} else if (geometry.getGeometryType().equals("LineString")) {//线
|
||||||
} else if (geometry.getGeometryType().equals("Polygon")) {}//面
|
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
||||||
|
poiListEntity.setX(latLineString.get(0).longitude + "");
|
||||||
|
poiListEntity.setY(latLineString.get(0).latitude + "");
|
||||||
|
} else if (geometry.getGeometryType().equals("Polygon")) {//面
|
||||||
|
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
|
||||||
|
poiListEntity.setX(latPolygon.get(0).longitude + "");
|
||||||
|
poiListEntity.setY(latPolygon.get(0).latitude + "");
|
||||||
|
}
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
poiDao.insertPoiEntity(poiListEntity);
|
poiDao.insertPoiEntity(poiListEntity);
|
||||||
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
btnFinishGather.setVisibility(View.VISIBLE);
|
btnFinishGather.setVisibility(View.VISIBLE);
|
||||||
if (isSaver&&aSave==1) {
|
if (isSaver) {
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.GATHER_GET_MAP;
|
obtain.what = Constant.GATHER_GET_MAP;
|
||||||
obtain.obj = poiListEntity;
|
obtain.obj = poiListEntity;
|
||||||
@ -284,8 +547,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable e, int id) {
|
public void onError(Throwable e, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
@ -293,6 +556,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
}).build();
|
}).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String format5(double value) {
|
public static String format5(double value) {
|
||||||
return String.format("%.2f", value).toString();
|
return String.format("%.2f", value).toString();
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,7 @@ import com.navinfo.outdoor.api.Constant;
|
|||||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||||
import com.navinfo.outdoor.bean.Info;
|
import com.navinfo.outdoor.bean.Info;
|
||||||
import com.navinfo.outdoor.bean.NameAuthenticationBean;
|
import com.navinfo.outdoor.bean.NameAuthenticationBean;
|
||||||
|
import com.navinfo.outdoor.bean.OtherUploadPicBean;
|
||||||
import com.navinfo.outdoor.bean.PoiBean;
|
import com.navinfo.outdoor.bean.PoiBean;
|
||||||
import com.navinfo.outdoor.bean.PoiSaveBean;
|
import com.navinfo.outdoor.bean.PoiSaveBean;
|
||||||
import com.navinfo.outdoor.http.Callback;
|
import com.navinfo.outdoor.http.Callback;
|
||||||
@ -91,9 +92,10 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
private RelativeLayout linearExist;
|
private RelativeLayout linearExist;
|
||||||
private Spinner spinnerExist;
|
private Spinner spinnerExist;
|
||||||
|
|
||||||
private ArrayList<File> otheruploadList;
|
|
||||||
private String takePhotoPath;
|
private String takePhotoPath;
|
||||||
private String takePhotoPath2;
|
private String takePhotoPath2;
|
||||||
|
private int body;
|
||||||
|
|
||||||
public static OtherFragment newInstance(Bundle bundle) {
|
public static OtherFragment newInstance(Bundle bundle) {
|
||||||
OtherFragment fragment = new OtherFragment();
|
OtherFragment fragment = new OtherFragment();
|
||||||
@ -182,10 +184,18 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
checkPot.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
checkPot.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
Message obtain = Message.obtain();
|
if (isChecked){
|
||||||
obtain.what = Constant.MAIN_OTHER;
|
Message obtain = Message.obtain();
|
||||||
obtain.obj = isChecked;
|
obtain.what = Constant.MAIN_OTHER;
|
||||||
EventBus.getDefault().post(obtain);
|
obtain.obj = latLng;
|
||||||
|
EventBus.getDefault().post(obtain);
|
||||||
|
}else {
|
||||||
|
Message obtain = Message.obtain();
|
||||||
|
obtain.what = Constant.MAIN_CHECKED_OTHER;
|
||||||
|
obtain.obj = true;
|
||||||
|
EventBus.getDefault().post(obtain);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
editTaskName = findViewById(R.id.et_task_name);
|
editTaskName = findViewById(R.id.et_task_name);
|
||||||
@ -299,9 +309,8 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
public void onGranted(List<String> permissions, boolean all) {
|
public void onGranted(List<String> permissions, boolean all) {
|
||||||
if (all) {
|
if (all) {
|
||||||
//保存数据库:
|
//保存数据库:
|
||||||
PoiEntity poiEntity = new PoiEntity();
|
PoiEntity poiEntity = showPoiEntity;
|
||||||
List<Info> infoList = new ArrayList<>();
|
List<Info> infoList = new ArrayList<>();
|
||||||
|
|
||||||
String name = editTaskName.getText().toString().trim();//名称
|
String name = editTaskName.getText().toString().trim();//名称
|
||||||
if (name == null || name.equals("")) {
|
if (name == null || name.equals("")) {
|
||||||
Toast.makeText(getActivity(), "请输入poi 名称", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "请输入poi 名称", Toast.LENGTH_SHORT).show();
|
||||||
@ -314,6 +323,8 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
String encode = Geohash.getInstance().encode(latLng.latitude,latLng.longitude);
|
||||||
|
poiEntity.setGeoWkt(encode);
|
||||||
poiEntity.setX(String.valueOf(latLng.longitude));
|
poiEntity.setX(String.valueOf(latLng.longitude));
|
||||||
poiEntity.setY(String.valueOf(latLng.latitude));
|
poiEntity.setY(String.valueOf(latLng.latitude));
|
||||||
}
|
}
|
||||||
@ -338,11 +349,6 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
} else {
|
} else {
|
||||||
infoList.add(new Info(tagPictures));
|
infoList.add(new Info(tagPictures));
|
||||||
}
|
}
|
||||||
if (showPoiEntity != null) {
|
|
||||||
if (showPoiEntity.getTaskId() != 0) {
|
|
||||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
poiEntity.setStation_type(station_type);
|
poiEntity.setStation_type(station_type);
|
||||||
poiEntity.setPhotoInfo(infoList);
|
poiEntity.setPhotoInfo(infoList);
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
@ -361,7 +367,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
otherSaveByNetWork(poiEntity);
|
otherSaveByNetWork(poiEntity);
|
||||||
onBackPressed();
|
// onBackPressed();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
@ -379,43 +385,52 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case R.id.btn_other_uploading:
|
case R.id.btn_other_uploading:
|
||||||
otherUploadByNet();
|
ArrayList<File> otherUploadList = new ArrayList<>();
|
||||||
|
String tagPicture = (String) ivPicture.getTag();
|
||||||
|
if (tagPicture != null) {
|
||||||
|
otherUploadList.add(new File(tagPicture));
|
||||||
|
}
|
||||||
|
String tagPictures = (String) ivPictures.getTag();
|
||||||
|
if (tagPictures != null) {
|
||||||
|
otherUploadList.add(new File(tagPictures));
|
||||||
|
}
|
||||||
|
if (body!=0){
|
||||||
|
otherUploadByNet(body,otherUploadList);
|
||||||
|
}else {
|
||||||
|
Toast.makeText(getActivity(), "请保存本地", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void otherUploadByNet() {
|
private void otherUploadByNet(int body, List<File> otherUploadList) {
|
||||||
showLoadingDialog();
|
if (body == 0 ){
|
||||||
otheruploadList = new ArrayList<>();
|
Toast.makeText(getActivity(), "没有保存不能上传", Toast.LENGTH_SHORT).show();
|
||||||
File otherUploadFile = new File(takePhotoPath);
|
|
||||||
File otherUploadFile2 = new File(takePhotoPath2);
|
|
||||||
if (!otherUploadFile.exists() || !otherUploadFile2.exists()) {
|
|
||||||
Toast.makeText(getContext(), "照片不能为空", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
otheruploadList.add(otherUploadFile);
|
showLoadingDialog();
|
||||||
otheruploadList.add(otherUploadFile2);
|
|
||||||
OkGo
|
OkGo
|
||||||
// 请求方式和请求url
|
// 请求方式和请求url
|
||||||
.<NameAuthenticationBean>post(HttpInterface.USER_AUTH_ADD)
|
.<OtherUploadPicBean>post(HttpInterface.OTHER_TASK_UPLOAD_PIC)
|
||||||
// 请求的 tag, 主要用于取消对应的请求
|
// 请求的 tag, 主要用于取消对应的请求
|
||||||
.params("userid", "1")
|
.params("auditId", body)
|
||||||
.addFileParams("file", otheruploadList)
|
.addFileParams("file", otherUploadList)
|
||||||
.tag(this)
|
.tag(this)
|
||||||
.execute(new DialogCallback<NameAuthenticationBean>(NameAuthenticationBean.class) {
|
.execute(new DialogCallback<OtherUploadPicBean>(OtherUploadPicBean.class) {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Response<NameAuthenticationBean> response) {
|
public void onSuccess(Response<OtherUploadPicBean> response) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
|
Toast.makeText(getActivity(), "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
|
Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Response<NameAuthenticationBean> response) {
|
public void onError(Response<OtherUploadPicBean> response) {
|
||||||
super.onError(response);
|
super.onError(response);
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
Toast.makeText(getActivity(), response.message(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), response.code()+"", Toast.LENGTH_SHORT).show();
|
||||||
Log.d("TAG", "onError: " + response.message());
|
Log.d("TAG", "onError: " + response.code());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -427,9 +442,8 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
httpParams.put("type", poiEntity.getStation_type());
|
httpParams.put("type", poiEntity.getStation_type());
|
||||||
httpParams.put("taskId", poiEntity.getTaskId());
|
httpParams.put("taskId", poiEntity.getTaskId());
|
||||||
httpParams.put("name", poiEntity.getName());
|
httpParams.put("name", poiEntity.getName());
|
||||||
httpParams.put("existence", "1");
|
httpParams.put("existence", poiEntity.getExistence());
|
||||||
String encode = Geohash.getInstance().encode(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX()));
|
httpParams.put("geo", poiEntity.getGeoWkt());
|
||||||
httpParams.put("geo", encode);
|
|
||||||
httpParams.put("memo", poiEntity.getMemo());
|
httpParams.put("memo", poiEntity.getMemo());
|
||||||
|
|
||||||
OkGoBuilder.getInstance()
|
OkGoBuilder.getInstance()
|
||||||
@ -443,6 +457,8 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
public void onSuccess(PoiSaveBean poiSaveBean, int id) {
|
public void onSuccess(PoiSaveBean poiSaveBean, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
|
||||||
|
body = poiSaveBean.getBody();
|
||||||
|
Log.d("TAG", " 其他其他其他其他"+poiSaveBean.getBody());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -466,7 +482,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
//获取Editor对象
|
//获取Editor对象
|
||||||
SharedPreferences.Editor edit = poi.edit();
|
SharedPreferences.Editor edit = poi.edit();
|
||||||
//根据要保存的数据的类型,调用对应的put方法,
|
//根据要保存的数据的类型,调用对应的put方法,
|
||||||
PoiEntity poiEntity = new PoiEntity();
|
PoiEntity poiEntity =showPoiEntity;
|
||||||
ArrayList<Info> arrayList = new ArrayList<>();
|
ArrayList<Info> arrayList = new ArrayList<>();
|
||||||
String name = editTaskName.getText().toString().trim();//名称
|
String name = editTaskName.getText().toString().trim();//名称
|
||||||
if (name != null && !name.equals("")) {
|
if (name != null && !name.equals("")) {
|
||||||
|
@ -49,6 +49,7 @@ import com.navinfo.outdoor.api.Constant;
|
|||||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||||
import com.navinfo.outdoor.bean.Info;
|
import com.navinfo.outdoor.bean.Info;
|
||||||
import com.navinfo.outdoor.bean.NameAuthenticationBean;
|
import com.navinfo.outdoor.bean.NameAuthenticationBean;
|
||||||
|
import com.navinfo.outdoor.bean.OtherUploadPicBean;
|
||||||
import com.navinfo.outdoor.bean.PoiBean;
|
import com.navinfo.outdoor.bean.PoiBean;
|
||||||
import com.navinfo.outdoor.bean.PoiSaveBean;
|
import com.navinfo.outdoor.bean.PoiSaveBean;
|
||||||
import com.navinfo.outdoor.http.Callback;
|
import com.navinfo.outdoor.http.Callback;
|
||||||
@ -70,6 +71,7 @@ import java.io.File;
|
|||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -98,16 +100,17 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
private CheckBox checkBoxRight;
|
private CheckBox checkBoxRight;
|
||||||
private PoiEntity showPoiEntity;
|
private PoiEntity showPoiEntity;
|
||||||
private LatLng latLng;
|
private LatLng latLng;
|
||||||
String[] spinner = new String[]{"存在","不存在","无法验证"};
|
String[] spinner = new String[]{"存在", "不存在", "无法验证"};
|
||||||
private RelativeLayout linearExist;
|
private RelativeLayout linearExist;
|
||||||
private Spinner spinnerExist;
|
private Spinner spinnerExist;
|
||||||
private ArrayList<File> poiUploadList;
|
|
||||||
//获取的拍照图片
|
//获取的拍照图片
|
||||||
private String takePhotoPath2;
|
private String takePhotoPath2;
|
||||||
private String takePhotoPath5;
|
private String takePhotoPath5;
|
||||||
private String takePhotoPath4;
|
private String takePhotoPath4;
|
||||||
private String takePhotoPath3;
|
private String takePhotoPath3;
|
||||||
private String takePhotoPath1;
|
private String takePhotoPath1;
|
||||||
|
private Integer body;
|
||||||
|
|
||||||
public static PoiFragment newInstance(Bundle bundle) {
|
public static PoiFragment newInstance(Bundle bundle) {
|
||||||
PoiFragment fragment = new PoiFragment();
|
PoiFragment fragment = new PoiFragment();
|
||||||
@ -172,10 +175,18 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
checkBoxLife.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
checkBoxLife.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
Message obtain = Message.obtain();
|
if (isChecked) {
|
||||||
obtain.what = Constant.TREASURE_WORD;
|
Message obtain = Message.obtain();
|
||||||
obtain.obj = isChecked;
|
obtain.what = Constant.TREASURE_WORD;
|
||||||
EventBus.getDefault().post(obtain);
|
obtain.obj = latLng;
|
||||||
|
EventBus.getDefault().post(obtain);
|
||||||
|
} else {
|
||||||
|
Message obtain = Message.obtain();
|
||||||
|
obtain.what = Constant.TREASURE_CHECKED_WORD;
|
||||||
|
obtain.obj = true;
|
||||||
|
EventBus.getDefault().post(obtain);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
checkBoxRight.setVisibility(View.GONE);
|
checkBoxRight.setVisibility(View.GONE);
|
||||||
@ -269,54 +280,54 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
private void initShowPoi() {
|
private void initShowPoi() {
|
||||||
// 添加信息:
|
// 添加信息:
|
||||||
showPoiEntity = (PoiEntity) getArguments().getSerializable("poiEntity");
|
showPoiEntity = (PoiEntity) getArguments().getSerializable("poiEntity");
|
||||||
if (showPoiEntity != null) {
|
String name = showPoiEntity.getName();//名称
|
||||||
String name = showPoiEntity.getName();//名称
|
if (name != null && !name.equals("")) {
|
||||||
if (name != null && !name.equals("")) {
|
editNameContent.setText(name + "");
|
||||||
editNameContent.setText(name + "");
|
}
|
||||||
}
|
String address = showPoiEntity.getAddress();//地址
|
||||||
String address = showPoiEntity.getAddress();//地址
|
if (address != null && !address.equals("")) {
|
||||||
if (address != null && !address.equals("")) {
|
editSiteContent.setText(address);
|
||||||
editSiteContent.setText(address);
|
}
|
||||||
}
|
String x = showPoiEntity.getX();
|
||||||
String x = showPoiEntity.getX();
|
String y = showPoiEntity.getY();
|
||||||
String y = showPoiEntity.getY();
|
if (x != null && y != null) {
|
||||||
if (x != null && y != null) {
|
latLng = new LatLng();
|
||||||
latLng = new LatLng();
|
latLng.setLatitude(Double.parseDouble(y));
|
||||||
latLng.setLatitude(Double.parseDouble(y));
|
latLng.setLongitude(Double.parseDouble(x));
|
||||||
latLng.setLongitude(Double.parseDouble(x));
|
}
|
||||||
}
|
String describe = showPoiEntity.getDescribe();//任务描述
|
||||||
String describe = showPoiEntity.getDescribe();//任务描述
|
if (describe != null && !describe.equals("")) {
|
||||||
if (describe != null && !describe.equals("")) {
|
editDescribe.setText(describe);
|
||||||
editDescribe.setText(describe);
|
}
|
||||||
}
|
String telPhone = showPoiEntity.getTelPhone();
|
||||||
String telPhone = showPoiEntity.getTelPhone();
|
if (telPhone != null && !telPhone.equals("")) {
|
||||||
if (telPhone != null && !telPhone.equals("")) {
|
phoneData.add(showPoiEntity.getTelPhone());
|
||||||
phoneData.add(showPoiEntity.getTelPhone());
|
poiBeans.add(new PoiBean("电话*", telPhone, R.drawable.icon_add_bg));
|
||||||
poiBeans.add(new PoiBean("电话*", telPhone, R.drawable.icon_add_bg));
|
|
||||||
poiRecycleAdapter.setList(poiBeans);
|
|
||||||
|
|
||||||
}
|
} else {
|
||||||
linearExist.setVisibility(View.VISIBLE);
|
poiBeans.add(new PoiBean("电话*", "", R.drawable.icon_add_bg));
|
||||||
if (showPoiEntity.getPhotoInfo() != null) {
|
}
|
||||||
for (int i = 0; i < showPoiEntity.getPhotoInfo().size(); i++) {
|
poiRecycleAdapter.setList(poiBeans);
|
||||||
String photo = showPoiEntity.getPhotoInfo().get(i).getPhoto();
|
linearExist.setVisibility(View.VISIBLE);
|
||||||
String[] split = photo.split("/");
|
if (showPoiEntity.getPhotoInfo() != null) {
|
||||||
if (split[split.length - 1].startsWith("a")) {
|
for (int i = 0; i < showPoiEntity.getPhotoInfo().size(); i++) {
|
||||||
Glide.with(getActivity()).load(photo).into(ivPanorama);
|
String photo = showPoiEntity.getPhotoInfo().get(i).getPhoto();
|
||||||
ivPanorama.setTag(photo);
|
String[] split = photo.split("/");
|
||||||
} else if (split[split.length - 1].startsWith("b")) {
|
if (split[split.length - 1].startsWith("a")) {
|
||||||
Glide.with(getActivity()).load(photo).into(ivName);
|
Glide.with(getActivity()).load(photo).into(ivPanorama);
|
||||||
ivName.setTag(photo);
|
ivPanorama.setTag(photo);
|
||||||
} else if (split[split.length - 1].startsWith("c")) {
|
} else if (split[split.length - 1].startsWith("b")) {
|
||||||
Glide.with(getActivity()).load(photo).into(ivInternal);
|
Glide.with(getActivity()).load(photo).into(ivName);
|
||||||
ivInternal.setTag(photo);
|
ivName.setTag(photo);
|
||||||
} else if (split[split.length - 1].startsWith("d")) {
|
} else if (split[split.length - 1].startsWith("c")) {
|
||||||
Glide.with(getActivity()).load(photo).into(ivCard);
|
Glide.with(getActivity()).load(photo).into(ivInternal);
|
||||||
ivCard.setTag(photo);
|
ivInternal.setTag(photo);
|
||||||
} else if (split[split.length - 1].startsWith("e")) {
|
} else if (split[split.length - 1].startsWith("d")) {
|
||||||
Glide.with(getActivity()).load(photo).into(ivElse);
|
Glide.with(getActivity()).load(photo).into(ivCard);
|
||||||
ivElse.setTag(photo);
|
ivCard.setTag(photo);
|
||||||
}
|
} else if (split[split.length - 1].startsWith("e")) {
|
||||||
|
Glide.with(getActivity()).load(photo).into(ivElse);
|
||||||
|
ivElse.setTag(photo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -371,7 +382,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
public void onGranted(List<String> permissions, boolean all) {
|
public void onGranted(List<String> permissions, boolean all) {
|
||||||
if (all) {
|
if (all) {
|
||||||
//保存数据库:
|
//保存数据库:
|
||||||
PoiEntity poiEntity = new PoiEntity();
|
PoiEntity poiEntity = showPoiEntity;
|
||||||
ArrayList<Info> infoPhoto = new ArrayList<>();
|
ArrayList<Info> infoPhoto = new ArrayList<>();
|
||||||
String name = editNameContent.getText().toString().trim();//名称
|
String name = editNameContent.getText().toString().trim();//名称
|
||||||
if (name == null || name.equals("")) {
|
if (name == null || name.equals("")) {
|
||||||
@ -391,6 +402,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
String encode = Geohash.getInstance().encode(latLng.latitude,latLng.longitude);
|
||||||
|
poiEntity.setGeoWkt(encode);
|
||||||
poiEntity.setX(String.valueOf(latLng.longitude));
|
poiEntity.setX(String.valueOf(latLng.longitude));
|
||||||
poiEntity.setY(String.valueOf(latLng.latitude));
|
poiEntity.setY(String.valueOf(latLng.latitude));
|
||||||
}
|
}
|
||||||
@ -434,11 +447,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
if (tagCard != null) {
|
if (tagCard != null) {
|
||||||
infoPhoto.add(new Info(tagCard));
|
infoPhoto.add(new Info(tagCard));
|
||||||
}
|
}
|
||||||
if (showPoiEntity!=null){
|
|
||||||
if (showPoiEntity.getTaskId()!=0){
|
|
||||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
poiEntity.setPhotoInfo(infoPhoto);
|
poiEntity.setPhotoInfo(infoPhoto);
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
@ -455,7 +463,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
poiSaveByNet(poiEntity);
|
poiSaveByNet(poiEntity);
|
||||||
onBackPressed();
|
// onBackPressed();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
@ -477,7 +485,29 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
obtain.what = Constant.TREASURE_FRAGMENT;
|
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||||
obtain.obj = false;
|
obtain.obj = false;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
poiUploadByNetWork();
|
ArrayList<File> poiPicList = new ArrayList<>();
|
||||||
|
String tagPanorama = (String) ivPanorama.getTag();
|
||||||
|
if (tagPanorama != null) {
|
||||||
|
poiPicList.add(new File(tagPanorama));
|
||||||
|
}
|
||||||
|
String tagName = (String) ivName.getTag();
|
||||||
|
if (tagName!= null) {
|
||||||
|
poiPicList.add(new File(tagName));
|
||||||
|
}
|
||||||
|
|
||||||
|
String tagInternal = (String) ivInternal.getTag();
|
||||||
|
if (tagInternal != null) {
|
||||||
|
poiPicList.add(new File(tagInternal));
|
||||||
|
}
|
||||||
|
String tagElse = (String) ivElse.getTag();
|
||||||
|
if (tagElse != null) {
|
||||||
|
poiPicList.add(new File(tagElse));
|
||||||
|
}
|
||||||
|
String tagCard = (String) ivCard.getTag();
|
||||||
|
if (tagCard != null) {
|
||||||
|
poiPicList.add(new File(tagCard));
|
||||||
|
}
|
||||||
|
poiUploadByNetWork(body,poiPicList);
|
||||||
break;
|
break;
|
||||||
case R.id.tv_examine:
|
case R.id.tv_examine:
|
||||||
Toast.makeText(getContext(), editNameContent.getText().toString(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), editNameContent.getText().toString(), Toast.LENGTH_SHORT).show();
|
||||||
@ -506,68 +536,47 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void poiUploadByNetWork() {
|
private void poiUploadByNetWork(int body, ArrayList<File> poiPicList) {
|
||||||
poiUploadList = new ArrayList<>();
|
if (body==0){
|
||||||
File poiUploadFile1 = new File(takePhotoPath1);
|
Toast.makeText(getActivity(), "没有保存本地", Toast.LENGTH_SHORT).show();
|
||||||
File poiUploadFile2 = new File(takePhotoPath2);
|
Log.e("TAG", "poiUploadByNetWork: "+body+poiPicList);
|
||||||
File poiUploadFile3 = new File(takePhotoPath3);
|
return;
|
||||||
File poiUploadFile4 = new File(takePhotoPath4);
|
|
||||||
File poiUploadFile5 = new File(takePhotoPath5);
|
|
||||||
if (!poiUploadFile1.exists()||!poiUploadFile2.exists()||!poiUploadFile3.exists()||!poiUploadFile4.exists()||!poiUploadFile5.exists()){
|
|
||||||
Toast.makeText(getActivity(), "照片不能为空", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
poiUploadList.add(poiUploadFile1);
|
|
||||||
poiUploadList.add(poiUploadFile2);
|
|
||||||
poiUploadList.add(poiUploadFile3);
|
|
||||||
poiUploadList.add(poiUploadFile4);
|
|
||||||
poiUploadList.add(poiUploadFile5);
|
|
||||||
OkGo
|
OkGo
|
||||||
// 请求方式和请求url
|
// 请求方式和请求url
|
||||||
.<NameAuthenticationBean>post(HttpInterface.USER_AUTH_ADD)
|
.<OtherUploadPicBean>post(HttpInterface.POI_TASK_UPLOAD_PIC)
|
||||||
// 请求的 tag, 主要用于取消对应的请求
|
// 请求的 tag, 主要用于取消对应的请求
|
||||||
.params("auditId", "1")
|
.params("auditId", body)
|
||||||
.addFileParams("file",poiUploadList)
|
.addFileParams("file",poiPicList)
|
||||||
.tag(this)
|
.tag(this)
|
||||||
.execute(new DialogCallback<NameAuthenticationBean>(NameAuthenticationBean.class) {
|
.execute(new DialogCallback<OtherUploadPicBean>(OtherUploadPicBean.class) {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Response<NameAuthenticationBean> response) {
|
public void onSuccess(Response<OtherUploadPicBean> otherUploadPicBeanResponse) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
|
Toast.makeText(getActivity(), "上传成功", Toast.LENGTH_SHORT).show();
|
||||||
|
Log.d("TAG", "onSuccess: " + otherUploadPicBeanResponse.toString() + "sssssssssssss");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Response<NameAuthenticationBean> response) {
|
public void onError(Response<OtherUploadPicBean> response) {
|
||||||
super.onError(response);
|
super.onError(response);
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
Toast.makeText(getActivity(), response.message(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), response.code()+"", Toast.LENGTH_SHORT).show();
|
||||||
Log.d("TAG", "onError: " + response.message());
|
Log.d("TAG", "onError: " + response.code()+"");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void poiSaveByNet(PoiEntity poiEntity) {
|
private void poiSaveByNet(PoiEntity poiEntity) {
|
||||||
showLoadingDialog();
|
showLoadingDialog();
|
||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
if (poiEntity.getTaskId() != 0) {
|
|
||||||
httpParams.put("taskId", poiEntity.getTaskId());
|
httpParams.put("taskId", poiEntity.getTaskId());
|
||||||
}
|
|
||||||
if (poiEntity.getName() != null && !poiEntity.getName().equals("")) {
|
|
||||||
httpParams.put("name", poiEntity.getName());
|
httpParams.put("name", poiEntity.getName());
|
||||||
}
|
|
||||||
if (poiEntity.getAddress() != null && !poiEntity.getAddress().equals("")) {
|
|
||||||
httpParams.put("address", poiEntity.getAddress());
|
httpParams.put("address", poiEntity.getAddress());
|
||||||
}
|
httpParams.put("existence", poiEntity.getExistence());
|
||||||
httpParams.put("existence", "1");
|
httpParams.put("geo", poiEntity.getGeoWkt());
|
||||||
if (poiEntity.getY() != null && poiEntity.getX() != null) {
|
|
||||||
String encode = Geohash.getInstance().encode(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX()));
|
|
||||||
httpParams.put("geo", encode);
|
|
||||||
}
|
|
||||||
if (poiEntity.getMemo() != null) {
|
|
||||||
httpParams.put("memo", poiEntity.getMemo());
|
httpParams.put("memo", poiEntity.getMemo());
|
||||||
}
|
|
||||||
|
|
||||||
OkGoBuilder.getInstance()
|
OkGoBuilder.getInstance()
|
||||||
.Builder(getActivity())
|
.Builder(getActivity())
|
||||||
.url(HttpInterface.SUBMIT_POI_TASK)
|
.url(HttpInterface.SUBMIT_POI_TASK)
|
||||||
@ -578,7 +587,10 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(PoiSaveBean poiSaveBean, int id) {
|
public void onSuccess(PoiSaveBean poiSaveBean, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
|
|
||||||
|
body = poiSaveBean.getBody();
|
||||||
|
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
|
||||||
|
Log.d("TAG", "onSuccess: "+poiSaveBean.getBody());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -603,7 +615,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
SharedPreferences.Editor edit = poi.edit();
|
SharedPreferences.Editor edit = poi.edit();
|
||||||
//根据要保存的数据的类型,调用对应的put方法,
|
//根据要保存的数据的类型,调用对应的put方法,
|
||||||
|
|
||||||
PoiEntity poiEntity = new PoiEntity();
|
PoiEntity poiEntity = showPoiEntity;
|
||||||
ArrayList<Info> infoPhoto = new ArrayList<>();
|
ArrayList<Info> infoPhoto = new ArrayList<>();
|
||||||
String name = editNameContent.getText().toString().trim();//名称
|
String name = editNameContent.getText().toString().trim();//名称
|
||||||
if (name != null && !name.equals("")) {
|
if (name != null && !name.equals("")) {
|
||||||
@ -644,8 +656,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
if (tagCard != null && !tagCard.equals("")) {
|
if (tagCard != null && !tagCard.equals("")) {
|
||||||
infoPhoto.add(new Info(tagCard));
|
infoPhoto.add(new Info(tagCard));
|
||||||
}
|
}
|
||||||
if (showPoiEntity!=null){
|
if (showPoiEntity != null) {
|
||||||
if (showPoiEntity.getTaskId()!=0){
|
if (showPoiEntity.getTaskId() != 0) {
|
||||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,6 +60,7 @@ import com.tencent.map.geolocation.TencentLocation;
|
|||||||
import com.tencent.tencentmap.mapsdk.maps.CameraUpdate;
|
import com.tencent.tencentmap.mapsdk.maps.CameraUpdate;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.CameraUpdateFactory;
|
import com.tencent.tencentmap.mapsdk.maps.CameraUpdateFactory;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.MapView;
|
import com.tencent.tencentmap.mapsdk.maps.MapView;
|
||||||
|
import com.tencent.tencentmap.mapsdk.maps.Projection;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.TencentMap;
|
import com.tencent.tencentmap.mapsdk.maps.TencentMap;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.UiSettings;
|
import com.tencent.tencentmap.mapsdk.maps.UiSettings;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.interfaces.Removable;
|
import com.tencent.tencentmap.mapsdk.maps.interfaces.Removable;
|
||||||
@ -102,7 +103,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
private ImageView ivRefish;
|
private ImageView ivRefish;
|
||||||
private SlidingUpPanelLayout sliding_layout;
|
private SlidingUpPanelLayout sliding_layout;
|
||||||
private FragmentTransaction fragmentTransaction;
|
private FragmentTransaction fragmentTransaction;
|
||||||
private Marker marker;
|
private Marker markerPoi;
|
||||||
private CheckBox cbFootType;
|
private CheckBox cbFootType;
|
||||||
private ImageView ivFilter;
|
private ImageView ivFilter;
|
||||||
private Point screenPosition; //marker的屏幕坐标
|
private Point screenPosition; //marker的屏幕坐标
|
||||||
@ -233,6 +234,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
JobSearchBean.BodyBean.ListBean listBean = (JobSearchBean.BodyBean.ListBean) marker.getTag();
|
JobSearchBean.BodyBean.ListBean listBean = (JobSearchBean.BodyBean.ListBean) marker.getTag();
|
||||||
PoiEntity poiListEntity = new PoiEntity();
|
PoiEntity poiListEntity = new PoiEntity();
|
||||||
poiListEntity.setTaskId(listBean.getId());
|
poiListEntity.setTaskId(listBean.getId());
|
||||||
|
poiListEntity.setGeoWkt(listBean.getGeo());
|
||||||
poiListEntity.setName(listBean.getName());
|
poiListEntity.setName(listBean.getName());
|
||||||
poiListEntity.setAddress(listBean.getAddress());
|
poiListEntity.setAddress(listBean.getAddress());
|
||||||
poiListEntity.setTelPhone(listBean.getTelephone() + "");
|
poiListEntity.setTelPhone(listBean.getTelephone() + "");
|
||||||
@ -253,6 +255,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
JobSearchBean.BodyBean.ListBean listBean = (JobSearchBean.BodyBean.ListBean) marker.getTag();
|
JobSearchBean.BodyBean.ListBean listBean = (JobSearchBean.BodyBean.ListBean) marker.getTag();
|
||||||
PoiEntity poiListEntity = new PoiEntity();
|
PoiEntity poiListEntity = new PoiEntity();
|
||||||
poiListEntity.setTaskId(listBean.getId());
|
poiListEntity.setTaskId(listBean.getId());
|
||||||
|
poiListEntity.setGeoWkt(listBean.getGeo());
|
||||||
poiListEntity.setName(listBean.getName());
|
poiListEntity.setName(listBean.getName());
|
||||||
poiListEntity.setAddress(listBean.getAddress());
|
poiListEntity.setAddress(listBean.getAddress());
|
||||||
poiListEntity.setTelPhone(listBean.getTelephone() + "");
|
poiListEntity.setTelPhone(listBean.getTelephone() + "");
|
||||||
@ -278,8 +281,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initList(TencentLocation tencentLocation) {
|
private void initList(TencentLocation tencentLocation) {
|
||||||
int task_type=Constant.TASK_TYPE;
|
int task_type = Constant.TASK_TYPE;
|
||||||
int limit_type=Constant.LIMIT_TTPE;
|
int limit_type = Constant.LIMIT_TTPE;
|
||||||
int taskStatus = Constant.TASK_STASTUS;
|
int taskStatus = Constant.TASK_STASTUS;
|
||||||
if (taskStatus == 1 || taskStatus == 2) {
|
if (taskStatus == 1 || taskStatus == 2) {
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
@ -305,8 +308,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
.params("date", date)
|
.params("date", date)
|
||||||
.params("pageSize", Constant.NUMBER)
|
.params("pageSize", Constant.NUMBER)
|
||||||
.params("pageNum", "1")
|
.params("pageNum", "1")
|
||||||
.params("type",task_type)
|
.params("type", task_type)
|
||||||
.params("isExclusive",limit_type)
|
.params("isExclusive", limit_type)
|
||||||
// .client(new OkHttpClient())
|
// .client(new OkHttpClient())
|
||||||
.execute(new DialogCallback<JobSearchBean>(JobSearchBean.class) {
|
.execute(new DialogCallback<JobSearchBean>(JobSearchBean.class) {
|
||||||
@Override
|
@Override
|
||||||
@ -365,7 +368,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
}
|
}
|
||||||
switch (Integer.valueOf(list.get(i).getType())) {
|
switch (Integer.valueOf(list.get(i).getType())) {
|
||||||
case 1://poi
|
case 1://poi
|
||||||
Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.POI_ICON).alpha(0.5f)
|
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bg);
|
||||||
|
Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor).alpha(0.7f)
|
||||||
.flat(true)
|
.flat(true)
|
||||||
.clockwise(false));
|
.clockwise(false));
|
||||||
poiMarker.setTag(listBean);
|
poiMarker.setTag(listBean);
|
||||||
@ -373,7 +377,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
poiMarker.setClickable(true);
|
poiMarker.setClickable(true);
|
||||||
break;
|
break;
|
||||||
case 2://充电站
|
case 2://充电站
|
||||||
Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.STATION_ICON).alpha(0.7f)
|
BitmapDescriptor chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bg);
|
||||||
|
Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(chargeDescriptor).alpha(0.7f)
|
||||||
.flat(true)
|
.flat(true)
|
||||||
.clockwise(false));
|
.clockwise(false));
|
||||||
stationMarker.setTag(listBean);
|
stationMarker.setTag(listBean);
|
||||||
@ -381,9 +386,17 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
stationMarker.setClickable(true);
|
stationMarker.setClickable(true);
|
||||||
break;
|
break;
|
||||||
case 3://poi录像
|
case 3://poi录像
|
||||||
|
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_bg);
|
||||||
|
Marker poiVideoMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiVideoDescriptor).alpha(0.7f)
|
||||||
|
.flat(true)
|
||||||
|
.clockwise(false));
|
||||||
|
poiVideoMarker.setTag(listBean);
|
||||||
|
removables.add(poiVideoMarker);
|
||||||
|
poiVideoMarker.setClickable(true);
|
||||||
break;
|
break;
|
||||||
case 4://道路录像
|
case 4://道路录像
|
||||||
Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.ROAD_ICON).alpha(0.7f)
|
BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bg);
|
||||||
|
Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor).alpha(0.7f)
|
||||||
.flat(true)
|
.flat(true)
|
||||||
.clockwise(false));
|
.clockwise(false));
|
||||||
roadMarker.setTag(listBean);
|
roadMarker.setTag(listBean);
|
||||||
@ -391,9 +404,17 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
roadMarker.setClickable(true);
|
roadMarker.setClickable(true);
|
||||||
break;
|
break;
|
||||||
case 5://其他
|
case 5://其他
|
||||||
|
BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg);
|
||||||
|
Marker otherMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(otherDescriptor).alpha(0.7f)
|
||||||
|
.flat(true)
|
||||||
|
.clockwise(false));
|
||||||
|
otherMarker.setTag(listBean);
|
||||||
|
removables.add(otherMarker);
|
||||||
|
otherMarker.setClickable(true);
|
||||||
break;
|
break;
|
||||||
case 6://面状任务
|
case 6://面状任务
|
||||||
Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.PLANAR_TASK_ICON).alpha(0.7f)
|
BitmapDescriptor Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg);
|
||||||
|
Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Descriptor).alpha(0.7f)
|
||||||
.flat(true)
|
.flat(true)
|
||||||
.clockwise(false));
|
.clockwise(false));
|
||||||
Log.d("面妆任务", "onSuccess: " + planarMarker);
|
Log.d("面妆任务", "onSuccess: " + planarMarker);
|
||||||
@ -447,8 +468,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -464,12 +483,70 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
showAllPoi.clear();
|
showAllPoi.clear();
|
||||||
showAllPoi.addAll(allTaskStatus);
|
showAllPoi.addAll(allTaskStatus);
|
||||||
for (int i = 0; i < allTaskStatus.size(); i++) {
|
for (int i = 0; i < allTaskStatus.size(); i++) {
|
||||||
LatLng position = new LatLng(Double.valueOf(allTaskStatus.get(i).getY()), Double.valueOf(allTaskStatus.get(i).getX()));
|
PoiEntity poiEntity = allTaskStatus.get(i);
|
||||||
Marker marker = tencentMap.addMarker(new MarkerOptions(position));
|
LatLng latLng = new LatLng(Double.valueOf(allTaskStatus.get(i).getY()), Double.valueOf(allTaskStatus.get(i).getX()));
|
||||||
marker.setClickable(true);
|
switch (Integer.valueOf(poiEntity.getType())) {
|
||||||
marker.setTitle("本地");//1:本地
|
case 1://poi
|
||||||
marker.setTag(allTaskStatus.get(i));
|
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_have_bg);
|
||||||
removablesLocality.add(marker);
|
Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor).alpha(0.7f)
|
||||||
|
.flat(true)
|
||||||
|
.clockwise(false));
|
||||||
|
poiMarker.setClickable(true);
|
||||||
|
poiMarker.setTitle("本地");//1:本地
|
||||||
|
poiMarker.setTag(poiEntity);
|
||||||
|
removablesLocality.add(poiMarker);
|
||||||
|
break;
|
||||||
|
case 2://充电站
|
||||||
|
BitmapDescriptor chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_have_bg);
|
||||||
|
Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(chargeDescriptor).alpha(0.7f)
|
||||||
|
.flat(true)
|
||||||
|
.clockwise(false));
|
||||||
|
stationMarker.setClickable(true);
|
||||||
|
stationMarker.setTitle("本地");//1:本地
|
||||||
|
stationMarker.setTag(poiEntity);
|
||||||
|
removablesLocality.add(stationMarker);
|
||||||
|
break;
|
||||||
|
case 3://poi录像
|
||||||
|
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_have_bg);
|
||||||
|
Marker poiVideoMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiVideoDescriptor).alpha(0.7f)
|
||||||
|
.flat(true)
|
||||||
|
.clockwise(false));
|
||||||
|
poiVideoMarker.setClickable(true);
|
||||||
|
poiVideoMarker.setTitle("本地");//1:本地
|
||||||
|
poiVideoMarker.setTag(poiEntity);
|
||||||
|
removablesLocality.add(poiVideoMarker);
|
||||||
|
break;
|
||||||
|
case 4://道路录像
|
||||||
|
BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_have_bg);
|
||||||
|
Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor).alpha(0.7f)
|
||||||
|
.flat(true)
|
||||||
|
.clockwise(false));
|
||||||
|
roadMarker.setClickable(true);
|
||||||
|
roadMarker.setTitle("本地");//1:本地
|
||||||
|
roadMarker.setTag(poiEntity);
|
||||||
|
removablesLocality.add(roadMarker);
|
||||||
|
break;
|
||||||
|
case 5://其他
|
||||||
|
BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_have_bg);
|
||||||
|
Marker otherMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(otherDescriptor).alpha(0.7f)
|
||||||
|
.flat(true)
|
||||||
|
.clockwise(false));
|
||||||
|
otherMarker.setClickable(true);
|
||||||
|
otherMarker.setTitle("本地");//1:本地
|
||||||
|
otherMarker.setTag(poiEntity);
|
||||||
|
removablesLocality.add(otherMarker);
|
||||||
|
break;
|
||||||
|
case 6://面状任务
|
||||||
|
BitmapDescriptor Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_have_bg);
|
||||||
|
Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Descriptor).alpha(0.7f)
|
||||||
|
.clockwise(false)
|
||||||
|
.flat(true));
|
||||||
|
planarMarker.setClickable(true);
|
||||||
|
planarMarker.setTitle("本地");//1:本地
|
||||||
|
planarMarker.setTag(poiEntity);
|
||||||
|
removablesLocality.add(planarMarker);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.JOB_SEARCH_POI_WORD;
|
obtain.what = Constant.JOB_SEARCH_POI_WORD;
|
||||||
@ -659,20 +736,36 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
List<PoiEntity> poiEntities = (List<PoiEntity>) data.obj;
|
List<PoiEntity> poiEntities = (List<PoiEntity>) data.obj;
|
||||||
initFilterMarker(poiEntities);
|
initFilterMarker(poiEntities);
|
||||||
} else if (data.what == Constant.TREASURE_WORD) { // POI采集-移动位置
|
} else if (data.what == Constant.TREASURE_WORD) { // POI采集-移动位置
|
||||||
initPoiMarker(Boolean.valueOf((Boolean) data.obj), Constant.POI_WORD);
|
initPoiMarker((LatLng) data.obj);
|
||||||
|
} else if (data.what == Constant.TREASURE_CHECKED_WORD) {//poi采集 -确定位置
|
||||||
|
if((boolean)data.obj){
|
||||||
|
initCheckedMarker(Constant.POI_WORD);
|
||||||
|
}
|
||||||
} else if (data.what == Constant.MAIN_CHARGING_STATION) {//充电站采集-移动位置
|
} else if (data.what == Constant.MAIN_CHARGING_STATION) {//充电站采集-移动位置
|
||||||
initPoiMarker(Boolean.valueOf((Boolean) data.obj), Constant.CHARGING_STATION_WORD);
|
initPoiMarker((LatLng) data.obj);
|
||||||
|
} else if (data.what == Constant.MAIN_CHARGING_CHECKED_STATION) {//充电站采集 -确定位置
|
||||||
|
if((boolean)data.obj){
|
||||||
|
initCheckedMarker(Constant.CHARGING_STATION_WORD);
|
||||||
|
}
|
||||||
} else if (data.what == Constant.MAIN_CHARGING_PILE) {//充电桩采集-移动位置
|
} else if (data.what == Constant.MAIN_CHARGING_PILE) {//充电桩采集-移动位置
|
||||||
initPoiMarker(Boolean.valueOf((Boolean) data.obj), Constant.CHARGING_PILE_WORD);
|
initPileMarker((LatLng) data.obj);
|
||||||
|
} else if (data.what == Constant.MAIN_CHARGING_CHECKED_PILE) {//充电桩采集-确定位置
|
||||||
|
if((boolean)data.obj){
|
||||||
|
initCheckedMarker(Constant.CHARGING_PILE_WORD);
|
||||||
|
}
|
||||||
} else if (data.what == Constant.MAIN_OTHER) {//其他采集-移动位置
|
} else if (data.what == Constant.MAIN_OTHER) {//其他采集-移动位置
|
||||||
initPoiMarker(Boolean.valueOf((Boolean) data.obj), Constant.OTHER_WORD);
|
initPoiMarker((LatLng) data.obj);
|
||||||
|
} else if (data.what == Constant.MAIN_CHECKED_OTHER) {//其他采集-确定位置
|
||||||
|
if((boolean)data.obj){
|
||||||
|
initCheckedMarker(Constant.OTHER_WORD);
|
||||||
|
}
|
||||||
} else if (data.what == Constant.TREASURE_FRAGMENT) {
|
} else if (data.what == Constant.TREASURE_FRAGMENT) {
|
||||||
if ((boolean) data.obj == true) {
|
if ((boolean) data.obj == true) {
|
||||||
frameLayout.setVisibility(View.GONE);
|
frameLayout.setVisibility(View.GONE);
|
||||||
sliding_layout.setPanelHeight(0);
|
sliding_layout.setPanelHeight(0);
|
||||||
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
|
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
|
||||||
if (marker != null) {
|
if (markerPoi != null) {
|
||||||
marker.remove();
|
markerPoi.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (data.what == Constant.MAIN_BUTTON_VISIABLE) {
|
} else if (data.what == Constant.MAIN_BUTTON_VISIABLE) {
|
||||||
@ -726,6 +819,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 控制主界面各个按钮的显示状态
|
* 控制主界面各个按钮的显示状态
|
||||||
*/
|
*/
|
||||||
@ -750,24 +844,42 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void initPoiMarker(Boolean t, int aInt) {
|
private void initPoiMarker(LatLng latLng) {
|
||||||
if (t == true) {
|
CameraUpdate cameraSigma = CameraUpdateFactory.newCameraPosition(new CameraPosition(
|
||||||
//移动地图
|
latLng, //中心点坐标,地图目标经纬度
|
||||||
CameraUpdate cameraSigma =
|
tencentMap.getCameraPosition().zoom, //目标缩放级别
|
||||||
CameraUpdateFactory.newCameraPosition(new CameraPosition(
|
tencentMap.getCameraPosition().tilt, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0)
|
||||||
Constant.markerLatlng, //中心点坐标,地图目标经纬度
|
tencentMap.getCameraPosition().bearing)); //目标旋转角 0~360° (正北方为0)
|
||||||
tencentMap.getCameraPosition().zoom, //目标缩放级别
|
tencentMap.animateCamera(cameraSigma, new TencentMap.CancelableCallback() {
|
||||||
tencentMap.getCameraPosition().tilt, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0)
|
@Override
|
||||||
tencentMap.getCameraPosition().bearing)); //目标旋转角 0~360° (正北方为0)
|
public void onFinish() {
|
||||||
|
screenPosition = tencentMap.getProjection().toScreenLocation(latLng);
|
||||||
|
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
|
||||||
|
//创建Marker对象之前,设置属性
|
||||||
|
markerPoi.setFixingPoint(screenPosition.x, screenPosition.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCancel() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
private void initPileMarker(LatLng latLng) {
|
||||||
|
CameraUpdate cameraSigma = CameraUpdateFactory.newCameraPosition(new CameraPosition(
|
||||||
|
latLng, //中心点坐标,地图目标经纬度
|
||||||
|
tencentMap.getCameraPosition().zoom, //目标缩放级别
|
||||||
|
tencentMap.getCameraPosition().tilt, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0)
|
||||||
|
tencentMap.getCameraPosition().bearing)); //目标旋转角 0~360° (正北方为0)
|
||||||
tencentMap.animateCamera(cameraSigma, new TencentMap.CancelableCallback() {
|
tencentMap.animateCamera(cameraSigma, new TencentMap.CancelableCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onFinish() {
|
public void onFinish() {
|
||||||
screenPosition = tencentMap.getProjection().toScreenLocation(Constant.markerLatlng);
|
screenPosition = tencentMap.getProjection().toScreenLocation(latLng);
|
||||||
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
|
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
|
||||||
//创建Marker对象之前,设置属性
|
//创建Marker对象之前,设置属性
|
||||||
LatLng position = Constant.markerLatlng;
|
markerPoi = tencentMap.addMarker(new MarkerOptions(latLng));
|
||||||
marker = tencentMap.addMarker(new MarkerOptions(position));
|
markerPoi.setFixingPoint(screenPosition.x, screenPosition.y);
|
||||||
marker.setFixingPoint(screenPosition.x, screenPosition.y);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -775,28 +887,28 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
}
|
||||||
if (screenPosition != null) {
|
|
||||||
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
|
|
||||||
LatLng latLng = tencentMap.getProjection().fromScreenLocation(screenPosition);
|
|
||||||
marker.setPosition(latLng);
|
|
||||||
marker.setFixingPointEnable(false);
|
|
||||||
Constant.markerLatlng = latLng;
|
|
||||||
Message obtain = Message.obtain();
|
|
||||||
obtain.what = aInt;
|
|
||||||
obtain.obj = latLng;
|
|
||||||
EventBus.getDefault().post(obtain);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
private void initCheckedMarker(int poiWord) {
|
||||||
|
if (screenPosition != null) {
|
||||||
|
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
|
||||||
|
LatLng latLng = tencentMap.getProjection().fromScreenLocation(screenPosition);
|
||||||
|
markerPoi.setPosition(latLng);
|
||||||
|
markerPoi.setFixingPointEnable(false);
|
||||||
|
Constant.markerLatlng = latLng;
|
||||||
|
Message obtain = Message.obtain();
|
||||||
|
obtain.what = poiWord;
|
||||||
|
obtain.obj = latLng;
|
||||||
|
EventBus.getDefault().post(obtain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* 设置定位图标样式
|
* 设置定位图标样式
|
||||||
*/
|
*/
|
||||||
private void setLocMarkerStyle() {
|
private void setLocMarkerStyle() {
|
||||||
locationStyle= new MyLocationStyle();
|
locationStyle = new MyLocationStyle();
|
||||||
locationStyle.myLocationType(MyLocationStyle.LOCATION_TYPE_FOLLOW_NO_CENTER);
|
locationStyle.myLocationType(MyLocationStyle.LOCATION_TYPE_FOLLOW_NO_CENTER);
|
||||||
//创建图标
|
//创建图标
|
||||||
BitmapDescriptor bitmapDescriptor = BitmapDescriptorFactory.fromBitmap(getBitMap(R.drawable.location));
|
BitmapDescriptor bitmapDescriptor = BitmapDescriptorFactory.fromBitmap(getBitMap(R.drawable.location));
|
||||||
@ -871,6 +983,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
treasureMap.onDestroy();
|
treasureMap.onDestroy();
|
||||||
|
markerPoi.remove();
|
||||||
EventBus.getDefault().unregister(this);
|
EventBus.getDefault().unregister(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -913,12 +1026,19 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
itemList.add(new ShareDialog.Item(getContext(), R.drawable.push_road, "道路"));
|
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_chongdianzhuang, "充电站"));
|
||||||
itemList.add(new ShareDialog.Item(getContext(), R.drawable.push_qingbao, "其他"));
|
itemList.add(new ShareDialog.Item(getContext(), R.drawable.push_qingbao, "其他"));
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
PoiEntity poiEntity = new PoiEntity();
|
||||||
|
LatLng mapCenterPoint = getMapCenterPoint();
|
||||||
|
poiEntity.setX(mapCenterPoint.longitude + "");
|
||||||
|
poiEntity.setY(mapCenterPoint.latitude + "");
|
||||||
|
bundle.putSerializable("poiEntity", poiEntity);
|
||||||
ShareDialog.show((AppCompatActivity) getActivity(), itemList, new ShareDialog.OnItemClickListener() {
|
ShareDialog.show((AppCompatActivity) getActivity(), itemList, new ShareDialog.OnItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(ShareDialog shareDialog, int index, ShareDialog.Item item) {
|
public boolean onClick(ShareDialog shareDialog, int index, ShareDialog.Item item) {
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
PoiFragment poiFragment = PoiFragment.newInstance(new Bundle());
|
markerPoi = tencentMap.addMarker(new MarkerOptions(mapCenterPoint));
|
||||||
|
PoiFragment poiFragment = PoiFragment.newInstance(bundle);
|
||||||
showSlidingFragment(poiFragment);
|
showSlidingFragment(poiFragment);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
@ -930,11 +1050,13 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
showSlidingFragment(roadFragment);
|
showSlidingFragment(roadFragment);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(new Bundle());
|
markerPoi = tencentMap.addMarker(new MarkerOptions(mapCenterPoint));
|
||||||
|
ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle);
|
||||||
showSlidingFragment(chargingStationFragment);
|
showSlidingFragment(chargingStationFragment);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
OtherFragment otherFragment = OtherFragment.newInstance(new Bundle());
|
markerPoi = tencentMap.addMarker(new MarkerOptions(mapCenterPoint));
|
||||||
|
OtherFragment otherFragment = OtherFragment.newInstance(bundle);
|
||||||
showSlidingFragment(otherFragment);
|
showSlidingFragment(otherFragment);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -945,8 +1067,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
case R.id.iv_filter:
|
case R.id.iv_filter:
|
||||||
initThread();
|
initThread();
|
||||||
initList(Constant.currentLocation);
|
initList(Constant.currentLocation);
|
||||||
Bundle bundle = new Bundle();
|
FilterFragment filterFragment = FilterFragment.newInstance(new Bundle());
|
||||||
FilterFragment filterFragment = FilterFragment.newInstance(bundle);
|
|
||||||
showSlidingFragment(filterFragment);
|
showSlidingFragment(filterFragment);
|
||||||
break;
|
break;
|
||||||
case R.id.iv_message:
|
case R.id.iv_message:
|
||||||
@ -1076,4 +1197,5 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
return tencentMap.getCameraPosition().target;
|
return tencentMap.getCameraPosition().target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -58,16 +58,49 @@ public class HttpInterface {
|
|||||||
public static final String IPm7 = "http://172.23.139.4:8003/poitask/1/";
|
public static final String IPm7 = "http://172.23.139.4:8003/poitask/1/";
|
||||||
|
|
||||||
//172.23.139.4:8003/poitask/1/receivedPoitask/1
|
//172.23.139.4:8003/poitask/1/receivedPoitask/1
|
||||||
public static final String RECEIVED_POI_TASK = IPm7+"receivedPoitask/1";//poi-领取任务
|
public static final String RECEIVED_POI_TASK = IPm7 + "receivedPoitask/1";//poi-领取任务
|
||||||
|
|
||||||
|
|
||||||
public static final String IPm8 = "http://172.23.139.4:8003/poitask/1/";
|
public static final String IPm8 = "http://172.23.139.4:8003/poitask/1/";
|
||||||
//172.23.139.4:8003/poitask/1/submitPoitask?taskId=5001&name=测试修改名称&address=测试修改地址&existence=1&geo=1rn7exd5uhxy&memo=测试备注
|
//172.23.139.4:8003/poitask/1/submitPoitask?taskId=5001&name=测试修改名称&address=测试修改地址&existence=1&geo=1rn7exd5uhxy&memo=测试备注
|
||||||
|
|
||||||
public static final String SUBMIT_POI_TASK = IPm8+"submitPoitask";//poi-保存本地
|
public static final String SUBMIT_POI_TASK = IPm8 + "submitPoitask";//poi-保存本地
|
||||||
|
|
||||||
public static final String IPm9 = "http://172.23.139.4:8003/othertask/1/";
|
public static final String IPm9 = "http://172.23.139.4:8003/othertask/1/";
|
||||||
//172.23.139.4:8003/othertask/1/submitOhtertask?taskId=5001&name=测试修改名称&address=测试修改地址&existence=1&geo=1rn7exd5uhxy&memo=测试备注
|
//172.23.139.4:8003/othertask/1/submitOhtertask?taskId=5001&name=测试修改名称&address=测试修改地址&existence=1&geo=1rn7exd5uhxy&memo=测试备注
|
||||||
|
|
||||||
public static final String SUBMIT_OTHER_TASK = IPm9+"submitOthertask";//其他-保存本地
|
public static final String SUBMIT_OTHER_TASK = IPm9 + "submitOthertask";//其他-保存本地
|
||||||
|
|
||||||
|
/*172.23.139.4:8003/polygonTask/1/receivedPolygontask/8602
|
||||||
|
172.23.139.4:8003/polygonTask/1/unReceivedPolygontask/8602
|
||||||
|
172.23.139.4:8003/polygonTask/1/complete/8602
|
||||||
|
172.23.139.4:8003/polygonTask/1/submitPolygontask?id=8602*/
|
||||||
|
public static final String IPm10="http://172.23.139.4:8003/polygonTask/1/";
|
||||||
|
|
||||||
|
public static final String RECEIVED_POLYGON_TASK=IPm10+"receivedPolygontask"; //任务领取
|
||||||
|
public static final String UNRECEIVED_POLYGON_TASK=IPm10+"unReceivedPolygontask";//结束领取
|
||||||
|
public static final String COMPLETE=IPm10+"complete";//任务采集
|
||||||
|
public static final String SUBMIT_POLYGON_TASK=IPm10+"submitPolygontask";//结束采集
|
||||||
|
|
||||||
|
|
||||||
|
public static final String IPm11= "http://172.23.139.4:8003/othertask/1/";
|
||||||
|
|
||||||
|
//172.23.139.4:8003/othertask/1/uploadpic
|
||||||
|
public static final String OTHER_TASK_UPLOAD_PIC=IPm11+"uploadpic";//其他-上传
|
||||||
|
|
||||||
|
|
||||||
|
public static final String IPm12= "http://172.23.139.4:8003/ctask/1/";
|
||||||
|
|
||||||
|
//172.23.139.4:8003/ctask/1/receivedCtask/8608
|
||||||
|
public static final String RECEIVED_CTASK=IPm12+"receivedCtask/8608";//充电站-领取任务
|
||||||
|
|
||||||
|
|
||||||
|
//172.23.139.4:8003/ctask/1/submitCtask?id=8608&name=充电站&address=地址&telephone=18812345678|14712345678&geo=1rn7exd5uhxy&memo=测试备注&sptype=1
|
||||||
|
public static final String SUBMIT_CTASK=IPm12+"submitCtask";//充电站-保存本地
|
||||||
|
|
||||||
|
public static final String IPm13= "http://172.23.139.4:8003/poitask/1/";
|
||||||
|
|
||||||
|
//172.23.139.4:8003/poitask/1/uploadpic
|
||||||
|
public static final String POI_TASK_UPLOAD_PIC=IPm13+"uploadpic";//poi-上传
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -25,10 +25,14 @@ public interface PoiDao {
|
|||||||
@Query("SELECT * FROM poi where type=:type")
|
@Query("SELECT * FROM poi where type=:type")
|
||||||
List<PoiEntity> getAllPoiType(int type);
|
List<PoiEntity> getAllPoiType(int type);
|
||||||
|
|
||||||
|
|
||||||
@Query("SELECT * FROM poi WHERE (:taskStatus =-1 or taskStatus=:taskStatus1) and (:type=-1 or type=:type1) and (:isExclusive=-1 or isExclusive=:isExclusive1) ")
|
@Query("SELECT * FROM poi WHERE (:taskStatus =-1 or taskStatus=:taskStatus1) and (:type=-1 or type=:type1) and (:isExclusive=-1 or isExclusive=:isExclusive1) ")
|
||||||
// @Query("SELECT * FROM poi WHERE taskStatus=:taskStatus and type=:type and (:isExclusive=-1 or isExclusive=:isExclusive) ")
|
// @Query("SELECT * FROM poi WHERE taskStatus=:taskStatus and type=:type and (:isExclusive=-1 or isExclusive=:isExclusive) ")
|
||||||
List<PoiEntity> getAllTaskStatus(int taskStatus, int taskStatus1, int type, int type1, int isExclusive, int isExclusive1);
|
List<PoiEntity> getAllTaskStatus(int taskStatus, int taskStatus1, int type, int type1, int isExclusive, int isExclusive1);
|
||||||
|
|
||||||
|
|
||||||
|
@Query("SELECT * FROM poi where taskId=:taskId")
|
||||||
|
PoiEntity getPoiEntity(int taskId);
|
||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
*
|
*
|
||||||
@ -70,6 +74,14 @@ public interface PoiDao {
|
|||||||
void deleteFormName(int taskStatus);
|
void deleteFormName(int taskStatus);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件删除
|
||||||
|
*
|
||||||
|
* @param taskId
|
||||||
|
*/
|
||||||
|
@Query("DELETE FROM poi where taskId=:taskId")
|
||||||
|
void deleteFormTaskID(int taskId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 全部删除
|
* 全部删除
|
||||||
*/
|
*/
|
||||||
|
@ -30,6 +30,15 @@ public class PoiEntity implements Serializable {
|
|||||||
private String photo;//照片信息
|
private String photo;//照片信息
|
||||||
private String extend;//添加字段
|
private String extend;//添加字段
|
||||||
private boolean checked;
|
private boolean checked;
|
||||||
|
private String geoWkt; // 数据的wkt
|
||||||
|
|
||||||
|
public String getGeoWkt() {
|
||||||
|
return geoWkt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGeoWkt(String geoWkt) {
|
||||||
|
this.geoWkt = geoWkt;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isChecked() {
|
public boolean isChecked() {
|
||||||
return checked;
|
return checked;
|
||||||
|
5
app/src/main/res/drawable/ic_baseline_add_alert.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#F6F4F4"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M10.01,21.01c0,1.1 0.89,1.99 1.99,1.99s1.99,-0.89 1.99,-1.99h-3.98zM18.88,16.82L18.88,11c0,-3.25 -2.25,-5.97 -5.29,-6.69v-0.72C13.59,2.71 12.88,2 12,2s-1.59,0.71 -1.59,1.59v0.72C7.37,5.03 5.12,7.75 5.12,11v5.82L3,18.94L3,20h18v-1.06l-2.12,-2.12zM16,13.01h-3v3h-2v-3L8,13.01L8,11h3L11,8h2v3h3v2.01z"/>
|
||||||
|
</vector>
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 928 B |
BIN
app/src/main/res/drawable/marker_charge_centre_bg.png
Normal file
After Width: | Height: | Size: 937 B |
BIN
app/src/main/res/drawable/marker_charge_have_bg.png
Normal file
After Width: | Height: | Size: 893 B |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 888 B |
BIN
app/src/main/res/drawable/marker_other_have_bg.png
Normal file
After Width: | Height: | Size: 894 B |
BIN
app/src/main/res/drawable/marker_pile_bg.png
Normal file
After Width: | Height: | Size: 802 B |
BIN
app/src/main/res/drawable/marker_pile_centre_bg.png
Normal file
After Width: | Height: | Size: 806 B |
BIN
app/src/main/res/drawable/marker_pile_have_bg.png
Normal file
After Width: | Height: | Size: 832 B |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 844 B |
BIN
app/src/main/res/drawable/marker_poi_have_bg.png
Normal file
After Width: | Height: | Size: 844 B |
Before Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 1.0 KiB |
BIN
app/src/main/res/drawable/marker_road_have_bg.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 296 B |
Before Width: | Height: | Size: 815 B |
Before Width: | Height: | Size: 558 B After Width: | Height: | Size: 391 B |
BIN
app/src/main/res/drawable/poi_video_bg.png
Normal file
After Width: | Height: | Size: 873 B |
BIN
app/src/main/res/drawable/poi_video_have_bg.png
Normal file
After Width: | Height: | Size: 878 B |
Before Width: | Height: | Size: 507 B After Width: | Height: | Size: 716 B |
11
app/src/main/res/drawable/small_bell_text.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!--<corners android:radius="50dp"/>-->
|
||||||
|
<!-- <solid android:color="@color/colorRed"/>-->
|
||||||
|
<corners android:radius="180dip" />
|
||||||
|
<solid android:color="#FF0000" />
|
||||||
|
<padding
|
||||||
|
android:left="4dip"
|
||||||
|
android:right="4dip" />
|
||||||
|
|
||||||
|
</shape>
|
BIN
app/src/main/res/drawable/start_bg.png
Normal file
After Width: | Height: | Size: 92 KiB |
@ -4,14 +4,13 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@drawable/ic_launcher_background"
|
android:background="@drawable/start_bg"
|
||||||
tools:context="activity.MainActivity">
|
tools:context="activity.MainActivity">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_view"
|
android:id="@+id/tv_view"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="启动页"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
@ -23,9 +23,9 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="?attr/actionBarSize"
|
android:layout_marginTop="?attr/actionBarSize"
|
||||||
android:focusable="false"
|
|
||||||
android:focusableInTouchMode="false"
|
android:focusableInTouchMode="false"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
android:focusable="false"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/frame_layout"
|
app:layout_constraintBottom_toTopOf="@+id/frame_layout"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.0"
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
@ -35,15 +35,24 @@
|
|||||||
</com.tencent.tencentmap.mapsdk.maps.MapView>
|
</com.tencent.tencentmap.mapsdk.maps.MapView>
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_message"
|
android:id="@+id/iv_message"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="50dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="50dp"
|
||||||
android:layout_marginTop="60dp"
|
android:layout_marginTop="60dp"
|
||||||
android:layout_marginLeft="20dp"
|
android:layout_marginLeft="20dp"
|
||||||
android:background="@drawable/fuwu"
|
android:background="@drawable/ic_baseline_add_alert"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
</ImageView>
|
</ImageView>
|
||||||
|
|
||||||
|
<!--<TextView-->
|
||||||
|
<!--android:layout_width="wrap_content"-->
|
||||||
|
<!--android:layout_height="wrap_content"-->
|
||||||
|
<!--android:text="10"-->
|
||||||
|
<!--android:background="@drawable/small_bell_text"-->
|
||||||
|
<!--android:textColor="@color/white"-->
|
||||||
|
<!--app:layout_constraintTop_toTopOf="@+id/iv_message"-->
|
||||||
|
<!--app:layout_constraintLeft_toRightOf="@+id/iv_message"/>-->
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/frame_layout"
|
android:id="@+id/frame_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -52,7 +61,8 @@
|
|||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
/>
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/cb_map_type"
|
android:id="@+id/cb_map_type"
|
||||||
@ -64,7 +74,8 @@
|
|||||||
android:checked="false"
|
android:checked="false"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
/>
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/cb_foot_type"
|
android:id="@+id/cb_foot_type"
|
||||||
@ -75,7 +86,8 @@
|
|||||||
android:button="@null"
|
android:button="@null"
|
||||||
android:checked="false"
|
android:checked="false"
|
||||||
app:layout_constraintRight_toRightOf="@id/cb_map_type"
|
app:layout_constraintRight_toRightOf="@id/cb_map_type"
|
||||||
app:layout_constraintTop_toBottomOf="@id/cb_map_type" />
|
app:layout_constraintTop_toBottomOf="@id/cb_map_type"
|
||||||
|
/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_submit"
|
android:id="@+id/iv_submit"
|
||||||
@ -84,7 +96,8 @@
|
|||||||
android:src="@mipmap/submit"
|
android:src="@mipmap/submit"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/iv_refrish"
|
app:layout_constraintBottom_toBottomOf="@id/iv_refrish"
|
||||||
app:layout_constraintLeft_toLeftOf="@id/cb_foot_type"
|
app:layout_constraintLeft_toLeftOf="@id/cb_foot_type"
|
||||||
app:layout_constraintTop_toTopOf="@id/iv_zoom_del" />
|
app:layout_constraintTop_toTopOf="@id/iv_zoom_del"
|
||||||
|
/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_filter"
|
android:id="@+id/iv_filter"
|
||||||
@ -93,7 +106,8 @@
|
|||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:src="@mipmap/filter"
|
android:src="@mipmap/filter"
|
||||||
app:layout_constraintLeft_toLeftOf="@id/cb_foot_type"
|
app:layout_constraintLeft_toLeftOf="@id/cb_foot_type"
|
||||||
app:layout_constraintTop_toBottomOf="@id/iv_submit" />
|
app:layout_constraintTop_toBottomOf="@id/iv_submit"
|
||||||
|
/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_zoom_add"
|
android:id="@+id/iv_zoom_add"
|
||||||
@ -103,7 +117,8 @@
|
|||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:src="@mipmap/zoom_add"
|
android:src="@mipmap/zoom_add"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/cb_foot_type" />
|
app:layout_constraintTop_toBottomOf="@id/cb_foot_type"
|
||||||
|
/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_zoom_del"
|
android:id="@+id/iv_zoom_del"
|
||||||
@ -112,7 +127,8 @@
|
|||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:src="@mipmap/zoom_del"
|
android:src="@mipmap/zoom_del"
|
||||||
app:layout_constraintLeft_toLeftOf="@id/iv_zoom_add"
|
app:layout_constraintLeft_toLeftOf="@id/iv_zoom_add"
|
||||||
app:layout_constraintTop_toBottomOf="@id/iv_zoom_add" />
|
app:layout_constraintTop_toBottomOf="@id/iv_zoom_add"
|
||||||
|
/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_refrish"
|
android:id="@+id/iv_refrish"
|
||||||
@ -121,7 +137,8 @@
|
|||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:src="@mipmap/refresh"
|
android:src="@mipmap/refresh"
|
||||||
app:layout_constraintLeft_toLeftOf="@id/iv_zoom_del"
|
app:layout_constraintLeft_toLeftOf="@id/iv_zoom_del"
|
||||||
app:layout_constraintTop_toBottomOf="@id/iv_zoom_del" />
|
app:layout_constraintTop_toBottomOf="@id/iv_zoom_del"
|
||||||
|
/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_location"
|
android:id="@+id/iv_location"
|
||||||
@ -130,7 +147,8 @@
|
|||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:src="@mipmap/mine_location"
|
android:src="@mipmap/mine_location"
|
||||||
app:layout_constraintLeft_toLeftOf="@id/iv_refrish"
|
app:layout_constraintLeft_toLeftOf="@id/iv_refrish"
|
||||||
app:layout_constraintTop_toBottomOf="@id/iv_refrish" />
|
app:layout_constraintTop_toBottomOf="@id/iv_refrish"
|
||||||
|
/>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -15,5 +15,6 @@
|
|||||||
<color name="colorHui">#95CAF6</color>
|
<color name="colorHui">#95CAF6</color>
|
||||||
<color name="colorRed">#F44236</color>
|
<color name="colorRed">#F44236</color>
|
||||||
<color name="colorText">#87CDF6</color>
|
<color name="colorText">#87CDF6</color>
|
||||||
|
<color name="colorRead">#ED1931</color>
|
||||||
|
|
||||||
</resources>
|
</resources>
|