解决界面上的编辑点位上的逻辑

This commit is contained in:
wds 2021-08-13 15:58:54 +08:00
parent 2f3b1cbeae
commit 974ad50612
22 changed files with 612 additions and 412 deletions

View File

@ -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"

View File

@ -18,11 +18,14 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.os.Handler;
import android.os.Message;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.navinfo.outdoor.R;
import com.google.android.material.tabs.TabLayout;
import com.gyf.immersionbar.ImmersionBar;
@ -38,11 +41,19 @@ import java.util.ArrayList;
* 首页
*/
public class HomeActivity extends BaseActivity{
private boolean isExit=false;//标识是否退出
private NoSlideViewPager mViewPager;
private TabLayout mTab;
private final String[] names = {"寻宝", "记录", "发现", "我的"};
private final int[] pic = {R.drawable.selector_map,R.drawable.selector_task,R.drawable.selector_article,R.drawable.selector_mine};
private RecordFragment recordFragment;
private Handler handler = new Handler(new Handler.Callback() {
@Override
public boolean handleMessage(@NonNull Message msg) {
isExit=false;
return false;
}
});
@Override
protected int getLayout() {
@ -117,7 +128,7 @@ public class HomeActivity extends BaseActivity{
public void onTabSelected(TabLayout.Tab tab) {
if (tab.getPosition()==1){
Message obtain = Message.obtain();
obtain.what = Constant.HOME_TREASURE;
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
}else if (tab.getPosition()==3){
@ -149,12 +160,21 @@ public class HomeActivity extends BaseActivity{
}
}
private void exit() {
if (!isExit) {
isExit = true;
Toast.makeText(this, "再按一次后退键退出程序", Toast.LENGTH_SHORT).show();
handler.sendEmptyMessageDelayed(0, 2000); // 利用handler延迟发送更改状态信息
} else {
this.finish();
}
}
@Override
public void onBackPressed() {
if (!BackHandlerHelper.handleBackPress(this)) {
super.onBackPressed();
}
}
@Override

View File

@ -76,8 +76,8 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
@Override
protected void initView() {
super.initView();
navInfoEditor = getSharedPreferences("navInfo", Context.MODE_PRIVATE).edit();
navInfo = getSharedPreferences("navInfo", Context.MODE_PRIVATE);
navInfoEditor = getSharedPreferences(Constant.SHARED_PREFERENCES, Context.MODE_PRIVATE).edit();
navInfo = getSharedPreferences(Constant.SHARED_PREFERENCES, Context.MODE_PRIVATE);
tvRegister = findViewById(R.id.tv_register);
etLoginName = findViewById(R.id.et_login_name);
etLoginPaw = findViewById(R.id.et_login_paw);
@ -88,14 +88,17 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
tvStatement.setOnClickListener(this::onClick);
tvRegister.setOnClickListener(this);
tvForgetPaw.setOnClickListener(this);
String user_name = navInfo.getString("user_name", null);
if (user_name != null && !user_name.equals("")) {
etLoginName.setText(user_name);
}
String pass_word = navInfo.getString("pass_word", null);
if (pass_word != null && !pass_word.equals("")) {
etLoginPaw.setText(pass_word);
if (navInfo!=null){
String user_name = navInfo.getString("user_name", null);
if (user_name!=null&&!user_name.equals("")){
etLoginName.setText(user_name);
}
String pass_word = navInfo.getString("pass_word", null);
if (pass_word!=null&&!pass_word.equals("")){
etLoginPaw.setText(pass_word);
}
}
}
@Override
@ -148,22 +151,21 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
@Override
public void onSuccess(LoginOauthTokenBean response, int id) {
dismissLoadingDialog();
if (response.getCode() == 200) {
if (response.getCode()==200){
LoginOauthTokenBean.BodyBean body = response.getBody();
navInfoEditor.putString("access_token", body.getAccess_token());
navInfoEditor.putString("refresh_token", body.getRefresh_token());
navInfoEditor.putString("userId", body.getUserId());
navInfoEditor.commit();
if (body.getUserId() != null && !body.getUserId().equals("")) {
if (body.getUserId()!=null&&!body.getUserId().equals("")){
Constant.initRootFolder(body.getUserId());
}
Constant.ACCESS_TOKEN = body.getAccess_token();
Constant.REFRESH_TOKEN = body.getRefresh_token();
Constant.USERID = body.getUserId();
Constant.PASS_WORD = paw;
navInfoEditor.putString("access_token",body.getAccess_token());
navInfoEditor.putString("refresh_token",body.getRefresh_token());
navInfoEditor.putString("userId",body.getUserId());
navInfoEditor.putString("pass_word",paw);
navInfoEditor.putString("user_name",name);
navInfoEditor.commit();
Constant.ACCESS_TOKEN=body.getAccess_token();
Constant.REFRESH_TOKEN=body.getRefresh_token();
Constant.USERID=body.getUserId();
Constant.PASS_WORD=paw;
initGetUserInfo();//获取用户信息
Toast.makeText(LoginActivity.this, "登录成功", Toast.LENGTH_SHORT).show();
} else {
@ -194,50 +196,50 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
@Override
public void onSuccess(UserDetailBean response, int id) {
dismissLoadingDialog();
if (response.getCode() == 200) {
if (response.getCode()==200){
UserDetailBean.BodyBean body = response.getBody();
if (body != null) {
navInfoEditor.putString("username", body.getUsername());
Constant.USER_NAME = body.getUsername();
navInfoEditor.putString("mobile", body.getMobile());
Constant.MOBILE = body.getMobile();
navInfoEditor.putInt("sex", body.getSex());//0: 1
Constant.SEX = body.getSex();
navInfoEditor.putString("qq", body.getQq());
Constant.QQ = body.getQq();
navInfoEditor.putString("wechat", body.getWechat());
Constant.WECHAT = body.getWechat();
if (body!=null){
navInfoEditor.putString("username",body.getUsername());
Constant.USER_NAME=body.getUsername();
navInfoEditor.putString("mobile",body.getMobile());
Constant.MOBILE=body.getMobile();
navInfoEditor.putInt("sex",body.getSex());//0: 1
Constant.SEX=body.getSex();
navInfoEditor.putString("qq",body.getQq());
Constant.QQ=body.getQq();
navInfoEditor.putString("wechat",body.getWechat());
Constant.WECHAT=body.getWechat();
UserDetailBean.BodyBean.UserBankcardBean userBankcard = body.getUserBankcard();
if (userBankcard != null) {//存储银行卡信息
navInfoEditor.putString("bankAccount", userBankcard.getBankAccount());//银行卡编号
Constant.BANKACCOUNT = userBankcard.getBankAccount();
navInfoEditor.putString("idNumber", userBankcard.getIdNumber());//银行卡账号
Constant.ID_NUMBER = userBankcard.getIdNumber();
if (userBankcard!=null){//存储银行卡信息
navInfoEditor.putString("bankAccount",userBankcard.getBankAccount());//银行卡编号
Constant.BANKACCOUNT=userBankcard.getBankAccount();
navInfoEditor.putString("idNumber",userBankcard.getIdNumber());//银行卡账号
Constant.ID_NUMBER=userBankcard.getIdNumber();
}
UserDetailBean.BodyBean.UserAuthBean userAuth = body.getUserAuth();
if (userAuth != null) {//存储身份证信息
navInfoEditor.putString("name", userAuth.getName());//身份证姓名
Constant.NAME = userAuth.getName();
navInfoEditor.putString("idnum", userAuth.getIdnum());//身份证号码
Constant.ID_NUM = userAuth.getIdnum();
navInfoEditor.putInt("auditstatus", userAuth.getAuditstatus());//审核状态
Constant.AUDITSTATUS = userAuth.getAuditstatus();
navInfoEditor.putString("auditmsg", userAuth.getAuditmsg());//审核信息
Constant.AUDITMSG = userAuth.getAuditmsg();
if (userAuth!=null){//存储身份证信息
navInfoEditor.putString("name",userAuth.getName());//身份证姓名
Constant.NAME=userAuth.getName();
navInfoEditor.putString("idnum",userAuth.getIdnum());//身份证号码
Constant.ID_NUM=userAuth.getIdnum();
navInfoEditor.putInt("auditstatus",userAuth.getAuditstatus());//审核状态
Constant.AUDITSTATUS=userAuth.getAuditstatus();
navInfoEditor.putString("auditmsg",userAuth.getAuditmsg());//审核信息
Constant.AUDITMSG=userAuth.getAuditmsg();
}
navInfoEditor.commit();
}
Intent intent = new Intent(LoginActivity.this, HomeActivity.class);
startActivity(intent);
finish();
} else {
}else {
Toast.makeText(LoginActivity.this, response.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();
dismissLoadingDialog();
Toast.makeText(LoginActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show();
}
});
@ -249,7 +251,6 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
@Override
public void onDestroy() {
if (EventBus.getDefault().isRegistered(this))//加上判断

View File

@ -45,6 +45,7 @@ import java.util.List;
* 启动页
*/
public class MainActivity extends BaseActivity {
private Handler handler = new Handler(new Handler.Callback() {
@Override
public boolean handleMessage(@NonNull Message msg) {

View File

@ -9,6 +9,7 @@ import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Matrix;
import android.location.Location;
import android.media.MediaMetadataRetriever;
@ -36,7 +37,10 @@ import com.navinfo.outdoor.R;
import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.base.BaseActivity;
import com.navinfo.outdoor.room.PoiEntity;
import com.navinfo.outdoor.util.AWMp4ParserHelper;
import com.navinfo.outdoor.util.GeometryTools;
import com.navinfo.outdoor.util.MapManager;
import com.navinfo.outdoor.util.MyTecentLocationSource;
import com.otaliastudios.cameraview.CameraException;
import com.otaliastudios.cameraview.CameraListener;
@ -68,6 +72,11 @@ import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
import com.tencent.tencentmap.mapsdk.maps.model.Marker;
import com.tencent.tencentmap.mapsdk.maps.model.MarkerOptions;
import com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle;
import com.tencent.tencentmap.mapsdk.maps.model.Polygon;
import com.tencent.tencentmap.mapsdk.maps.model.PolygonOptions;
import com.tencent.tencentmap.mapsdk.maps.model.Polyline;
import com.tencent.tencentmap.mapsdk.maps.model.PolylineOptions;
import com.vividsolutions.jts.geom.Geometry;
import org.greenrobot.eventbus.EventBus;
@ -80,6 +89,7 @@ import java.io.FileDescriptor;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@ -116,8 +126,9 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
private long recordingTime = 0;// 记录下来的总时间
private int oratation = -1; // 是否强制横屏拍摄默认不强制,0-强制横屏 其他-任意
private List<Removable> removables;
private String uuId;
private ImageView ivPic;
private PoiEntity poiEntity;
private Polyline polyline;
@Override
protected int getLayout() {
@ -133,7 +144,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
if (getIntent() != null) {
finalVideoPath = getIntent().getStringExtra(Constant.INTENT_VIDEO_PATH);
uuId = getIntent().getStringExtra("uuId");
poiEntity = (PoiEntity) getIntent().getSerializableExtra("poiEntity");
oratation = getIntent().getIntExtra(Constant.INTENT_VIDEO_ORATATION, -1);
}
videoChronometer = findViewById(R.id.video_chronometer);
@ -224,6 +235,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
uiSettings.setLogoScale(0.7f);
// uiSettings.setAllGesturesEnabled(false);
setLocMarkerStyle(); // 设置当前位置显示样式
initLine();
// camera.addFrameProcessor(new FrameProcessor() {
// @Override
@ -232,8 +244,8 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
// }
// });
removables = new ArrayList<>();//存储轨迹的marker
if (uuId != null) {
List<File> videoFileListByUUID = AWMp4ParserHelper.getInstance().getVideoFileListByUUID(uuId);
if (poiEntity.getId() != null) {
List<File> videoFileListByUUID = AWMp4ParserHelper.getInstance().getVideoFileListByUUID(poiEntity.getId());
if (videoFileListByUUID != null) {
List<LatLng> lineStringByVideoFileList = AWMp4ParserHelper.getInstance().getLineStringByVideoFileList(videoFileListByUUID);
for (int i = 0; i < lineStringByVideoFileList.size(); i++) {
@ -282,50 +294,50 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
PictureActivity.this.finish();
return;
}
if (captureVideo.isChecked()&&!isFinishActivity){
if (captureVideo.isChecked() && !isFinishActivity) {
startTakenVideo();
return;
}
Toast.makeText(PictureActivity.this, "暂停摄像", Toast.LENGTH_SHORT).show();
// new Thread(new Runnable() {
// @Override
// public void run() {
// if (result!=null) {
// File currentFile = result.getFile();
// if (finalVideoPath!=null) { // 有指定的视频文件名称合并文件
// if (new File(finalVideoPath).exists()) {
// List<String> spliteFileList = new ArrayList<>();
// spliteFileList.add(finalVideoPath);
// spliteFileList.add(currentFile.getAbsolutePath());
// try {
// AWMp4ParserHelper.getInstance().mergeVideos(spliteFileList, tmpFile.getAbsolutePath());
// if (tmpFile.exists()) {
// File finalVideoFile = new File(finalVideoPath);
// finalVideoFile.delete();
// currentFile.delete();
// tmpFile.renameTo(finalVideoFile);
// } else {
// Toast.makeText(PictureActivity.this, "视频合并失败!", Toast.LENGTH_SHORT).show();
// }
// } catch (Exception e) {
// Log.e("PictureActivity", e.getMessage());
// }
// } else {
// currentFile.renameTo(new File(finalVideoPath));
// }
// }
// }
// runOnUiThread(new Runnable() {
// @Override
// public void run() {
// dismissLoadingDialog();
// if (isFinishActivity) {
// PictureActivity.this.finish();
// }
// }
// });
// }
// }).start();
/* new Thread(new Runnable() {
@Override
public void run() {
if (result!=null) {
File currentFile = result.getFile();
if (finalVideoPath!=null) { // 有指定的视频文件名称合并文件
if (new File(finalVideoPath).exists()) {
List<String> spliteFileList = new ArrayList<>();
spliteFileList.add(finalVideoPath);
spliteFileList.add(currentFile.getAbsolutePath());
try {
AWMp4ParserHelper.getInstance().mergeVideos(spliteFileList, tmpFile.getAbsolutePath());
if (tmpFile.exists()) {
File finalVideoFile = new File(finalVideoPath);
finalVideoFile.delete();
currentFile.delete();
tmpFile.renameTo(finalVideoFile);
} else {
Toast.makeText(PictureActivity.this, "视频合并失败!", Toast.LENGTH_SHORT).show();
}
} catch (Exception e) {
Log.e("PictureActivity", e.getMessage());
}
} else {
currentFile.renameTo(new File(finalVideoPath));
}
}
}
runOnUiThread(new Runnable() {
@Override
public void run() {
dismissLoadingDialog();
if (isFinishActivity) {
PictureActivity.this.finish();
}
}
});
}
}).start();*/
}
@Override
@ -379,6 +391,37 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
ivMap.setLayoutParams(layoutParamsMap);
}
private void initLine() {
String geo = poiEntity.getGeoWkt();
Geometry geometry = GeometryTools.createGeometry(geo);
if (geometry != null) {
if (geometry.getGeometryType().equals("LineString")) {//线
BitmapDescriptor bitmapLine = null;
if (poiEntity.getType() == 3) {//poi录像
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_arrows);
} else if (poiEntity.getType() == 4) {//道路录像
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.road_arrows);
}
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
// 构造 PolylineOpitons
PolylineOptions polylineOptions = new PolylineOptions()
.addAll(latLineString)
// 折线设置圆形线头
.lineCap(true)
// 折线的颜色为绿色
.color(0xff00ff00)
// 折线宽度为5像素
.width(45)
.arrow(true)
.arrowSpacing(150)
.arrowTexture(bitmapLine);
// 绘制折线
polyline = tencentMap.addPolyline(polylineOptions);
polyline.setZIndex(2);
}
}
}
// 将秒转化成小时分钟秒
private String formatMiss(long miss) {
@ -572,6 +615,9 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
protected void onDestroy() {
super.onDestroy();
stopTakenVideo();
if (polyline!=null){
polyline.remove();
}
camera.destroy();
for (int i = 0; i < removables.size(); i++) {
removables.get(i).remove();

View File

@ -86,8 +86,8 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
protected void initView() {
super.initView();
initJsonData();
navInfo = getSharedPreferences("navInfo", Context.MODE_PRIVATE);
navInfoEditor = getSharedPreferences("navInfo", Context.MODE_PRIVATE).edit();
navInfo = getSharedPreferences(Constant.SHARED_PREFERENCES, Context.MODE_PRIVATE);
navInfoEditor = getSharedPreferences(Constant.SHARED_PREFERENCES, Context.MODE_PRIVATE).edit();
ivUser = findViewById(R.id.iv_user);
ivUser.setOnClickListener(this::onClick);
btnAttestation = findViewById(R.id.btn_attestations);

View File

@ -33,19 +33,23 @@ public class Constant {
public static final String GET_ERR_MESSAGE1 = "设备缺少使用腾讯定位服务需要的基本条件";
public static final String GET_ERR_MESSAGE2 = "manifest 中配置的 key 不正确";
public static final String GET_ERR_MESSAGE3 = "自动加载libtencentloc.so失败";
public static String BASE_FOLDER = SdkFolderCreate.getSDPath() + "/navinfoOutDoor";
public static String BASE_FOLDER = SdkFolderCreate.getSDPath() + "/navinfoOutDoor";
// 保存图片的目录
public static String PICTURE_FOLDER;
public static String VIDEOS_ ;
public static String POI_DAO ;
public static String VIDEOS_;
public static String POI_DAO;
public static String SHARED_PREFERENCES = "navInfo";
public static String DATA_FILE = "dataFile";
//下载文件
public static final String NAVINFO_APk = BASE_FOLDER + "/apk/";
public static void initRootFolder(String userId){
BASE_FOLDER+="/"+userId;
public static void initRootFolder(String userId) {
BASE_FOLDER += "/" + userId;
PICTURE_FOLDER = BASE_FOLDER + "/picture";
POI_DAO = BASE_FOLDER + "/BaseDao/";
VIDEOS_ = BASE_FOLDER + "/videos";
// 初始化应用目录
File baseFolder = new File(BASE_FOLDER); // 数据库文件夹路径
if (!baseFolder.exists()) {
@ -57,6 +61,7 @@ public class Constant {
SdkFolderCreate.mkdirs(picFolder.getAbsolutePath());
}
}
// 申请权限的RequestCode
public static final int PERMISSION_REQUEST_CODE = 0x100;
@ -64,36 +69,32 @@ public class Constant {
//筛选
public static final int FILTER_CODE = 0x200;
public static final String DATA_FILE = "dataFile";
/**
* 存储用户信息
* access_token 后续需求需要用到的key 过期时间8小时
* refresh_token 刷新token用 过期时间1个月
* userId 用户id
* username 用户编号
* access_token 后续需求需要用到的key 过期时间8小时
* refresh_token 刷新token用 过期时间1个月
* userId 用户id
* username 用户编号
*/
public static String ACCESS_TOKEN=null;
public static String REFRESH_TOKEN=null;
public static String USERID=null;
public static String ACCESS_TOKEN = null;
public static String REFRESH_TOKEN = null;
public static String USERID = null;
public static String USER_NAME=null;//登录账号/修改账号/注册
public static String PASS_WORD=null;//登录密码/修改密码/注册密码
public static String USER_NAME = null;//登录账号/修改账号/注册
public static String PASS_WORD = null;//登录密码/修改密码/注册密码
public static String AUDITMSG = null;//身份证审核信息
public static int AUDITSTATUS = -1;//身份证审核状态 //0不通過1通過-1待审核
public static String ID_NUM = null;//身份证号
public static String NAME = null;//身份证姓名
public static String ID_NUMBER = null;//银行卡号
public static String BANKACCOUNT = null;//银行卡编码
public static int SEX = -1;//性别
public static String BANKACCOUNT = null;//银行卡编码
public static int SEX = -1;//性别
public static String QQ = null;
public static String WECHAT = null;
public static String WECHAT = null;
public static String MOBILE = null;//手机号
//message word
public static final int TREASURE_FRAGMENT = 100;//抽屉界面的展示和隐藏
public static final int TREASURE_WORD = 39;//poi 对地图页面marker 的一个展示 编辑
@ -112,24 +113,21 @@ public class Constant {
public static final int CHARGING_STATION_WORD = 15;//地图页面marker 的经纬都回传
public static final int CHARGING_STATION = 16;//跳转到充电桩
public static final int CHARGING_STATION_ITEM = 17;//适配器的item跳转到充电桩
public static final int MAIN_CHARGING_PILE = 18;//充电桩的Fragment 对地图页面marker 的一个展示 编辑
public static final int MAIN_CHARGING_CHECKED_PILE = 49;//充电桩的Fragment 对地图页面marker 的一个展示 确定
public static final int CHARGING_PILE_WORD = 20;//地图页面marker 的经纬都回传
public static final int CHARGING_PILE_STATION = 22;//将充电桩的数据回传给充电站
public static final int MAIN_OTHER = 23;//其他的Fragment 对地图页面marker 的一个展示 编辑
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 后弹窗点击开始采集
public static final int HOME_MINE = 32;//点击我的实时监听刷新
public static final int HOME_TREASURE = 33;//点击寻宝实时监听刷新
public static final int JOB_WORD_MONITOR = 34;//筛选条件的刷新
public static final int JOB_WORD_MONITOR = 34;//寻宝界面和删选的刷新
public static final int EVENT_WHAT_LOCATION_CHANGE = 35; // 定位位置更新的Event的What值
// public static final int CHARGING_PILE_BODY = 36;//充电装的body
// public static final int CHARGING_PILE_BODY = 36;//充电装的body
// public static final int CHARGING_PILE_PHOTO = 37;//充电桩的照片
public static final int Filter_WhAT_RECYCLER = 39;//刪選適配器的刷新
public static final int EVENT_WHAT_CURRENT_MARKER = 41; // 显示当前正在编辑的POI类型数据的Event的What值
//CompleteTask
public static final int EVENT_WHAT_COMPLETE_TASK = 42; // 点击记录跳转开始采集
@ -164,7 +162,10 @@ public class Constant {
public static final String INTENT_VIDEO_PATH = "INTENT_VIDEO_PATH"; // 拍照界面指定的视频文件保存位置
public static final String INTENT_VIDEO_ORATATION = "INTENT_VIDEO_ORATATION"; // 视频拍摄时屏幕方向 0-强制横屏 其他-任意
public static SlidingUpPanelLayout SLIDING_LAYOUT=null;//設置
public static SlidingUpPanelLayout SLIDING_LAYOUT = null;//設置
public static boolean IS_FILTER_LIST_ITEM =true;//poi页面的查重
public static boolean IS_FILTER_LIST_ITEM = true;//poi页面的查重
//--/
}

View File

@ -83,7 +83,7 @@ public abstract class BaseActivity extends AppCompatActivity {
alertDialog.setView(view);
alertDialog.setCanceledOnTouchOutside(false);
alertDialog.show();
initTimer();
// initTimer();
} else {
Toast.makeText(this, "网络不可用", Toast.LENGTH_SHORT).show();
}

View File

@ -87,7 +87,7 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
alertDialog.setView(view);
alertDialog.setCanceledOnTouchOutside(false);
alertDialog.show();
initTimer();
//initTimer();
} else {
Toast.makeText(getActivity(), "网络不可用", Toast.LENGTH_SHORT).show();
}

View File

@ -1,4 +1,4 @@
package com.navinfo.outdoor.fragment;
package com.navinfo.outdoor.bean;
public class GetPhoneBean {

View File

@ -1340,7 +1340,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
}
String tagParking = (String) tvParking.getTag();
if (tagParking != null && !tagParking.equals("")) {
photo.add(tagPanorama);
photo.add(tagParking);
}
String tagNumber = (String) tvNumber.getTag();
if (tagNumber != null && !tagNumber.equals("")) {

View File

@ -2,14 +2,13 @@ package com.navinfo.outdoor.fragment;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Point;
import android.net.Uri;
import android.os.Bundle;
import android.os.Message;
import android.provider.MediaStore;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
@ -41,7 +40,6 @@ import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
import com.kongzue.dialog.util.BaseDialog;
import com.kongzue.dialog.util.DialogSettings;
import com.kongzue.dialog.v3.MessageDialog;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.HttpParams;
import com.navinfo.outdoor.R;
import com.navinfo.outdoor.activity.FragmentManagement;
@ -50,12 +48,12 @@ import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.base.BaseDrawerFragment;
import com.navinfo.outdoor.bean.ChargingPileSaveBean;
import com.navinfo.outdoor.bean.ChargingStationBean;
import com.navinfo.outdoor.bean.GetPhoneBean;
import com.navinfo.outdoor.bean.Info;
import com.navinfo.outdoor.bean.PhoneBean;
import com.navinfo.outdoor.bean.PoiUploadBean;
import com.navinfo.outdoor.bean.TaskNameBean;
import com.navinfo.outdoor.http.Callback;
import com.navinfo.outdoor.http.DialogCallback;
import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.navinfo.outdoor.room.ChargingPileDao;
@ -66,10 +64,14 @@ import com.navinfo.outdoor.room.PoiDatabase;
import com.navinfo.outdoor.room.PoiEntity;
import com.navinfo.outdoor.ui.view.ContactView;
import com.navinfo.outdoor.util.Geohash;
import com.navinfo.outdoor.util.PhotoPathUtil;
import com.navinfo.outdoor.util.PhotoUtils;
import com.navinfo.outdoor.util.ToastUtil;
import com.tencent.tencentmap.mapsdk.maps.TencentMap;
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptorFactory;
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
import com.tencent.tencentmap.mapsdk.maps.model.Marker;
import com.tencent.tencentmap.mapsdk.maps.model.MarkerOptions;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
@ -84,7 +86,6 @@ import java.util.HashMap;
import java.util.List;
import okhttp3.Response;
import okhttp3.ResponseBody;
import static android.app.Activity.RESULT_OK;
@ -129,6 +130,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
// private ArrayList<File> fileList;
private File photoFile; // 拍照保存的路径
private NestedScrollView nestedScrollView;
private Marker markerStation;
private Point screenStationPositions;
public static ChargingStationFragment newInstance(Bundle bundle) {
ChargingStationFragment fragment = new ChargingStationFragment();
@ -197,6 +200,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
public void onResume() {
super.onResume();
initHeader();
moveLatlng(latLng,null);
}
@Override
@ -259,14 +263,13 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
chargingPileAdapter.setOnLickItem(new ChargingPileAdapter.onLickItem() {
@Override
public void item(ChargingPileEntity chargingPileEntity) {
Message obtains = Message.obtain();
obtains.what = Constant.CHARGING_STATION_PILE;
obtains.obj = chargingPileEntity;
EventBus.getDefault().post(obtains);
String showStation = initShowStation();
HashMap<String, Object> stringObjectHashMap = new HashMap<>();
stringObjectHashMap.put("chargingPileEntity",chargingPileEntity);
stringObjectHashMap.put("showStation",showStation);
Message obtain = Message.obtain();
obtain.what = Constant.CHARGING_STATION;
obtain.obj = showStation;
obtain.obj = stringObjectHashMap;
EventBus.getDefault().post(obtain);
}
});
@ -277,17 +280,26 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
if (isChecked) {
checkBoxLife.setText("保存");
checkBoxLife.setTextColor(Color.WHITE);
Message obtain = Message.obtain();
obtain.what = Constant.MAIN_CHARGING_STATION;
obtain.obj = latLng;
EventBus.getDefault().post(obtain);
moveLatlng(latLng, new TencentMap.CancelableCallback() {
@Override
public void onFinish() {
screenStationPositions = tencentMap.getProjection().toScreenLocation(latLng);
//创建Marker对象之前设置属性
if (markerStation != null) {
markerStation.setFixingPoint(screenStationPositions.x, screenStationPositions.y);
}
}
@Override
public void onCancel() {
}
});
} else {
checkBoxLife.setText("编辑");
checkBoxLife.setTextColor(Color.BLACK);
Message obtain = Message.obtain();
obtain.what = Constant.MAIN_CHARGING_CHECKED_STATION;
obtain.obj = true;
EventBus.getDefault().post(obtain);
latLng = tencentMap.getProjection().fromScreenLocation(screenStationPositions);
markerStation.setPosition(latLng);
markerStation.setFixingPointEnable(false);
}
}
@ -463,6 +475,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
latLng = new LatLng();
latLng.setLatitude(Double.parseDouble(y));
latLng.setLongitude(Double.parseDouble(x));
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
markerStation = tencentMap.addMarker(new MarkerOptions(latLng).icon(pileDescriptor));
markerStation.setZIndex(4);
moveLatlng(latLng,null);
}
initPhone();
@ -584,15 +600,14 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
String pileFileString = dataFile.getString("chargingPileEntity", null);
if (pileFileString != null) {
ChargingPileEntity chargingPileEntity = new Gson().fromJson(pileFileString, ChargingPileEntity.class);
Message obtains = Message.obtain();
obtains.what = Constant.CHARGING_STATION_PILE;
obtains.obj = chargingPileEntity;
EventBus.getDefault().post(obtains);
initRemovePileSharePre();
String showStation = initShowStation();
HashMap<String, Object> stringObjectHashMap = new HashMap<>();
stringObjectHashMap.put("chargingPileEntity",chargingPileEntity);
stringObjectHashMap.put("showStation",showStation);
initRemovePileSharePre();
Message obtain = Message.obtain();
obtain.what = Constant.CHARGING_STATION;
obtain.obj = showStation;
obtain.obj = stringObjectHashMap;
EventBus.getDefault().post(obtain);
}
}
@ -682,11 +697,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
chargingPileEntities.add(chargingPileEntity);
chargingPileAdapter.setChargingPileEntities(chargingPileEntities);
}
/*else if (data.what == Constant.CHARGING_PILE_BODY) {
chargingPileBody = (Integer) data.obj;
} else if (data.what == Constant.CHARGING_PILE_PHOTO) {
fileList = (ArrayList<File>) data.obj;
}*/
}
@Override
@ -806,18 +816,17 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
}
private void initChargingPile() {
Message obtains = Message.obtain();
obtains.what = Constant.CHARGING_STATION_PILE;
String showStation = initShowStation();
HashMap<String, Object> stringObjectHashMap = new HashMap<>();
ChargingPileEntity chargingPileEntity = new ChargingPileEntity();
String encode = Geohash.getInstance().encode(latLng.latitude, latLng.longitude);
chargingPileEntity.setP(encode);
obtains.obj = chargingPileEntity;
EventBus.getDefault().post(obtains);
stringObjectHashMap.put("chargingPileEntity",chargingPileEntity);
stringObjectHashMap.put("showStation",showStation);
initRemovePileSharePre();
String showStation = initShowStation();
Message obtain = Message.obtain();
obtain.what = Constant.CHARGING_STATION;
obtain.obj = showStation;
obtain.obj = stringObjectHashMap;
EventBus.getDefault().post(obtain);
}
@ -870,38 +879,40 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} catch (IOException e) {
e.printStackTrace();
}
/*
// OkGo
// // 请求方式和请求url
// .<PoiUploadBean>post(HttpInterface.CS_TASK_UP_LOAD_PIC)
// // 请求的 tag, 主要用于取消对应的请求
// .params("auditId", chargingPileEntity.getBodyId())
// .addFileParams("file", chargingPileFileList)
// .tag(this)
// .execute(new DialogCallback<PoiUploadBean>(PoiUploadBean.class) {
// @Override
// public void onSuccess(Response<PoiUploadBean> poiUploadBeanResponse) {
// dismissLoadingDialog();
// Toast.makeText(getActivity(), "上传成功", Toast.LENGTH_SHORT).show();
// isChargingPoleUploaded = true;
// if (isChargeStationUploaded && isChargingPoleUploaded) {
// getActivity().runOnUiThread(new Runnable() {
// @Override
// public void run() {
// getActivity().onBackPressed();//回退
// }
// });
// }
// }
//
// @Override
// public void onError(Response<PoiUploadBean> poiUploadBeanResponse) {
// super.onError(poiUploadBeanResponse);
// dismissLoadingDialog();
// Toast.makeText(getActivity(), poiUploadBeanResponse.code() + "", Toast.LENGTH_SHORT).show();
// Log.d("TAG", "onError: " + poiUploadBeanResponse.code() + "");
// }
// });
OkGo
// 请求方式和请求url
.<PoiUploadBean>post(HttpInterface.CS_TASK_UP_LOAD_PIC)
// 请求的 tag, 主要用于取消对应的请求
.params("auditId", chargingPileEntity.getBodyId())
.addFileParams("file", chargingPileFileList)
.tag(this)
.execute(new DialogCallback<PoiUploadBean>(PoiUploadBean.class) {
@Override
public void onSuccess(Response<PoiUploadBean> poiUploadBeanResponse) {
dismissLoadingDialog();
Toast.makeText(getActivity(), "上传成功", Toast.LENGTH_SHORT).show();
isChargingPoleUploaded = true;
if (isChargeStationUploaded && isChargingPoleUploaded) {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
getActivity().onBackPressed();//回退
}
});
}
}
@Override
public void onError(Response<PoiUploadBean> poiUploadBeanResponse) {
super.onError(poiUploadBeanResponse);
dismissLoadingDialog();
Toast.makeText(getActivity(), poiUploadBeanResponse.code() + "", Toast.LENGTH_SHORT).show();
Log.d("TAG", "onError: " + poiUploadBeanResponse.code() + "");
}
});
*/
}
private void initRoadSaveLocal(boolean isLocal) {
@ -949,7 +960,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
}
private void stationUploadByNetWork(PoiEntity poiEntity, ArrayList<File> chargingStationList) {
showFileLoadingDialog();
showLoadingDialog();
setLoadingDialogText("上传中...");
if (poiEntity == null || poiEntity.getBodyId() == 0) {
Toast.makeText(getActivity(), "没有保存本地", Toast.LENGTH_SHORT).show();
@ -987,7 +998,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
public void onSuccess(PoiUploadBean response, int id) {
dismissLoadingDialog();
if (response.getCode() == 200) {
Toast.makeText(getActivity(), "上传成功", Toast.LENGTH_SHORT).show();
new Thread(new Runnable() {
@Override
public void run() {
@ -995,6 +1006,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(getActivity(), "上传成功", Toast.LENGTH_SHORT).show();
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
getActivity().onBackPressed();//回退
}
});
@ -1109,7 +1125,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
// chargingPileUploadNetWork(chargingPileBody, fileList);
} else {
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
onBackPressed();
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
getActivity().onBackPressed();
}
Log.d("TAG", "onSuccess: " + chargingStationBean.getBody());
}
@ -1412,6 +1432,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
}
}).start();
}
if (markerStation!=null){
markerStation.remove();
}
}
@Override

View File

@ -8,6 +8,7 @@ import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.constraintlayout.widget.ConstraintLayout;
@ -23,6 +24,7 @@ import com.navinfo.outdoor.R;
import com.navinfo.outdoor.adapter.FilterAdapter;
import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.base.BaseDrawerFragment;
import com.navinfo.outdoor.bean.HasSubmitBean;
import com.navinfo.outdoor.bean.JobSearchBean;
import com.navinfo.outdoor.room.ChargingPileEntity;
import com.navinfo.outdoor.room.PoiDao;
@ -54,6 +56,7 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
private FilterAdapter filterAdapter;
private ArrayList<PoiEntity> poiEntities;
private List<PoiEntity> allPoi;
private int page;
@ -203,7 +206,6 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
filterAdapter.notifyDataSetChanged();
}
@Override
protected void initData() {
super.initData();
@ -276,28 +278,24 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
recyclerFilter.setLoadingMoreEnabled(false);
filterAdapter = new FilterAdapter(getContext(), poiEntities);
recyclerFilter.setAdapter(filterAdapter);
recyclerFilter.setScrollAlphaChangeListener(new XRecyclerView.ScrollAlphaChangeListener() {
@Override
public void onAlphaChange(int alpha) {
}
@Override
public int setLimitHeight() {
return 0;
}
});
recyclerFilter.getDefaultFootView().setNoMoreHint("成功加载完毕");
recyclerFilter.setLoadingListener(new XRecyclerView.LoadingListener() {
@Override
public void onRefresh() {
page=1;
Message obtain = Message.obtain();
obtain.what = Constant.Filter_WhAT_RECYCLER;
obtain.obj = true;
EventBus.getDefault().post(obtain);
}
@Override
public void onLoadMore() {
Message obtain = Message.obtain();
obtain.what = Constant.Filter_WhAT_RECYCLER;
obtain.obj = false;
EventBus.getDefault().post(obtain);
}
});
filterAdapter.setItemCLick(new FilterAdapter.ItemCLick() {

View File

@ -363,12 +363,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
}
InsertAndUpdateUtils.getInstance().insertOrUpdateChargingPile(getActivity(), chargingPileEntityList);
}
//获取当前位置的marker
if (chargingStationEntity.getTaskStatus()==1){
//senMessageMarker(chargingStationEntity.getType(), chargingStationEntity.getY(), chargingStationEntity.getX());
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(),chargingStationEntity);
}
// senMessageMarker(chargingStationEntity.getType(), chargingStationEntity.getY(), chargingStationEntity.getX());
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), chargingStationEntity);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
@ -398,7 +394,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
}
}).start();
}
}else {
} else {
Toast.makeText(getContext(), response.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@ -557,7 +553,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
}
showLoadingDialog();
HttpParams httpParams = new HttpParams();
httpParams.put("id",taskId);
httpParams.put("id", taskId);
OkGoBuilder.getInstance()
.Builder(getActivity())
.url(url)
@ -586,8 +582,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
});
}
}).start();
}else {
Toast.makeText(getContext(), ""+response.getMessage(), Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getContext(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@ -628,8 +624,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
}
}).start();
}else {
Toast.makeText(getContext(), ""+response.getMessage(), Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getContext(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@ -696,11 +692,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
poiListEntity.setX(latPolygon.get(0).longitude + "");
poiListEntity.setY(latPolygon.get(0).latitude + "");
}
if (poiListEntity.getTaskStatus() == 1) {
// 通知地图界面显示当前编辑数据的marker
//senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX());
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
}
// senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX());
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
@ -730,8 +723,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
}
}).start();
}
}else {
Toast.makeText(getContext(), ""+response.getMessage(), Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getContext(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@ -811,12 +804,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
poiListEntity.setX(latPolygon.get(0).longitude + "");
poiListEntity.setY(latPolygon.get(0).latitude + "");
}
if (poiListEntity.getTaskStatus() == 1) {
// 通知地图界面显示当前编辑数据的marker
//senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX());
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
}
//senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX());
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
@ -848,8 +837,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
}
}else {
Toast.makeText(getContext(), ""+response.getMessage(), Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getContext(), "" + response.getMessage(), Toast.LENGTH_SHORT).show();
}
}

View File

@ -4,6 +4,7 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Point;
import android.net.Uri;
import android.os.Bundle;
import android.os.Message;
@ -60,7 +61,12 @@ import com.navinfo.outdoor.room.PoiEntity;
import com.navinfo.outdoor.util.Geohash;
import com.navinfo.outdoor.util.PhotoPathUtil;
import com.navinfo.outdoor.util.PhotoUtils;
import com.tencent.tencentmap.mapsdk.maps.TencentMap;
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptorFactory;
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
import com.tencent.tencentmap.mapsdk.maps.model.Marker;
import com.tencent.tencentmap.mapsdk.maps.model.MarkerOptions;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
@ -99,6 +105,8 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
private CheckBox checkPot;
private File file;
private NestedScrollView nestedScrollView;
private Marker markerOther;
private Point screenOtherPositions;
public static OtherFragment newInstance(Bundle bundle) {
OtherFragment fragment = new OtherFragment();
@ -149,6 +157,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
startActivity(intent);
}
});
moveLatlng(latLng,null);
}
@Override
@ -188,17 +197,26 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
if (isChecked) {
checkPot.setText("保存");
checkPot.setTextColor(Color.WHITE);
Message obtain = Message.obtain();
obtain.what = Constant.MAIN_OTHER;
obtain.obj = latLng;
EventBus.getDefault().post(obtain);
moveLatlng(latLng, new TencentMap.CancelableCallback() {
@Override
public void onFinish() {
screenOtherPositions = tencentMap.getProjection().toScreenLocation(latLng);
//创建Marker对象之前设置属性
if (markerOther != null) {
markerOther.setFixingPoint(screenOtherPositions.x, screenOtherPositions.y);
}
}
@Override
public void onCancel() {
}
});
} else {
checkPot.setText("编辑");
checkPot.setTextColor(Color.BLACK);
Message obtain = Message.obtain();
obtain.what = Constant.MAIN_CHECKED_OTHER;
obtain.obj = true;
EventBus.getDefault().post(obtain);
latLng = tencentMap.getProjection().fromScreenLocation(screenOtherPositions);
markerOther.setPosition(latLng);
markerOther.setFixingPointEnable(false);
}
}
});
@ -297,6 +315,10 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
latLng = new LatLng();
latLng.setLongitude(Double.parseDouble(x));
latLng.setLatitude(Double.parseDouble(y));
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
markerOther = tencentMap.addMarker(new MarkerOptions(latLng).icon(pileDescriptor));
markerOther.setZIndex(4);
moveLatlng(latLng,null);
}
String describe = showPoiEntity.getMemo();//任务描述
if (describe != null && !describe.equals("")) {
@ -446,7 +468,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
HttpParams httpParams=new HttpParams();
httpParams.put("auditId",body);
showFileLoadingDialog();
showLoadingDialog();
setLoadingDialogText("上传中...");
OkGoBuilder.getInstance()
.Builder(getActivity())
@ -459,7 +481,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
@Override
public void onSuccess(PoiUploadBean response, int id) {
dismissLoadingDialog();
Toast.makeText(getActivity(), "上传成功", Toast.LENGTH_SHORT).show();
new Thread(new Runnable() {
@Override
public void run() {
@ -468,6 +490,11 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(getActivity(), "上传成功", Toast.LENGTH_SHORT).show();
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
getActivity().onBackPressed();//回退
}
});
@ -521,7 +548,11 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
otherUploadByNet(body,otherUploadList);
}else {
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
onBackPressed();
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
getActivity(). onBackPressed();
}
}
});
@ -619,6 +650,9 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
}
}).start();
}
if (markerOther!=null){
markerOther.remove();
}
}
@Override

