修改删选流程上的bug

This commit is contained in:
wds 2021-07-29 20:16:48 +08:00
parent 440fd90a5f
commit 9d4e5aa4e4
15 changed files with 120 additions and 109 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' //Version '23.0.7123448'
defaultConfig { defaultConfig {
applicationId "com.navinfo.outdoor" applicationId "com.navinfo.outdoor"

View File

@ -36,7 +36,6 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
protected void initView() { protected void initView() {
super.initView(); super.initView();
tvRegister = (TextView) findViewById(R.id.tv_register); tvRegister = (TextView) findViewById(R.id.tv_register);
etLoginName = (EditText) findViewById(R.id.et_login_name); etLoginName = (EditText) findViewById(R.id.et_login_name);
etLoginPaw = (EditText) findViewById(R.id.et_login_paw); etLoginPaw = (EditText) findViewById(R.id.et_login_paw);
tvForgetPaw = (TextView) findViewById(R.id.tv_forget_paw); tvForgetPaw = (TextView) findViewById(R.id.tv_forget_paw);

View File

@ -1,12 +1,5 @@
package com.navinfo.outdoor.activity; package com.navinfo.outdoor.activity;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import android.Manifest;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PermissionGroupInfo;
import android.os.CountDownTimer; import android.os.CountDownTimer;
import android.view.View; import android.view.View;
@ -19,7 +12,6 @@ import com.kongzue.dialog.v3.MessageDialog;
import com.navinfo.outdoor.R; import com.navinfo.outdoor.R;
import com.navinfo.outdoor.base.BaseActivity; import com.navinfo.outdoor.base.BaseActivity;
import com.kongzue.dialog.util.DialogSettings; import com.kongzue.dialog.util.DialogSettings;
import com.umeng.commonsdk.debug.E;
import java.util.List; import java.util.List;
@ -54,19 +46,18 @@ public class MainActivity extends BaseActivity {
// 申请单个权限 // 申请单个权限
.permission(Permission.RECORD_AUDIO) .permission(Permission.RECORD_AUDIO)
// 申请多个权限 // 申请多个权限
// .permission(Permission.Group.CALENDAR) //.permission(Permission.Group.CALENDAR)
// 申请读写外部存储卡 // 申请读写外部存储卡
.permission(Permission.MANAGE_EXTERNAL_STORAGE/*, Permission.READ_EXTERNAL_STORAGE, Permission.WRITE_EXTERNAL_STORAGE*/) .permission(Permission.MANAGE_EXTERNAL_STORAGE/*, Permission.READ_EXTERNAL_STORAGE, Permission.WRITE_EXTERNAL_STORAGE*/)
// 申请相机权限 // 申请相机权限
.permission(Permission.CAMERA) .permission(Permission.CAMERA)
// 位置权限 // 位置权限
.permission(Permission.ACCESS_FINE_LOCATION) .permission(Permission.ACCESS_FINE_LOCATION)
// .permission(Permission.ACCESS_BACKGROUND_LOCATION) //.permission(Permission.ACCESS_BACKGROUND_LOCATION)
.permission(Permission.ACCESS_COARSE_LOCATION) .permission(Permission.ACCESS_COARSE_LOCATION)
//读写权限 //读写权限
.permission(Permission.READ_PHONE_STATE) .permission(Permission.READ_PHONE_STATE)
.request(new OnPermissionCallback() { .request(new OnPermissionCallback() {
@Override @Override
public void onGranted(List<String> permissions, boolean all) { public void onGranted(List<String> permissions, boolean all) {
if (all) { if (all) {

View File

@ -53,7 +53,6 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
private ImageView ivUser; private ImageView ivUser;
private TextView region; private TextView region;
private EditText etPhone, etQq, etMailbox; private EditText etPhone, etQq, etMailbox;
// public static Pattern compile = Pattern.compile("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,})$/");
private Button userSave; private Button userSave;
private LinearLayout llRegion; private LinearLayout llRegion;
private String userqq; private String userqq;

View File

@ -64,7 +64,7 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder
holder.tvDistance.setText("距离:" +0); holder.tvDistance.setText("距离:" +0);
} }
//0.未领取 1.已领取2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功)4已上传结束采集, //0.未领取 1.已领取2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功)4已上传结束采集,
if (poiEntity.getTaskStatus() == 0) { if (poiEntity.getTaskStatus() == 0) {//"未领取", "已领取", "未保存", "已保存"
holder.tvTaskStatus.setVisibility(View.GONE); holder.tvTaskStatus.setVisibility(View.GONE);
holder.tvTaskStatus.setText("未领取"); holder.tvTaskStatus.setText("未领取");
} else if (poiEntity.getTaskStatus() == 1) { } else if (poiEntity.getTaskStatus() == 1) {

View File

@ -55,6 +55,7 @@ import com.navinfo.outdoor.util.PictureUtil;
import com.navinfo.outdoor.util.ToastUtil; import com.navinfo.outdoor.util.ToastUtil;
import com.tencent.tencentmap.mapsdk.maps.model.LatLng; 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;

View File

@ -357,8 +357,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
//数据展示 //数据展示
initShowPoi(); initShowPoi();
//禁用所有可操作控件
//disables();
onLongDelPic(); onLongDelPic();
@ -575,6 +573,17 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
obtain.what = Constant.CHARGING_STATION; obtain.what = Constant.CHARGING_STATION;
obtain.obj = showStation; obtain.obj = showStation;
EventBus.getDefault().post(obtain); EventBus.getDefault().post(obtain);
}else {
Message obtains = Message.obtain();
obtains.what = Constant.CHARGING_STATION_PILE;
obtains.obj = null;
EventBus.getDefault().post(obtains);
initRemovePileSharePre();
String showStation = initShowStation();
Message obtain = Message.obtain();
obtain.what = Constant.CHARGING_STATION;
obtain.obj = showStation;
EventBus.getDefault().post(obtain);
} }
} }
@ -744,11 +753,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
startActivityForResult(intentScutcheon, 105); startActivityForResult(intentScutcheon, 105);
break; break;
case R.id.linear_charging_pile: case R.id.linear_charging_pile:
String showStation = initShowStation(); initPile();
Message obtains = Message.obtain();
obtains.what = Constant.CHARGING_STATION;
obtains.obj = showStation;
EventBus.getDefault().post(obtains);
break; break;
} }
} }
@ -915,7 +920,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
infoPhoto.add(new Info(tagScutcheon)); infoPhoto.add(new Info(tagScutcheon));
} }
} }
poiEntity.setExistence(existence); poiEntity.setExistence(existence);
poiEntity.setPhotoInfo(infoPhoto); poiEntity.setPhotoInfo(infoPhoto);
poiEntity.setStation_type(station_type); poiEntity.setStation_type(station_type);
@ -1405,15 +1409,15 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
if (EventBus.getDefault().isRegistered(this))//加上判断 if (EventBus.getDefault().isRegistered(this))//加上判断
EventBus.getDefault().unregister(this); EventBus.getDefault().unregister(this);
super.onDestroy(); super.onDestroy();
/* new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId()); PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
if (poiDaoPoiEntity != null && poiDaoPoiEntity.getName() == null) { if (poiDaoPoiEntity != null && poiDaoPoiEntity.getMemo() == null) {
poiDao.deletePoiEntity(poiDaoPoiEntity); poiDao.deletePoiEntity(poiDaoPoiEntity);
chargingPileDao.deleteChargingFidPileEntity(showPoiEntity.getId()); chargingPileDao.deleteChargingFidPileEntity(showPoiEntity.getId());
} }
} }
}).start();*/ }).start();
} }
} }

