寻宝页面刷新,marker的点击逻辑

This commit is contained in:
wds 2021-07-06 19:07:54 +08:00
parent f2a48b9a2a
commit aa777a3371
19 changed files with 702 additions and 352 deletions

View File

@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
android { android {
compileSdkVersion 29 compileSdkVersion 29
buildToolsVersion '29.0.2' buildToolsVersion '29.0.2'
ndkVersion '23.0.7123448' //ndkVersion '23.0.7123448'
defaultConfig { defaultConfig {
applicationId "com.navinfo.outdoor" applicationId "com.navinfo.outdoor"

View File

@ -82,7 +82,12 @@ public class HomeActivity extends BaseActivity{
@Override @Override
public void onTabSelected(TabLayout.Tab tab) { public void onTabSelected(TabLayout.Tab tab) {
mTab.getTabAt(tab.getPosition()).setIcon(pic[tab.getPosition()]); mTab.getTabAt(tab.getPosition()).setIcon(pic[tab.getPosition()]);
if (tab.getPosition()==3){ if (tab.getPosition()==1){
Message obtain = Message.obtain();
obtain.what = Constant.HOME_TREASURE;
obtain.obj = true;
EventBus.getDefault().post(obtain);
}else if (tab.getPosition()==3){
Message obtain = Message.obtain(); Message obtain = Message.obtain();
obtain.what = Constant.HOME_MINE; obtain.what = Constant.HOME_MINE;
obtain.obj = true; obtain.obj = true;

View File

@ -74,17 +74,15 @@ import java.util.List;
import static com.tencent.mapsdk.internal.aaa.getContext; import static com.tencent.mapsdk.internal.aaa.getContext;
public class PictureActivity extends BaseActivity implements View.OnClickListener, LocationSource, TencentLocationListener { public class PictureActivity extends BaseActivity implements View.OnClickListener {
private static final CameraLogger LOG = CameraLogger.create("Picture"); private static final CameraLogger LOG = CameraLogger.create("Picture");
private CameraView camera; private CameraView camera;
private ImageButton capturePicture; private ImageButton capturePicture;
private long captureTime = 0; private long captureTime = 0;
private android.widget.Button btnSwitch; private android.widget.Button btnSwitch;
private TencentMap tencentMap; private TencentMap tencentMap;
private TencentLocationManager locationManager;
private TencentLocationRequest locationRequest;
private MyLocationStyle locationStyle; private MyLocationStyle locationStyle;
private OnLocationChangedListener locationChangedListener; // private OnLocationChangedListener locationChangedListener;
private MapView ivMap; private MapView ivMap;
private Button captureVideo; private Button captureVideo;
private Button btnVideo; private Button btnVideo;
@ -127,8 +125,6 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
UiSettings uiSettings = tencentMap.getUiSettings(); UiSettings uiSettings = tencentMap.getUiSettings();
//设置logo的大小 //设置logo的大小
uiSettings.setLogoScale(0.7f); uiSettings.setLogoScale(0.7f);
//开启定位权限
checkNetWork();
//相机预览监听 //相机预览监听
camera.addCameraListener(new CameraListener() { camera.addCameraListener(new CameraListener() {
@ -172,48 +168,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
}); });
} }
//
private void checkNetWork() {
if (NetWorkUtils.isNetworkAvailable(this)) { // 当前网络可用
checkMyLocation();
} else { // 当前网络不可用
ToastUtil.showShort(this, Constant.NETWORK_UNAVAILABLE);
}
}
private void checkMyLocation() {
// 1.判断是否拥有定位的权限
// 1.1 拥有权限进行相应操作
// 1.2 没有权限申请权限
// 1.2.1 Android 6.0 动态申请权限
// 1.2.1.1 用户给予权限进行相应操作
// 1.2.1.2 用户没有给予权限 作出相应提示
// 1.2.2 某些5.0权限的手机执行相应操作
XXPermissions.with(this)
.permission(Permission.ACCESS_COARSE_LOCATION)
.request(new OnPermissionCallback() {
@Override
public void onGranted(List<String> permissions, boolean all) {
if (all) {
//建立定位
initLocation();
} else {
Toast.makeText(PictureActivity.this, "申请权限失败", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onDenied(List<String> permissions, boolean never) {
if (never) {
Toast.makeText(PictureActivity.this, "被永久拒绝授权,请手动授予定位权限", Toast.LENGTH_SHORT).show();
// 如果是被永久拒绝就跳转到应用权限系统设置页面
XXPermissions.startPermissionActivity(PictureActivity.this, permissions);
}
}
});
}
private void message(String content, Boolean important) { private void message(String content, Boolean important) {
if (important) { if (important) {
@ -259,28 +214,6 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
} }
} }
/**
* 定位的一些初始化设置
*/
private void initLocation() {
//用于访问腾讯定位服务的类, 周期性向客户端提供位置更新
locationManager = TencentLocationManager.getInstance(this);
//设置坐标系
locationManager.setCoordinateType(TencentLocationManager.COORDINATE_TYPE_GCJ02);
//创建定位请求
locationRequest = TencentLocationRequest.create();
//设置定位周期位置监听器回调周期为3s
// locationRequest.setInterval(3000);
//地图上设置定位数据源
tencentMap.setLocationSource(this);
//设置当前位置可见
tencentMap.setMyLocationEnabled(true);
//设置定位图标样式
setLocMarkerStyle();
// locationStyle = locationStyle.myLocationType(MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE);
tencentMap.setMyLocationStyle(locationStyle);
}
private Bitmap getBitMap(int resourceId) { private Bitmap getBitMap(int resourceId) {
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), resourceId); Bitmap bitmap = BitmapFactory.decodeResource(getResources(), resourceId);
int width = bitmap.getWidth(); int width = bitmap.getWidth();
@ -358,62 +291,4 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
} }
@Override
public void activate(OnLocationChangedListener onLocationChangedListener) {
locationChangedListener = onLocationChangedListener;
int err = locationManager.requestLocationUpdates(locationRequest, this, Looper.myLooper());
switch (err) {
case 1:
ToastUtil.showShort(this, Constant.GET_ERR_MESSAGE1);
break;
case 2:
ToastUtil.showShort(this, Constant.GET_ERR_MESSAGE2);
break;
case 3:
ToastUtil.showShort(this, Constant.GET_ERR_MESSAGE3);
break;
default:
break;
}
}
@Override
public void deactivate() {
locationManager.removeUpdates(this);
locationManager = null;
locationRequest = null;
locationChangedListener = null;
}
/**
* 实现位置监听
*
* @param tencentLocation
* @param i
* @param s
*/
@Override
public void onLocationChanged(TencentLocation tencentLocation, int i, String s) {
if (i == TencentLocation.ERROR_OK && locationChangedListener != null) {
Location location = new Location(tencentLocation.getProvider());
//设置经纬度以及精度
location.setLatitude(tencentLocation.getLatitude());
location.setLongitude(tencentLocation.getLongitude());
location.setAccuracy(tencentLocation.getAccuracy());
locationChangedListener.onLocationChanged(location);
Constant.currentLocation = tencentLocation;
//显示回调的实时位置信息
runOnUiThread(new Runnable() {
@Override
public void run() {
//打印tencentLocation的json字符串
// Toast.makeText(getApplicationContext(), new Gson().toJson(location), Toast.LENGTH_LONG).show();
}
});
}
}
@Override
public void onStatusUpdate(String s, int i, String s1) {
Log.v("State changed", s + "===" + s1);
}
} }

View File

@ -20,16 +20,16 @@ public class Constant {
* 位置权限 * 位置权限
*/ */
public static final String SET_LOCATION_PERMISSION = "请在“设置”中给予“TengXunMap”位置权限,否则当前功能将不可使用"; public static final String SET_LOCATION_PERMISSION = "请在“设置”中给予“TengXunMap”位置权限,否则当前功能将不可使用";
public static final String SET_LOCATION = "请在“设置”中给予权限否则当前功能将不可使用"; public static final String SET_LOCATION= "请在“设置”中给予权限否则当前功能将不可使用";
public static final String GET_ERR_MESSAGE1 = "设备缺少使用腾讯定位服务需要的基本条件"; public static final String GET_ERR_MESSAGE1 = "设备缺少使用腾讯定位服务需要的基本条件";
public static final String GET_ERR_MESSAGE2 = "manifest 中配置的 key 不正确"; public static final String GET_ERR_MESSAGE2 = "manifest 中配置的 key 不正确";
public static final String GET_ERR_MESSAGE3 = "自动加载libtencentloc.so失败"; public static final String GET_ERR_MESSAGE3 = "自动加载libtencentloc.so失败";
public static final String BASE_FOLDER = SdkFolderCreate.getSDPath() + "/navinfoOutDoor"; public static final String BASE_FOLDER = SdkFolderCreate.getSDPath()+"/navinfoOutDoor";
// 保存图片的目录 // 保存图片的目录
public static final String PICTURE_FOLDER = BASE_FOLDER + "/picture"; public static final String PICTURE_FOLDER = BASE_FOLDER+"/picture";
public static final String POI_DAO = BASE_FOLDER + "/BaseDao/"; public static final String POI_DAO = BASE_FOLDER+"/BaseDao/";
// 申请权限的RequestCode // 申请权限的RequestCode
public static final int PERMISSION_REQUEST_CODE = 0x100; public static final int PERMISSION_REQUEST_CODE = 0x100;
@ -40,6 +40,7 @@ public class Constant {
public static final String DATA_FILE = "dataFile"; public static final String DATA_FILE = "dataFile";
//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 的一个展示
@ -65,6 +66,7 @@ public class Constant {
public static final int JOB_SEARCH_WORD = 28;//任务搜索的数据 public static final int JOB_SEARCH_WORD = 28;//任务搜索的数据
public static final int GATHER_GET_MAP = 30;//地图点击marker 后弹窗点击开始采集 public static final int GATHER_GET_MAP = 30;//地图点击marker 后弹窗点击开始采集
public static final int HOME_MINE = 32;//点击我的实时监听刷新 public static final int HOME_MINE = 32;//点击我的实时监听刷新
public static final int HOME_TREASURE = 33;//点击寻宝实时监听刷新
public static String USER_ATTESTATION_NAME; //实名认证姓名 银行卡 public static String USER_ATTESTATION_NAME; //实名认证姓名 银行卡
public static int NUMBER = 200; //任务个数 public static int NUMBER = 200; //任务个数

View File

@ -371,7 +371,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
station = getArguments().getString("station"); station = getArguments().getString("station");
if (station!=null){ if (station!=null){
PoiEntity poiEntity = new Gson().fromJson(station, PoiEntity.class); PoiEntity poiEntity = new Gson().fromJson(station, PoiEntity.class);
pid = poiEntity.getId(); pid = poiEntity.getTaskId();
} }
// 添加信息 // 添加信息
ChargingPileEntity chargingPileEntity = (ChargingPileEntity) getArguments().getSerializable("chargingPileEntity"); ChargingPileEntity chargingPileEntity = (ChargingPileEntity) getArguments().getSerializable("chargingPileEntity");

View File

@ -90,6 +90,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
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[]{"全部", "poi", "充电站", "POI录像", "道路录像"};//1."全部"2 "POI"3 "充电站"4 "POI录像"5 "道路录像",
String[] spinner = new String[]{"存在","不存在","无法验证"};
private ArrayAdapter<String> adapter; private ArrayAdapter<String> adapter;
private LinearLayout linearChargingPile; private LinearLayout linearChargingPile;
private RecyclerView recyclerStation; private RecyclerView recyclerStation;
@ -99,6 +100,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
private PoiEntity showPoiEntity; private PoiEntity showPoiEntity;
private ChargingPileDao chargingPileDao; private ChargingPileDao chargingPileDao;
private LatLng latLng; private LatLng latLng;
private RelativeLayout linearExist;
private Spinner spinnerExist;
public static ChargingStationFragment newInstance(Bundle bundle) { public static ChargingStationFragment newInstance(Bundle bundle) {
ChargingStationFragment fragment = new ChargingStationFragment(); ChargingStationFragment fragment = new ChargingStationFragment();
@ -234,6 +237,28 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
public void onNothingSelected(AdapterView<?> parent) { public void onNothingSelected(AdapterView<?> parent) {
} }
}); });
linearExist = findViewById(R.id.linear_exist);
spinnerExist = findViewById(R.id.spinner_exist);
ArrayAdapter<String> adapterExist = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, spinner);
adapterExist.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //设置下拉列表框的下拉选项样式
spinnerExist.setAdapter(adapterExist);
spinnerExist.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
switch (position) {
case 0:
break;
case 1:
break;
case 2:
break;
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
//添加桩 //添加桩
linearChargingPile = findViewById(R.id.linear_charging_pile); linearChargingPile = findViewById(R.id.linear_charging_pile);
linearChargingPile.setOnClickListener(this::onClick); linearChargingPile.setOnClickListener(this::onClick);
@ -335,6 +360,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
poiBeans.add(new PoiBean("电话*", telPhone, R.drawable.icon_add_bg)); poiBeans.add(new PoiBean("电话*", telPhone, R.drawable.icon_add_bg));
poiRecycleAdapter.setList(poiBeans); poiRecycleAdapter.setList(poiBeans);
} }
linearExist.setVisibility(View.VISIBLE);
if (showPoiEntity.getPhotoInfo() != null) { if (showPoiEntity.getPhotoInfo() != null) {
for (int i = 0; i < showPoiEntity.getPhotoInfo().size(); i++) { for (int i = 0; i < showPoiEntity.getPhotoInfo().size(); i++) {
String photo = showPoiEntity.getPhotoInfo().get(i).getPhoto(); String photo = showPoiEntity.getPhotoInfo().get(i).getPhoto();
@ -358,6 +384,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} }
} }
ArrayList<ChargingPileEntity> chargingPileEntities = new ArrayList<>(); ArrayList<ChargingPileEntity> chargingPileEntities = new ArrayList<>();
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -377,6 +404,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} }
}).start(); }).start();
} else { } else {
poiBeans.add(new PoiBean("电话*", phone, R.drawable.icon_add_bg)); poiBeans.add(new PoiBean("电话*", phone, R.drawable.icon_add_bg));
poiRecycleAdapter.setList(poiBeans); poiRecycleAdapter.setList(poiBeans);
@ -395,7 +423,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
obtains.obj = chargingPileEntity; obtains.obj = chargingPileEntity;
EventBus.getDefault().post(obtains); EventBus.getDefault().post(obtains);
initRemovePileSharePre(); initRemovePileSharePre();
String showStation = initShowStation(); String showStation = initShowStation();
Message obtain = Message.obtain(); Message obtain = Message.obtain();
obtain.what = Constant.CHARGING_STATION; obtain.what = Constant.CHARGING_STATION;
@ -409,6 +436,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
//表示文件名系统将会在/dada/dada/包名/shared_prefs目录下生成 //表示文件名系统将会在/dada/dada/包名/shared_prefs目录下生成
//一个以该参数命名的.xml文件第二个mode表示创建的模式通过查看 //一个以该参数命名的.xml文件第二个mode表示创建的模式通过查看
//方法注释得知建议以0或者MODE_PRIVATE为默认值 //方法注释得知建议以0或者MODE_PRIVATE为默认值
SharedPreferences poi = getActivity().getSharedPreferences(Constant.DATA_FILE, 0); SharedPreferences poi = getActivity().getSharedPreferences(Constant.DATA_FILE, 0);
//获取Editor对象 //获取Editor对象
SharedPreferences.Editor edit = poi.edit(); SharedPreferences.Editor edit = poi.edit();
@ -550,8 +578,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} else { } else {
aBoolean = false; aBoolean = false;
} }
if (showPoiEntity.getTaskId()!=0){ if (showPoiEntity!=null){
poiEntity.setTaskId(showPoiEntity.getTaskId()); 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();
@ -671,8 +701,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
if (tagScutcheon != null&&!tagScutcheon.equals("")) { if (tagScutcheon != null&&!tagScutcheon.equals("")) {
infoPhoto.add(new Info(tagScutcheon)); infoPhoto.add(new Info(tagScutcheon));
} }
if (showPoiEntity.getTaskId()!=0){ if (showPoiEntity!=null){
poiEntity.setTaskId(showPoiEntity.getTaskId()); if (showPoiEntity.getTaskId()!=0){
poiEntity.setTaskId(showPoiEntity.getTaskId());
}
} }
poiEntity.setPhotoInfo(infoPhoto); poiEntity.setPhotoInfo(infoPhoto);
poiEntity.setStation_type(station_type); poiEntity.setStation_type(station_type);
@ -683,7 +715,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
poiEntity.setCreateTime(format); poiEntity.setCreateTime(format);
poiEntity.setType(2); poiEntity.setType(2);
poiEntity.setTaskStatus(2); poiEntity.setTaskStatus(2);
new Thread(new Runnable() { /* new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
List<PoiEntity> allPoi = poiDao.getAllPoi(); List<PoiEntity> allPoi = poiDao.getAllPoi();
@ -694,7 +726,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} }
}); });
} }
}).start(); }).start();*/
String newPoiEntity = new Gson().toJson(poiEntity); String newPoiEntity = new Gson().toJson(poiEntity);
return newPoiEntity; return newPoiEntity;
} }
@ -759,8 +791,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
if (tagScutcheon != null&&!tagScutcheon.equals("")) { if (tagScutcheon != null&&!tagScutcheon.equals("")) {
infoPhoto.add(new Info(tagScutcheon)); infoPhoto.add(new Info(tagScutcheon));
} }
if (showPoiEntity.getTaskId()!=0){ if (showPoiEntity!=null){
poiEntity.setTaskId(showPoiEntity.getTaskId()); if (showPoiEntity.getTaskId()!=0){
poiEntity.setTaskId(showPoiEntity.getTaskId());
}
} }
poiEntity.setPhotoInfo(infoPhoto); poiEntity.setPhotoInfo(infoPhoto);
poiEntity.setStation_type(station_type); poiEntity.setStation_type(station_type);

View File

@ -28,24 +28,23 @@ import org.greenrobot.eventbus.EventBus;
* 领取采集的fragment * 领取采集的fragment
*/ */
public class GatherGetFragment extends BaseFragment implements View.OnClickListener { public class GatherGetFragment extends BaseFragment implements View.OnClickListener {
private Button btnCancelGet, btnGetTask, btnGather, btnFinishGather;
private Button btnCancelGet,btnGetTask,btnGather,btnFinishGather;
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 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);
@ -65,13 +64,10 @@ 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();
@ -93,67 +89,124 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
Bundle arguments = getArguments(); Bundle arguments = getArguments();
if (arguments != null) { if (arguments != null) {
poiEntity = (PoiEntity) arguments.getSerializable("poiEntity"); poiEntity = (PoiEntity) arguments.getSerializable("poiEntity");
if (poiEntity != null) { aSave = arguments.getInt("aSave", 0);
tvTitle.setText(poiEntity.getName()); if (aSave == 1) {//普通任务
if ( poiEntity.getPrecision()==null){ if (poiEntity != null) {
tvMoney.setText("" +0); tvTitle.setText(poiEntity.getName());
}else { if (poiEntity.getPrecision() == null) {
tvMoney.setText("" + poiEntity.getPrecision()); 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");
}
} }
tvTime.setText("到期时间:" + poiEntity.getCreateTime()); int taskStatus = poiEntity.getTaskStatus();
tvDescribe.setText("任务描述:" + poiEntity.getDescribe()); switch (taskStatus) {
if (poiEntity.getDist() != null) { case 0://未领取
tvDistance.setText("距离:" + format5(Double.valueOf(poiEntity.getDist()) / 1000) + "km"); 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;
}
} 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); poiEntity.setTaskStatus(0);
btnGetTask.setVisibility(View.VISIBLE); btnGetTask.setVisibility(View.VISIBLE);
btnCancelGet.setVisibility(View.GONE); btnCancelGet.setVisibility(View.GONE);
new Thread(new Runnable() {
@Override
public void run() {
if (poiListEntity!=null){
poiDao.deletePoiEntity(poiListEntity);
}else {
poiDao.deletePoiEntity(poiEntity);
}
}
}).start();
break; break;
case R.id.btn_get_task://领取任务 case R.id.btn_get_task://领取任务
poiEntity.setTaskStatus(1); poiEntity.setTaskStatus(1);
btnGetTask.setVisibility(View.GONE); btnGetTask.setVisibility(View.GONE);
btnCancelGet.setVisibility(View.VISIBLE); btnCancelGet.setVisibility(View.VISIBLE);
//网络请求 //网络请求
if (poiEntity!=null){ if (poiEntity != null) {
if (poiEntity.getType()==1) {//poi的领取类型 if (poiEntity.getType() == 1) {//poi的领取类型
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK,poiEntity.getTaskId()+"",false); 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()+"",false); receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK, poiEntity.getTaskId() + "", false);
} }
} }
break; break;
@ -167,37 +220,40 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
EventBus.getDefault().post(obtain); EventBus.getDefault().post(obtain);
} }
} else { } else {
if (poiEntity!=null){ if (poiEntity != null) {
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() + "", true);
}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() + "", true);
} }
} }
} }
break; break;
case R.id.btn_finish_gather://结束采集 case R.id.btn_finish_gather://结束采集
new Thread(new Runnable() { btnFinishGather.setVisibility(View.VISIBLE);
@Override new Thread(new Runnable() {
public void run() { @Override
public void run() {
if (poiListEntity!=null){
poiDao.deletePoiEntity(poiListEntity);
}else {
poiDao.deletePoiEntity(poiEntity); poiDao.deletePoiEntity(poiEntity);
} }
}).start();
}
}).start();
break; break;
} }
} }
/** /**
* @param url 不同任务类型对应的url * @param url 不同任务类型对应的url
* @param id 任务id * @param id 任务id
* */ */
private void receivedTaskByNet(String url, String id,boolean isSaver) { private void receivedTaskByNet(String url, String id, boolean isSaver) {
showLoadingDialog(); showLoadingDialog();
OkGoBuilder.getInstance() OkGoBuilder.getInstance()
.Builder(getActivity()) .Builder(getActivity())
.url(url+id) .url(url + id)
.method(OkGoBuilder.GET) .method(OkGoBuilder.GET)
.cls(ReceivedPoiBean.class) .cls(ReceivedPoiBean.class)
.callback(new Callback<ReceivedPoiBean>() { .callback(new Callback<ReceivedPoiBean>() {
@ -205,7 +261,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
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();
PoiEntity poiListEntity = new 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());
@ -218,18 +274,29 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
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")) {// } else if (geometry.getGeometryType().equals("Polygon")) {}//
} new Thread(new Runnable() {
if (isSaver){ @Override
Message obtain = Message.obtain(); public void run() {
obtain.what = Constant.GATHER_GET_MAP; poiDao.insertPoiEntity(poiListEntity);
obtain.obj = poiListEntity;
EventBus.getDefault().post(obtain); getActivity().runOnUiThread(new Runnable() {
} @Override
public void run() {
btnFinishGather.setVisibility(View.VISIBLE);
if (isSaver&&aSave==1) {
Message obtain = Message.obtain();
obtain.what = Constant.GATHER_GET_MAP;
obtain.obj = poiListEntity;
EventBus.getDefault().post(obtain);
}
}
});
}
}).start();
} }
@Override @Override
public void onError(Throwable e, int id) { public void onError(Throwable e, int id) {
dismissLoadingDialog(); dismissLoadingDialog();
@ -237,10 +304,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();
} }
} }