View File

@ -3,6 +3,7 @@ package com.navinfo.outdoor.fragment;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.graphics.Point;
import android.net.Uri;
import android.os.Bundle;
import android.os.Message;
@ -42,6 +43,7 @@ import com.navinfo.outdoor.R;
import com.navinfo.outdoor.activity.FragmentManagement;
import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.base.BaseDrawerFragment;
import com.navinfo.outdoor.bean.GetPhoneBean;
import com.navinfo.outdoor.bean.Info;
import com.navinfo.outdoor.bean.OtherUploadPicBean;
import com.navinfo.outdoor.bean.PhoneBean;
@ -58,7 +60,12 @@ import com.navinfo.outdoor.room.PoiEntity;
import com.navinfo.outdoor.ui.view.ContactView;
import com.navinfo.outdoor.util.Geohash;
import com.navinfo.outdoor.util.PhotoUtils;
import com.tencent.tencentmap.mapsdk.maps.TencentMap;
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptorFactory;
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
import com.tencent.tencentmap.mapsdk.maps.model.Marker;
import com.tencent.tencentmap.mapsdk.maps.model.MarkerOptions;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
@ -104,9 +111,10 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
private LinearLayout linearContact;
private ContactView contactView;
private ArrayList<File> poiPicList;
private String tagPanorama;
private File file;
private NestedScrollView nestedScrollView;
private Marker markerPoi;
private Point screenPoiPositions;
public static PoiFragment newInstance(Bundle bundle) {
@ -159,7 +167,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
startActivity(intent);
}
});
moveLatlng(latLng,null);
}
@Override
@ -175,17 +183,26 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
if (isChecked) {
checkBoxLife.setText("保存");
checkBoxLife.setTextColor(Color.WHITE);
Message obtain = Message.obtain();
obtain.what = Constant.TREASURE_WORD;
obtain.obj = latLng;
EventBus.getDefault().post(obtain);
moveLatlng(latLng, new TencentMap.CancelableCallback() {
@Override
public void onFinish() {
screenPoiPositions = tencentMap.getProjection().toScreenLocation(latLng);
//创建Marker对象之前设置属性
if (markerPoi != null) {
markerPoi.setFixingPoint(screenPoiPositions.x, screenPoiPositions.y);
}
}
@Override
public void onCancel() {
}
});
} else {
checkBoxLife.setText("编辑");
checkBoxLife.setTextColor(Color.BLACK);
Message obtain = Message.obtain();
obtain.what = Constant.TREASURE_CHECKED_WORD;
obtain.obj = true;
EventBus.getDefault().post(obtain);
latLng = tencentMap.getProjection().fromScreenLocation(screenPoiPositions);
markerPoi.setPosition(latLng);
markerPoi.setFixingPointEnable(false);
}
}
@ -195,8 +212,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
if (slidingPaneLayout!=null) {
slidingPaneLayout.setScrollableView(nestedScrollView);
}
checkBoxRight.setVisibility(View.GONE);
btnSaveLocal = findViewById(R.id.btn_save_local);
btnSaveLocal.setOnClickListener(this::onClick);
@ -358,8 +373,13 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
String y = showPoiEntity.getY();
if (x != null && y != null) {
latLng = new LatLng();
latLng.setLatitude(Double.parseDouble(y));
latLng.setLatitude(Double.parseDouble
(y));
latLng.setLongitude(Double.parseDouble(x));
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
markerPoi = tencentMap.addMarker(new MarkerOptions(latLng).icon(pileDescriptor));
markerPoi.setZIndex(4);
moveLatlng(latLng,null);
}
//得到区号
initPhone();
@ -720,7 +740,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
Log.e("TAG", "poiUploadByNetWork: " + body + poiPicList);
return;
}
showFileLoadingDialog();
showLoadingDialog();
setLoadingDialogText("上传中...");
HttpParams httpParams=new HttpParams();
httpParams.put("auditId",body);
@ -734,7 +754,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
@Override
public void onSuccess(OtherUploadPicBean response, int id) {
dismissLoadingDialog();
Toast.makeText(getActivity(), "上传成功", Toast.LENGTH_SHORT).show();
new Thread(new Runnable() {
@Override
public void run() {
@ -743,6 +762,11 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(getActivity(), "上传成功", Toast.LENGTH_SHORT).show();
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
getActivity().onBackPressed();//回退
}
});
@ -798,7 +822,11 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
poiUploadByNetWork(body, poiPicList);//上传
} else {
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
onBackPressed();
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
getActivity().onBackPressed();
}
}
});
@ -999,6 +1027,9 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
}
}).start();
}
if (markerPoi!=null){
markerPoi.remove();
}
}
@Override