View File

@ -60,7 +60,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
@Override @Override
public void onHiddenChanged(boolean hidden) { public void onHiddenChanged(boolean hidden) {
super.onHiddenChanged(hidden); super.onHiddenChanged(hidden);
if (hidden) { if (!hidden) {
View header1 = LayoutInflater.from(getActivity()).inflate(R.layout.filter_header, null); View header1 = LayoutInflater.from(getActivity()).inflate(R.layout.filter_header, null);
Message obtain = Message.obtain(); Message obtain = Message.obtain();
obtain.what = Constant.MAIN_HEADER; obtain.what = Constant.MAIN_HEADER;
@ -262,14 +262,16 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
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) { if (Constant.TASK_STASTUS == -1) {//"未领取", "已领取", "未保存", "已保存"
tvType.setText("全部"); tvType.setText("全部");
}else if(Constant.TASK_STASTUS==0){
tvType.setText("未领取");
} else if (Constant.TASK_STASTUS == 1) { } else if (Constant.TASK_STASTUS == 1) {
tvType.setText("已领取"); tvType.setText("已领取");
} else if (Constant.TASK_STASTUS == 2) { } else if (Constant.TASK_STASTUS == 2) {
tvType.setText("待提交"); tvType.setText("未保存");
} else if (Constant.TASK_STASTUS == 3) { } else if (Constant.TASK_STASTUS == 3) {
tvType.setText("未领取"); tvType.setText("已保存");
} }
btnFilter = findViewById(R.id.btn_filter); btnFilter = findViewById(R.id.btn_filter);

View File

@ -110,7 +110,6 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
if (!EventBus.getDefault().isRegistered(this)) {//加上判断 if (!EventBus.getDefault().isRegistered(this)) {//加上判断
EventBus.getDefault().register(this); EventBus.getDefault().register(this);
} }
} }
@Override @Override
@ -365,7 +364,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
public void initPoiSaveLocal(boolean isLocal) { public void initPoiSaveLocal(boolean isLocal) {
XXPermissions.with(this) XXPermissions.with(this)
//读写权限 //读写权限
.permission(Permission.READ_EXTERNAL_STORAGE, Permission.WRITE_EXTERNAL_STORAGE) .permission(Permission.MANAGE_EXTERNAL_STORAGE)
.request(new OnPermissionCallback() { .request(new OnPermissionCallback() {
@Override @Override
public void onGranted(List<String> permissions, boolean all) { public void onGranted(List<String> permissions, boolean all) {
@ -614,7 +613,6 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
} }
}); });
} else { } else {
// int angle1 = PictureUtil.readPictureDegree(takePhotoPath);
//照片路径 //照片路径
takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a", Geohash.getInstance().encode(latLng.latitude, latLng.longitude)); takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
ivPicture.setTag(takePhotoPath); ivPicture.setTag(takePhotoPath);
@ -637,7 +635,6 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
} }
}); });
} else { } else {
// int angle2 = PictureUtil.readPictureDegree(takePhotoPath2);
//照片路径 //照片路径
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b", Geohash.getInstance().encode(latLng.latitude, latLng.longitude)); takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
ivPictures.setTag(takePhotoPath2); ivPictures.setTag(takePhotoPath2);
@ -651,15 +648,15 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
if (EventBus.getDefault().isRegistered(this))//加上判断 if (EventBus.getDefault().isRegistered(this))//加上判断
EventBus.getDefault().unregister(this); EventBus.getDefault().unregister(this);
super.onDestroy(); super.onDestroy();
// new Thread(new Runnable() { new Thread(new Runnable() {
// @Override @Override
// public void run() { public void run() {
// PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId()); PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
// if (poiDaoPoiEntity!=null&&poiDaoPoiEntity.getName() == null) { if (poiDaoPoiEntity!=null&&poiDaoPoiEntity.getMemo() == null) {
// poiDao.deletePoiEntity(poiDaoPoiEntity); poiDao.deletePoiEntity(poiDaoPoiEntity);
// } }
// } }
// }).start(); }).start();
} }
} }