View File

@ -87,7 +87,10 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
private PoiEntity showPoiEntity; private PoiEntity showPoiEntity;
private LatLng latLng; private LatLng latLng;
private int station_type=0; private int station_type=0;
private String name; String[] spinner = new String[]{"存在","不存在","无法验证"};
private RelativeLayout linearExist;
private Spinner spinnerExist;
private ArrayList<Object> otheruploadList; private ArrayList<Object> otheruploadList;
private String takePhotoPath; private String takePhotoPath;
private String takePhotoPath2; private String takePhotoPath2;
@ -197,6 +200,28 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
btnOtherLocal.setOnClickListener(this::onClick); btnOtherLocal.setOnClickListener(this::onClick);
btnOtherUploading = findViewById(R.id.btn_other_uploading); btnOtherUploading = findViewById(R.id.btn_other_uploading);
btnOtherUploading.setOnClickListener(this::onClick); btnOtherUploading.setOnClickListener(this::onClick);
linearExist = findViewById(R.id.linear_exist);
spinnerExist = findViewById(R.id.spinner_exist);
ArrayAdapter<String> adapterExist = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, spinner);
adapterExist.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //设置下拉列表框的下拉选项样式
spinnerExist.setAdapter(adapterExist);
spinnerExist.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
switch (position) {
case 0:
break;
case 1:
break;
case 2:
break;
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
//数据展示 //数据展示
initShowPoi(); initShowPoi();
@ -233,6 +258,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
if (describe != null &&!describe.equals("")) { if (describe != null &&!describe.equals("")) {
editOtherDescribe.setText(describe); editOtherDescribe.setText(describe);
} }
linearExist.setVisibility(View.VISIBLE);
int station_type = showPoiEntity.getStation_type(); int station_type = showPoiEntity.getStation_type();
spinnerOther.setSelection(station_type,true); spinnerOther.setSelection(station_type,true);
if (showPoiEntity.getPhotoInfo() != null) { if (showPoiEntity.getPhotoInfo() != null) {
@ -276,8 +302,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
PoiEntity poiEntity = new PoiEntity(); PoiEntity poiEntity = new PoiEntity();
List<Info> infoList = new ArrayList<>(); List<Info> infoList = new ArrayList<>();
//名称 String name = editTaskName.getText().toString().trim();//名称
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();
return; return;
@ -313,8 +338,10 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
} else { } else {
infoList.add(new Info(tagPictures)); infoList.add(new Info(tagPictures));
} }
if (showPoiEntity.getTaskId()!=0){ if (showPoiEntity!=null){
poiEntity.setTaskId(showPoiEntity.getTaskId()); if (showPoiEntity.getTaskId()!=0){
poiEntity.setTaskId(showPoiEntity.getTaskId());
}
} }
poiEntity.setStation_type(station_type); poiEntity.setStation_type(station_type);
poiEntity.setPhotoInfo(infoList); poiEntity.setPhotoInfo(infoList);
@ -376,7 +403,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
HttpParams httpParams = new HttpParams(); HttpParams httpParams = new HttpParams();
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", name); httpParams.put("name", poiEntity.getName());
httpParams.put("existence", "1"); httpParams.put("existence", "1");
String encode = Geohash.getInstance().encode(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX())); String encode = Geohash.getInstance().encode(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX()));
httpParams.put("geo", encode); httpParams.put("geo", encode);
@ -439,8 +466,10 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
if (tagPictures != null&&!tagPictures.equals("")) { if (tagPictures != null&&!tagPictures.equals("")) {
arrayList.add(new Info(tagPictures)); arrayList.add(new Info(tagPictures));
} }
if (showPoiEntity.getTaskId()!=0){ if (showPoiEntity!=null){
poiEntity.setTaskId(showPoiEntity.getTaskId()); if (showPoiEntity.getTaskId()!=0){
poiEntity.setTaskId(showPoiEntity.getTaskId());
}
} }
poiEntity.setPhotoInfo(arrayList); poiEntity.setPhotoInfo(arrayList);
poiEntity.setStation_type(station_type); poiEntity.setStation_type(station_type);

