删选上全部显示
This commit is contained in:
parent
839c96e638
commit
e1679b4c2e
@ -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"
|
||||
|
@ -51,7 +51,6 @@ public class Constant {
|
||||
public static final int TREASURE_CHECKED_WORD = 40;//poi 对地图页面marker 的一个展示 确定
|
||||
public static final int CAPACITY_EVALUATION_PAGE = 1;//能力测评的页数
|
||||
public static final int POI_WORD = 2;//地图页面marker 的经纬都回传
|
||||
public static final int FILTER_LIST = 4;//筛选列表所有数据地图显示
|
||||
public static final int FILTER_LIST_ITEM = 5;//点击筛选的item
|
||||
public static final int GATHER_GET = 6;//点击开始采集
|
||||
public static final int TREASURE_GATHER_GET_WORD = 7;//领取采集页面其他marker 的回传
|
||||
|
@ -323,14 +323,17 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
|
||||
case R.id.btn_filter:
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.FILTER_LIST;
|
||||
obtain.obj = poiEntities;
|
||||
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
break;
|
||||
|
||||
Message mainButtonVisiableMsg = Message.obtain();
|
||||
mainButtonVisiableMsg.what = Constant.MAIN_BUTTON_VISIABLE;
|
||||
mainButtonVisiableMsg.obj = View.VISIBLE;
|
||||
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||
break;
|
||||
case R.id.cl_number:
|
||||
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"200", "500", "1000"}, new OnMenuItemClickListener() {
|
||||
@Override
|
||||
|
@ -240,6 +240,24 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
@Override
|
||||
public boolean onMarkerClick(Marker marker) {
|
||||
if (marker.getTitle() != null && !marker.getTitle().equals("")) {//是本地数据直接跳转到采集页面
|
||||
frameLayout.setVisibility(View.GONE);
|
||||
if (gatherGetFragment != null) {
|
||||
fragmentTransaction.remove(gatherGetFragment);
|
||||
}
|
||||
if (markerPoi != null) {
|
||||
markerPoi.remove();
|
||||
}
|
||||
if (markerPile != null) {
|
||||
markerPile.remove();
|
||||
}
|
||||
|
||||
if (bigMarker != null) {
|
||||
bigMarker.setVisible(false);
|
||||
}
|
||||
for (int i = 0; i < removablesMarker.size(); i++) {
|
||||
removablesMarker.get(i).remove();
|
||||
}
|
||||
removablesMarker.clear();
|
||||
PoiEntity poiEntity = (PoiEntity) marker.getTag();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
@ -316,7 +334,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
|
||||
private void initList(TencentLocation tencentLocation) {
|
||||
|
||||
int task_type = Constant.TASK_TYPE;
|
||||
int limit_type = Constant.LIMIT_TTPE;
|
||||
int taskStatus = Constant.TASK_STASTUS;
|
||||
@ -921,9 +938,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
if (gatherGetFragment != null) {
|
||||
fragmentTransaction.remove(gatherGetFragment);
|
||||
}
|
||||
} else if (data.what == Constant.FILTER_LIST) { // 筛选列表所有数据地图显示
|
||||
List<PoiEntity> poiEntities = (List<PoiEntity>) data.obj;
|
||||
initFilterMarker(poiEntities);
|
||||
} else if (data.what == Constant.TREASURE_WORD) { // POI采集-移动位置
|
||||
initPoiMarker((LatLng) data.obj);
|
||||
} else if (data.what == Constant.TREASURE_CHECKED_WORD) {//poi采集 -确定位置
|
||||
@ -1129,14 +1143,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
ivMessage.setVisibility(visiable);
|
||||
}
|
||||
|
||||
private void initFilterMarker(List<PoiEntity> poiEntities) {
|
||||
sliding_layout.setPanelHeight(1000);
|
||||
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
|
||||
for (int i = 0; i < poiEntities.size(); i++) {
|
||||
LatLng position = new LatLng(Double.valueOf(poiEntities.get(i).getY()), Double.valueOf(poiEntities.get(i).getX()));
|
||||
tencentMap.addMarker(new MarkerOptions(position).zIndex(2));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void initPoiMarker(LatLng latLng) {
|
||||
@ -1347,6 +1354,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
case R.id.iv_submit://弹窗
|
||||
//分享
|
||||
CharSequence title = "请选择上报类型";
|
||||
// 如果当前fragment是筛选,则移除该fragment
|
||||
FilterFragment filterFragments = (FilterFragment) supportFragmentManager.findFragmentByTag(FilterFragment.class.getName());
|
||||
if (filterFragments != null) {
|
||||
fragmentTransaction.remove(filterFragments);
|
||||
}
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_MIUI;
|
||||
List<ShareDialog.Item> itemList = new ArrayList<>();
|
||||
itemList.add(new ShareDialog.Item(getContext(), R.drawable.push_poi, "POI"));
|
||||
@ -1366,96 +1378,35 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
LatLng newPoiLatLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
|
||||
poiEntity.setX(newPoiLatLng.getLongitude() + "");
|
||||
poiEntity.setY(newPoiLatLng.getLatitude() + "");
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
ShareDialog.show((AppCompatActivity) getActivity(), itemList, new ShareDialog.OnItemClickListener() {
|
||||
@Override
|
||||
public boolean onClick(ShareDialog shareDialog, int index, ShareDialog.Item item) {
|
||||
switch (index) {
|
||||
case 0: // POI
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
showPoiMarkerByType(1, newPoiLatLng);
|
||||
PoiFragment poiFragment = PoiFragment.newInstance(bundle);
|
||||
showSlidingFragment(poiFragment);
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
showPoiMarkerByType(1, newPoiLatLng);
|
||||
PoiFragment poiFragment = PoiFragment.newInstance(bundle);
|
||||
showSlidingFragment(poiFragment);
|
||||
break;
|
||||
case 1: // POI录像
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
// InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
showPoiMarkerByType(2, newPoiLatLng);
|
||||
PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
|
||||
showSlidingFragment(poiVideoFragment);
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
|
||||
showPoiMarkerByType(2, newPoiLatLng);
|
||||
PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
|
||||
showSlidingFragment(poiVideoFragment);
|
||||
break;
|
||||
case 2://道路录像
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
showPoiMarkerByType(3, newPoiLatLng);
|
||||
RoadFragment roadFragment = RoadFragment.newInstance(bundle);
|
||||
showSlidingFragment(roadFragment);
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
showPoiMarkerByType(3, newPoiLatLng);
|
||||
RoadFragment roadFragment = RoadFragment.newInstance(bundle);
|
||||
showSlidingFragment(roadFragment);
|
||||
break;
|
||||
case 3://充电站
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
showPoiMarkerByType(4, newPoiLatLng);
|
||||
ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle);
|
||||
showSlidingFragment(chargingStationFragment);
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
showPoiMarkerByType(4, newPoiLatLng);
|
||||
ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle);
|
||||
showSlidingFragment(chargingStationFragment);
|
||||
break;
|
||||
case 4://其他
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
showPoiMarkerByType(5, newPoiLatLng);
|
||||
OtherFragment otherFragment = OtherFragment.newInstance(bundle);
|
||||
showSlidingFragment(otherFragment);
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
showPoiMarkerByType(5, newPoiLatLng);
|
||||
OtherFragment otherFragment = OtherFragment.newInstance(bundle);
|
||||
showSlidingFragment(otherFragment);
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user