View File

@ -99,11 +99,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
//获取的拍照图片 //获取的拍照图片
private String takePhotoPath2;
private String takePhotoPath5;
private String takePhotoPath4;
private String takePhotoPath3;
private String takePhotoPath1;
private LinearLayout linearContact; private LinearLayout linearContact;
private ContactView contactView; private ContactView contactView;
private ArrayList<File> poiPicList; private ArrayList<File> poiPicList;
@ -243,16 +239,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
public void onNothingSelected(AdapterView<?> parent) { public void onNothingSelected(AdapterView<?> parent) {
} }
}); });
/*recyclerPhone = findViewById(R.id.recycler_phone);
recyclerPhone.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerPhone.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
poiRecycleAdapter = new PoiRecycleAdapter(getContext());
recyclerPhone.setAdapter(poiRecycleAdapter);*/
//数据展示 //数据展示
initShowPoi(); initShowPoi();
//禁用所有可操作控件
//disables();
//拍照长按删除 //拍照长按删除
onLongDel(); onLongDel();
@ -799,7 +787,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
onBackPressed(); onBackPressed();
} }
} }
}); });
} }
@ -913,7 +900,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
} }
}); });
} else { } else {
takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a", Geohash.getInstance().encode(latLng.latitude, latLng.longitude)); String takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
ivPanorama.setTag(takePhotoPath1); ivPanorama.setTag(takePhotoPath1);
ivPanorama.setImageBitmap(bitmap);//显示图像 ivPanorama.setImageBitmap(bitmap);//显示图像
} }
@ -933,8 +920,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
} }
}); });
} else { } else {
// int angle2 = PictureUtil.readPictureDegree(takePhotoPath2); String takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
ivName.setTag(takePhotoPath2); ivName.setTag(takePhotoPath2);
ivName.setImageBitmap(bitmap);//显示图像 ivName.setImageBitmap(bitmap);//显示图像
} }
@ -954,8 +940,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
} }
}); });
} else { } else {
// int angle3 = PictureUtil.readPictureDegree(takePhotoPath3); String takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
ivInternal.setTag(takePhotoPath3); ivInternal.setTag(takePhotoPath3);
ivInternal.setImageBitmap(bitmap);//显示图像 ivInternal.setImageBitmap(bitmap);//显示图像
} }
@ -975,8 +960,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
} }
}); });
} else { } else {
// int angle4 = PictureUtil.readPictureDegree(takePhotoPath4); String takePhotoPath4 = PhotoPathUtil.getTakePhotoPath(data, "d", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
takePhotoPath4 = PhotoPathUtil.getTakePhotoPath(data, "d", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
ivCard.setTag(takePhotoPath4); ivCard.setTag(takePhotoPath4);
ivCard.setImageBitmap(bitmap);//显示图像 ivCard.setImageBitmap(bitmap);//显示图像
} }
@ -996,8 +980,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
} }
}); });
} else { } else {
// int angle5 = PictureUtil.readPictureDegree(takePhotoPath5); String takePhotoPath5 = PhotoPathUtil.getTakePhotoPath(data, "e", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
takePhotoPath5 = PhotoPathUtil.getTakePhotoPath(data, "e", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
ivElse.setTag(takePhotoPath5); ivElse.setTag(takePhotoPath5);
ivElse.setImageBitmap(bitmap);//显示图像 ivElse.setImageBitmap(bitmap);//显示图像
} }
@ -1016,15 +999,15 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
if (EventBus.getDefault().isRegistered(this))//加上判断 if (EventBus.getDefault().isRegistered(this))//加上判断
EventBus.getDefault().unregister(this); EventBus.getDefault().unregister(this);
super.onDestroy(); super.onDestroy();
// new Thread(new Runnable() { new Thread(new Runnable() {
// @Override @Override
// public void run() { public void run() {
// PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId()); PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
// if (poiDaoPoiEntity!=null&&poiDaoPoiEntity.getName() == null) { if (poiDaoPoiEntity!=null&&poiDaoPoiEntity.getMemo() == null) {
// poiDao.deletePoiEntity(poiDaoPoiEntity); poiDao.deletePoiEntity(poiDaoPoiEntity);
// } }
// } }
// }).start(); }).start();
} }