View File

@ -63,7 +63,11 @@ import com.navinfo.outdoor.room.PoiDatabase;
import com.navinfo.outdoor.room.PoiEntity;
import com.navinfo.outdoor.util.AWMp4ParserHelper;
import com.navinfo.outdoor.util.GeometryTools;
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptorFactory;
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
import com.tencent.tencentmap.mapsdk.maps.model.Marker;
import com.tencent.tencentmap.mapsdk.maps.model.MarkerOptions;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
@ -97,6 +101,8 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
private File fileZip;
private FrameLayout fmPoiVideoPic;
private NestedScrollView nestedScrollView;
private LatLng latLng;
private Marker markerPoiVideo;
public static PoiVideoFragment newInstance(Bundle bundle) {
PoiVideoFragment fragment = new PoiVideoFragment();
@ -120,7 +126,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
@Override
public void onResume() {
super.onResume();
View header =mView.findViewById(R.id.poi_video_header);
View header = mView.findViewById(R.id.poi_video_header);
header.findViewById(R.id.iv_final).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -143,10 +149,11 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
@Override
public void onClick(View v) {
Intent intent = new Intent(getActivity(), FragmentManagement.class);
intent.putExtra("tag",8);
intent.putExtra("tag", 8);
startActivity(intent);
}
});
moveLatlng(latLng,null);
}
@ -159,7 +166,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
tvPictures.setOnClickListener(this::onClick);
setSlidingUpPanelLayout(Constant.SLIDING_LAYOUT);
nestedScrollView = findViewById(R.id.nested_scroll_view);
if (slidingPaneLayout!=null){
if (slidingPaneLayout != null) {
slidingPaneLayout.setScrollableView(nestedScrollView);
}
etRoadName = (EditText) findViewById(R.id.et_poi_video_name);
@ -184,7 +191,8 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
File finalFile = AWMp4ParserHelper.getInstance().obtainMp4FilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath());
Intent intent = new Intent(getContext(), PictureActivity.class);
intent.putExtra("uuId", showPoiEntity.getId());
// intent.putExtra("uuId", showPoiEntity.getId());
intent.putExtra("poiEntity", showPoiEntity);
intent.putExtra(Constant.INTENT_VIDEO_PATH, finalFile.getAbsolutePath());
startActivityForResult(intent, 0x101);
}
@ -219,6 +227,17 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
if (name != null && !name.equals("")) {
etRoadName.setText(name + "");
}
String x = showPoiEntity.getX();
String y = showPoiEntity.getY();
if (x != null && y != null) {
latLng = new LatLng();
latLng.setLongitude(Double.parseDouble(x));
latLng.setLatitude(Double.parseDouble(y));
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
markerPoiVideo = tencentMap.addMarker(new MarkerOptions(latLng).icon(pileDescriptor));
markerPoiVideo.setZIndex(4);
moveLatlng(latLng,null);
}
int work_type = showPoiEntity.getWork_type();
showPictureType(work_type);
String describe = showPoiEntity.getMemo();//任务描述
@ -271,15 +290,14 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
@Subscribe
public void onEvent(Message data) {
if (data.what == Constant.PICTURE_VIDEO_WORD) {
if ((boolean)data.obj){
if ((boolean) data.obj) {
initPoiVideoSharePre();
}
initPoiVideoSharePre();
}
}
}
@Override
public void onClick(View v) {
switch (v.getId()) {
@ -293,12 +311,12 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
Intent intent = new Intent(getContext(), PictureActivity.class);
File finalFile = AWMp4ParserHelper.getInstance().obtainMp4FilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath());
intent.putExtra(Constant.INTENT_VIDEO_PATH, finalFile.getAbsolutePath());
intent.putExtra("uuId", showPoiEntity.getId());
intent.putExtra("poiEntity", showPoiEntity);
startActivityForResult(intent, 0x101);
break;
case R.id.btn_poi_video_upload:
showFileLoadingDialog();
showLoadingDialog();
setLoadingDialogText("压缩中...");
if (fmPoiVideoPic.getTag() != null) {
List<File> videoFileList = (List<File>) fmPoiVideoPic.getTag();
@ -308,7 +326,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
public void run() {
ZipUtil.zipFiles(videoFileList, fileZip, null);
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
if (poiDaoPoiEntity == null || poiDaoPoiEntity.getTaskStatus() == 1 || poiDaoPoiEntity.getTaskStatus() == 2 || poiDaoPoiEntity.getTaskStatus() == 0||poiDaoPoiEntity.getTaskStatus()==5) {
if (poiDaoPoiEntity == null || poiDaoPoiEntity.getTaskStatus() == 1 || poiDaoPoiEntity.getTaskStatus() == 2 || poiDaoPoiEntity.getTaskStatus() == 0 || poiDaoPoiEntity.getTaskStatus() == 5) {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
@ -380,7 +398,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
}
private void poiVideoUpload(int poiVideoBody, File fileZip) {
if (poiVideoBody == 0) {
Toast.makeText(getActivity(), "请先保存本地在上传", Toast.LENGTH_SHORT).show();
@ -392,10 +409,10 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
}
HttpParams httpParams = new HttpParams();
httpParams.put("auditId", poiVideoBody);
long time=System.currentTimeMillis();
httpParams.put("datetime",time);
long time = System.currentTimeMillis();
httpParams.put("datetime", time);
httpParams.put("file", fileZip);
showFileLoadingDialog();
showLoadingDialog();
setLoadingDialogText("上传中...");
OkGoBuilder.getInstance()
.Builder(getActivity())
@ -416,6 +433,10 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
@Override
public void run() {
Toast.makeText(getContext(), "上传成功", Toast.LENGTH_SHORT).show();
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
getActivity().onBackPressed();//回退
}
});
@ -468,7 +489,11 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
poiVideoUpload(poiVideoBody, fileZip);
} else {
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
onBackPressed();
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
getActivity().onBackPressed();
}
}
});
@ -569,7 +594,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
if (EventBus.getDefault().isRegistered(this))//加上判断
EventBus.getDefault().unregister(this);
super.onDestroy();
if (showPoiEntity!=null){
if (showPoiEntity != null) {
new Thread(new Runnable() {
@Override
public void run() {
@ -583,6 +608,9 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
}
}).start();
}
if (markerPoiVideo!=null){
markerPoiVideo.remove();
}
}
@Override
@ -631,13 +659,13 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
poiEntity.setType(3);
poiEntity.setTaskStatus(2);
poiEntity.setIsLocalData(1);
if (fmPoiVideoPic.getTag()==null){
if (fmPoiVideoPic.getTag() == null) {
List<File> videoFileListByUUID = AWMp4ParserHelper.getInstance().getVideoFileListByUUID(showPoiEntity.getId());
if (videoFileListByUUID!=null){
if (videoFileListByUUID != null) {
fmPoiVideoPic.setTag(videoFileListByUUID);
}
}
if (fmPoiVideoPic.getTag() != null &&!((List<File>) fmPoiVideoPic.getTag()).isEmpty()) {
if (fmPoiVideoPic.getTag() != null && !((List<File>) fmPoiVideoPic.getTag()).isEmpty()) {
List<LatLng> lineStringByVideoFileList = AWMp4ParserHelper.getInstance().getLineStringByVideoFileList((List<File>) fmPoiVideoPic.getTag());
String lineString = GeometryTools.getLineString(lineStringByVideoFileList);
Log.d("TAG", "onGranted: " + lineString);
@ -653,12 +681,12 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
@Override
protected PoiCheckResult checkPoiEntity(PoiEntity entity) {
PoiCheckResult poiCheckResult = new PoiCheckResult();
if (entity.getPhoto()==null){
if (entity.getPhoto() == null) {
poiCheckResult.setCode(1);
poiCheckResult.setMsg("请录像");
return poiCheckResult;
}
if (entity.getWork_type()==-1){
if (entity.getWork_type() == -1) {
poiCheckResult.setCode(1);
poiCheckResult.setMsg("请选择录像方式");
return poiCheckResult;

View File

@ -63,7 +63,11 @@ import com.navinfo.outdoor.room.PoiDatabase;
import com.navinfo.outdoor.room.PoiEntity;
import com.navinfo.outdoor.util.AWMp4ParserHelper;
import com.navinfo.outdoor.util.GeometryTools;
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptorFactory;
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
import com.tencent.tencentmap.mapsdk.maps.model.Marker;
import com.tencent.tencentmap.mapsdk.maps.model.MarkerOptions;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
@ -99,6 +103,8 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
private File fileZip;
private FrameLayout fmRoadPic;
private NestedScrollView nestedScrollView;
private Marker markerRoad;
private LatLng latLng;
public static RoadFragment newInstance(Bundle bundle) {
RoadFragment fragment = new RoadFragment();
@ -148,6 +154,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
startActivity(intent);
}
});
moveLatlng(latLng,null);
}
@ -189,7 +196,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
Intent intent = new Intent(getContext(), PictureActivity.class);
intent.putExtra(Constant.INTENT_VIDEO_PATH, finalFile.getAbsolutePath());
intent.putExtra(Constant.INTENT_VIDEO_ORATATION, 0);
intent.putExtra("uuId", showPoiEntity.getId());
intent.putExtra("poiEntity", showPoiEntity);
startActivityForResult(intent, 0x101);
}
});
@ -226,6 +233,17 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
if (name != null && !name.equals("")) {
etRoadName.setText(name + "");
}
String x = showPoiEntity.getX();
String y = showPoiEntity.getY();
if (x != null && y != null) {
latLng = new LatLng();
latLng.setLongitude(Double.parseDouble(x));
latLng.setLatitude(Double.parseDouble(y));
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
markerRoad = tencentMap.addMarker(new MarkerOptions(latLng).icon(pileDescriptor));
markerRoad.setZIndex(4);
moveLatlng(latLng,null);
}
int work_type = showPoiEntity.getWork_type();
showPictureType(work_type);
String describe = showPoiEntity.getDescribe();//任务描述
@ -301,11 +319,11 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
File finalFile = AWMp4ParserHelper.getInstance().obtainMp4FilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath());
intent.putExtra(Constant.INTENT_VIDEO_PATH, finalFile.getAbsolutePath());
intent.putExtra(Constant.INTENT_VIDEO_ORATATION, 0);
intent.putExtra("uuId", showPoiEntity.getId());
intent.putExtra("poiEntity", showPoiEntity);
startActivityForResult(intent, 0x101);
break;
case R.id.road_upload:
showFileLoadingDialog();
showLoadingDialog();
setLoadingDialogText("压缩中...");
if (fmRoadPic.getTag() != null) {
List<File> videoFileList = (List<File>) fmRoadPic.getTag();
@ -398,7 +416,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
long time = System.currentTimeMillis();
httpParams.put("datetime", time);
httpParams.put("file", fileZip);
showFileLoadingDialog();
showLoadingDialog();
setLoadingDialogText("上传中...");
OkGoBuilder.getInstance()
.Builder(getActivity())
@ -419,6 +437,10 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
@Override
public void run() {
Toast.makeText(getContext(), "上传成功", Toast.LENGTH_SHORT).show();
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
getActivity().onBackPressed();//回退
}
});
@ -470,6 +492,10 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
poiVideoUpload(roadBody, fileZip);
} else {
Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();
Message obtain = Message.obtain();
obtain.what = Constant.JOB_WORD_MONITOR;
obtain.obj = true;
EventBus.getDefault().post(obtain);
onBackPressed();
}
}
@ -612,6 +638,9 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
}
}).start();
}
if (markerRoad!=null){
markerRoad.remove();
}
}
@Override

