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