View File

@ -193,8 +193,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
}); });
//添加数据 //添加数据
initShowPoi(); initShowPoi();
//禁用可操作性控件
// disables();
} }
private void initShowPoi() { private void initShowPoi() {
@ -242,11 +240,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
rbBicycle.setEnabled(false); rbBicycle.setEnabled(false);
} }
@Override
protected void initData() {
super.initData();
// infos = new ArrayList<>();
}
/** /**
* 获取本地视频的第一帧 * 获取本地视频的第一帧
@ -523,7 +516,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
}); });
} }
}).start(); }).start();
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
} else { } else {
Toast.makeText(getActivity(), ""+poiVideoBean.getMessage(), Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), ""+poiVideoBean.getMessage(), Toast.LENGTH_SHORT).show();
} }
@ -640,14 +632,14 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
if (EventBus.getDefault().isRegistered(this))//加上判断 if (EventBus.getDefault().isRegistered(this))//加上判断
EventBus.getDefault().unregister(this); EventBus.getDefault().unregister(this);
super.onDestroy(); super.onDestroy();
/* new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId()); PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
if (poiDaoPoiEntity != null && poiDaoPoiEntity.getName() == null) { if (poiDaoPoiEntity!=null&&poiDaoPoiEntity.getMemo() == null) {
poiDao.deletePoiEntity(poiDaoPoiEntity); poiDao.deletePoiEntity(poiDaoPoiEntity);
} }
} }
}).start();*/ }).start();
} }
} }

