任务marker点击逻辑处理,我的页面请求刷新
This commit is contained in:
parent
4696a7dd29
commit
2156a8a371
@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion '29.0.2'
|
||||
ndkVersion '23.0.7123448'
|
||||
// ndkVersion '23.0.7123448'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.navinfo.outdoor"
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.navinfo.outdoor.activity;
|
||||
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseActivity;
|
||||
import com.navinfo.outdoor.fragment.FindFragment;
|
||||
import com.navinfo.outdoor.fragment.MineFragment;
|
||||
@ -13,6 +14,7 @@ import androidx.fragment.app.FragmentPagerAdapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Message;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
@ -20,6 +22,9 @@ import android.widget.TextView;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
@ -77,12 +82,19 @@ public class HomeActivity extends BaseActivity{
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
mTab.getTabAt(tab.getPosition()).setIcon(pic[tab.getPosition()]);
|
||||
if (tab.getPosition()==3){
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.HOME_MINE;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
}
|
||||
|
||||
//点击table layout效果
|
||||
@Override
|
||||
public void onTabUnselected(TabLayout.Tab tab) {
|
||||
mTab.getTabAt(tab.getPosition()).setIcon(pic1[tab.getPosition()]);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -64,7 +64,8 @@ public class Constant {
|
||||
public static final int CHARGING_STATION_PILE = 26;//跳转到充电桩 传给数据
|
||||
|
||||
public static final int JOB_SEARCH_WORD = 28;//任务搜索的数据
|
||||
|
||||
public static final int GATHER_GET_MAP = 30;//地图点击marker 后弹窗点击开始采集
|
||||
public static final int HOME_MINE = 32;//点击我的实时监听刷新
|
||||
|
||||
public static String USER_ATTESTATION_NAME; //实名认证姓名 银行卡
|
||||
public static int NUMBER =200; //任务个数
|
||||
|
@ -48,7 +48,7 @@ public class JobSearchBean implements Serializable {
|
||||
this.upload = upload;
|
||||
}
|
||||
|
||||
public static class BodyBean {
|
||||
public static class BodyBean implements Serializable{
|
||||
/**
|
||||
* pageNum : 0
|
||||
* list : [{"id":0,"name":"","address":"http://10.130.23.166:8080/cbt/img/blue.png","telephone":11,"geo":"标题11","price":"通过","type":"","dist":""}]
|
||||
@ -103,7 +103,7 @@ public class JobSearchBean implements Serializable {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public static class ListBean {
|
||||
public static class ListBean implements Serializable{
|
||||
/**
|
||||
* id : 0
|
||||
* name :
|
||||
|
@ -89,7 +89,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
private CheckBox checkBoxRight;
|
||||
private String phone = null;
|
||||
private Spinner spinnerType;
|
||||
String[] ctype = new String[]{"全部", "poi", "道路", "充电站", "其他"};
|
||||
String[] ctype = new String[]{"全部", "poi", "充电站", "POI录像", "道路录像"};//1."全部"2 "POI"3 "充电站"4 "POI录像"5 "道路录像",
|
||||
private ArrayAdapter<String> adapter;
|
||||
private LinearLayout linearChargingPile;
|
||||
private RecyclerView recyclerStation;
|
||||
@ -327,6 +327,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
if (describe != null&&!describe.equals("")) {
|
||||
editDescribe.setText(describe);
|
||||
}
|
||||
int station_type = showPoiEntity.getStation_type();
|
||||
spinnerType.setSelection(station_type,true);
|
||||
String telPhone = showPoiEntity.getTelPhone();
|
||||
if (telPhone != null&&!telPhone.equals("")) {
|
||||
phoneData.add(showPoiEntity.getTelPhone());
|
||||
@ -548,15 +550,16 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
} else {
|
||||
aBoolean = false;
|
||||
}
|
||||
if (showPoiEntity.getTaskId()!=0){
|
||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
||||
}
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
String format = formatter.format(calendar.getTime());
|
||||
poiEntity.setCreateTime(format);
|
||||
poiEntity.setType(2);
|
||||
poiEntity.setTaskStatus(1);
|
||||
poiEntity.setIsLocalData(1);
|
||||
|
||||
poiEntity.setTaskStatus(2);
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -668,6 +671,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
if (tagScutcheon != null&&!tagScutcheon.equals("")) {
|
||||
infoPhoto.add(new Info(tagScutcheon));
|
||||
}
|
||||
if (showPoiEntity.getTaskId()!=0){
|
||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
||||
}
|
||||
poiEntity.setPhotoInfo(infoPhoto);
|
||||
poiEntity.setStation_type(station_type);
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
@ -676,8 +682,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
String format = formatter.format(calendar.getTime());
|
||||
poiEntity.setCreateTime(format);
|
||||
poiEntity.setType(2);
|
||||
poiEntity.setTaskStatus(1);
|
||||
poiEntity.setIsLocalData(1);
|
||||
poiEntity.setTaskStatus(2);
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -754,6 +759,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
if (tagScutcheon != null&&!tagScutcheon.equals("")) {
|
||||
infoPhoto.add(new Info(tagScutcheon));
|
||||
}
|
||||
if (showPoiEntity.getTaskId()!=0){
|
||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
||||
}
|
||||
poiEntity.setPhotoInfo(infoPhoto);
|
||||
poiEntity.setStation_type(station_type);
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
@ -762,8 +770,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
String format = formatter.format(calendar.getTime());
|
||||
poiEntity.setCreateTime(format);
|
||||
poiEntity.setType(2);
|
||||
poiEntity.setTaskStatus(1);
|
||||
poiEntity.setIsLocalData(1);
|
||||
poiEntity.setTaskStatus(2);
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -7,31 +7,32 @@ import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.bean.GetPriceBean;
|
||||
import com.navinfo.outdoor.bean.ReceivedPoiBean;
|
||||
import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||
import com.navinfo.outdoor.room.PoiDao;
|
||||
import com.navinfo.outdoor.room.PoiDatabase;
|
||||
import com.navinfo.outdoor.room.PoiEntity;
|
||||
import com.navinfo.outdoor.util.GeometryTools;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
/**
|
||||
* 领取采集的fragment
|
||||
*/
|
||||
public class GatherGetFragment extends BaseFragment implements View.OnClickListener {
|
||||
|
||||
private Button btnBank;
|
||||
private Button btnCancelGet,btnGetTask,btnGather,btnFinishGather;
|
||||
private TextView tvTitle, tvMoney, tvTime, tvDistance, tvDescribe;
|
||||
private PoiEntity poiEntity;
|
||||
private Button btnDraw;
|
||||
private PoiDao poiDao;
|
||||
|
||||
public static GatherGetFragment newInstance(Bundle bundle) {
|
||||
GatherGetFragment fragment = new GatherGetFragment();
|
||||
@ -39,28 +40,21 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (!EventBus.getDefault().isRegistered(this)) {//加上判断
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
getFocus();
|
||||
}
|
||||
|
||||
//主界面获取焦点
|
||||
private void getFocus() {
|
||||
boolean aBoolean = getArguments().getBoolean("boolean", true);
|
||||
getView().setFocusableInTouchMode(true);
|
||||
getView().requestFocus();
|
||||
getView().setOnKeyListener(new View.OnKeyListener() {
|
||||
@Override
|
||||
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
||||
if (event.getAction() == KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
boolean aBoolean = getArguments().getBoolean("boolean", true);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.GATHER_GET_RETURN;
|
||||
obtain.obj = aBoolean;
|
||||
@ -72,17 +66,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(Message data) {
|
||||
if (data.what == Constant.TREASURE_GATHER_GET_WORD) {
|
||||
PoiEntity poiEntity = (PoiEntity) data.obj;
|
||||
tvTitle.setText(poiEntity.getName());
|
||||
tvMoney.setText("3.5元");
|
||||
tvTime.setText("到期时间:" + poiEntity.getCreateTime());
|
||||
tvDescribe.setText("任务描述:" + poiEntity.getDescribe());
|
||||
tvDistance.setText("距离:" + poiEntity.getDist());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
@ -92,51 +75,115 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
PoiDatabase poiDatabase = PoiDatabase.getInstance(getContext());
|
||||
poiDao = poiDatabase.getPoiDao();
|
||||
tvTitle = findViewById(R.id.tv_title);
|
||||
tvMoney = findViewById(R.id.tv_money);
|
||||
tvTime = findViewById(R.id.tv_time);
|
||||
tvDistance = findViewById(R.id.tv_distance);
|
||||
tvDescribe = findViewById(R.id.tv_describe);
|
||||
btnBank = findViewById(R.id.btn_bank);
|
||||
btnBank.setOnClickListener(this);
|
||||
btnDraw = findViewById(R.id.btn_draw);
|
||||
btnDraw.setOnClickListener(this::onClick);
|
||||
btnCancelGet = findViewById(R.id.btn_cancel_get);//取消领取
|
||||
btnCancelGet.setOnClickListener(this::onClick);
|
||||
btnGetTask = findViewById(R.id.btn_get_task);//领取任务
|
||||
btnGetTask.setOnClickListener(this::onClick);
|
||||
btnGather = findViewById(R.id.btn_gather);//立即采集
|
||||
btnGather.setOnClickListener(this::onClick);
|
||||
btnFinishGather = findViewById(R.id.btn_finish_gather);//结束采集
|
||||
btnFinishGather.setOnClickListener(this::onClick);
|
||||
Bundle arguments = getArguments();
|
||||
|
||||
if (arguments!=null) {
|
||||
if (arguments != null) {
|
||||
poiEntity = (PoiEntity) arguments.getSerializable("poiEntity");
|
||||
tvTitle.setText(poiEntity.getName());
|
||||
tvMoney.setText("¥"+poiEntity.getPrecision());
|
||||
tvTime.setText("到期时间:" + poiEntity.getCreateTime());
|
||||
tvDescribe.setText("任务描述:" + poiEntity.getDescribe());
|
||||
tvDistance.setText("距离:"+format5(Double.valueOf(poiEntity.getDist())/1000)+"km");
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.btn_bank:
|
||||
if (poiEntity!=null){
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.GATHER_GET;
|
||||
obtain.obj = poiEntity;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}else {
|
||||
Toast.makeText(getContext(), "无法采集", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
case R.id.btn_cancel_get://结束领取
|
||||
poiEntity.setTaskStatus(0);
|
||||
btnGetTask.setVisibility(View.VISIBLE);
|
||||
btnCancelGet.setVisibility(View.GONE);
|
||||
break;
|
||||
|
||||
case R.id.btn_draw:
|
||||
case R.id.btn_get_task://领取任务
|
||||
poiEntity.setTaskStatus(1);
|
||||
btnGetTask.setVisibility(View.GONE);
|
||||
btnCancelGet.setVisibility(View.VISIBLE);
|
||||
//网络请求:
|
||||
if (poiEntity!=null){
|
||||
if (poiEntity.getType()==1) {//poi的领取类型
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK,poiEntity.getPid()+"");
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK,poiEntity.getTaskId()+"",false);
|
||||
}else if (poiEntity.getType() == 5){
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK,poiEntity.getPid()+"");
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK,poiEntity.getTaskId()+"",false);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case R.id.btn_gather://立即采集
|
||||
int aInt = getArguments().getInt("aInt", 0);
|
||||
if (aInt == 1) {
|
||||
if (poiEntity != null) {
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.GATHER_GET;
|
||||
obtain.obj = poiEntity;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
} else {
|
||||
if (poiEntity!=null){
|
||||
if (poiEntity.getType()==1) {//poi的领取类型
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK,poiEntity.getTaskId()+"",true);
|
||||
}else if (poiEntity.getType() == 5){
|
||||
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK,poiEntity.getTaskId()+"",true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case R.id.btn_finish_gather://结束采集
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiDao.deletePoiEntity(poiEntity);
|
||||
}
|
||||
}).start();
|
||||
|
||||
break;
|
||||
}
|
||||
@ -146,7 +193,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
* @param url 不同任务类型对应的url
|
||||
* @param id 任务id
|
||||
* */
|
||||
private void receivedTaskByNet(String url, String id) {
|
||||
private void receivedTaskByNet(String url, String id,boolean isSaver) {
|
||||
showLoadingDialog();
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
@ -157,16 +204,35 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
@Override
|
||||
public void onSuccess(ReceivedPoiBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
// Toast.makeText(getContext(), "获取成功", Toast.LENGTH_SHORT).show();
|
||||
ReceivedPoiBean.BodyBean listBean = response.getBody();
|
||||
PoiEntity poiListEntity = new PoiEntity();
|
||||
poiListEntity.setTaskId(listBean.getId());
|
||||
poiListEntity.setName(listBean.getName());
|
||||
poiListEntity.setAddress(listBean.getAddress());
|
||||
poiListEntity.setTelPhone(listBean.getTelephone() + "");
|
||||
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")) {//面
|
||||
|
||||
}
|
||||
if (isSaver){
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.GATHER_GET_MAP;
|
||||
obtain.obj = poiListEntity;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
|
||||
Integer PoiId = response.getBody().getId();
|
||||
Log.d("TAG", "onSuccess: " + response.toString() + "tttttttt");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
// Toast.makeText(getContext(), "获取失败"+e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
@ -176,11 +242,5 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
return String.format("%.2f", value).toString();
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
@ -16,22 +17,27 @@ import com.bumptech.glide.request.RequestOptions;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.FragmentManagement;
|
||||
import com.navinfo.outdoor.activity.UserActivity;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.bean.GetPriceBean;
|
||||
import com.navinfo.outdoor.bean.MeasureBean;
|
||||
import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
/**
|
||||
* 我的Fragment
|
||||
* 2021-5-25
|
||||
*/
|
||||
public class MineFragment extends BaseFragment implements View.OnClickListener{
|
||||
public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
|
||||
private ImageView imageHeard ,imageShare, imageSign;
|
||||
private ImageView imageHeard, imageShare, imageSign;
|
||||
private TextView tvName, tvMoney;
|
||||
private Button btnWithdraw,btnQuit;
|
||||
private Button btnWithdraw, btnQuit;
|
||||
private RelativeLayout rlGrade, rlPrivilege, rlMap, rlIssue, rlContact, rlSet, rlAbout;
|
||||
|
||||
public static MineFragment newInstance(Bundle bundle) {
|
||||
@ -39,7 +45,14 @@ public class MineFragment extends BaseFragment implements View.OnClickListener{
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (!EventBus.getDefault().isRegistered(this)) {//加上判断
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.mine_fragment;
|
||||
@ -78,6 +91,14 @@ public class MineFragment extends BaseFragment implements View.OnClickListener{
|
||||
btnQuit.setOnClickListener(this::onClick);
|
||||
initNetWork();
|
||||
}
|
||||
@Subscribe
|
||||
public void onEvent(Message data) {
|
||||
if (data.what == Constant.HOME_MINE) {
|
||||
if ((boolean)data.obj){
|
||||
initNetWork();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void initNetWork() {
|
||||
showLoadingDialog();
|
||||
@ -90,16 +111,16 @@ public class MineFragment extends BaseFragment implements View.OnClickListener{
|
||||
@Override
|
||||
public void onSuccess(GetPriceBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
// Toast.makeText(getContext(), "获取成功", Toast.LENGTH_SHORT).show();
|
||||
// Toast.makeText(getContext(), "获取成功", Toast.LENGTH_SHORT).show();
|
||||
Double userPrice = response.getBody().getUserPrice();
|
||||
tvMoney.setText(userPrice+"");
|
||||
tvMoney.setText(userPrice + "");
|
||||
Log.d("TAG", "onSuccess: " + response.toString() + "tttttttt");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
// Toast.makeText(getContext(), "获取失败"+e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
// Toast.makeText(getContext(), "获取失败"+e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
}).build();
|
||||
@ -112,11 +133,11 @@ public class MineFragment extends BaseFragment implements View.OnClickListener{
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()){
|
||||
switch (v.getId()) {
|
||||
case R.id.image_heard:
|
||||
case R.id.tv_name://跳转到个人信息
|
||||
Intent intentUser = new Intent(getActivity(), UserActivity.class);
|
||||
intentUser.putExtra("tag",16);
|
||||
intentUser.putExtra("tag", 16);
|
||||
startActivity(intentUser);
|
||||
break;
|
||||
case R.id.image_share://分享
|
||||
@ -128,42 +149,42 @@ public class MineFragment extends BaseFragment implements View.OnClickListener{
|
||||
case R.id.btn_withdraw://提现页面
|
||||
|
||||
Intent intentWithdraw = new Intent(getActivity(), FragmentManagement.class);
|
||||
intentWithdraw.putExtra("tag",15);
|
||||
intentWithdraw.putExtra("tag", 15);
|
||||
startActivity(intentWithdraw);
|
||||
break;
|
||||
case R.id.rl_grade://我的等级
|
||||
Intent intentGrade = new Intent(getActivity(), FragmentManagement.class);
|
||||
intentGrade.putExtra("tag",17);
|
||||
intentGrade.putExtra("tag", 17);
|
||||
startActivity(intentGrade);
|
||||
break;
|
||||
case R.id.rl_privilege://我的特权
|
||||
Intent intentPrivilege = new Intent(getActivity(), FragmentManagement.class);
|
||||
intentPrivilege.putExtra("tag",18);
|
||||
intentPrivilege.putExtra("tag", 18);
|
||||
startActivity(intentPrivilege);
|
||||
break;
|
||||
case R.id.rl_map://地图下载
|
||||
Intent intentMap = new Intent(getActivity(), FragmentManagement.class);
|
||||
intentMap.putExtra("tag",19);
|
||||
intentMap.putExtra("tag", 19);
|
||||
startActivity(intentMap);
|
||||
break;
|
||||
case R.id.rl_issue://常见问题
|
||||
Intent intentIssue = new Intent(getActivity(), FragmentManagement.class);
|
||||
intentIssue.putExtra("tag",20);
|
||||
intentIssue.putExtra("tag", 20);
|
||||
startActivity(intentIssue);
|
||||
break;
|
||||
case R.id.rl_contact://联系我们
|
||||
Intent intentContact = new Intent(getActivity(), FragmentManagement.class);
|
||||
intentContact.putExtra("tag",21);
|
||||
intentContact.putExtra("tag", 21);
|
||||
startActivity(intentContact);
|
||||
break;
|
||||
case R.id.rl_set://设置
|
||||
Intent intentSet = new Intent(getActivity(), FragmentManagement.class);
|
||||
intentSet.putExtra("tag",22);
|
||||
intentSet.putExtra("tag", 22);
|
||||
startActivity(intentSet);
|
||||
break;
|
||||
case R.id.rl_about://关于
|
||||
Intent intentAbout = new Intent(getActivity(), FragmentManagement.class);
|
||||
intentAbout.putExtra("tag",23);
|
||||
intentAbout.putExtra("tag", 23);
|
||||
startActivity(intentAbout);
|
||||
break;
|
||||
case R.id.btn_quit://退出登录
|
||||
@ -171,4 +192,11 @@ public class MineFragment extends BaseFragment implements View.OnClickListener{
|
||||
break;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
|
||||
|
||||
private Spinner spinnerOther;
|
||||
String[] others = new String[]{"门牌", "道路施工", "标牌采集", "公交", "其他"};
|
||||
String[] others = new String[]{"门牌", "公交", "情报"};// //门牌:6 公交:7 情报:8 现在其他任务类型里就这三种
|
||||
private EditText editTaskName, editOtherDescribe;
|
||||
private RelativeLayout rlPicture;
|
||||
private ImageView ivPicture;
|
||||
@ -75,6 +75,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
private PoiDao poiDao;
|
||||
private PoiEntity showPoiEntity;
|
||||
private LatLng latLng;
|
||||
private int station_type=0;
|
||||
|
||||
public static OtherFragment newInstance(Bundle bundle) {
|
||||
OtherFragment fragment = new OtherFragment();
|
||||
@ -143,21 +144,14 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
switch (position) {
|
||||
case 0:
|
||||
|
||||
station_type=6;
|
||||
break;
|
||||
case 1:
|
||||
Toast.makeText(getActivity(), others[1], Toast.LENGTH_SHORT).show();
|
||||
station_type=7;
|
||||
break;
|
||||
case 2:
|
||||
Toast.makeText(getActivity(), others[2], Toast.LENGTH_SHORT).show();
|
||||
station_type=8;
|
||||
break;
|
||||
case 3:
|
||||
Toast.makeText(getActivity(), others[3], Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
case 4:
|
||||
Toast.makeText(getActivity(), others[4], Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -224,6 +218,8 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
if (describe != null &&!describe.equals("")) {
|
||||
editOtherDescribe.setText(describe);
|
||||
}
|
||||
int station_type = showPoiEntity.getStation_type();
|
||||
spinnerOther.setSelection(station_type,true);
|
||||
if (showPoiEntity.getPhotoInfo() != null) {
|
||||
for (int i = 0; i < showPoiEntity.getPhotoInfo().size(); i++) {
|
||||
String photo = showPoiEntity.getPhotoInfo().get(i).getPhoto();
|
||||
@ -301,6 +297,10 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
} else {
|
||||
infoList.add(new Info(tagPictures));
|
||||
}
|
||||
if (showPoiEntity.getTaskId()!=0){
|
||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
||||
}
|
||||
poiEntity.setStation_type(station_type);
|
||||
poiEntity.setPhotoInfo(infoList);
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
@ -308,8 +308,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
String format = formatter.format(calendar.getTime());
|
||||
poiEntity.setCreateTime(format);
|
||||
poiEntity.setType(5);
|
||||
poiEntity.setTaskStatus(1);
|
||||
poiEntity.setIsLocalData(1);
|
||||
poiEntity.setTaskStatus(2);
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -374,15 +373,18 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
if (tagPictures != null&&!tagPictures.equals("")) {
|
||||
arrayList.add(new Info(tagPictures));
|
||||
}
|
||||
if (showPoiEntity.getTaskId()!=0){
|
||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
||||
}
|
||||
poiEntity.setPhotoInfo(arrayList);
|
||||
poiEntity.setStation_type(station_type);
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
String format = formatter.format(calendar.getTime());
|
||||
poiEntity.setCreateTime(format);
|
||||
poiEntity.setType(5);
|
||||
poiEntity.setTaskStatus(1);
|
||||
poiEntity.setIsLocalData(1);
|
||||
poiEntity.setTaskStatus(2);
|
||||
String newPoiEntity = new Gson().toJson(poiEntity);
|
||||
//以键值对的形式添加新值。
|
||||
edit.putString("poiEntity", newPoiEntity);
|
||||
|
@ -238,11 +238,11 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
latLng.setLongitude(Double.parseDouble(x));
|
||||
}
|
||||
String describe = showPoiEntity.getDescribe();//任务描述
|
||||
if (describe != null&&!describe.equals("")) {
|
||||
if (describe != null && !describe.equals("")) {
|
||||
editDescribe.setText(describe);
|
||||
}
|
||||
String telPhone = showPoiEntity.getTelPhone();
|
||||
if (telPhone != null&&!telPhone.equals("")) {
|
||||
if (telPhone != null && !telPhone.equals("")) {
|
||||
phoneData.add(showPoiEntity.getTelPhone());
|
||||
poiBeans.add(new PoiBean("电话*", telPhone, R.drawable.icon_add_bg));
|
||||
poiRecycleAdapter.setList(poiBeans);
|
||||
@ -250,27 +250,27 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
if (showPoiEntity.getPhotoInfo() != null) {
|
||||
for (int i = 0; i < showPoiEntity.getPhotoInfo().size(); i++) {
|
||||
String photo =showPoiEntity.getPhotoInfo().get(i).getPhoto();
|
||||
String photo = showPoiEntity.getPhotoInfo().get(i).getPhoto();
|
||||
String[] split = photo.split("/");
|
||||
if (split[split.length - 1].startsWith("a")){
|
||||
if (split[split.length - 1].startsWith("a")) {
|
||||
Glide.with(getActivity()).load(photo).into(ivPanorama);
|
||||
ivPanorama.setTag(photo);
|
||||
}else if (split[split.length - 1].startsWith("b")){
|
||||
} else if (split[split.length - 1].startsWith("b")) {
|
||||
Glide.with(getActivity()).load(photo).into(ivName);
|
||||
ivName.setTag(photo);
|
||||
}else if (split[split.length - 1].startsWith("c")){
|
||||
} else if (split[split.length - 1].startsWith("c")) {
|
||||
Glide.with(getActivity()).load(photo).into(ivInternal);
|
||||
ivInternal.setTag(photo);
|
||||
}else if (split[split.length - 1].startsWith("d")){
|
||||
} else if (split[split.length - 1].startsWith("d")) {
|
||||
Glide.with(getActivity()).load(photo).into(ivCard);
|
||||
ivCard.setTag(photo);
|
||||
}else if (split[split.length - 1].startsWith("e")){
|
||||
} else if (split[split.length - 1].startsWith("e")) {
|
||||
Glide.with(getActivity()).load(photo).into(ivElse);
|
||||
ivElse.setTag(photo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
poiBeans.add(new PoiBean("电话*", "", R.drawable.icon_add_bg));
|
||||
poiRecycleAdapter.setList(poiBeans);
|
||||
}
|
||||
@ -372,6 +372,9 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
} else {
|
||||
infoPhoto.add(new Info(tagName));
|
||||
}
|
||||
if (showPoiEntity.getTaskId()!=0){
|
||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
||||
}
|
||||
String tagInternal = (String) ivInternal.getTag();
|
||||
if (tagInternal != null) {
|
||||
infoPhoto.add(new Info(tagInternal));
|
||||
@ -384,6 +387,9 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
if (tagCard != null) {
|
||||
infoPhoto.add(new Info(tagCard));
|
||||
}
|
||||
if (showPoiEntity.getTaskId()!=0){
|
||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
||||
}
|
||||
poiEntity.setPhotoInfo(infoPhoto);
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
@ -391,17 +397,11 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
String format = formatter.format(calendar.getTime());
|
||||
poiEntity.setCreateTime(format);
|
||||
poiEntity.setType(1);
|
||||
poiEntity.setTaskStatus(1);
|
||||
poiEntity.setIsLocalData(1);
|
||||
poiEntity.setTaskStatus(2);
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (showPoiEntity != null) {
|
||||
poiDao.updatePoiEntity(poiEntity);
|
||||
} else {
|
||||
poiDao.insertPoiEntity(poiEntity);
|
||||
}
|
||||
|
||||
poiDao.insertPoiEntity(poiEntity);
|
||||
}
|
||||
}).start();
|
||||
onBackPressed();
|
||||
@ -483,32 +483,38 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
poiEntity.setY(String.valueOf(latLng.latitude));
|
||||
}
|
||||
String describe = editDescribe.getText().toString().trim();
|
||||
if (describe!= null && !describe.equals("")) {
|
||||
if (describe != null && !describe.equals("")) {
|
||||
poiEntity.setDescribe(describe);
|
||||
}
|
||||
if (phoneData.size() > 0) {
|
||||
poiEntity.setTelPhone(phoneData.get(0));
|
||||
}
|
||||
String tagPanorama = (String) ivPanorama.getTag();
|
||||
if (tagPanorama!=null&&!tagPanorama.equals("")) {
|
||||
if (tagPanorama != null && !tagPanorama.equals("")) {
|
||||
infoPhoto.add(new Info(tagPanorama));
|
||||
}
|
||||
String tagName = (String) ivName.getTag();
|
||||
if (tagName!= null&&!tagName.equals("")) {
|
||||
if (tagName != null && !tagName.equals("")) {
|
||||
infoPhoto.add(new Info(tagName));
|
||||
}
|
||||
String tagInternal = (String) ivInternal.getTag();
|
||||
if (tagInternal!= null&&!tagInternal.equals("")) {
|
||||
if (tagInternal != null && !tagInternal.equals("")) {
|
||||
infoPhoto.add(new Info(tagInternal));
|
||||
}
|
||||
String tagElse = (String) ivElse.getTag();
|
||||
if (tagElse!=null&&!tagElse.equals("")) {
|
||||
if (tagElse != null && !tagElse.equals("")) {
|
||||
infoPhoto.add(new Info(tagElse));
|
||||
}
|
||||
String tagCard = (String) ivCard.getTag();
|
||||
if (tagCard != null&&!tagCard.equals("")) {
|
||||
if (tagCard != null && !tagCard.equals("")) {
|
||||
infoPhoto.add(new Info(tagCard));
|
||||
}
|
||||
if (showPoiEntity.getTaskId()!=0){
|
||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
||||
}
|
||||
if (showPoiEntity.getTaskId()!=0){
|
||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
||||
}
|
||||
poiEntity.setPhotoInfo(infoPhoto);
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
@ -516,8 +522,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
String format = formatter.format(calendar.getTime());
|
||||
poiEntity.setCreateTime(format);
|
||||
poiEntity.setType(1);
|
||||
poiEntity.setTaskStatus(1);
|
||||
poiEntity.setIsLocalData(1);
|
||||
poiEntity.setTaskStatus(2);
|
||||
String newPoiEntity = new Gson().toJson(poiEntity);
|
||||
//以键值对的形式添加新值。
|
||||
edit.putString("poiEntity", newPoiEntity);
|
||||
@ -527,7 +532,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
@ -547,7 +551,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data,"a");
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a");
|
||||
ivPanorama.setTag(takePhotoPath);
|
||||
ivPanorama.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
@ -568,7 +572,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data,"b");
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "b");
|
||||
ivName.setTag(takePhotoPath);
|
||||
ivName.setImageBitmap(bitmap);//显示图像
|
||||
|
||||
@ -590,8 +594,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data,"c");
|
||||
ivInternal.setTag(takePhotoPath);
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c");
|
||||
ivInternal.setTag(takePhotoPath);
|
||||
ivInternal.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
} else if (requestCode == 104 && resultCode == RESULT_OK) {
|
||||
@ -610,7 +614,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data,"d");
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "d");
|
||||
ivCard.setTag(takePhotoPath);
|
||||
ivCard.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
@ -630,7 +634,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data,"e");
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "e");
|
||||
ivElse.setTag(takePhotoPath);
|
||||
ivElse.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
@ -220,14 +220,16 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
} else {
|
||||
poiEntity.setDescribe(desc);
|
||||
}
|
||||
if (showPoiEntity.getTaskId()!=0){
|
||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
||||
}
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
String format = formatter.format(calendar.getTime());
|
||||
poiEntity.setCreateTime(format);
|
||||
poiEntity.setType(3);
|
||||
poiEntity.setTaskStatus(1);
|
||||
poiEntity.setIsLocalData(1);
|
||||
poiEntity.setTaskStatus(2);
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -296,14 +298,16 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
if (desc != null && !desc.equals("")) {
|
||||
poiEntity.setDescribe(desc);
|
||||
}
|
||||
if (showPoiEntity.getTaskId()!=0){
|
||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
||||
}
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
String format = formatter.format(calendar.getTime());
|
||||
poiEntity.setCreateTime(format);
|
||||
poiEntity.setType(3);
|
||||
poiEntity.setTaskStatus(1);
|
||||
poiEntity.setIsLocalData(1);
|
||||
poiEntity.setTaskStatus(2);
|
||||
String newPoiEntity = new Gson().toJson(poiEntity);
|
||||
//以键值对的形式添加新值。
|
||||
edit.putString("poiEntity", newPoiEntity);
|
||||
|
@ -226,14 +226,16 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
} else {
|
||||
poiEntity.setDescribe(desc);
|
||||
}
|
||||
if (showPoiEntity.getTaskId()!=0){
|
||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
||||
}
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
String format = formatter.format(calendar.getTime());
|
||||
poiEntity.setCreateTime(format);
|
||||
poiEntity.setType(4);
|
||||
poiEntity.setTaskStatus(1);
|
||||
poiEntity.setIsLocalData(1);
|
||||
poiEntity.setTaskStatus(2);
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -303,14 +305,16 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
if (desc != null && !desc.equals("")) {
|
||||
poiEntity.setDescribe(desc);
|
||||
}
|
||||
if (showPoiEntity.getTaskId()!=0){
|
||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
||||
}
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
String format = formatter.format(calendar.getTime());
|
||||
poiEntity.setCreateTime(format);
|
||||
poiEntity.setType(4);
|
||||
poiEntity.setTaskStatus(1);
|
||||
poiEntity.setIsLocalData(1);
|
||||
poiEntity.setTaskStatus(2);
|
||||
String newPoiEntity = new Gson().toJson(poiEntity);
|
||||
//以键值对的形式添加新值。
|
||||
edit.putString("poiEntity", newPoiEntity);
|
||||
|
@ -123,6 +123,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
private String userEncode;
|
||||
private String centerEncode;
|
||||
private JobSearchBean body;
|
||||
private ArrayList<Removable> removables;
|
||||
|
||||
public static TreasureFragment newInstance(Bundle bundle) {
|
||||
TreasureFragment fragment = new TreasureFragment();
|
||||
@ -196,6 +197,67 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
initSharePre();
|
||||
//数据库
|
||||
initThread();
|
||||
removables = new ArrayList<>();
|
||||
|
||||
tencentMap.addOnMapLoadedCallback(new TencentMap.OnMapLoadedCallback() {
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
tencentMap.setOnMarkerClickListener(new TencentMap.OnMarkerClickListener() {
|
||||
@Override
|
||||
public boolean onMarkerClick(Marker marker) {
|
||||
if (marker.getTitle().equals("本地")) {//是本地数据直接跳转到采集页面
|
||||
PoiEntity poiEntity = (PoiEntity) marker.getTag();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
switch (poiEntity.getType()) {
|
||||
case 1:
|
||||
PoiFragment poiFragment = PoiFragment.newInstance(bundle);
|
||||
showSlidingFragment(poiFragment);
|
||||
break;
|
||||
case 2:
|
||||
ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle);
|
||||
showSlidingFragment(chargingStationFragment);
|
||||
break;
|
||||
case 3:
|
||||
PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
|
||||
showSlidingFragment(poiVideoFragment);
|
||||
break;
|
||||
case 4:
|
||||
RoadFragment roadFragment = RoadFragment.newInstance(bundle);
|
||||
showSlidingFragment(roadFragment);
|
||||
break;
|
||||
case 5:
|
||||
OtherFragment otherFragment = OtherFragment.newInstance(bundle);
|
||||
showSlidingFragment(otherFragment);
|
||||
break;
|
||||
}
|
||||
} 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,2);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private TencentMap.OnCameraChangeListener cameraChangeListener = new TencentMap.OnCameraChangeListener() {
|
||||
@ -215,21 +277,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
private void initList(TencentLocation tencentLocation) {
|
||||
//获取中心点位置
|
||||
LatLng mapCenterPoint = getMapCenterPoint();
|
||||
ArrayList<Removable> removables = new ArrayList<>();
|
||||
if (removables.size() != 0) {
|
||||
for (int i = 0; i < removables.size(); i++) {
|
||||
removables.get(i).remove();
|
||||
}
|
||||
removables.clear();
|
||||
}
|
||||
if (mapCenterPoint != null) {
|
||||
centerEncode = Geohash.getInstance().encode(mapCenterPoint.latitude, mapCenterPoint.longitude);
|
||||
}
|
||||
|
||||
userEncode = Geohash.getInstance().encode(tencentLocation.getLatitude(), tencentLocation.getLongitude());
|
||||
|
||||
long date = System.currentTimeMillis();
|
||||
// showLoadingDialog();
|
||||
OkGo.getInstance().cancelTag(this);
|
||||
// 请求方式和请求url
|
||||
OkGo.<JobSearchBean>get(HttpInterface.TASK_LIST)
|
||||
@ -244,84 +296,89 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
.execute(new DialogCallback<JobSearchBean>(JobSearchBean.class) {
|
||||
@Override
|
||||
public void onSuccess(Response<JobSearchBean> response) {
|
||||
dismissLoadingDialog();
|
||||
body = response.body();
|
||||
Log.d("TAG", "onSuccess: " + response.body().toString() + "sssssssssssss");
|
||||
if (removables.size() != 0) {
|
||||
for (int i = 0; i < removables.size(); i++) {
|
||||
removables.get(i).remove();
|
||||
}
|
||||
removables.clear();
|
||||
} else {
|
||||
List<JobSearchBean.BodyBean.ListBean> list = response.body().getBody().getList();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
String geo = list.get(i).getGeo();
|
||||
Log.d("TAG", "onSuccess: " + geo);
|
||||
Geometry geometry = GeometryTools.createGeometry(geo);
|
||||
if (geometry.getGeometryType().equals("Point")) {//点
|
||||
LatLng latLng = GeometryTools.createLatLng(geo);
|
||||
switch (Integer.valueOf(list.get(i).getType())) {
|
||||
case 1://poi
|
||||
Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.POI_ICON).alpha(0.5f)
|
||||
.flat(true)
|
||||
.clockwise(false));
|
||||
removables.add(poiMarker);
|
||||
for (int i = 0; i < removables.size(); i++) {
|
||||
removables.get(i).remove();
|
||||
}
|
||||
removables.clear();
|
||||
body = response.body();
|
||||
List<JobSearchBean.BodyBean.ListBean> list = response.body().getBody().getList();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
JobSearchBean.BodyBean.ListBean listBean = list.get(i);
|
||||
String geo = list.get(i).getGeo();
|
||||
Log.d("TAG", "onSuccess: " + geo);
|
||||
Geometry geometry = GeometryTools.createGeometry(geo);
|
||||
if (geometry.getGeometryType().equals("Point")) {//点
|
||||
LatLng latLng = GeometryTools.createLatLng(geo);
|
||||
switch (Integer.valueOf(list.get(i).getType())) {
|
||||
case 1://poi
|
||||
Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.POI_ICON).alpha(0.5f)
|
||||
.flat(true)
|
||||
.clockwise(false));
|
||||
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;
|
||||
|
||||
break;
|
||||
case 2://充电站
|
||||
Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.STATION_ICON).alpha(0.7f)
|
||||
.flat(true)
|
||||
.clockwise(false));
|
||||
removables.add(stationMarker);
|
||||
break;
|
||||
case 3://poi录像
|
||||
break;
|
||||
case 4://道路录像
|
||||
Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.ROAD_ICON).alpha(0.7f)
|
||||
.flat(true)
|
||||
.clockwise(false));
|
||||
removables.add(roadMarker);
|
||||
break;
|
||||
case 5://其他
|
||||
break;
|
||||
case 6://面状任务
|
||||
Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Constant.PLANAR_TASK_ICON).alpha(0.7f)
|
||||
.flat(true)
|
||||
.clockwise(false));
|
||||
removables.add(planarMarker);
|
||||
break;
|
||||
}
|
||||
} else if (geometry.getGeometryType().equals("LineString")) {//线
|
||||
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
||||
// 构造 PolylineOpitons
|
||||
PolylineOptions polylineOptions = new PolylineOptions()
|
||||
.addAll(latLineString)
|
||||
// 折线设置圆形线头
|
||||
.lineCap(true)
|
||||
// 折线的颜色为绿色
|
||||
.color(0xff00ff00)
|
||||
// 折线宽度为5像素
|
||||
.width(5)
|
||||
// 还可以添加描边颜色
|
||||
.borderColor(0xffff0000)
|
||||
// 描边颜色的宽度,线宽还是 25 像素,不过填充的部分宽度为 `width` - 2 * `borderWidth`
|
||||
.borderWidth(1);
|
||||
// 绘制折线
|
||||
Polyline polyline = tencentMap.addPolyline(polylineOptions);
|
||||
removables.add(polyline);
|
||||
} else if (geometry.getGeometryType().equals("Polygon")) {//面
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
|
||||
Polygon polygon = tencentMap.addPolygon(new PolygonOptions().
|
||||
//连接封闭图形的点
|
||||
addAll(latPolygon).
|
||||
//填充颜色为红色
|
||||
fillColor(Color.parseColor("#97E0E7EC")).
|
||||
//边线颜色为黑色
|
||||
strokeColor(0xff000000).
|
||||
//边线宽度15像素
|
||||
strokeWidth(5));
|
||||
removables.add(polygon);
|
||||
}
|
||||
} else if (geometry.getGeometryType().equals("LineString")) {//线
|
||||
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
||||
// 构造 PolylineOpitons
|
||||
PolylineOptions polylineOptions = new PolylineOptions()
|
||||
.addAll(latLineString)
|
||||
// 折线设置圆形线头
|
||||
.lineCap(true)
|
||||
// 折线的颜色为绿色
|
||||
.color(0xff00ff00)
|
||||
// 折线宽度为5像素
|
||||
.width(5)
|
||||
// 还可以添加描边颜色
|
||||
.borderColor(0xffff0000)
|
||||
// 描边颜色的宽度,线宽还是 25 像素,不过填充的部分宽度为 `width` - 2 * `borderWidth`
|
||||
.borderWidth(1);
|
||||
// 绘制折线
|
||||
Polyline polyline = tencentMap.addPolyline(polylineOptions);
|
||||
removables.add(polyline);
|
||||
} else if (geometry.getGeometryType().equals("Polygon")) {//面
|
||||
List<LatLng> latPolygon = GeometryTools.getLatLngs(geo);
|
||||
Polygon polygon = tencentMap.addPolygon(new PolygonOptions().
|
||||
//连接封闭图形的点
|
||||
addAll(latPolygon).
|
||||
//填充颜色为红色
|
||||
fillColor(Color.parseColor("#97E0E7EC")).
|
||||
//边线颜色为黑色
|
||||
strokeColor(0xff000000).
|
||||
//边线宽度15像素
|
||||
strokeWidth(5));
|
||||
removables.add(polygon);
|
||||
}
|
||||
}
|
||||
Message obtain = Message.obtain();
|
||||
@ -333,13 +390,28 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
@Override
|
||||
public void onError(Response<JobSearchBean> response) {
|
||||
super.onError(response);
|
||||
dismissLoadingDialog();
|
||||
Log.d("TAG", "onError: " + response.message());
|
||||
|
||||
Log.d("TAG", "onError: " + response.message() + "gggggggggggggggggg");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void initMarker( PoiEntity poiEntity,int aInt) {
|
||||
sliding_layout.setPanelHeight(0);
|
||||
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
|
||||
frameLayout.setVisibility(View.VISIBLE);
|
||||
setMainButtonVisiable(View.GONE);
|
||||
fragmentTransaction = supportFragmentManager.beginTransaction();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
bundle.putBoolean("boolean",false);
|
||||
bundle.putInt("isServe",aInt);
|
||||
gatherGetFragment = GatherGetFragment.newInstance(bundle);
|
||||
fragmentTransaction.replace(R.id.frame_layout, gatherGetFragment);
|
||||
fragmentTransaction.commit();
|
||||
}
|
||||
|
||||
private void initThread() {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
@ -353,24 +425,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
Marker marker = tencentMap.addMarker(new MarkerOptions(position));
|
||||
marker.setClickable(true);
|
||||
PoiEntity poiEntity = allPoi.get(i);
|
||||
tencentMap.setOnMarkerClickListener(new TencentMap.OnMarkerClickListener() {
|
||||
@Override
|
||||
public boolean onMarkerClick(Marker marker) {
|
||||
sliding_layout.setPanelHeight(0);
|
||||
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
|
||||
frameLayout.setVisibility(View.VISIBLE);
|
||||
setMainButtonVisiable(View.GONE);
|
||||
fragmentTransaction = supportFragmentManager.beginTransaction();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
bundle.putBoolean("boolean", false);
|
||||
gatherGetFragment = GatherGetFragment.newInstance(bundle);
|
||||
fragmentTransaction.replace(R.id.frame_layout, gatherGetFragment);
|
||||
fragmentTransaction.commit();
|
||||
Toast.makeText(getActivity(), marker.getId() + "", Toast.LENGTH_SHORT).show();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
marker.setTitle("本地");
|
||||
marker.setTag(poiEntity);
|
||||
|
||||
}
|
||||
}
|
||||
@ -387,7 +443,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
if (dataFileString != null) {
|
||||
PoiEntity poiEntity = new Gson().fromJson(dataFileString, PoiEntity.class);
|
||||
switch (poiEntity.getType()) {
|
||||
case 0:
|
||||
case 1:
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "你poi页面还有未提交完的数据", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
@ -401,20 +457,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 1:
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "你道路页面还有未提交完的数据", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
RoadFragment roadFragment = RoadFragment.newInstance(bundle);
|
||||
showSlidingFragment(roadFragment);
|
||||
initRemovePoiSharePre();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 2:
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "你充电站页面还有未提交完的数据", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||
@ -430,20 +472,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
});
|
||||
break;
|
||||
case 3:
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "你其他页面还有未提交完的数据", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
OtherFragment otherFragment = OtherFragment.newInstance(bundle);
|
||||
showSlidingFragment(otherFragment);
|
||||
initRemovePoiSharePre();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 4:
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "你poi录像页面还有未提交完的数据", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
@ -457,6 +485,36 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 4:
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "你道路页面还有未提交完的数据", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
RoadFragment roadFragment = RoadFragment.newInstance(bundle);
|
||||
showSlidingFragment(roadFragment);
|
||||
initRemovePoiSharePre();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case 5:
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "你其他页面还有未提交完的数据", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
OtherFragment otherFragment = OtherFragment.newInstance(bundle);
|
||||
showSlidingFragment(otherFragment);
|
||||
initRemovePoiSharePre();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -490,10 +548,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
fragmentTransaction = supportFragmentManager.beginTransaction();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
bundle.putInt("aInt", 1);
|
||||
gatherGetFragment = GatherGetFragment.newInstance(bundle);
|
||||
fragmentTransaction.replace(R.id.frame_layout, gatherGetFragment);
|
||||
fragmentTransaction.commit();
|
||||
} else if (data.what == Constant.GATHER_GET) { // 点击开始采集
|
||||
} else if (data.what == Constant.GATHER_GET) { //删选item 点击开始采集
|
||||
PoiEntity poiEntity = (PoiEntity) data.obj;
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putBoolean("isSliding", false); // 通知抽屉不收回
|
||||
@ -522,6 +581,34 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
frameLayout.setVisibility(View.GONE);
|
||||
fragmentTransaction.remove(gatherGetFragment);
|
||||
} else if (data.what == Constant.GATHER_GET_MAP) { //地图界面点击采集 点击开始采集
|
||||
PoiEntity poiEntity = (PoiEntity) data.obj;
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
switch (poiEntity.getType()) {
|
||||
case 1:
|
||||
PoiFragment poiFragment = PoiFragment.newInstance(bundle);
|
||||
showSlidingFragment(poiFragment);
|
||||
break;
|
||||
case 2:
|
||||
ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle);
|
||||
showSlidingFragment(chargingStationFragment);
|
||||
break;
|
||||
case 3:
|
||||
PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
|
||||
showSlidingFragment(poiVideoFragment);
|
||||
break;
|
||||
case 4:
|
||||
RoadFragment roadFragment = RoadFragment.newInstance(bundle);
|
||||
showSlidingFragment(roadFragment);
|
||||
break;
|
||||
case 5:
|
||||
OtherFragment otherFragment = OtherFragment.newInstance(bundle);
|
||||
showSlidingFragment(otherFragment);
|
||||
break;
|
||||
}
|
||||
frameLayout.setVisibility(View.GONE);
|
||||
fragmentTransaction.remove(gatherGetFragment);
|
||||
} else if (data.what == Constant.FILTER_LIST) { // 筛选列表所有数据地图显示
|
||||
List<PoiEntity> poiEntities = (List<PoiEntity>) data.obj;
|
||||
initFilterMarker(poiEntities);
|
||||
|
@ -55,10 +55,10 @@ public class PoiEntity implements Serializable {
|
||||
private String y;//纬度
|
||||
private String detail;//深度信息
|
||||
private String dist;//距离用户位置
|
||||
private int taskStatus;//任务状态 1.待提交,2.已提交,3已领取
|
||||
private int taskStatus;//任务状态 1.已领取,2.已保存,3已提交
|
||||
private int type;//1 "POI"2 "充电站"3 "POI录像"4 "道路录像"5 "其他"6 "面状任务"
|
||||
private int station_type;//1 "POI"2 "充电站"3 "POI录像"4 "道路录像"5 "其他"6 "面状任务"
|
||||
private int isLocalData;//是否是本地数据 0,服务 1,本地
|
||||
private int station_type;//1."全部"2 "POI"3 "充电站"4 "POI录像"5 "道路录像", "门牌:6 公交:7 情报:8
|
||||
private int isLocalData;//是否是本地数据 0,服务 1,本地//现在没用
|
||||
|
||||
public int getIsLocalData() {
|
||||
return isLocalData;
|
||||
|
@ -37,7 +37,6 @@
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="到期时间:"
|
||||
android:textSize="15sp"
|
||||
android:maxLength="10"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title" />
|
||||
|
||||
@ -68,7 +67,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="任务描述:"
|
||||
android:textSize="15sp"
|
||||
android:maxLength="10"
|
||||
android:layout_marginTop="20dp"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_time"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_time" />
|
||||
@ -81,21 +79,41 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_describe">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_draw"
|
||||
android:id="@+id/btn_cancel_get"
|
||||
style="@style/user_data_style"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="20dp"
|
||||
android:visibility="gone"
|
||||
android:layout_weight="1"
|
||||
android:text="取消领取" />
|
||||
<Button
|
||||
android:id="@+id/btn_get_task"
|
||||
style="@style/user_data_style"
|
||||
android:layout_width="0dp"
|
||||
android:visibility="visible"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="20dp"
|
||||
android:layout_weight="1"
|
||||
android:text="领取任务" />
|
||||
<Button
|
||||
android:id="@+id/btn_bank"
|
||||
android:id="@+id/btn_gather"
|
||||
style="@style/user_data_style"
|
||||
android:layout_width="0dp"
|
||||
android:visibility="visible"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="20dp"
|
||||
android:layout_weight="1"
|
||||
android:text="立即采集" />
|
||||
<Button
|
||||
android:id="@+id/btn_finish_gather"
|
||||
style="@style/user_data_style"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="20dp"
|
||||
android:visibility="gone"
|
||||
android:layout_weight="1"
|
||||
android:text="结束采集" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
x
Reference in New Issue
Block a user