fix: POI通用头部处理,筛选界面获取数据流程修改
This commit is contained in:
@@ -24,17 +24,13 @@ import java.util.List;
|
||||
*/
|
||||
public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.ViewHolder> {
|
||||
private Context context;
|
||||
private List<PoiEntity> allPoi = new ArrayList<>();
|
||||
private List<PoiEntity> allPoi;
|
||||
|
||||
public FilterAdapter(Context context) {
|
||||
public FilterAdapter(Context context, List<PoiEntity> allPoi) {
|
||||
this.context = context;
|
||||
this.allPoi = allPoi;
|
||||
}
|
||||
|
||||
public void setAllPoi(List<PoiEntity> allPoi) {
|
||||
this.allPoi.clear();
|
||||
this.allPoi.addAll(allPoi);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
|
||||
@@ -87,6 +87,7 @@ public class Constant {
|
||||
public static final int MAIN_CHECKED_OTHER = 24;//其他的Fragment 对地图页面marker 的一个展示 确定
|
||||
public static final int OTHER_WORD = 25;//地图页面marker 的经纬都回传
|
||||
public static final int CHARGING_STATION_PILE = 26;//跳转到充电桩 传给数据
|
||||
public static final int FILTER_DATA_CLEAR = 27;//清空筛选界面的数据
|
||||
public static final int JOB_SEARCH_WORD = 28;//任务搜索的网络数据
|
||||
public static final int JOB_SEARCH_POI_WORD = 29;//任务搜索的本地数据
|
||||
public static final int GATHER_GET_MAP = 30;//地图点击marker 后弹窗点击开始采集
|
||||
|
||||
@@ -60,12 +60,7 @@ public abstract class BaseDrawerFragment extends BaseFragment {
|
||||
@Override
|
||||
public void onHiddenChanged(boolean hidden) {
|
||||
super.onHiddenChanged(hidden);
|
||||
if (hidden) {
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.MAIN_REMOVE;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -82,10 +77,6 @@ public abstract class BaseDrawerFragment extends BaseFragment {
|
||||
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj = isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what = Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj = View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
initRemovePoiSharePre();
|
||||
}
|
||||
@@ -111,7 +102,5 @@ public abstract class BaseDrawerFragment extends BaseFragment {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
}
|
||||
|
||||
public View getScrollerView() {
|
||||
return findViewById(R.id.scroller_view);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -131,11 +131,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
View header = LayoutInflater.from(getActivity()).inflate(R.layout.charging_pile_header, null);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
View header = findViewById(R.id.charging_pile_header);
|
||||
header.findViewById(R.id.iv_charging_pile_final).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -150,11 +146,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj = isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what = Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj = View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
onBackPressed();
|
||||
}
|
||||
|
||||
@@ -116,9 +116,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
private Integer bodyId;
|
||||
private LinearLayout linearContact;
|
||||
private ContactView contactView;
|
||||
// private Integer chargingPileBody;
|
||||
private ArrayList<File> chargingStationList;
|
||||
// private ArrayList<File> fileList;
|
||||
|
||||
public static ChargingStationFragment newInstance(Bundle bundle) {
|
||||
ChargingStationFragment fragment = new ChargingStationFragment();
|
||||
@@ -131,57 +129,16 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
return R.layout.charging_station_fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void onHiddenChanged(boolean hidden) {
|
||||
super.onHiddenChanged(hidden);
|
||||
if (!hidden) {
|
||||
View header = LayoutInflater.from(getActivity()).inflate(R.layout.charging_station_header, null);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
header.findViewById(R.id.iv_charging_station_final).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Bundle arguments = getArguments();
|
||||
if (arguments != null) {
|
||||
isSliding = arguments.getBoolean("isSliding", true);
|
||||
Log.d("TAG", "onCreatessss: " + isSliding);
|
||||
}
|
||||
if (isSliding) {
|
||||
// 监听到返回按钮点击事件
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj = isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what = Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj = View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
onBackPressed();
|
||||
}
|
||||
});
|
||||
initHeader();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (!EventBus.getDefault().isRegistered(this)) {//加上判断
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
View header = LayoutInflater.from(getActivity()).inflate(R.layout.charging_station_header, null);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
private void initHeader() {
|
||||
View header = findViewById(R.id.charging_station_header);
|
||||
header.findViewById(R.id.iv_charging_station_final).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -192,7 +149,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
if (isSliding) {
|
||||
// 监听到返回按钮点击事件
|
||||
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj = isSliding;
|
||||
@@ -208,6 +164,20 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (!EventBus.getDefault().isRegistered(this)) {//加上判断
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
initHeader();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
|
||||
@@ -63,55 +63,12 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
public void onHiddenChanged(boolean hidden) {
|
||||
super.onHiddenChanged(hidden);
|
||||
if (!hidden) {
|
||||
View header1 = LayoutInflater.from(getActivity()).inflate(R.layout.filter_header, null);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header1;
|
||||
EventBus.getDefault().post(obtain);
|
||||
header1.findViewById(R.id.iv_filter_final).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Bundle arguments = getArguments();
|
||||
if (arguments != null) {
|
||||
isSliding = arguments.getBoolean("isSliding", true);
|
||||
Log.d("TAG", "onCreatessss: " + isSliding);
|
||||
}
|
||||
if (isSliding) {
|
||||
// 监听到返回按钮点击事件
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj = isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what = Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj = View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
onBackPressed();
|
||||
}
|
||||
|
||||
});
|
||||
initHeader();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (!EventBus.getDefault().isRegistered(this)) {//加上判断
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
View header = LayoutInflater.from(getActivity()).inflate(R.layout.filter_header, null);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
private void initHeader() {
|
||||
View header = findViewById(R.id.frame_header);
|
||||
header.findViewById(R.id.iv_filter_final).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -126,17 +83,28 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj = isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what = Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj = View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
onBackPressed();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (!EventBus.getDefault().isRegistered(this)) {//加上判断
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
initHeader();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.fragment_filter;
|
||||
@@ -146,7 +114,6 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
|
||||
/* JobSearchBean jobSearchBean = (JobSearchBean) getArguments().getSerializable("body");//服务数据
|
||||
ArrayList<PoiEntity> showAllPoi = (ArrayList<PoiEntity>) getArguments().getSerializable("showAllPoi");//本地数据
|
||||
if (jobSearchBean != null) {
|
||||
@@ -181,10 +148,11 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(@NotNull Message data) {
|
||||
poiEntities = new ArrayList<>();
|
||||
poiEntities.clear();
|
||||
if (data.what == Constant.JOB_SEARCH_POI_WORD) {
|
||||
allPoi = (List<PoiEntity>) data.obj;
|
||||
if (allPoi != null) {
|
||||
poiEntities.addAll(allPoi);
|
||||
}
|
||||
} else if (data.what == Constant.JOB_SEARCH_WORD) {
|
||||
JobSearchBean jobSearchBean = (JobSearchBean) data.obj;
|
||||
if (jobSearchBean != null) {
|
||||
@@ -216,11 +184,10 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
poiEntities.add(poiEntity);
|
||||
}
|
||||
}
|
||||
if (allPoi != null) {
|
||||
poiEntities.addAll(allPoi);
|
||||
}
|
||||
filterAdapter.setAllPoi(poiEntities);
|
||||
} else if (data.what == Constant.FILTER_DATA_CLEAR) {
|
||||
poiEntities.clear();
|
||||
}
|
||||
filterAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
||||
@@ -289,7 +256,8 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
//取消上啦加载下拉刷新
|
||||
recyclerFilter.setPullRefreshEnabled(false);
|
||||
recyclerFilter.setLoadingMoreEnabled(false);
|
||||
filterAdapter = new FilterAdapter(getContext());
|
||||
poiEntities = new ArrayList<>();
|
||||
filterAdapter = new FilterAdapter(getContext(), poiEntities);
|
||||
recyclerFilter.setAdapter(filterAdapter);
|
||||
|
||||
recyclerFilter.getDefaultFootView().setNoMoreHint("成功加载完毕");
|
||||
|
||||
@@ -111,11 +111,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
View header = LayoutInflater.from(getActivity()).inflate(R.layout.other_header, null);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
View header = findViewById(R.id.other_header);
|
||||
header.findViewById(R.id.iv_final).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -130,11 +126,6 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj = isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what = Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj = View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
onBackPressed();
|
||||
}
|
||||
|
||||
@@ -129,11 +129,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
View header = LayoutInflater.from(getActivity()).inflate(R.layout.poi_header, null);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
View header = findViewById(R.id.poi_header);
|
||||
header.findViewById(R.id.iv_final).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -148,11 +144,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj = isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what = Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj = View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
onBackPressed();
|
||||
}
|
||||
@@ -800,25 +791,28 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
public void onSuccess(PoiSaveBean poiSaveBean, int id) {
|
||||
dismissLoadingDialog();
|
||||
Integer body = poiSaveBean.getBody();
|
||||
poiEntity.setBodyId(body);
|
||||
poiEntity.setTaskStatus(3);
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (isLocal) {
|
||||
poiUploadByNetWork(body, poiPicList);//上传
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
|
||||
onBackPressed();
|
||||
if (body!=null){
|
||||
poiEntity.setBodyId(body);
|
||||
poiEntity.setTaskStatus(3);
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (isLocal) {
|
||||
poiUploadByNetWork(body, poiPicList);//上传
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
|
||||
onBackPressed();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -106,11 +106,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
View header = LayoutInflater.from(getActivity()).inflate(R.layout.poi_video_header, null);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
View header =findViewById(R.id.poi_video_header);
|
||||
header.findViewById(R.id.iv_final).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -125,11 +121,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj = isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what = Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj = View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
onBackPressed();
|
||||
}
|
||||
|
||||
@@ -101,30 +101,19 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
View header = LayoutInflater.from(getActivity()).inflate(R.layout.road_header, null);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.MAIN_HEADER;
|
||||
obtain.obj = header;
|
||||
EventBus.getDefault().post(obtain);
|
||||
View header = findViewById(R.id.road_header);
|
||||
header.findViewById(R.id.iv_final).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Bundle arguments = getArguments();
|
||||
if (arguments != null) {
|
||||
isSliding = arguments.getBoolean("isSliding", true);
|
||||
Log.d("TAG", "onCreatessss: " + isSliding);
|
||||
}
|
||||
if (isSliding) {
|
||||
// 监听到返回按钮点击事件
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj = isSliding;
|
||||
EventBus.getDefault().post(obtain);
|
||||
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what = Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj = View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
}
|
||||
onBackPressed();
|
||||
}
|
||||
|
||||
@@ -141,6 +141,16 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
return R.layout.treasure_fragment;
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新筛选界面数据
|
||||
*/
|
||||
private void refreshFilterData() {
|
||||
Message msg = Message.obtain();
|
||||
msg.what = Constant.FILTER_DATA_CLEAR;
|
||||
EventBus.getDefault().post(msg);
|
||||
initThread(); // 刷新筛选的本地数据
|
||||
initList(Constant.currentLocation); // 刷新筛选的网络数据
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
@@ -213,8 +223,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
iniUserLocation();
|
||||
//检查是否有没有填完的页面
|
||||
initSharePre();
|
||||
//数据库
|
||||
initThread();
|
||||
removables = new ArrayList<>();//存储网络数据的marker
|
||||
removablesLocality = new ArrayList<>(); //存储本地数据的marker
|
||||
removablesMarker = new ArrayList<>();//存储网络数据的marker
|
||||
@@ -233,8 +241,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
@Override
|
||||
public void onFinish() {
|
||||
dismissLoadingDialog();
|
||||
// 移动到当前位置后,开始请求地图数据
|
||||
initList(Constant.currentLocation);
|
||||
refreshFilterData();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1067,6 +1074,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
if ((boolean) data.obj == true) {
|
||||
frameLayout.setVisibility(View.GONE);
|
||||
sliding_layout.setPanelHeight(0);
|
||||
setMainButtonVisiable(View.VISIBLE);
|
||||
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
|
||||
}
|
||||
if (markerPoi != null) {
|
||||
@@ -1085,16 +1093,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
removablesMarker.clear();
|
||||
} else if (data.what == Constant.MAIN_BUTTON_VISIABLE) {//控制主界面各个按钮显隐状态的what值
|
||||
setMainButtonVisiable((Integer) data.obj);
|
||||
} else if (data.what == Constant.MAIN_HEADER) {// 控制主界面各个header
|
||||
View view = (View) data.obj;
|
||||
if (view != null) {
|
||||
initHeader(view);
|
||||
}
|
||||
|
||||
} else if (data.what == Constant.MAIN_REMOVE) {//// 控制主界面各个header移除
|
||||
if ((boolean) data.obj) {
|
||||
dragView.removeAllViews();
|
||||
}
|
||||
} else if (data.what == Constant.GATHER_GET_RETURN) {//item 点击页面的返回事件的处理
|
||||
if ((boolean) data.obj) {
|
||||
frameLayout.setVisibility(View.GONE);
|
||||
@@ -1134,7 +1132,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
showSlidingFragment(chargingPileFragment);
|
||||
} else if (data.what == Constant.HOME_TREASURE) {//寻宝的刷新
|
||||
if ((boolean) data.obj) {
|
||||
initList(Constant.currentLocation);
|
||||
refreshFilterData();
|
||||
}
|
||||
} else if (data.what == Constant.JOB_WORD_MONITOR) {//筛选条件界面的刷新
|
||||
// 移除网络数据
|
||||
@@ -1147,8 +1145,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
removablesLocality.get(i).remove();
|
||||
}
|
||||
removablesLocality.clear();
|
||||
initThread();// 查询本地数据库
|
||||
initList(Constant.currentLocation);//网络数据
|
||||
refreshFilterData();
|
||||
} else if (data.what == Constant.EVENT_WHAT_CURRENT_MARKER) {
|
||||
LatLng latLng = (LatLng) data.obj;
|
||||
int type = data.arg1;
|
||||
@@ -1188,29 +1185,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
}
|
||||
|
||||
private void initRemoveFragment () {
|
||||
PoiFragment poiFragments = (PoiFragment) supportFragmentManager.findFragmentByTag(PoiFragment.class.getName());
|
||||
if (poiFragments != null) {
|
||||
fragmentTransaction.remove(poiFragments);
|
||||
}
|
||||
ChargingStationFragment chargingStationFragment = (ChargingStationFragment) supportFragmentManager.findFragmentByTag(ChargingStationFragment.class.getName());
|
||||
if (chargingStationFragment != null) {
|
||||
fragmentTransaction.remove(chargingStationFragment);
|
||||
}
|
||||
PoiVideoFragment poiVideoFragment = (PoiVideoFragment) supportFragmentManager.findFragmentByTag(PoiVideoFragment.class.getName());
|
||||
if (poiVideoFragment != null) {
|
||||
fragmentTransaction.remove(poiVideoFragment);
|
||||
}
|
||||
RoadFragment roadFragment = (RoadFragment) supportFragmentManager.findFragmentByTag(RoadFragment.class.getName());
|
||||
if (roadFragment != null) {
|
||||
fragmentTransaction.remove(roadFragment);
|
||||
}
|
||||
OtherFragment otherFragment = (OtherFragment) supportFragmentManager.findFragmentByTag(OtherFragment.class.getName());
|
||||
if (otherFragment != null) {
|
||||
fragmentTransaction.remove(otherFragment);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 控制主界面各个按钮的显示状态
|
||||
@@ -1408,8 +1382,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
tencentMap.animateCamera(cameraUpdateOut);
|
||||
break;
|
||||
case R.id.iv_refrish://刷新
|
||||
initList(Constant.currentLocation);
|
||||
initThread();
|
||||
refreshFilterData();
|
||||
break;
|
||||
case R.id.iv_location://定位:
|
||||
if (Constant.currentLocation != null) {
|
||||
@@ -1488,10 +1461,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}).setTitle(title);
|
||||
break;
|
||||
case R.id.iv_filter:
|
||||
initThread();
|
||||
initList(Constant.currentLocation);
|
||||
FilterFragment filterFragment = FilterFragment.newInstance(new Bundle());
|
||||
showSlidingFragment(filterFragment);
|
||||
refreshFilterData();
|
||||
break;
|
||||
case R.id.iv_message:
|
||||
Intent messageIntent = new Intent(getContext(), FragmentManagement.class);
|
||||
|
||||
Reference in New Issue
Block a user