修改删选流程上的bug
This commit is contained in:
parent
440fd90a5f
commit
9d4e5aa4e4
@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion '29.0.2'
|
||||
ndkVersion '23.0.7123448'
|
||||
//Version '23.0.7123448'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.navinfo.outdoor"
|
||||
|
@ -36,7 +36,6 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
tvRegister = (TextView) findViewById(R.id.tv_register);
|
||||
|
||||
etLoginName = (EditText) findViewById(R.id.et_login_name);
|
||||
etLoginPaw = (EditText) findViewById(R.id.et_login_paw);
|
||||
tvForgetPaw = (TextView) findViewById(R.id.tv_forget_paw);
|
||||
|
@ -1,12 +1,5 @@
|
||||
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.pm.PermissionGroupInfo;
|
||||
import android.os.CountDownTimer;
|
||||
import android.view.View;
|
||||
|
||||
@ -19,7 +12,6 @@ import com.kongzue.dialog.v3.MessageDialog;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.base.BaseActivity;
|
||||
import com.kongzue.dialog.util.DialogSettings;
|
||||
import com.umeng.commonsdk.debug.E;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
@ -54,19 +46,18 @@ public class MainActivity extends BaseActivity {
|
||||
// 申请单个权限
|
||||
.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.CAMERA)
|
||||
// 位置权限
|
||||
.permission(Permission.ACCESS_FINE_LOCATION)
|
||||
// .permission(Permission.ACCESS_BACKGROUND_LOCATION)
|
||||
//.permission(Permission.ACCESS_BACKGROUND_LOCATION)
|
||||
.permission(Permission.ACCESS_COARSE_LOCATION)
|
||||
//读写权限
|
||||
.permission(Permission.READ_PHONE_STATE)
|
||||
.request(new OnPermissionCallback() {
|
||||
|
||||
@Override
|
||||
public void onGranted(List<String> permissions, boolean all) {
|
||||
if (all) {
|
||||
|
@ -53,7 +53,6 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
||||
private ImageView ivUser;
|
||||
private TextView region;
|
||||
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 LinearLayout llRegion;
|
||||
private String userqq;
|
||||
|
@ -64,7 +64,7 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder
|
||||
holder.tvDistance.setText("距离:" +0);
|
||||
}
|
||||
//0.未领取 1.已领取,2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功),4已上传(结束采集),
|
||||
if (poiEntity.getTaskStatus() == 0) {
|
||||
if (poiEntity.getTaskStatus() == 0) {//"未领取", "已领取", "未保存", "已保存"
|
||||
holder.tvTaskStatus.setVisibility(View.GONE);
|
||||
holder.tvTaskStatus.setText("未领取");
|
||||
} else if (poiEntity.getTaskStatus() == 1) {
|
||||
|
@ -55,6 +55,7 @@ import com.navinfo.outdoor.util.PictureUtil;
|
||||
import com.navinfo.outdoor.util.ToastUtil;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
|
@ -357,8 +357,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
|
||||
//数据展示
|
||||
initShowPoi();
|
||||
//禁用所有可操作控件
|
||||
//disables();
|
||||
|
||||
onLongDelPic();
|
||||
|
||||
@ -575,6 +573,17 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
obtain.what = Constant.CHARGING_STATION;
|
||||
obtain.obj = showStation;
|
||||
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);
|
||||
break;
|
||||
case R.id.linear_charging_pile:
|
||||
String showStation = initShowStation();
|
||||
Message obtains = Message.obtain();
|
||||
obtains.what = Constant.CHARGING_STATION;
|
||||
obtains.obj = showStation;
|
||||
EventBus.getDefault().post(obtains);
|
||||
initPile();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -915,7 +920,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
infoPhoto.add(new Info(tagScutcheon));
|
||||
}
|
||||
}
|
||||
|
||||
poiEntity.setExistence(existence);
|
||||
poiEntity.setPhotoInfo(infoPhoto);
|
||||
poiEntity.setStation_type(station_type);
|
||||
@ -1405,15 +1409,15 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
/* new Thread(new Runnable() {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
if (poiDaoPoiEntity != null && poiDaoPoiEntity.getName() == null) {
|
||||
if (poiDaoPoiEntity != null && poiDaoPoiEntity.getMemo() == null) {
|
||||
poiDao.deletePoiEntity(poiDaoPoiEntity);
|
||||
chargingPileDao.deleteChargingFidPileEntity(showPoiEntity.getId());
|
||||
}
|
||||
}
|
||||
}).start();*/
|
||||
}).start();
|
||||
}
|
||||
}
|
@ -60,7 +60,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
@Override
|
||||
public void onHiddenChanged(boolean hidden) {
|
||||
super.onHiddenChanged(hidden);
|
||||
if (hidden) {
|
||||
if (!hidden) {
|
||||
View header1 = LayoutInflater.from(getActivity()).inflate(R.layout.filter_header, null);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
@ -262,14 +262,16 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
clType = findViewById(R.id.cl_type);
|
||||
clType.setOnClickListener(this::onClick);
|
||||
tvType = findViewById(R.id.tv_type);
|
||||
if (Constant.TASK_STASTUS == -1) {
|
||||
if (Constant.TASK_STASTUS == -1) {//"未领取", "已领取", "未保存", "已保存"
|
||||
tvType.setText("全部");
|
||||
}else if(Constant.TASK_STASTUS==0){
|
||||
tvType.setText("未领取");
|
||||
} else if (Constant.TASK_STASTUS == 1) {
|
||||
tvType.setText("已领取");
|
||||
} else if (Constant.TASK_STASTUS == 2) {
|
||||
tvType.setText("待提交");
|
||||
tvType.setText("未保存");
|
||||
} else if (Constant.TASK_STASTUS == 3) {
|
||||
tvType.setText("未领取");
|
||||
tvType.setText("已保存");
|
||||
}
|
||||
|
||||
btnFilter = findViewById(R.id.btn_filter);
|
||||
|
@ -110,7 +110,6 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
if (!EventBus.getDefault().isRegistered(this)) {//加上判断
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -365,7 +364,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
public void initPoiSaveLocal(boolean isLocal) {
|
||||
XXPermissions.with(this)
|
||||
//读写权限
|
||||
.permission(Permission.READ_EXTERNAL_STORAGE, Permission.WRITE_EXTERNAL_STORAGE)
|
||||
.permission(Permission.MANAGE_EXTERNAL_STORAGE)
|
||||
.request(new OnPermissionCallback() {
|
||||
@Override
|
||||
public void onGranted(List<String> permissions, boolean all) {
|
||||
@ -614,7 +613,6 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// int angle1 = PictureUtil.readPictureDegree(takePhotoPath);
|
||||
//照片路径
|
||||
takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivPicture.setTag(takePhotoPath);
|
||||
@ -637,7 +635,6 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// int angle2 = PictureUtil.readPictureDegree(takePhotoPath2);
|
||||
//照片路径
|
||||
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivPictures.setTag(takePhotoPath2);
|
||||
@ -651,15 +648,15 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
// new Thread(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
// if (poiDaoPoiEntity!=null&&poiDaoPoiEntity.getName() == null) {
|
||||
// poiDao.deletePoiEntity(poiDaoPoiEntity);
|
||||
// }
|
||||
// }
|
||||
// }).start();
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
if (poiDaoPoiEntity!=null&&poiDaoPoiEntity.getMemo() == null) {
|
||||
poiDao.deletePoiEntity(poiDaoPoiEntity);
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
}
|
@ -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 ContactView contactView;
|
||||
private ArrayList<File> poiPicList;
|
||||
@ -243,16 +239,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
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();
|
||||
//禁用所有可操作控件
|
||||
//disables();
|
||||
//拍照长按删除
|
||||
onLongDel();
|
||||
|
||||
@ -799,7 +787,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
|
||||
onBackPressed();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -913,7 +900,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} 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.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
@ -933,8 +920,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// int angle2 = PictureUtil.readPictureDegree(takePhotoPath2);
|
||||
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
String takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivName.setTag(takePhotoPath2);
|
||||
ivName.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
@ -954,8 +940,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// int angle3 = PictureUtil.readPictureDegree(takePhotoPath3);
|
||||
takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
String takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivInternal.setTag(takePhotoPath3);
|
||||
ivInternal.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
@ -975,8 +960,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// int angle4 = PictureUtil.readPictureDegree(takePhotoPath4);
|
||||
takePhotoPath4 = PhotoPathUtil.getTakePhotoPath(data, "d", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
String takePhotoPath4 = PhotoPathUtil.getTakePhotoPath(data, "d", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivCard.setTag(takePhotoPath4);
|
||||
ivCard.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
@ -996,8 +980,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// int angle5 = PictureUtil.readPictureDegree(takePhotoPath5);
|
||||
takePhotoPath5 = PhotoPathUtil.getTakePhotoPath(data, "e", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
String takePhotoPath5 = PhotoPathUtil.getTakePhotoPath(data, "e", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
||||
ivElse.setTag(takePhotoPath5);
|
||||
ivElse.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
@ -1016,15 +999,15 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
// new Thread(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
// if (poiDaoPoiEntity!=null&&poiDaoPoiEntity.getName() == null) {
|
||||
// poiDao.deletePoiEntity(poiDaoPoiEntity);
|
||||
// }
|
||||
// }
|
||||
// }).start();
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
if (poiDaoPoiEntity!=null&&poiDaoPoiEntity.getMemo() == null) {
|
||||
poiDao.deletePoiEntity(poiDaoPoiEntity);
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
|
||||
|
@ -193,8 +193,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
});
|
||||
//添加数据
|
||||
initShowPoi();
|
||||
//禁用可操作性控件
|
||||
// disables();
|
||||
}
|
||||
|
||||
private void initShowPoi() {
|
||||
@ -242,11 +240,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
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();
|
||||
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
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))//加上判断
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
/* new Thread(new Runnable() {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
if (poiDaoPoiEntity != null && poiDaoPoiEntity.getName() == null) {
|
||||
if (poiDaoPoiEntity!=null&&poiDaoPoiEntity.getMemo() == null) {
|
||||
poiDao.deletePoiEntity(poiDaoPoiEntity);
|
||||
}
|
||||
}
|
||||
}).start();*/
|
||||
}).start();
|
||||
}
|
||||
}
|
@ -315,7 +315,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
|
||||
private void initList(TencentLocation tencentLocation) {
|
||||
showLoadingDialog();
|
||||
|
||||
int task_type = Constant.TASK_TYPE;
|
||||
int limit_type = Constant.LIMIT_TTPE;
|
||||
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());
|
||||
long date = System.currentTimeMillis();
|
||||
OkGo.getInstance().cancelTag(this);
|
||||
showLoadingDialog();
|
||||
// 请求方式和请求url
|
||||
OkGo.<JobSearchBean>get(HttpInterface.TASK_LIST)
|
||||
.tag(this)
|
||||
@ -786,19 +787,12 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
FilterFragment filterFragment = (FilterFragment) supportFragmentManager.findFragmentByTag(FilterFragment.class.getName());
|
||||
if (filterFragment != null) {
|
||||
fragmentTransaction.remove(filterFragment);
|
||||
// fragmentTransaction.commit();
|
||||
|
||||
}
|
||||
} 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;
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putBoolean("isSliding", true); // 通知抽屉不收回
|
||||
bundle.putBoolean("isSliding", false); // 通知抽屉不收回
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
switch (poiEntity.getType()) {
|
||||
case 1:
|
||||
@ -823,7 +817,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
break;
|
||||
}
|
||||
frameLayout.setVisibility(View.GONE);
|
||||
fragmentTransaction.remove(gatherGetFragment);
|
||||
if (gatherGetFragment!=null){
|
||||
fragmentTransaction.remove(gatherGetFragment);
|
||||
}
|
||||
} else if (data.what == Constant.GATHER_GET_MAP) { //地图界面点击采集 点击开始采集
|
||||
PoiEntity poiEntity = (PoiEntity) data.obj;
|
||||
Bundle bundle = new Bundle();
|
||||
@ -852,7 +848,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
break;
|
||||
}
|
||||
frameLayout.setVisibility(View.GONE);
|
||||
fragmentTransaction.remove(gatherGetFragment);
|
||||
if (gatherGetFragment!=null){
|
||||
fragmentTransaction.remove(gatherGetFragment);
|
||||
}
|
||||
} else if (data.what == Constant.FILTER_LIST) { // 筛选列表所有数据地图显示
|
||||
List<PoiEntity> poiEntities = (List<PoiEntity>) data.obj;
|
||||
initFilterMarker(poiEntities);
|
||||
@ -869,10 +867,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
initCheckedMarker(Constant.CHARGING_STATION_WORD);
|
||||
}
|
||||
} 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) {//充电桩采集-确定位置
|
||||
if ((boolean) data.obj) {
|
||||
initCheckedMarker(Constant.CHARGING_PILE_WORD);
|
||||
initCheckedPileMarker(Constant.CHARGING_PILE_WORD);
|
||||
}
|
||||
} else if (data.what == Constant.MAIN_OTHER) {//其他采集-移动位置
|
||||
initPoiMarker((LatLng) data.obj);
|
||||
@ -891,7 +889,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
if (markerPile!=null){
|
||||
markerPile.remove();
|
||||
}
|
||||
bigMarker.setVisible(false);
|
||||
if (bigMarker!=null){
|
||||
bigMarker.setVisible(false);
|
||||
}
|
||||
}
|
||||
} else if (data.what == Constant.MAIN_BUTTON_VISIABLE) {//控制主界面各个按钮显隐状态的what值
|
||||
setMainButtonVisiable((Integer) data.obj);
|
||||
@ -911,7 +911,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
setMainButtonVisiable(View.VISIBLE);
|
||||
frameLayout.setVisibility(View.GONE);
|
||||
fragmentTransaction.remove(gatherGetFragment);
|
||||
bigMarker.setVisible(false);
|
||||
if (bigMarker!=null){
|
||||
bigMarker.setVisible(false);
|
||||
}
|
||||
}
|
||||
} else if (data.what == Constant.CHARGING_STATION) {//充电站的充电桩-新增
|
||||
Bundle bundle = new Bundle();
|
||||
@ -993,7 +995,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
setMainButtonVisiable(View.VISIBLE);
|
||||
frameLayout.setVisibility(View.GONE);
|
||||
fragmentTransaction.remove(gatherGetFragment);
|
||||
bigMarker.setVisible(false);
|
||||
if (bigMarker!=null){
|
||||
bigMarker.setVisible(false);
|
||||
}
|
||||
Toast.makeText(getActivity(), "不在作业范围", Toast.LENGTH_SHORT).show();
|
||||
}else {
|
||||
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) {
|
||||
if (screenPosition != null) {
|
||||
@ -1306,10 +1349,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}).setTitle(title);
|
||||
break;
|
||||
case R.id.iv_filter:
|
||||
FilterFragment filterFragment = FilterFragment.newInstance(new Bundle());
|
||||
showSlidingFragment(filterFragment);
|
||||
initThread();
|
||||
initList(Constant.currentLocation);
|
||||
FilterFragment filterFragment = FilterFragment.newInstance(new Bundle());
|
||||
showSlidingFragment(filterFragment);
|
||||
|
||||
break;
|
||||
case R.id.iv_message:
|
||||
Intent messageIntent = new Intent(getContext(), FragmentManagement.class);
|
||||
|
@ -108,8 +108,7 @@
|
||||
android:layout_toRightOf="@id/tv_name"
|
||||
android:background="@color/white"
|
||||
android:hint="名称"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:layout_toEndOf="@id/tv_name"
|
||||
android:layout_toStartOf="@id/tv_examine"
|
||||
android:textSize="15sp"
|
||||
|
@ -150,8 +150,7 @@
|
||||
android:layout_marginLeft="15dp"
|
||||
android:background="@null"
|
||||
android:hint="任务名称"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/test_color_selector"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
@ -107,6 +107,7 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="18dp"
|
||||
android:layout_toRightOf="@id/tv_name"
|
||||
android:singleLine="true"
|
||||
android:background="@color/white"
|
||||
android:hint="poi名称"
|
||||
android:inputType="text"
|
||||
|
Loading…
x
Reference in New Issue
Block a user