View File

@ -315,7 +315,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
} }
private void initList(TencentLocation tencentLocation) { private void initList(TencentLocation tencentLocation) {
showLoadingDialog();
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;
@ -334,6 +334,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
userEncode = Geohash.getInstance().encode(tencentLocation.getLatitude(), tencentLocation.getLongitude()); userEncode = Geohash.getInstance().encode(tencentLocation.getLatitude(), tencentLocation.getLongitude());
long date = System.currentTimeMillis(); long date = System.currentTimeMillis();
OkGo.getInstance().cancelTag(this); OkGo.getInstance().cancelTag(this);
showLoadingDialog();
// 请求方式和请求url // 请求方式和请求url
OkGo.<JobSearchBean>get(HttpInterface.TASK_LIST) OkGo.<JobSearchBean>get(HttpInterface.TASK_LIST)
.tag(this) .tag(this)
@ -786,19 +787,12 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
FilterFragment filterFragment = (FilterFragment) supportFragmentManager.findFragmentByTag(FilterFragment.class.getName()); FilterFragment filterFragment = (FilterFragment) supportFragmentManager.findFragmentByTag(FilterFragment.class.getName());
if (filterFragment != null) { if (filterFragment != null) {
fragmentTransaction.remove(filterFragment); fragmentTransaction.remove(filterFragment);
// fragmentTransaction.commit();
} }
} else if (data.what == Constant.GATHER_GET) { //筛选item 点击开始采集 } else if (data.what == Constant.GATHER_GET) { //筛选item 点击开始采集
// 如果当前fragment是筛选则移除该fragment
FilterFragment filterFragment = (FilterFragment) supportFragmentManager.findFragmentByTag(FilterFragment.class.getName());
if (filterFragment != null) {
fragmentTransaction.remove(filterFragment);
//fragmentTransaction.commit();
}
PoiEntity poiEntity = (PoiEntity) data.obj; PoiEntity poiEntity = (PoiEntity) data.obj;
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putBoolean("isSliding", true); // 通知抽屉不收回 bundle.putBoolean("isSliding", false); // 通知抽屉不收回
bundle.putSerializable("poiEntity", poiEntity); bundle.putSerializable("poiEntity", poiEntity);
switch (poiEntity.getType()) { switch (poiEntity.getType()) {
case 1: case 1:
@ -823,7 +817,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
break; break;
} }
frameLayout.setVisibility(View.GONE); frameLayout.setVisibility(View.GONE);
fragmentTransaction.remove(gatherGetFragment); if (gatherGetFragment!=null){
fragmentTransaction.remove(gatherGetFragment);
}
} else if (data.what == Constant.GATHER_GET_MAP) { //地图界面点击采集 点击开始采集 } else if (data.what == Constant.GATHER_GET_MAP) { //地图界面点击采集 点击开始采集
PoiEntity poiEntity = (PoiEntity) data.obj; PoiEntity poiEntity = (PoiEntity) data.obj;
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
@ -852,7 +848,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
break; break;
} }
frameLayout.setVisibility(View.GONE); frameLayout.setVisibility(View.GONE);
fragmentTransaction.remove(gatherGetFragment); if (gatherGetFragment!=null){
fragmentTransaction.remove(gatherGetFragment);
}
} else if (data.what == Constant.FILTER_LIST) { // 筛选列表所有数据地图显示 } else if (data.what == Constant.FILTER_LIST) { // 筛选列表所有数据地图显示
List<PoiEntity> poiEntities = (List<PoiEntity>) data.obj; List<PoiEntity> poiEntities = (List<PoiEntity>) data.obj;
initFilterMarker(poiEntities); initFilterMarker(poiEntities);
@ -869,10 +867,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
initCheckedMarker(Constant.CHARGING_STATION_WORD); initCheckedMarker(Constant.CHARGING_STATION_WORD);
} }
} else if (data.what == Constant.MAIN_CHARGING_PILE) {//充电桩采集-移动位置 } else if (data.what == Constant.MAIN_CHARGING_PILE) {//充电桩采集-移动位置
initPoiMarker((LatLng) data.obj); initPileMarker((LatLng) data.obj);
} else if (data.what == Constant.MAIN_CHARGING_CHECKED_PILE) {//充电桩采集-确定位置 } else if (data.what == Constant.MAIN_CHARGING_CHECKED_PILE) {//充电桩采集-确定位置
if ((boolean) data.obj) { if ((boolean) data.obj) {
initCheckedMarker(Constant.CHARGING_PILE_WORD); initCheckedPileMarker(Constant.CHARGING_PILE_WORD);
} }
} else if (data.what == Constant.MAIN_OTHER) {//其他采集-移动位置 } else if (data.what == Constant.MAIN_OTHER) {//其他采集-移动位置
initPoiMarker((LatLng) data.obj); initPoiMarker((LatLng) data.obj);
@ -891,7 +889,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
if (markerPile!=null){ if (markerPile!=null){
markerPile.remove(); markerPile.remove();
} }
bigMarker.setVisible(false); if (bigMarker!=null){
bigMarker.setVisible(false);
}
} }
} else if (data.what == Constant.MAIN_BUTTON_VISIABLE) {//控制主界面各个按钮显隐状态的what值 } else if (data.what == Constant.MAIN_BUTTON_VISIABLE) {//控制主界面各个按钮显隐状态的what值
setMainButtonVisiable((Integer) data.obj); setMainButtonVisiable((Integer) data.obj);
@ -911,7 +911,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
setMainButtonVisiable(View.VISIBLE); setMainButtonVisiable(View.VISIBLE);
frameLayout.setVisibility(View.GONE); frameLayout.setVisibility(View.GONE);
fragmentTransaction.remove(gatherGetFragment); fragmentTransaction.remove(gatherGetFragment);
bigMarker.setVisible(false); if (bigMarker!=null){
bigMarker.setVisible(false);
}
} }
} else if (data.what == Constant.CHARGING_STATION) {//充电站的充电桩-新增 } else if (data.what == Constant.CHARGING_STATION) {//充电站的充电桩-新增
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
@ -993,7 +995,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
setMainButtonVisiable(View.VISIBLE); setMainButtonVisiable(View.VISIBLE);
frameLayout.setVisibility(View.GONE); frameLayout.setVisibility(View.GONE);
fragmentTransaction.remove(gatherGetFragment); fragmentTransaction.remove(gatherGetFragment);
bigMarker.setVisible(false); if (bigMarker!=null){
bigMarker.setVisible(false);
}
Toast.makeText(getActivity(), "不在作业范围", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), "不在作业范围", Toast.LENGTH_SHORT).show();
}else { }else {
frameLayout.setVisibility(View.VISIBLE); frameLayout.setVisibility(View.VISIBLE);
@ -1053,6 +1057,45 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
}); });
} }
private void initPileMarker(LatLng latLng) {
LatLng mapCenterPoint = getMapCenterPoint();
CameraUpdate cameraSigma = CameraUpdateFactory.newCameraPosition(new CameraPosition(
mapCenterPoint, //中心点坐标地图目标经纬度
tencentMap.getCameraPosition().zoom, //目标缩放级别
tencentMap.getCameraPosition().tilt, //目标倾斜角[0.0 ~ 45.0] (垂直地图时为0)
tencentMap.getCameraPosition().bearing)); //目标旋转角 0~360° (正北方为0)
tencentMap.animateCamera(cameraSigma, new TencentMap.CancelableCallback() {
@Override
public void onFinish() {
screenPosition = tencentMap.getProjection().toScreenLocation(latLng);
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
//创建Marker对象之前设置属性
if (markerPile != null) {
markerPile.setFixingPoint(screenPosition.x, screenPosition.y);
}
}
@Override
public void onCancel() {
}
});
}
private void initCheckedPileMarker(int poiWord) {
if (screenPosition != null) {
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
LatLng latLng = tencentMap.getProjection().fromScreenLocation(screenPosition);
markerPile.setPosition(latLng);
markerPile.setFixingPointEnable(false);
Constant.markerLatlng = latLng;
Message obtain = Message.obtain();
obtain.what = poiWord;
obtain.obj = latLng;
EventBus.getDefault().post(obtain);
}
}
private void initCheckedMarker(int poiWord) { private void initCheckedMarker(int poiWord) {
if (screenPosition != null) { if (screenPosition != null) {
@ -1306,10 +1349,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
}).setTitle(title); }).setTitle(title);
break; break;
case R.id.iv_filter: case R.id.iv_filter:
FilterFragment filterFragment = FilterFragment.newInstance(new Bundle());
showSlidingFragment(filterFragment);
initThread(); initThread();
initList(Constant.currentLocation); initList(Constant.currentLocation);
FilterFragment filterFragment = FilterFragment.newInstance(new Bundle());
showSlidingFragment(filterFragment);
break; break;
case R.id.iv_message: case R.id.iv_message:
Intent messageIntent = new Intent(getContext(), FragmentManagement.class); Intent messageIntent = new Intent(getContext(), FragmentManagement.class);

