fix: POI通用头部处理,筛选界面获取数据流程修改
This commit is contained in:
parent
f54db83131
commit
2d85223726
@ -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();
|
||||
@ -135,11 +133,12 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
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);
|
||||
initHeader();
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
@ -164,7 +163,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
@ -177,35 +175,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
@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);
|
||||
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
|
||||
|
@ -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,6 +791,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
public void onSuccess(PoiSaveBean poiSaveBean, int id) {
|
||||
dismissLoadingDialog();
|
||||
Integer body = poiSaveBean.getBody();
|
||||
if (body!=null){
|
||||
poiEntity.setBodyId(body);
|
||||
poiEntity.setTaskStatus(3);
|
||||
new Thread(new Runnable() {
|
||||
@ -821,6 +813,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}).start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
|
@ -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);
|
||||
|
@ -1,17 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/scroller_view"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<include
|
||||
android:id="@+id/charging_pile_header"
|
||||
layout="@layout/charging_pile_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
</include>
|
||||
<TextView
|
||||
android:id="@+id/tv_01"
|
||||
android:layout_width="wrap_content"
|
||||
@ -21,7 +24,7 @@
|
||||
android:textColor="@color/black"
|
||||
android:layout_margin="10dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toBottomOf="@id/charging_pile_header"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/linear_pot"
|
||||
@ -127,15 +130,14 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_charging"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:padding="2dp"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/underline"
|
||||
app:layout_constraintTop_toBottomOf="@id/text"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
>
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -815,7 +817,5 @@
|
||||
android:background="@drawable/shape_red_radius_bg"
|
||||
android:text="保存并返回"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</ScrollView>
|
@ -1,18 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/scroller_view"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<include
|
||||
android:id="@+id/charging_station_header"
|
||||
layout="@layout/charging_station_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
</include>
|
||||
<TextView
|
||||
android:id="@+id/tv_01"
|
||||
android:layout_width="wrap_content"
|
||||
@ -22,7 +25,7 @@
|
||||
android:textColor="@color/black"
|
||||
android:layout_margin="10dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toBottomOf="@id/charging_station_header" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/linear_pot"
|
||||
@ -611,4 +614,3 @@
|
||||
android:text="上传" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</ScrollView>
|
@ -4,7 +4,14 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<include
|
||||
android:id="@+id/frame_header"
|
||||
layout="@layout/filter_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
</include>
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_filter"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -1,17 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:context=".fragment.OtherFragment">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<include
|
||||
android:id="@+id/other_header"
|
||||
layout="@layout/other_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
</include>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_select_type"
|
||||
@ -21,7 +25,7 @@
|
||||
android:text="01.选择情报类型"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toBottomOf="@id/other_header" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_text"
|
||||
@ -328,4 +332,3 @@
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</ScrollView>
|
@ -1,25 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:context=".fragment.RoadFragment">
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<include
|
||||
android:id="@+id/road_header"
|
||||
layout="@layout/road_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
</include>
|
||||
<TextView
|
||||
android:id="@+id/tv_message"
|
||||
android:layout_width="wrap_content"
|
||||
@ -30,7 +30,7 @@
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/road_header" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_name"
|
||||
@ -244,4 +244,3 @@
|
||||
android:text="上传" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</ScrollView>
|
@ -1,18 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/scroller_view"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<include
|
||||
android:id="@+id/poi_header"
|
||||
layout="@layout/poi_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
</include>
|
||||
|
||||
|
||||
<TextView
|
||||
@ -23,7 +25,7 @@
|
||||
android:textColor="@color/black"
|
||||
android:layout_margin="10dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
app:layout_constraintTop_toBottomOf="@id/poi_header"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/linear_pot"
|
||||
@ -528,4 +530,3 @@
|
||||
android:text="上传" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</ScrollView>
|
@ -1,21 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<include
|
||||
android:id="@+id/poi_video_header"
|
||||
layout="@layout/poi_video_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
</include>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_message"
|
||||
android:layout_width="wrap_content"
|
||||
@ -26,7 +30,7 @@
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/poi_video_header" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_name"
|
||||
@ -277,4 +281,3 @@
|
||||
android:text="上传" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</ScrollView>
|
@ -10,7 +10,7 @@
|
||||
sothree:umanoDragView="@id/dragView"
|
||||
sothree:umanoOverlay="false"
|
||||
sothree:umanoPanelHeight="0dp"
|
||||
sothree:umanoScrollableView="@id/scroll_view"
|
||||
sothree:umanoScrollableView="@id/scroll_parent_view"
|
||||
sothree:umanoShadowHeight="0dp">
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -133,22 +133,27 @@
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dragView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/scroll_parent_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:id="@+id/dragView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"></LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical">
|
||||
<FrameLayout
|
||||
android:id="@+id/scroll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"></LinearLayout>
|
||||
android:layout_height="wrap_content"></FrameLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
|
Loading…
x
Reference in New Issue
Block a user