View File

@ -8,12 +8,16 @@ import android.os.Message;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button; import android.widget.Button;
import android.widget.CheckBox; import android.widget.CheckBox;
import android.widget.CompoundButton; import android.widget.CompoundButton;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.Spinner;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
@ -44,7 +48,6 @@ import com.navinfo.outdoor.base.BaseDrawerFragment;
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.bean.PoiSaveBean;
import com.navinfo.outdoor.bean.TaskPrefectureBean;
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;
@ -90,8 +93,9 @@ 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;
private String name; String[] spinner = new String[]{"存在","不存在","无法验证"};
private String site; private RelativeLayout linearExist;
private Spinner spinnerExist;
public static PoiFragment newInstance(Bundle bundle) { public static PoiFragment newInstance(Bundle bundle) {
PoiFragment fragment = new PoiFragment(); PoiFragment fragment = new PoiFragment();
@ -187,6 +191,29 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
rlCard.setOnClickListener(this::onClick); rlCard.setOnClickListener(this::onClick);
rlElse = findViewById(R.id.rl_else); rlElse = findViewById(R.id.rl_else);
rlElse.setOnClickListener(this::onClick); rlElse.setOnClickListener(this::onClick);
linearExist = findViewById(R.id.linear_exist);
spinnerExist = findViewById(R.id.spinner_exist);
ArrayAdapter<String> adapterExist = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, spinner);
adapterExist.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //设置下拉列表框的下拉选项样式
spinnerExist.setAdapter(adapterExist);
spinnerExist.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
switch (position) {
case 0:
break;
case 1:
break;
case 2:
break;
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
recyclerPhone = findViewById(R.id.recycler_phone); recyclerPhone = findViewById(R.id.recycler_phone);
recyclerPhone.setLayoutManager(new LinearLayoutManager(getContext())); recyclerPhone.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerPhone.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL)); recyclerPhone.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
@ -257,6 +284,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
poiRecycleAdapter.setList(poiBeans); poiRecycleAdapter.setList(poiBeans);
} }
linearExist.setVisibility(View.VISIBLE);
if (showPoiEntity.getPhotoInfo() != null) { if (showPoiEntity.getPhotoInfo() != null) {
for (int i = 0; i < showPoiEntity.getPhotoInfo().size(); i++) { for (int i = 0; i < showPoiEntity.getPhotoInfo().size(); i++) {
String photo = showPoiEntity.getPhotoInfo().get(i).getPhoto(); String photo = showPoiEntity.getPhotoInfo().get(i).getPhoto();
@ -333,15 +361,14 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
//保存数据库 //保存数据库
PoiEntity poiEntity = new PoiEntity(); PoiEntity poiEntity = new PoiEntity();
ArrayList<Info> infoPhoto = new ArrayList<>(); ArrayList<Info> infoPhoto = new ArrayList<>();
//名称 String name = editNameContent.getText().toString().trim();//名称
name = editNameContent.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();
return; return;
} else { } else {
poiEntity.setName(name); poiEntity.setName(name);
} }
site = editSiteContent.getText().toString().trim(); String site = editSiteContent.getText().toString().trim();
if (site == null || site.equals("")) { if (site == null || site.equals("")) {
Toast.makeText(getActivity(), "请输入poi 地址", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), "请输入poi 地址", Toast.LENGTH_SHORT).show();
return; return;
@ -382,9 +409,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
} else { } else {
infoPhoto.add(new Info(tagName)); infoPhoto.add(new Info(tagName));
} }
if (showPoiEntity.getTaskId() != 0) {
poiEntity.setTaskId(showPoiEntity.getTaskId());
}
String tagInternal = (String) ivInternal.getTag(); String tagInternal = (String) ivInternal.getTag();
if (tagInternal != null) { if (tagInternal != null) {
infoPhoto.add(new Info(tagInternal)); infoPhoto.add(new Info(tagInternal));
@ -397,8 +422,8 @@ 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!=null){
if (showPoiEntity.getTaskId() != 0) { if (showPoiEntity.getTaskId()!=0){
poiEntity.setTaskId(showPoiEntity.getTaskId()); poiEntity.setTaskId(showPoiEntity.getTaskId());
} }
} }
@ -462,7 +487,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
case R.id.rl_else: case R.id.rl_else:
Intent intentElse = new Intent("android.media.action.IMAGE_CAPTURE"); Intent intentElse = new Intent("android.media.action.IMAGE_CAPTURE");
startActivityForResult(intentElse, 105); startActivityForResult(intentElse, 105);
break; break;
} }
@ -474,11 +498,11 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
if (poiEntity.getTaskId() != 0) { if (poiEntity.getTaskId() != 0) {
httpParams.put("taskId", poiEntity.getTaskId()); httpParams.put("taskId", poiEntity.getTaskId());
} }
if (name != null && !name.equals("")) { if (poiEntity.getName() != null && !poiEntity.getName().equals("")) {
httpParams.put("name", name); httpParams.put("name", poiEntity.getName());
} }
if (site != null && !site.equals("")) { if (poiEntity.getAddress() != null && !poiEntity.getAddress().equals("")) {
httpParams.put("address", site); httpParams.put("address", poiEntity.getAddress());
} }
httpParams.put("existence", "1"); httpParams.put("existence", "1");
if (poiEntity.getY() != null && poiEntity.getX() != null) { if (poiEntity.getY() != null && poiEntity.getX() != null) {
@ -565,12 +589,12 @@ 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.getTaskId() != 0) { if (showPoiEntity!=null){
poiEntity.setTaskId(showPoiEntity.getTaskId()); if (showPoiEntity.getTaskId()!=0){
} poiEntity.setTaskId(showPoiEntity.getTaskId());
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();

View File

@ -9,11 +9,15 @@ import android.os.Message;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.RadioButton; import android.widget.RadioButton;
import android.widget.RadioGroup; import android.widget.RadioGroup;
import android.widget.RelativeLayout;
import android.widget.Spinner;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
@ -57,6 +61,9 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
private PoiDatabase poiDatabase; private PoiDatabase poiDatabase;
private PoiDao poiDao; private PoiDao poiDao;
private PoiEntity showPoiEntity; private PoiEntity showPoiEntity;
private RelativeLayout linearExist;
private Spinner spinnerExist;
String[] spinner = new String[]{"存在","不存在","无法验证"};
public static PoiVideoFragment newInstance(Bundle bundle) { public static PoiVideoFragment newInstance(Bundle bundle) {
PoiVideoFragment fragment = new PoiVideoFragment(); PoiVideoFragment fragment = new PoiVideoFragment();
@ -114,7 +121,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
tvPictures.setOnClickListener(this::onClick); tvPictures.setOnClickListener(this::onClick);
etRoadName = (EditText) findViewById(R.id.et_road_name); etRoadName = (EditText) findViewById(R.id.et_road_name);
ivRoadPicture = (ImageView) findViewById(R.id.iv_road_picture); ivRoadPicture = (ImageView) findViewById(R.id.iv_road_picture);
// Glide.with(getContext()).load(getLocalVideoBitmap(String.valueOf(R.drawable.bg_01))).into(ivRoadPicture);
rbCar = (RadioButton) findViewById(R.id.rb_car); rbCar = (RadioButton) findViewById(R.id.rb_car);
rbBicycle = (RadioButton) findViewById(R.id.rb_bicycle); rbBicycle = (RadioButton) findViewById(R.id.rb_bicycle);
rbWalking = (RadioButton) findViewById(R.id.rb_walking); rbWalking = (RadioButton) findViewById(R.id.rb_walking);
@ -123,11 +129,32 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
btnRoadSave = (Button) findViewById(R.id.btn_road_save); btnRoadSave = (Button) findViewById(R.id.btn_road_save);
btnRoadSave.setOnClickListener(this::onClick); btnRoadSave.setOnClickListener(this::onClick);
rgType = (RadioGroup) findViewById(R.id.rg_type); rgType = (RadioGroup) findViewById(R.id.rg_type);
linearExist = findViewById(R.id.linear_exist);
spinnerExist = findViewById(R.id.spinner_exist);
ArrayAdapter<String> adapterExist = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, spinner);
adapterExist.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //设置下拉列表框的下拉选项样式
spinnerExist.setAdapter(adapterExist);
spinnerExist.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
switch (position) {
case 0:
break;
case 1:
break;
case 2:
break;
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
//添加数据 //添加数据
initShowPoi(); initShowPoi();
//禁用可操作性控件 //禁用可操作性控件
// disables(); // disables();
//获取
} }
private void initShowPoi() { private void initShowPoi() {
// 添加信息 // 添加信息
@ -143,6 +170,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
int type= roadExtend.getType(); int type= roadExtend.getType();
showPictureType(type); showPictureType(type);
} }
linearExist.setVisibility(View.VISIBLE);
String describe = showPoiEntity.getDescribe();//任务描述 String describe = showPoiEntity.getDescribe();//任务描述
if (describe != null && !describe.equals("")) { if (describe != null && !describe.equals("")) {
etDesc.setText(describe); etDesc.setText(describe);
@ -220,8 +248,10 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
} else { } else {
poiEntity.setDescribe(desc); poiEntity.setDescribe(desc);
} }
if (showPoiEntity.getTaskId()!=0){ if (showPoiEntity!=null){
poiEntity.setTaskId(showPoiEntity.getTaskId()); 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();
@ -298,8 +328,10 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
if (desc != null && !desc.equals("")) { if (desc != null && !desc.equals("")) {
poiEntity.setDescribe(desc); poiEntity.setDescribe(desc);
} }
if (showPoiEntity.getTaskId()!=0){ if (showPoiEntity!=null){
poiEntity.setTaskId(showPoiEntity.getTaskId()); 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();

View File

@ -9,11 +9,15 @@ import android.os.Message;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.RadioButton; import android.widget.RadioButton;
import android.widget.RadioGroup; import android.widget.RadioGroup;
import android.widget.RelativeLayout;
import android.widget.Spinner;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
@ -64,6 +68,8 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
private PoiDao poiDao; private PoiDao poiDao;
private PoiEntity showPoiEntity; private PoiEntity showPoiEntity;
private ImageView ivRoadFinal; private ImageView ivRoadFinal;
private RelativeLayout linearExist;
String[] spinner = new String[]{"存在","不存在","无法验证"};
public static RoadFragment newInstance(Bundle bundle) { public static RoadFragment newInstance(Bundle bundle) {
RoadFragment fragment = new RoadFragment(); RoadFragment fragment = new RoadFragment();
@ -128,6 +134,28 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
btnRoadSave = (Button) findViewById(R.id.btn_road_save); btnRoadSave = (Button) findViewById(R.id.btn_road_save);
btnRoadSave.setOnClickListener(this::onClick); btnRoadSave.setOnClickListener(this::onClick);
rgType = (RadioGroup) findViewById(R.id.rg_type); rgType = (RadioGroup) findViewById(R.id.rg_type);
linearExist = findViewById(R.id.linear_exist);
Spinner spinnerExist = findViewById(R.id.spinner_exist);
ArrayAdapter<String> adapterExist = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, spinner);
adapterExist.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //设置下拉列表框的下拉选项样式
spinnerExist.setAdapter(adapterExist);
spinnerExist.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
switch (position) {
case 0:
break;
case 1:
break;
case 2:
break;
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
//数据展示 //数据展示
initShowPoi(); initShowPoi();
//禁用可操作性控件 //禁用可操作性控件
@ -148,6 +176,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
int type= roadExtend.getType(); int type= roadExtend.getType();
showPictureType(type); showPictureType(type);
} }
linearExist.setVisibility(View.VISIBLE);
String describe = showPoiEntity.getDescribe();//任务描述 String describe = showPoiEntity.getDescribe();//任务描述
if (describe != null && !describe.equals("")) { if (describe != null && !describe.equals("")) {
etDesc.setText(describe); etDesc.setText(describe);
@ -226,8 +255,10 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
} else { } else {
poiEntity.setDescribe(desc); poiEntity.setDescribe(desc);
} }
if (showPoiEntity.getTaskId()!=0){ if (showPoiEntity!=null){
poiEntity.setTaskId(showPoiEntity.getTaskId()); 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();
@ -305,8 +336,10 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
if (desc != null && !desc.equals("")) { if (desc != null && !desc.equals("")) {
poiEntity.setDescribe(desc); poiEntity.setDescribe(desc);
} }
if (showPoiEntity.getTaskId()!=0){ if (showPoiEntity!=null){
poiEntity.setTaskId(showPoiEntity.getTaskId()); 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();

View File

@ -66,6 +66,7 @@ import com.tencent.tencentmap.mapsdk.maps.LocationSource;
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.Projection;
import com.tencent.tencentmap.mapsdk.maps.TencentMap; import com.tencent.tencentmap.mapsdk.maps.TencentMap;
import com.tencent.tencentmap.mapsdk.maps.TencentMapContext;
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;
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor; import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
@ -191,6 +192,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
UiSettings uiSettings = tencentMap.getUiSettings(); UiSettings uiSettings = tencentMap.getUiSettings();
//设置logo的大小 //设置logo的大小
uiSettings.setLogoScale(0.7f); uiSettings.setLogoScale(0.7f);
uiSettings.setRotateGesturesEnabled(false);//禁止地图旋转手势.
uiSettings.setTiltGesturesEnabled(false);//禁止倾斜手势.
//开启定位权限 //开启定位权限
checkNetWork(); checkNetWork();
//检查是否有没有填完的页面 //检查是否有没有填完的页面
@ -202,6 +205,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
tencentMap.addOnMapLoadedCallback(new TencentMap.OnMapLoadedCallback() { tencentMap.addOnMapLoadedCallback(new TencentMap.OnMapLoadedCallback() {
@Override @Override
public void onMapLoaded() { public void onMapLoaded() {
if (Constant.currentLocation != null ) {
initList(Constant.currentLocation);
}
tencentMap.setOnMarkerClickListener(new TencentMap.OnMarkerClickListener() { tencentMap.setOnMarkerClickListener(new TencentMap.OnMarkerClickListener() {
@Override @Override
public boolean onMarkerClick(Marker marker) { public boolean onMarkerClick(Marker marker) {
@ -231,7 +237,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
showSlidingFragment(otherFragment); showSlidingFragment(otherFragment);
break; break;
} }
} else { }else if(marker.getTitle().equals("面妆任务")) {//面妆任务
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());
@ -249,9 +255,28 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
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")) {// } else if (geometry.getGeometryType().equals("Polygon")) {//
} }
initMarker(poiListEntity,2); initMarker(poiListEntity,2);
}else {
JobSearchBean.BodyBean.ListBean listBean = (JobSearchBean.BodyBean.ListBean) marker.getTag();
PoiEntity poiListEntity = new PoiEntity();
poiListEntity.setTaskId(listBean.getId());
poiListEntity.setName(listBean.getName());
poiListEntity.setAddress(listBean.getAddress());
poiListEntity.setTelPhone(listBean.getTelephone() + "");
poiListEntity.setPrecision(listBean.getPrice());
poiListEntity.setDist(listBean.getDist());
poiListEntity.setType(Integer.valueOf(listBean.getType()));
String geo = listBean.getGeo();
Geometry geometry = GeometryTools.createGeometry(geo);
if (geometry.getGeometryType().equals("Point")) {//
LatLng latLng = GeometryTools.createLatLng(geo);
poiListEntity.setX(latLng.longitude + "");
poiListEntity.setY(latLng.latitude + "");
} else if (geometry.getGeometryType().equals("LineString")) {//线
} else if (geometry.getGeometryType().equals("Polygon")) {//
}
initMarker(poiListEntity,1);
} }
return false; return false;
} }
@ -268,9 +293,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
@Override @Override
public void onCameraChangeFinished(CameraPosition cameraPosition) { // 地图移动结束 public void onCameraChangeFinished(CameraPosition cameraPosition) { // 地图移动结束
if (Constant.currentLocation != null) {
initList(Constant.currentLocation);
}
} }
}; };
@ -308,47 +332,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
String geo = list.get(i).getGeo(); String geo = list.get(i).getGeo();
Log.d("TAG", "onSuccess: " + geo); Log.d("TAG", "onSuccess: " + geo);
Geometry geometry = GeometryTools.createGeometry(geo); Geometry geometry = GeometryTools.createGeometry(geo);
LatLng latLng = null;
if (geometry.getGeometryType().equals("Point")) {// if (geometry.getGeometryType().equals("Point")) {//
LatLng latLng = GeometryTools.createLatLng(geo); latLng = GeometryTools.createLatLng(geo);
switch (Integer.valueOf(list.get(i).getType())) {
case 1://poi
Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.POI_ICON).alpha(0.5f)
.flat(true)
.clockwise(false));
poiMarker.setTag(listBean);
removables.add(poiMarker);
poiMarker.setClickable(true);
break;
case 2://充电站
Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.STATION_ICON).alpha(0.7f)
.flat(true)
.clockwise(false));
stationMarker.setTag(listBean);
removables.add(stationMarker);
stationMarker.setClickable(true);
break;
case 3://poi录像
break;
case 4://道路录像
Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.ROAD_ICON).alpha(0.7f)
.flat(true)
.clockwise(false));
roadMarker.setTag(listBean);
removables.add(roadMarker);
roadMarker.setClickable(true);
break;
case 5://其他
break;
case 6://面状任务
Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.PLANAR_TASK_ICON).alpha(0.7f)
.flat(true)
.clockwise(false));
planarMarker.setTag(listBean);
removables.add(planarMarker);
planarMarker.setClickable(true);
break;
}
} else if (geometry.getGeometryType().equals("LineString")) {//线 } else if (geometry.getGeometryType().equals("LineString")) {//线
List<LatLng> latLineString = GeometryTools.getLatLngs(geo); List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
// 构造 PolylineOpitons // 构造 PolylineOpitons
@ -367,6 +353,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
// 绘制折线 // 绘制折线
Polyline polyline = tencentMap.addPolyline(polylineOptions); Polyline polyline = tencentMap.addPolyline(polylineOptions);
removables.add(polyline); removables.add(polyline);
if (latLineString!=null&&latLineString.size()>0){
latLng = latLineString.get(0);
}
} else if (geometry.getGeometryType().equals("Polygon")) {// } else if (geometry.getGeometryType().equals("Polygon")) {//
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo); List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
Polygon polygon = tencentMap.addPolygon(new PolygonOptions(). Polygon polygon = tencentMap.addPolygon(new PolygonOptions().
@ -379,6 +368,50 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
//边线宽度15像素 //边线宽度15像素
strokeWidth(5)); strokeWidth(5));
removables.add(polygon); removables.add(polygon);
if (latPolygon!=null&&latPolygon.size()>0){
latLng = latPolygon.get(0);
}
}
switch (Integer.valueOf(list.get(i).getType())) {
case 1://poi
Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.POI_ICON).alpha(0.5f)
.flat(true)
.clockwise(false));
poiMarker.setTag(listBean);
removables.add(poiMarker);
poiMarker.setClickable(true);
break;
case 2://充电站
Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.STATION_ICON).alpha(0.7f)
.flat(true)
.clockwise(false));
stationMarker.setTag(listBean);
removables.add(stationMarker);
stationMarker.setClickable(true);
break;
case 3://poi录像
break;
case 4://道路录像
Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.ROAD_ICON).alpha(0.7f)
.flat(true)
.clockwise(false));
roadMarker.setTag(listBean);
removables.add(roadMarker);
roadMarker.setClickable(true);
break;
case 5://其他
break;
case 6://面状任务
Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.PLANAR_TASK_ICON).alpha(0.7f)
.flat(true)
.clockwise(false));
Log.d("面妆任务", "onSuccess: "+planarMarker);
planarMarker.setTag(listBean);
removables.add(planarMarker);
planarMarker.setTitle("面妆任务");//1面妆任务
planarMarker.setClickable(true);
break;
} }
} }
Message obtain = Message.obtain(); Message obtain = Message.obtain();
@ -406,7 +439,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putSerializable("poiEntity", poiEntity); bundle.putSerializable("poiEntity", poiEntity);
bundle.putBoolean("boolean",false); bundle.putBoolean("boolean",false);
bundle.putInt("isServe",aInt); bundle.putInt("aSave",aInt);
gatherGetFragment = GatherGetFragment.newInstance(bundle); gatherGetFragment = GatherGetFragment.newInstance(bundle);
fragmentTransaction.replace(R.id.frame_layout, gatherGetFragment); fragmentTransaction.replace(R.id.frame_layout, gatherGetFragment);
fragmentTransaction.commit(); fragmentTransaction.commit();
@ -425,9 +458,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
Marker marker = tencentMap.addMarker(new MarkerOptions(position)); Marker marker = tencentMap.addMarker(new MarkerOptions(position));
marker.setClickable(true); marker.setClickable(true);
PoiEntity poiEntity = allPoi.get(i); PoiEntity poiEntity = allPoi.get(i);
marker.setTitle("本地"); marker.setTitle("本地");//1本地
marker.setTag(poiEntity); marker.setTag(poiEntity);
} }
} }
}); });
@ -659,6 +691,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
showSlidingFragment(chargingPileFragment); showSlidingFragment(chargingPileFragment);
} else if (data.what == Constant.CHARGING_STATION_PILE) {//充电站的充电桩 } else if (data.what == Constant.CHARGING_STATION_PILE) {//充电站的充电桩
chargingPileEntity = (ChargingPileEntity) data.obj; chargingPileEntity = (ChargingPileEntity) data.obj;
}else if (data.what==Constant.HOME_TREASURE){//寻宝的刷新
if ((boolean)data.obj){
initList(Constant.currentLocation);
}
} }
} }