View File

@ -108,8 +108,7 @@
android:layout_toRightOf="@id/tv_name" android:layout_toRightOf="@id/tv_name"
android:background="@color/white" android:background="@color/white"
android:hint="名称" android:hint="名称"
android:inputType="text" android:singleLine="true"
android:maxLines="1"
android:layout_toEndOf="@id/tv_name" android:layout_toEndOf="@id/tv_name"
android:layout_toStartOf="@id/tv_examine" android:layout_toStartOf="@id/tv_examine"
android:textSize="15sp" android:textSize="15sp"

View File

@ -150,8 +150,7 @@
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:background="@null" android:background="@null"
android:hint="任务名称" android:hint="任务名称"
android:inputType="text" android:singleLine="true"
android:maxLines="1"
android:textColor="@color/test_color_selector" android:textColor="@color/test_color_selector"
android:textSize="12sp" /> android:textSize="12sp" />
</LinearLayout> </LinearLayout>

View File

@ -107,6 +107,7 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="18dp" android:layout_marginLeft="18dp"
android:layout_toRightOf="@id/tv_name" android:layout_toRightOf="@id/tv_name"
android:singleLine="true"
android:background="@color/white" android:background="@color/white"
android:hint="poi名称" android:hint="poi名称"
android:inputType="text" android:inputType="text"