View File

@ -12,6 +12,7 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import com.navinfo.outdoor.R;
import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.base.BaseFragment;
/**
@ -32,11 +33,6 @@ public class SetFragment extends BaseFragment implements View.OnClickListener {
fragment.setArguments(bundle);
return fragment;
}
@Override
public void onAttach(@NonNull Context context) {
super.onAttach(context);
navInfoEditor = context.getSharedPreferences("navInfo", Context.MODE_PRIVATE).edit();
}
@Override
protected int getLayout() {
@ -50,7 +46,8 @@ public class SetFragment extends BaseFragment implements View.OnClickListener {
@Override
protected void initView() {
super.initView();
navInfo = getActivity().getSharedPreferences("navInfo", Context.MODE_PRIVATE);
navInfo = getActivity().getSharedPreferences(Constant.SHARED_PREFERENCES, Context.MODE_PRIVATE);
navInfoEditor = getActivity().getSharedPreferences(Constant.SHARED_PREFERENCES, Context.MODE_PRIVATE).edit();
ivSet = findViewById(R.id.iv_set);
ivSet.setOnClickListener(this);
switchRealUpload = findViewById(R.id.switch_real_upload);

View File

@ -220,7 +220,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
}
}
if (poiEntities.size() > 0) {
showFileLoadingDialog();
showLoadingDialog();
setLoadingDialogText("提交中...");
PoiSaveUtils.getInstance(getActivity()).uploadPoiEntityBatch(poiEntities);
} else {

View File

@ -95,6 +95,7 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
@ -114,7 +115,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
private SlidingUpPanelLayout sliding_layout;
private FragmentTransaction fragmentTransaction;
private Marker markerPoi;
private CheckBox cbFootType;
private ImageView ivFilter;
private Point screenPosition; //marker的屏幕坐标
private FrameLayout frameLayout;
@ -122,26 +123,22 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
private LinearLayout dragView;
public ImageView ivMessage;
private PoiDao poiDao;
private ChargingPileEntity chargingPileEntity;
private String userEncode;
private String centerEncode;
private List<Removable> removables;
private List<Removable> removablesMarker;
private List<Removable> removableScreenMarker;
private List<Removable> removablesLocality;
/**
* bitmapDescriptor1
*/
private BitmapDescriptor bitmapDescriptor1, bitmapDescriptor2, bitmapDescriptor3, bitmapDescriptor4, bitmapDescriptor5;
// private BitmapDescriptor bitmapDescriptor1, bitmapDescriptor2, bitmapDescriptor3, bitmapDescriptor4, bitmapDescriptor5;
private Marker bigMarker;
private Marker markerPile;
private List<Integer> upload;
private Point screenPilePositions;
private List<Removable> pileLocality;
private final int MARKER_DOT=3;
private final int MARKER_LINE=2;
private final int MARKER_FACE=1;
private final int MARKER_BIG=4;
private final int MARKER_DOT = 3;
private final int MARKER_LINE = 2;
private final int MARKER_FACE = 1;
private final int MARKER_BIG = 4;
public static TreasureFragment newInstance(Bundle bundle) {
TreasureFragment fragment = new TreasureFragment();
@ -169,11 +166,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
@Override
protected void initView() {
super.initView();
bitmapDescriptor1 = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
/* bitmapDescriptor1 = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
bitmapDescriptor2 = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
bitmapDescriptor3 = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
bitmapDescriptor4 = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
bitmapDescriptor5 = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
bitmapDescriptor5 = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);*/
EventBus.getDefault().register(this);
//fragment 管理器
supportFragmentManager = getActivity().getSupportFragmentManager();
@ -239,8 +236,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
initSharePre();
removables = new ArrayList<>();//存储网络数据的marker
removablesLocality = new ArrayList<>(); //存储本地数据的marker
removablesMarker = new ArrayList<>();//存储网络数据的marker
pileLocality = new ArrayList<>();//存储充电桩的marker
removableScreenMarker = new ArrayList<>();//存储点击屏幕上的marker数据的marker
tencentMap.addOnMapLoadedCallback(new TencentMap.OnMapLoadedCallback() {
@Override
public void onMapLoaded() {
@ -277,42 +273,45 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
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();
for (int i = 0; i < removableScreenMarker.size(); i++) {
removableScreenMarker.get(i).remove();
}
removablesMarker.clear();
removableScreenMarker.clear();
PoiEntity poiEntity = (PoiEntity) marker.getTag();
Bundle bundle = new Bundle();
bundle.putSerializable("poiEntity", poiEntity);
switch (poiEntity.getType()) {
case 1:
// initMarker(poiEntity,false);
PoiFragment poiFragment = PoiFragment.newInstance(bundle);
showSlidingFragment(poiFragment);
break;
case 2:
// initMarker(poiEntity,false);
ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle);
showSlidingFragment(chargingStationFragment);
break;
case 3:
// initMarker(poiEntity,false);
PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
showSlidingFragment(poiVideoFragment);
break;
case 4:
// initMarker(poiEntity,false);
RoadFragment roadFragment = RoadFragment.newInstance(bundle);
showSlidingFragment(roadFragment);
break;
case 5:
// initMarker(poiEntity,false);
OtherFragment otherFragment = OtherFragment.newInstance(bundle);
showSlidingFragment(otherFragment);
break;
case 6:
initMarker(poiEntity);
initMarker(poiEntity, true);
break;
}
} else {
@ -345,7 +344,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
poiListEntity.setX(latPolygon.get(0).longitude + "");
poiListEntity.setY(latPolygon.get(0).latitude + "");
}
initMarker(poiListEntity);
initMarker(poiListEntity, true);
} else {
Toast.makeText(getActivity(), "数据为空", Toast.LENGTH_SHORT).show();
}
@ -362,6 +361,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
}
private class NestedScrollableViewHelper extends ScrollableViewHelper {
public int getScrollableViewScrollPosition(View mScrollableView, boolean isSlidingUp) {
if (mScrollableView instanceof NestedScrollView) {
@ -625,13 +625,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
dismissDialog();
}
public void initMarker(PoiEntity poiEntity) {
sliding_layout.setPanelHeight(0);
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
for (int i = 0; i < removablesMarker.size(); i++) {
removablesMarker.get(i).remove();
public void initMarker(PoiEntity poiEntity, boolean aBoolean) {
for (int i = 0; i < removableScreenMarker.size(); i++) {
removableScreenMarker.get(i).remove();
}
removablesMarker.clear();
removableScreenMarker.clear();
String geo = poiEntity.getGeoWkt();
Log.d("TAG", "onSuccess: " + geo);
Geometry geometry = GeometryTools.createGeometry(geo);
@ -654,7 +652,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
// 折线的颜色为绿色
.color(0xff00ff00)
// 折线宽度为5像素
.width(45)
.width(20)
.arrow(true)
.arrowSpacing(150)
.arrowTexture(bitmapLine);
@ -665,7 +663,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
// 绘制折线
Polyline polyline = tencentMap.addPolyline(polylineOptions);
polyline.setZIndex(MARKER_LINE);
removablesMarker.add(polyline);
removableScreenMarker.add(polyline);
if (latLineString != null && latLineString.size() > 0) {
latLng = latLineString.get(0);
}
@ -682,7 +680,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
strokeWidth(25));
polygon.setZIndex(MARKER_FACE);
removablesMarker.add(polygon);
removableScreenMarker.add(polygon);
com.vividsolutions.jts.geom.Point centroid = geometry.getCentroid();
double x = centroid.getX();
double y = centroid.getY();
@ -720,15 +718,19 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
bigMarker.setVisible(true);
bigMarker.setZIndex(MARKER_BIG);
bigMarker.setClickable(false);
if (aBoolean) {
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);
gatherGetFragment = GatherGetFragment.newInstance(bundle);
fragmentTransaction.replace(R.id.frame_layout, gatherGetFragment);
fragmentTransaction.commit();
}
frameLayout.setVisibility(View.VISIBLE);
setMainButtonVisiable(View.GONE);
fragmentTransaction = supportFragmentManager.beginTransaction();
Bundle bundle = new Bundle();
bundle.putSerializable("poiEntity", poiEntity);
gatherGetFragment = GatherGetFragment.newInstance(bundle);
fragmentTransaction.replace(R.id.frame_layout, gatherGetFragment);
fragmentTransaction.commit();
}
private void initThread() {
@ -760,7 +762,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
BitmapDescriptor bitmapLine = null;
if (type == 3) {//poi录像
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_arrows);
} else if (type== 4) {//道路录像
} else if (type == 4) {//道路录像
bitmapLine = BitmapDescriptorFactory.fromResource(R.drawable.road_arrows);
}
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
@ -770,9 +772,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
.addAll(latLineString)
// 折线设置圆形线头
.lineCap(true)
.color(0xffff0000)
.color(Color.parseColor("#AFDBD8"))
// 折线宽度为5像素
.width(35)
.width(10)
.arrow(true)
.arrowSpacing(100)
.arrowTexture(bitmapLine);
@ -943,7 +945,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
bundle.putSerializable("poiEntity", poiEntity);
PoiFragment poiFragment = PoiFragment.newInstance(bundle);
LatLng newPoiLatLng = new LatLng(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX()));
showPoiMarkerByType(1, newPoiLatLng);
// showPoiMarkerByType(1, newPoiLatLng);
showSlidingFragment(poiFragment);
initRemovePoiSharePre();
return false;
@ -959,7 +961,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
bundle.putSerializable("poiEntity", poiEntity);
ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle);
LatLng newPoiLatLng = new LatLng(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX()));
showPoiMarkerByType(4, newPoiLatLng);
// showPoiMarkerByType(4, newPoiLatLng);
showSlidingFragment(chargingStationFragment);
initRemovePoiSharePre();
return false;
@ -975,7 +977,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
bundle.putSerializable("poiEntity", poiEntity);
PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
LatLng newPoiLatLng = new LatLng(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX()));
showPoiMarkerByType(2, newPoiLatLng);
// showPoiMarkerByType(2, newPoiLatLng);
showSlidingFragment(poiVideoFragment);
initRemovePoiSharePre();
return false;
@ -991,7 +993,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
bundle.putSerializable("poiEntity", poiEntity);
RoadFragment roadFragment = RoadFragment.newInstance(bundle);
LatLng newPoiLatLng = new LatLng(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX()));
showPoiMarkerByType(3, newPoiLatLng);
// showPoiMarkerByType(3, newPoiLatLng);
showSlidingFragment(roadFragment);
initRemovePoiSharePre();
return false;
@ -1007,7 +1009,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
bundle.putSerializable("poiEntity", poiEntity);
OtherFragment otherFragment = OtherFragment.newInstance(bundle);
LatLng newPoiLatLng = new LatLng(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX()));
showPoiMarkerByType(5, newPoiLatLng);
// showPoiMarkerByType(5, newPoiLatLng);
showSlidingFragment(otherFragment);
initRemovePoiSharePre();
return false;
@ -1121,7 +1123,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
if (gatherGetFragment != null) {
fragmentTransaction.remove(gatherGetFragment);
}
} else if (data.what == Constant.TREASURE_WORD) { // POI采集-移动位置
}/* else if (data.what == Constant.TREASURE_WORD) { // POI采集-移动位置
initPoiMarker((LatLng) data.obj);
} else if (data.what == Constant.TREASURE_CHECKED_WORD) {//poi采集 -确定位置
if ((boolean) data.obj) {
@ -1133,20 +1135,19 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
if ((boolean) data.obj) {
initCheckedMarker(Constant.CHARGING_STATION_WORD);
}
}/* else if (data.what == Constant.MAIN_CHARGING_PILE) {//充电桩采集-移动位置
}*//* else if (data.what == Constant.MAIN_CHARGING_PILE) {//充电桩采集-移动位置
initPileMarker((LatLng) data.obj);
} else if (data.what == Constant.MAIN_CHARGING_CHECKED_PILE) {//充电桩采集-确定位置
if ((boolean) data.obj) {
initCheckedPileMarker(Constant.CHARGING_PILE_WORD);
}
}*/
else if (data.what == Constant.MAIN_OTHER) {//其他采集-移动位置
}*//* else if (data.what == Constant.MAIN_OTHER) {//其他采集-移动位置
initPoiMarker((LatLng) data.obj);
} else if (data.what == Constant.MAIN_CHECKED_OTHER) {//其他采集-确定位置
if ((boolean) data.obj) {
initCheckedMarker(Constant.OTHER_WORD);
}
} else if (data.what == Constant.TREASURE_FRAGMENT) {//抽屉界面的展示和隐藏
}*/ else if (data.what == Constant.TREASURE_FRAGMENT) {//抽屉界面的展示和隐藏
if ((boolean) data.obj == true) {
frameLayout.setVisibility(View.GONE);
sliding_layout.setPanelHeight(0);
@ -1155,20 +1156,14 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
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();
}else {
if (markerPile != null) {
markerPile.remove();
for (int i = 0; i < removableScreenMarker.size(); i++) {
removableScreenMarker.get(i).remove();
}
removableScreenMarker.clear();
}
} else if (data.what == Constant.MAIN_BUTTON_VISIABLE) {//控制主界面各个按钮显隐状态的what值
@ -1186,22 +1181,22 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
if (bigMarker != null) {
bigMarker.setVisible(false);
}
for (int i = 0; i < removablesMarker.size(); i++) {
removablesMarker.get(i).remove();
for (int i = 0; i < removableScreenMarker.size(); i++) {
removableScreenMarker.get(i).remove();
}
removablesMarker.clear();
removableScreenMarker.clear();
} else if (data.what == Constant.CHARGING_STATION) {//充电站的充电桩-新增
Bundle bundle = new Bundle();
bundle.putBoolean("isSliding", false); // 通知抽屉不收回
bundle.putString("station", (String) data.obj);
if (chargingPileEntity != null) {
if ((HashMap<String, Object>) data.obj != null) {
HashMap<String, Object> stationHashMap = (HashMap<String, Object>) data.obj;
String showStation = (String) stationHashMap.get("showStation");
ChargingPileEntity chargingPileEntity = (ChargingPileEntity) stationHashMap.get("chargingPileEntity");
Bundle bundle = new Bundle();
bundle.putBoolean("isSliding", false); // 通知抽屉不收回
bundle.putString("station", showStation);
bundle.putSerializable("chargingPileEntity", chargingPileEntity);
ChargingPileFragment chargingPileFragment = ChargingPileFragment.newInstance(bundle);
showSlidingFragment(chargingPileFragment);
}
ChargingPileFragment chargingPileFragment = ChargingPileFragment.newInstance(bundle);
showSlidingFragment(chargingPileFragment);
} else if (data.what == Constant.CHARGING_STATION_PILE) {//充电站的充电桩
chargingPileEntity = (ChargingPileEntity) data.obj;
} else if (data.what == Constant.CHARGING_STATION_ITEM) {//充电站的item 跳转到充电桩
Bundle bundle = new Bundle();
bundle.putBoolean("isSliding", false); // 通知抽屉不收回
@ -1209,28 +1204,33 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
bundle.putSerializable("chargingPileEntity", chargingPileEntity);
ChargingPileFragment chargingPileFragment = ChargingPileFragment.newInstance(bundle);
showSlidingFragment(chargingPileFragment);
} else if (data.what == Constant.HOME_TREASURE) {//寻宝的刷新
} else if (data.what == Constant.JOB_WORD_MONITOR) {//筛选条件界面的刷新
if ((boolean) data.obj) {
refreshFilterData();
}
} else if (data.what == Constant.JOB_WORD_MONITOR) {//筛选条件界面的刷新
// 移除网络数据
for (int i = 0; i < removables.size(); i++) {
removables.get(i).remove();
}
removables.clear();
// 移除本地图层marker
for (int i = 0; i < removablesLocality.size(); i++) {
removablesLocality.get(i).remove();
}
removablesLocality.clear();
refreshFilterData();
} else if (data.what == Constant.EVENT_WHAT_CURRENT_MARKER) {
} /*else if (data.what == Constant.EVENT_WHAT_CURRENT_MARKER) {
LatLng latLng = (LatLng) data.obj;
int type = data.arg1;
showPoiMarkerByType(type, latLng);
} else if (data.what == Constant.EVENT_WHAT_COMPLETE_TASK) {
// initRemoveFragment();
BitmapDescriptor descriptor = null;
switch (type){
case 1:
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bags);
break;
case 2:
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bags);
break;
case 3:
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_bag);
break;
case 4:
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bag);
break;
case 5:
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bag);
break;
}
markerPoi = tencentMap.addMarker(new MarkerOptions(latLng).icon(descriptor).zIndex(MARKER_BIG));
} */ else if (data.what == Constant.EVENT_WHAT_COMPLETE_TASK) {
PoiEntity poiEntity = (PoiEntity) data.obj;
Bundle bundle = new Bundle();
bundle.putBoolean("isSliding", true); // 通知抽屉不收回
@ -1278,10 +1278,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
if (bigMarker != null) {
bigMarker.setVisible(false);
}
for (int i = 0; i < removablesMarker.size(); i++) {
removablesMarker.get(i).remove();
for (int i = 0; i < removableScreenMarker.size(); i++) {
removableScreenMarker.get(i).remove();
}
removablesMarker.clear();
removableScreenMarker.clear();
}
}
@ -1300,7 +1300,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
ivMessage.setVisibility(visiable);
}
private void initPoiMarker(LatLng latLng) {
/* private void initPoiMarker(LatLng latLng) {
CameraUpdate cameraSigma = CameraUpdateFactory.newCameraPosition(new CameraPosition(
latLng, //中心点坐标地图目标经纬度
tencentMap.getCameraPosition().zoom, //目标缩放级别
@ -1335,7 +1335,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
obtain.obj = latLng;
EventBus.getDefault().post(obtain);
}
}
}*/
/**
* 设置定位图标样式
@ -1424,10 +1424,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
if (bigMarker != null) {
bigMarker.remove();
}
for (int i = 0; i < removablesMarker.size(); i++) {
removablesMarker.get(i).remove();
for (int i = 0; i < removableScreenMarker.size(); i++) {
removableScreenMarker.get(i).remove();
}
removablesMarker.clear();
removableScreenMarker.clear();
EventBus.getDefault().unregister(this);
}
@ -1515,25 +1515,25 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
@Override
public boolean onClick(ShareDialog shareDialog, int index, ShareDialog.Item item) {
if (item.getText().equals("POI")) {
showPoiMarkerByType(1, newPoiLatLng);
//showPoiMarkerByType(1, newPoiLatLng);
PoiFragment poiFragment = PoiFragment.newInstance(bundle);
showSlidingFragment(poiFragment);
} else if (item.getText().equals("充电站")) {
showPoiMarkerByType(4, newPoiLatLng);
// showPoiMarkerByType(4, newPoiLatLng);
ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle);
showSlidingFragment(chargingStationFragment);
} else if (item.getText().equals("POI录像")) {
showPoiMarkerByType(2, newPoiLatLng);
// showPoiMarkerByType(2, newPoiLatLng);
poiEntity.setWork_type(1);
bundle.putSerializable("poiEntity", poiEntity);
PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
showSlidingFragment(poiVideoFragment);
} else if (item.getText().equals("道路")) {
showPoiMarkerByType(3, newPoiLatLng);
//showPoiMarkerByType(3, newPoiLatLng);
RoadFragment roadFragment = RoadFragment.newInstance(bundle);
showSlidingFragment(roadFragment);
} else if (item.getText().equals("其他")) {
showPoiMarkerByType(5, newPoiLatLng);
// showPoiMarkerByType(5, newPoiLatLng);
OtherFragment otherFragment = OtherFragment.newInstance(bundle);
otherFragment.setSlidingUpPanelLayout(sliding_layout);
showSlidingFragment(otherFragment);
@ -1555,7 +1555,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
}
}
private void showPoiMarkerByType(int type, LatLng latLng) {
/* private void showPoiMarkerByType(int type, LatLng latLng) {
if (type == 1) {
markerPoi = tencentMap.addMarker(new MarkerOptions(latLng).icon(bitmapDescriptor1).zIndex(MARKER_BIG));
} else if (type == 2) {
@ -1567,7 +1567,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
} else if (type == 5) {
markerPoi = tencentMap.addMarker(new MarkerOptions(latLng).icon(bitmapDescriptor5).zIndex(MARKER_BIG));
}
}
}*/
/**
* 将fragment显示到抽屉内

View File

@ -11,4 +11,6 @@
<string name="hello_second_fragment">Hello second fragment. Arg: %1$s</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
</resources>