View File

@ -55,7 +55,7 @@ public class PoiEntity implements Serializable {
private String y;//纬度 private String y;//纬度
private String detail;//深度信息 private String detail;//深度信息
private String dist;//距离用户位置 private String dist;//距离用户位置
private int taskStatus;//任务状态 1.已领取2.已保存,3已提交 private int taskStatus;//任务状态 0.未领取 1.已领取2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功)4已上传结束采集,
private int type;//1 "POI"2 "充电站"3 "POI录像"4 "道路录像"5 "其他"6 "面状任务" private int type;//1 "POI"2 "充电站"3 "POI录像"4 "道路录像"5 "其他"6 "面状任务"
private int station_type;//1."全部"2 "POI"3 "充电站"4 "POI录像"5 "道路录像", "门牌:6 公交:7 情报:8 private int station_type;//1."全部"2 "POI"3 "充电站"4 "POI录像"5 "道路录像", "门牌:6 公交:7 情报:8
private int isLocalData;//是否是本地数据 0,服务 1,本地//现在没用 private int isLocalData;//是否是本地数据 0,服务 1,本地//现在没用

View File

@ -13,10 +13,6 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <TextView
android:id="@+id/tv_01" android:id="@+id/tv_01"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -220,6 +216,50 @@
android:background="@drawable/ic_baseline_arrow_drop" android:background="@drawable/ic_baseline_arrow_drop"
/> />
</RelativeLayout> </RelativeLayout>
<RelativeLayout
android:id="@+id/linear_exist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:padding="2dp"
android:visibility="gone"
android:background="@drawable/underline"
app:layout_constraintTop_toBottomOf="@id/linear_type"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:id="@+id/tv_exist"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="是否存在*"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:textColor="#333"
android:layout_marginLeft="18dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<Spinner
android:id="@+id/spinner_exist"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_marginLeft="18dp"
android:layout_toRightOf="@id/tv_exist"
android:background="@color/white"
android:layout_marginRight="10dp"
android:layout_toEndOf="@id/tv_exist"
android:textSize="15sp"
android:textColor="#333" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/ic_baseline_arrow_drop"
/>
</RelativeLayout>
<TextView <TextView
android:id="@+id/tv_02" android:id="@+id/tv_02"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -227,7 +267,7 @@
android:text="02.拍照" android:text="02.拍照"
android:layout_margin="10dp" android:layout_margin="10dp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/linear_type" /> app:layout_constraintTop_toBottomOf="@id/linear_exist" />
<LinearLayout <LinearLayout
android:id="@+id/linear_photograph" android:id="@+id/linear_photograph"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -70,14 +70,12 @@
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
app:layout_constraintStart_toStartOf="@+id/tv_time" app:layout_constraintStart_toStartOf="@+id/tv_time"
app:layout_constraintTop_toBottomOf="@+id/tv_time" /> app:layout_constraintTop_toBottomOf="@+id/tv_time" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_describe"> app:layout_constraintTop_toBottomOf="@+id/tv_describe">
<Button <Button
android:id="@+id/btn_cancel_get" android:id="@+id/btn_cancel_get"
style="@style/user_data_style" style="@style/user_data_style"
@ -115,5 +113,4 @@
android:layout_weight="1" android:layout_weight="1"
android:text="结束采集" /> android:text="结束采集" />
</LinearLayout> </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -20,13 +20,14 @@
android:layout_margin="20dp" android:layout_margin="20dp"
android:text="01.选择情报类型" android:text="01.选择情报类型"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintLeft_toLeftOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<LinearLayout <LinearLayout
android:id="@+id/ll_text" android:id="@+id/ll_text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="100dp" android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintLeft_toLeftOf="@id/tv_select_type" app:layout_constraintLeft_toLeftOf="@id/tv_select_type"
app:layout_constraintTop_toBottomOf="@id/tv_select_type"> app:layout_constraintTop_toBottomOf="@id/tv_select_type">
@ -36,7 +37,6 @@
android:layout_margin="20dp" android:layout_margin="20dp"
android:background="@drawable/other_text"> android:background="@drawable/other_text">
<Spinner <Spinner
android:id="@+id/spinner_other" android:id="@+id/spinner_other"
android:layout_width="0dp" android:layout_width="0dp"
@ -64,6 +64,51 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<RelativeLayout
android:id="@+id/linear_exist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:background="@drawable/other_text"
android:padding="2dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/linear_phone">
<TextView
android:id="@+id/tv_exist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="18dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:text="是否存在*"
android:textColor="#333" />
<Spinner
android:id="@+id/spinner_exist"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_marginLeft="18dp"
android:layout_marginRight="10dp"
android:layout_toEndOf="@id/tv_exist"
android:layout_toRightOf="@id/tv_exist"
android:background="@color/white"
android:textColor="#333"
android:textSize="15sp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/ic_baseline_arrow_drop" />
</RelativeLayout>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
@ -152,6 +197,7 @@
android:hint="任务名称" android:hint="任务名称"
android:textSize="12sp" /> android:textSize="12sp" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<TextView <TextView
@ -177,6 +223,7 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_other_picture"> app:layout_constraintTop_toBottomOf="@+id/tv_other_picture">
<RelativeLayout <RelativeLayout
android:id="@+id/rl_picture" android:id="@+id/rl_picture"
android:layout_width="150dp" android:layout_width="150dp"
@ -184,31 +231,32 @@
android:layout_margin="10dp" android:layout_margin="10dp"
android:background="#03A9F4" android:background="#03A9F4"
android:gravity="center"> android:gravity="center">
<ImageView <ImageView
android:id="@+id/image_picture" android:id="@+id/image_picture"
android:layout_centerHorizontal="true"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_marginTop="20dp"
android:background="@drawable/plus"
android:layout_height="40dp" android:layout_height="40dp"
/> android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:background="@drawable/plus" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="照片"
android:textSize="8sp"
android:layout_margin="5dp"
android:textColor="@color/pickerview_wheelview_textcolor_divider"
android:layout_below="@id/image_picture" android:layout_below="@id/image_picture"
/> android:layout_centerHorizontal="true"
android:layout_margin="5dp"
android:text="照片"
android:textColor="@color/pickerview_wheelview_textcolor_divider"
android:textSize="8sp" />
<ImageView <ImageView
android:id="@+id/iv_picture" android:id="@+id/iv_picture"
android:layout_centerInParent="true"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
/> android:layout_centerInParent="true" />
</RelativeLayout> </RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/rl_pictures" android:id="@+id/rl_pictures"
android:layout_width="150dp" android:layout_width="150dp"
@ -216,30 +264,30 @@
android:layout_margin="10dp" android:layout_margin="10dp"
android:background="#03A9F4" android:background="#03A9F4"
android:gravity="center"> android:gravity="center">
<ImageView <ImageView
android:id="@+id/image_pictures" android:id="@+id/image_pictures"
android:layout_centerHorizontal="true"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_marginTop="20dp"
android:background="@drawable/plus"
android:layout_height="40dp" android:layout_height="40dp"
/> android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:background="@drawable/plus" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="照片"
android:textSize="8sp"
android:layout_margin="5dp"
android:textColor="@color/pickerview_wheelview_textcolor_divider"
android:layout_below="@id/image_pictures" android:layout_below="@id/image_pictures"
/> android:layout_centerHorizontal="true"
android:layout_margin="5dp"
android:text="照片"
android:textColor="@color/pickerview_wheelview_textcolor_divider"
android:textSize="8sp" />
<ImageView <ImageView
android:id="@+id/iv_pictures" android:id="@+id/iv_pictures"
android:layout_centerInParent="true"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
/> android:layout_centerInParent="true" />
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>

View File

@ -175,7 +175,50 @@
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintLeft_toLeftOf="@id/iv_road_picture" app:layout_constraintLeft_toLeftOf="@id/iv_road_picture"
app:layout_constraintTop_toBottomOf="@id/iv_road_picture"> app:layout_constraintTop_toBottomOf="@id/iv_road_picture">
<RelativeLayout
android:id="@+id/linear_exist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/other_text"
android:padding="2dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/linear_phone">
<TextView
android:id="@+id/tv_exist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="18dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:text="是否存在*"
android:textColor="#333" />
<Spinner
android:id="@+id/spinner_exist"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_marginLeft="18dp"
android:layout_marginRight="10dp"
android:layout_toEndOf="@id/tv_exist"
android:layout_toRightOf="@id/tv_exist"
android:background="@color/white"
android:textColor="#333"
android:textSize="15sp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/ic_baseline_arrow_drop" />
</RelativeLayout>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@ -175,6 +175,50 @@
android:layout_centerInParent="true" android:layout_centerInParent="true"
/> />
</RelativeLayout> </RelativeLayout>
<RelativeLayout
android:id="@+id/linear_exist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:padding="2dp"
android:visibility="gone"
android:background="@drawable/underline"
app:layout_constraintTop_toBottomOf="@id/linear_phone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:id="@+id/tv_exist"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="是否存在*"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:textColor="#333"
android:layout_marginLeft="18dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<Spinner
android:id="@+id/spinner_exist"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_marginLeft="18dp"
android:layout_toRightOf="@id/tv_exist"
android:background="@color/white"
android:layout_marginRight="10dp"
android:layout_toEndOf="@id/tv_exist"
android:textSize="15sp"
android:textColor="#333" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/ic_baseline_arrow_drop"
/>
</RelativeLayout>
<TextView <TextView
android:id="@+id/tv_02" android:id="@+id/tv_02"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -182,7 +226,7 @@
android:text="02拍照" android:text="02拍照"
android:layout_margin="10dp" android:layout_margin="10dp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/linear_phone" /> app:layout_constraintTop_toBottomOf="@id/linear_exist" />
<LinearLayout <LinearLayout
android:id="@+id/linear_photograph" android:id="@+id/linear_photograph"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -171,6 +171,50 @@
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintLeft_toLeftOf="@id/iv_road_picture" app:layout_constraintLeft_toLeftOf="@id/iv_road_picture"
app:layout_constraintTop_toBottomOf="@id/iv_road_picture"> app:layout_constraintTop_toBottomOf="@id/iv_road_picture">
<RelativeLayout
android:id="@+id/linear_exist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/other_text"
android:padding="2dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/linear_phone">
<TextView
android:id="@+id/tv_exist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="18dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:text="是否存在*"
android:textColor="#333" />
<Spinner
android:id="@+id/spinner_exist"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_marginLeft="18dp"
android:layout_marginRight="10dp"
android:layout_toEndOf="@id/tv_exist"
android:layout_toRightOf="@id/tv_exist"
android:background="@color/white"
android:textColor="#333"
android:textSize="15sp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/ic_baseline_arrow_drop" />
</RelativeLayout>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"