修改拍照界面,添加了log日志
@ -137,5 +137,7 @@ dependencies {
|
||||
implementation 'com.github.lazylibrary:lazylibrary:1.0.2'
|
||||
//饺子播放器
|
||||
implementation 'cn.jzvd:jiaozivideoplayer:7.4.2'
|
||||
//图片压缩 https://github.com/Hu12037102/ImageCompress
|
||||
implementation 'com.github.Hu12037102:ImageCompress:2.3.0'
|
||||
|
||||
}
|
@ -13,6 +13,7 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
@ -74,8 +75,10 @@ import java.util.Objects;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import static com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE;
|
||||
import static com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER;
|
||||
import utils.bean.ImageConfig;
|
||||
import utils.task.AsyncImageTask;
|
||||
import utils.task.CompressImageTask;
|
||||
|
||||
|
||||
/**
|
||||
* 照片对应
|
||||
@ -151,21 +154,44 @@ public class PhotographActivity extends BaseActivity implements View.OnClickList
|
||||
if (oration == 1) {
|
||||
if (Objects.requireNonNull(cameraView.getPictureSize()).getWidth() < cameraView.getPictureSize().getHeight()) {
|
||||
photographBuilder.append("cameraView 用户竖向拍摄 ,");
|
||||
}else {
|
||||
} else {
|
||||
photographBuilder.append("cameraView 用户横屏拍摄 ,");
|
||||
}
|
||||
}
|
||||
|
||||
File file = new File(photo_path);
|
||||
File destFolder = new File(file.getParentFile().getAbsolutePath()+"aaa");
|
||||
if (!destFolder.exists()) {
|
||||
destFolder.mkdirs();
|
||||
}
|
||||
result.toFile(file, new FileCallback() {
|
||||
@Override
|
||||
public void onFileReady(@Nullable File file) {
|
||||
assert file != null && file.exists();
|
||||
Intent intent = new Intent();
|
||||
assert file != null;
|
||||
intent.putExtra("file", file.getPath());
|
||||
setResult(0x104, intent);
|
||||
SystemTTS.getInstance(PhotographActivity.this).stopSpeak();
|
||||
finish();
|
||||
PhotographActivity.this.finish();
|
||||
/*
|
||||
CompressImageTask.get().compressImage(ImageConfig.getDefaultConfig(file.getAbsolutePath(), file.getAbsolutePath()+"a.jpg"), new AsyncImageTask.OnImageResult(){
|
||||
@Override
|
||||
public void startCompress() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resultError() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resultFileSucceed(File file) {
|
||||
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@ -211,4 +237,5 @@ public class PhotographActivity extends BaseActivity implements View.OnClickList
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -206,7 +206,7 @@ public class TestActivity extends BaseActivity {
|
||||
}
|
||||
switch (list.get(i).getType()) {
|
||||
case 1://poi
|
||||
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bg1);
|
||||
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi);
|
||||
//poiDescriptor.getForager().setScale(50);
|
||||
assert latLng != null;
|
||||
Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor).alpha(0.9f)
|
||||
@ -220,7 +220,7 @@ public class TestActivity extends BaseActivity {
|
||||
onMarker(geo, poiMarker);
|
||||
break;
|
||||
case 2://充电站
|
||||
BitmapDescriptor chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bg1);
|
||||
BitmapDescriptor chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge);
|
||||
assert latLng != null;
|
||||
Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(chargeDescriptor).alpha(0.9f)
|
||||
.anchor(0.5f, 1.0f)
|
||||
@ -233,7 +233,7 @@ public class TestActivity extends BaseActivity {
|
||||
onMarker(geo, stationMarker);
|
||||
break;
|
||||
case 3://poi录像
|
||||
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video_bg1);
|
||||
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video);
|
||||
assert latLng != null;
|
||||
Marker poiVideoMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiVideoDescriptor).alpha(0.9f)
|
||||
.anchor(0.5f, 1.0f)
|
||||
@ -246,7 +246,7 @@ public class TestActivity extends BaseActivity {
|
||||
onMarker(geo, poiVideoMarker);
|
||||
break;
|
||||
case 4://道路录像
|
||||
BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bg);
|
||||
BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road);
|
||||
assert latLng != null;
|
||||
Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor).alpha(0.9f)
|
||||
.anchor(0.5f, 1.0f)
|
||||
@ -259,7 +259,7 @@ public class TestActivity extends BaseActivity {
|
||||
onMarker(geo, roadMarker);
|
||||
break;
|
||||
case 5://其他
|
||||
BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg1);
|
||||
BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other);
|
||||
assert latLng != null;
|
||||
Marker otherMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(otherDescriptor).alpha(0.9f)
|
||||
.anchor(0.5f, 1.0f)
|
||||
@ -272,7 +272,7 @@ public class TestActivity extends BaseActivity {
|
||||
onMarker(geo, otherMarker);
|
||||
break;
|
||||
case 6://面状任务
|
||||
BitmapDescriptor Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_facet_bg1);
|
||||
BitmapDescriptor Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_facet);
|
||||
assert latLng != null;
|
||||
Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Descriptor).alpha(0.9f)
|
||||
.anchor(0.5f, 1.0f)
|
||||
@ -452,7 +452,7 @@ public class TestActivity extends BaseActivity {
|
||||
Coordinate[] coordinates = intersection.getCoordinates();
|
||||
if (coordinates != null && coordinates.length > 0) {
|
||||
LatLng geo = new LatLng(coordinates[0].y, coordinates[0].x);
|
||||
BitmapDescriptor chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bg1);
|
||||
BitmapDescriptor chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge);
|
||||
tencentMap.addMarker(new MarkerOptions(geo).icon(chargeDescriptor).alpha(0.9f)
|
||||
.anchor(0.5f, 1.0f)
|
||||
.flat(true)
|
||||
|
@ -12,7 +12,6 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.bean.BankPathBean;
|
||||
import com.navinfo.outdoor.room.PoiEntity;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -41,22 +40,22 @@ public class MarkerAdapter extends RecyclerView.Adapter<MarkerAdapter.ViewHolder
|
||||
if (poiEntity.getTaskStatus()==0||poiEntity.getTaskStatus()==1){
|
||||
switch (poiEntity.getType()){
|
||||
case 1:
|
||||
Glide.with(context).load(R.drawable.marker_poi_bg1).into(holder.ivIcon);
|
||||
Glide.with(context).load(R.drawable.marker_poi).into(holder.ivIcon);
|
||||
break;
|
||||
case 2:
|
||||
Glide.with(context).load(R.drawable.marker_charge_bg1).into(holder.ivIcon);
|
||||
Glide.with(context).load(R.drawable.marker_charge).into(holder.ivIcon);
|
||||
break;
|
||||
case 3:
|
||||
Glide.with(context).load(R.drawable.marker_poi_video_bg1).into(holder.ivIcon);
|
||||
Glide.with(context).load(R.drawable.marker_poi_video).into(holder.ivIcon);
|
||||
break;
|
||||
case 4:
|
||||
Glide.with(context).load(R.drawable.marker_road_bg).into(holder.ivIcon);
|
||||
Glide.with(context).load(R.drawable.marker_road).into(holder.ivIcon);
|
||||
break;
|
||||
case 5:
|
||||
Glide.with(context).load(R.drawable.marker_other_bg1).into(holder.ivIcon);
|
||||
Glide.with(context).load(R.drawable.marker_other).into(holder.ivIcon);
|
||||
break;
|
||||
case 6:
|
||||
Glide.with(context).load(R.drawable.marker_facet_bg1).into(holder.ivIcon);
|
||||
Glide.with(context).load(R.drawable.marker_facet).into(holder.ivIcon);
|
||||
break;
|
||||
}
|
||||
}else if (poiEntity.getTaskStatus()==2||poiEntity.getTaskStatus()==3||poiEntity.getTaskStatus()==4){
|
||||
@ -68,7 +67,7 @@ public class MarkerAdapter extends RecyclerView.Adapter<MarkerAdapter.ViewHolder
|
||||
Glide.with(context).load(R.drawable.graycharge).into(holder.ivIcon);
|
||||
break;
|
||||
case 3:
|
||||
Glide.with(context).load(R.drawable.poi_video_have_bg1).into(holder.ivIcon);
|
||||
Glide.with(context).load(R.drawable.graypoivideo).into(holder.ivIcon);
|
||||
break;
|
||||
case 4:
|
||||
Glide.with(context).load(R.drawable.grayroad).into(holder.ivIcon);
|
||||
|
@ -1,7 +1,5 @@
|
||||
package com.navinfo.outdoor.api;
|
||||
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.bean.JobSearchBean;
|
||||
import com.navinfo.outdoor.util.SdkFolderCreate;
|
||||
@ -22,51 +20,31 @@ public class Constant {
|
||||
/*当前网络不可用
|
||||
*/
|
||||
public static final CharSequence NETWORK_UNAVAILABLE = "当前网络不可用,请检查网络设置";
|
||||
|
||||
/*位置权限
|
||||
*/
|
||||
public static final String SET_LOCATION_PERMISSION = "请在“设置”中给予“TengXunMap”位置权限,否则当前功能将不可使用";
|
||||
|
||||
public static final String SET_LOCATION = "请在“设置”中给予权限否则当前功能将不可使用";
|
||||
|
||||
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 final String ROOT_FOLDER = SdkFolderCreate.getSDPath() + "/navinfoOutDoor";
|
||||
|
||||
public static final String INTENT_POI_ROAD = "poi_road";
|
||||
|
||||
public static String BASE_FOLDER = ROOT_FOLDER;
|
||||
// 保存图片的目录
|
||||
public static String PICTURE_FOLDER;
|
||||
|
||||
public static String VIDEOS_;
|
||||
|
||||
public static String POI_DAO;
|
||||
|
||||
public static String LOG_FOLDER=ROOT_FOLDER+"/log";
|
||||
|
||||
public static String LOG_FOLDER = ROOT_FOLDER + "/log";
|
||||
public static String SHARED_PREFERENCES = "navInfo";
|
||||
|
||||
public static String MESSAGE_TYPE="messageType";
|
||||
|
||||
public static String MESSAGE_TYPE = "messageType";
|
||||
public static String DATA_FILE = "dataFile";
|
||||
//下载文件
|
||||
public static final String NABISCO_APk = ROOT_FOLDER + "/apk/";
|
||||
|
||||
|
||||
public static int TelLength=0;
|
||||
|
||||
public static int TelLength = 0;
|
||||
public static void initRootFolder(String userId) {
|
||||
BASE_FOLDER = ROOT_FOLDER +"/" + userId;
|
||||
BASE_FOLDER = ROOT_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()) {
|
||||
@ -77,20 +55,16 @@ public class Constant {
|
||||
SdkFolderCreate.mkdirs(picFolder.getAbsolutePath());
|
||||
}
|
||||
File logFolder = new File(LOG_FOLDER);//log文件夹路径
|
||||
if (!logFolder.exists()){
|
||||
if (!logFolder.exists()) {
|
||||
SdkFolderCreate.mkdirs(logFolder.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
|
||||
// 申请权限的RequestCode
|
||||
public static final int PERMISSION_REQUEST_CODE = 0x100;
|
||||
|
||||
public static final int ROAD_PICTURE = 101;
|
||||
//筛选
|
||||
public static final int FILTER_CODE = 0x200;
|
||||
|
||||
|
||||
/**
|
||||
/*
|
||||
* 存储用户信息
|
||||
* access_token 后续需求需要用到的key 过期时间8小时
|
||||
* refresh_token 刷新token用 过期时间1个月
|
||||
@ -100,7 +74,6 @@ public class Constant {
|
||||
public static String ACCESS_TOKEN = null;
|
||||
public static String REFRESH_TOKEN = null;
|
||||
public static String USHERED = null;
|
||||
|
||||
public static String USER_NAME = null;//登录账号/修改账号/注册
|
||||
public static String PASS_WORD = null;//登录密码/修改密码/注册密码
|
||||
public static String AUDITING = null;//身份证审核信息
|
||||
@ -116,20 +89,15 @@ public class Constant {
|
||||
public static String MOBILE = null;//手机号
|
||||
public static String FILE_PATH = null;//银行卡图片途径
|
||||
public static int LEVEL = 0;//用户等级
|
||||
public static boolean isPresent =true;//判断是否在提交中
|
||||
|
||||
|
||||
public static String YOU_MENG_APP_KEY="6139d82c5f798a55cafc51d6";//友盟appkey
|
||||
|
||||
|
||||
|
||||
//message word 值
|
||||
public static boolean isPresent = true;//判断是否在提交中
|
||||
public static String YOU_MENG_APP_KEY = "6139d82c5f798a55cafc51d6";//友盟appkey
|
||||
// message word 值
|
||||
public static final int TREASURE_FRAGMENT = 100;//抽屉界面的展示和隐藏
|
||||
public static final int TREASURE_WORD = 39;//poi 对地图页面marker 的一个展示 编辑
|
||||
public static final int TREASURE_CHECKED_WORD = 40;//poi 对地图页面marker 的一个展示 确定
|
||||
public static final int CAPACITY_EVALUATION_PAGE = 1;//能力测评的页数
|
||||
public static final int POI_WORD = 2;//地图页面marker 的经纬都回传
|
||||
public static final int ORIGINAL_MARKER_WORD =4 ;//記錄原先的點擊marker
|
||||
public static final int ORIGINAL_MARKER_WORD = 4;//記錄原先的點擊marker
|
||||
public static final int FILTER_LIST_ITEM = 5;//点击筛选的item
|
||||
public static final int GATHER_GET = 6;//点击开始采集
|
||||
public static final int TREASURE_GATHER_GET_WORD = 7;//领取采集页面其他marker 的回传
|
||||
@ -154,11 +122,11 @@ public class Constant {
|
||||
public static final int PILE_MARKER_SHOW = 33;//刷新充电桩的显示
|
||||
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_PHOTO = 37;//充电桩的照片
|
||||
// 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
|
||||
// CompleteTask
|
||||
public static final int EVENT_WHAT_COMPLETE_TASK = 42; // 点击记录跳转开始采集
|
||||
public static final int EVENT_STAY_REFRESH = 44; // 刷新记录页面
|
||||
public static final int EVENT_WORK_HOME = 45; //切换到寻宝
|
||||
@ -166,9 +134,8 @@ public class Constant {
|
||||
public static final int VIDEO_FINISH_ROAD = 47;//录像视频列表的返回
|
||||
public static final int PICTURE_VIDEO_WORD = 48; //视频页面崩溃后发给poi录像和道路
|
||||
public static final int PHOTO_FINISH_VIDEO = 49;//拍照列表的返回
|
||||
public static final int NEST_WORD_SUBMIT =50;//所有的提交/上传
|
||||
|
||||
public static final String INTENT_POI_VIDEO_TYPE ="poi_video_type";
|
||||
public static final int NEST_WORD_SUBMIT = 50;//所有的提交/上传
|
||||
public static final String INTENT_POI_VIDEO_TYPE = "poi_video_type";
|
||||
public static int NUMBER = 200; //任务个数
|
||||
public static int LIMIT_TYPE = -1; //权限类型,普通任务-0,专属任务-1
|
||||
public static int TASK_TYPE = -1; // 任务类型
|
||||
@ -180,35 +147,45 @@ public class Constant {
|
||||
public static TencentLocation currentLocation;
|
||||
public static LatLng markerLacing;
|
||||
//marker 图标
|
||||
public static final BitmapDescriptor MARKER_POI_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_show);
|
||||
public static final BitmapDescriptor MARKER_CHARGE_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_show);
|
||||
public static final BitmapDescriptor MARKER_CHARGE_PILE_SHOW=BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_pile_show);
|
||||
public static final BitmapDescriptor MARKER_POI_VIDEO_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video_show);
|
||||
public static final BitmapDescriptor MARKER_ROOD_SHOW = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_show);
|
||||
public static final BitmapDescriptor MARKER_OTHER_SHOW= BitmapDescriptorFactory.fromResource(R.drawable.marker_other_show);
|
||||
public static final BitmapDescriptor MARKER_FACET_SHOW= BitmapDescriptorFactory.fromResource(R.drawable.marker_facet_show);
|
||||
|
||||
// public static final BitmapDescriptor POI_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bg);
|
||||
// public static BitmapDescriptor ROAD_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bg);
|
||||
// public static BitmapDescriptor STATION_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bg);
|
||||
// public static BitmapDescriptor PLANAR_TASK_ICON = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg);
|
||||
public static final BitmapDescriptor MARKER_POI = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi);
|
||||
public static final BitmapDescriptor MARKER_CHARGE = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge);
|
||||
public static final BitmapDescriptor MARKER_CHARGE_PILE=BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_pile);
|
||||
public static final BitmapDescriptor MARKER_POI_VIDEO = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video);
|
||||
public static final BitmapDescriptor MARKER_ROOD = BitmapDescriptorFactory.fromResource(R.drawable.marker_road);
|
||||
public static final BitmapDescriptor MARKER_OTHER= BitmapDescriptorFactory.fromResource(R.drawable.marker_other);
|
||||
public static final BitmapDescriptor MARKER_FACET= BitmapDescriptorFactory.fromResource(R.drawable.marker_facet);
|
||||
|
||||
public static final BitmapDescriptor GRAY_POI = BitmapDescriptorFactory.fromResource(R.drawable.graypoi);
|
||||
public static final BitmapDescriptor GRAY_CHARGE = BitmapDescriptorFactory.fromResource(R.drawable.graycharge);
|
||||
public static final BitmapDescriptor GRAY_CHARGE_PILE=BitmapDescriptorFactory.fromResource(R.drawable.graychargepile);
|
||||
public static final BitmapDescriptor GRAY_POI_VIDEO = BitmapDescriptorFactory.fromResource(R.drawable.graypoivideo);
|
||||
public static final BitmapDescriptor GRAY_ROOD = BitmapDescriptorFactory.fromResource(R.drawable.grayroad);
|
||||
public static final BitmapDescriptor GRAY_OTHER= BitmapDescriptorFactory.fromResource(R.drawable.grayother);
|
||||
public static final BitmapDescriptor GRAY_FACET= BitmapDescriptorFactory.fromResource(R.drawable.grayfacet);
|
||||
|
||||
public static JobSearchBean jobSearchBean;//数据
|
||||
public static final BitmapDescriptor ICON_OPERATION=BitmapDescriptorFactory.fromResource(R.mipmap.icon_operation);
|
||||
|
||||
public static JobSearchBean jobSearchBean;//数
|
||||
public static MapView treasureMap;
|
||||
|
||||
public static final String INTENT_VIDEO_PATH = "INTENT_VIDEO_PATH"; // 拍照界面指定的视频文件保存位置
|
||||
|
||||
public static final String INTENT_JPG_PATH = "INTENT_JPG_PATH"; // 拍照界面指定的图片保存位置
|
||||
|
||||
public static final String INTENT_PHOTO_PATH = "INTENT_PHOTO_PATH"; // 拍照界面指定的图片保存位置
|
||||
|
||||
public static final String INTENT_PICTURES_PATH = "INTENT_VIDEO_PATH"; // 拍照界面指定的视频文件保存位置
|
||||
|
||||
public static final String INTENT_VIDEO_OBLATION = "INTENT_VIDEO_OBLATION"; // 视频拍摄时屏幕方向 0-强制横屏 其他-任意
|
||||
|
||||
public static SlidingUpPanelLayout SLIDING_LAYOUT = null;//設置
|
||||
|
||||
public static boolean IS_FILTER_LIST_ITEM = true;//poi页面的查重
|
||||
|
||||
public static TencentMap.OnMarkerClickListener markerClickListener=null;
|
||||
|
||||
public static final String NAVIN_FO="10.11";//版本日期
|
||||
/*联系我们的QQ群名称和QQ群号
|
||||
public static TencentMap.OnMarkerClickListener markerClickListener = null;
|
||||
public static final String NAVIN_FO = "10.12";//版本日期
|
||||
/*
|
||||
*联系我们的QQ群名称和QQ群号
|
||||
*/
|
||||
public static String REGION_JIG_NAME = "京津冀晋蒙-地图寻宝群";
|
||||
public static String REGION_JIG_PHONE = "9721810";
|
||||
@ -236,5 +213,4 @@ public class Constant {
|
||||
public static String REGION_YUE_PHONE = "892781071";
|
||||
public static String REGION_YUN_NAME = "云贵-地图寻宝群";
|
||||
public static String REGION_YUN_PHONE = "284447253";
|
||||
|
||||
}
|
||||
|
@ -2,15 +2,11 @@ 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;
|
||||
@ -38,17 +34,11 @@ 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.model.HttpParams;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.FragmentManagement;
|
||||
import com.navinfo.outdoor.activity.PhotographActivity;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
import com.navinfo.outdoor.bean.ChargingPileSaveBean;
|
||||
import com.navinfo.outdoor.bean.PoiSaveBean;
|
||||
import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||
import com.navinfo.outdoor.room.ChargingPileDao;
|
||||
import com.navinfo.outdoor.room.ChargingPileEntity;
|
||||
import com.navinfo.outdoor.room.InsertAndUpdateUtils;
|
||||
@ -56,21 +46,14 @@ import com.navinfo.outdoor.room.PoiDatabase;
|
||||
import com.navinfo.outdoor.room.PoiEntity;
|
||||
import com.navinfo.outdoor.util.Geohash;
|
||||
import com.navinfo.outdoor.util.GeometryTools;
|
||||
import com.navinfo.outdoor.util.MapManager;
|
||||
import com.navinfo.outdoor.util.PhotoUtils;
|
||||
import com.navinfo.outdoor.util.PictureUtil;
|
||||
import com.navinfo.outdoor.util.ToastUtil;
|
||||
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
|
||||
import com.tencent.tencentmap.mapsdk.maps.CameraUpdate;
|
||||
import com.tencent.tencentmap.mapsdk.maps.CameraUpdateFactory;
|
||||
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.CameraPosition;
|
||||
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.vividsolutions.jts.geom.impl.PackedCoordinateSequence;
|
||||
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
@ -78,12 +61,9 @@ import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import static android.app.Activity.RESULT_OK;
|
||||
|
||||
/**
|
||||
* 充电站中的充电桩的Fragment
|
||||
* 2021-5-25
|
||||
@ -184,7 +164,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
moveLatlng(latLng, new TencentMap.CancelableCallback() {
|
||||
@Override
|
||||
public void onFinish() {
|
||||
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
|
||||
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.mipmap.icon_operation);
|
||||
markerPile.setIcon(pileDescriptor);
|
||||
screenPilePositions = tencentMap.getProjection().toScreenLocation(latLng);
|
||||
//创建Marker对象之前,设置属性
|
||||
@ -198,7 +178,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_gray_chang_pile);
|
||||
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_pile_show);
|
||||
markerPile.setIcon(pileDescriptor);
|
||||
checkBoxLife.setText("编辑");
|
||||
checkBoxLife.setTextColor(Color.BLACK);
|
||||
@ -206,7 +186,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
});
|
||||
}else {
|
||||
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_gray_chang_pile);
|
||||
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_pile_show);
|
||||
markerPile.setIcon(pileDescriptor);
|
||||
checkBoxLife.setText("编辑");
|
||||
checkBoxLife.setTextColor(Color.BLACK);
|
||||
@ -605,7 +585,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
// 解密geo
|
||||
String decodeGeometry = Geohash.getInstance().decode(p);
|
||||
latLng = GeometryTools.createLatLng(decodeGeometry);
|
||||
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_gray_chang_pile);
|
||||
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_pile_show);
|
||||
markerPile = tencentMap.addMarker(new MarkerOptions(latLng).icon(pileDescriptor).anchor(0.5f,1.0f));
|
||||
markerPile.setZIndex(4);
|
||||
moveLatlng(latLng, null);
|
||||
@ -702,7 +682,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
||||
}
|
||||
|
||||
/* private void initPileMarker(LatLng latLng) {
|
||||
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
|
||||
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.mipmap.icon_operation);
|
||||
if (markerPile == null) {
|
||||
markerPile = tencentMap.addMarker(new MarkerOptions(latLng).icon(pileDescriptor));
|
||||
markerPile.setZIndex(MARKER_BIG);
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Color;
|
||||
@ -28,6 +30,7 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.github.lazylibrary.util.FileUtils;
|
||||
import com.github.lazylibrary.util.StringUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.hjq.permissions.OnPermissionCallback;
|
||||
@ -45,7 +48,6 @@ import com.navinfo.outdoor.activity.PhotographActivity;
|
||||
import com.navinfo.outdoor.adapter.ChargingPileAdapter;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
import com.navinfo.outdoor.util.AWMp4ParserHelper;
|
||||
import com.navinfo.outdoor.util.UploadUtils;
|
||||
import com.navinfo.outdoor.bean.ChargingPileSaveBean;
|
||||
import com.navinfo.outdoor.bean.ChargingStationBean;
|
||||
@ -86,6 +88,7 @@ import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@ -127,6 +130,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
private Marker markerStation;
|
||||
private Point screenStationPositions;
|
||||
private List<Removable> removablesLocality;
|
||||
private File logFile;
|
||||
private StringBuilder chargingStationBuilder;
|
||||
|
||||
public static ChargingStationFragment newInstance(Bundle bundle) {
|
||||
ChargingStationFragment fragment = new ChargingStationFragment();
|
||||
@ -271,11 +276,12 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
checkBoxLife.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
chargingStationBuilder.append("点击了编辑的按钮 ,");
|
||||
if (checkBoxLife.isChecked()) {
|
||||
moveLatlng(latLng, new TencentMap.CancelableCallback() {
|
||||
@Override
|
||||
public void onFinish() {
|
||||
BitmapDescriptor stationDescriptor = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
|
||||
BitmapDescriptor stationDescriptor = BitmapDescriptorFactory.fromResource(R.mipmap.icon_operation);
|
||||
markerStation.setIcon(stationDescriptor);
|
||||
screenStationPositions = tencentMap.getProjection().toScreenLocation(latLng);
|
||||
//创建Marker对象之前,设置属性
|
||||
@ -289,7 +295,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
BitmapDescriptor stationDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bags);
|
||||
BitmapDescriptor stationDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_show);
|
||||
markerStation.setIcon(stationDescriptor);
|
||||
checkBoxLife.setText("编辑");
|
||||
checkBoxLife.setTextColor(Color.BLACK);
|
||||
@ -297,7 +303,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
});
|
||||
} else {
|
||||
BitmapDescriptor stationDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bags);
|
||||
BitmapDescriptor stationDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_show);
|
||||
markerStation.setIcon(stationDescriptor);
|
||||
checkBoxLife.setText("编辑");
|
||||
checkBoxLife.setTextColor(Color.BLACK);
|
||||
@ -497,7 +503,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
latLng = latLineString.get(0);
|
||||
break;
|
||||
}
|
||||
BitmapDescriptor stationDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bags);
|
||||
BitmapDescriptor stationDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_show);
|
||||
markerStation = tencentMap.addMarker(new MarkerOptions(latLng).icon(stationDescriptor).anchor(0.5f, 1.0f));
|
||||
markerStation.setZIndex(4);
|
||||
moveLatlng(latLng, null);
|
||||
@ -508,7 +514,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
latLng = new LatLng();
|
||||
latLng.setLatitude(Double.parseDouble(y));
|
||||
latLng.setLongitude(Double.parseDouble(x));
|
||||
BitmapDescriptor stationDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bags);
|
||||
BitmapDescriptor stationDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_show);
|
||||
markerStation = tencentMap.addMarker(new MarkerOptions(latLng).icon(stationDescriptor).anchor(0.5f, 1.0f));
|
||||
markerStation.setZIndex(4);
|
||||
moveLatlng(latLng, null);
|
||||
@ -732,6 +738,29 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
//存储对象
|
||||
poiBeans = new ArrayList<>();
|
||||
chargingStationList = new ArrayList<>();
|
||||
|
||||
SharedPreferences sharedPreferences = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.MESSAGE_TYPE, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor sharedEdit = sharedPreferences.edit();
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
DateFormat formatter = new SimpleDateFormat("yyyyMMdd");
|
||||
String newFormat = formatter.format(new Date(System.currentTimeMillis()));
|
||||
String pictures_time = sharedPreferences.getString("pictures_time", null);
|
||||
if (pictures_time == null) {
|
||||
sharedEdit.putString("pictures_time", newFormat);
|
||||
sharedEdit.apply();
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
} else {
|
||||
if (pictures_time.equals(newFormat)) {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + pictures_time + ".txt");
|
||||
} else {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
}
|
||||
}
|
||||
chargingStationBuilder = new StringBuilder();
|
||||
chargingStationBuilder.append("ChargingStationActivity-onCreate-initData ,");
|
||||
if (Constant.USHERED != null) {
|
||||
chargingStationBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
@ -770,7 +799,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
removablesLocality.clear();
|
||||
List<ChargingPileEntity> chargingPileEntities = chargingPileAdapter.getChargingPileEntities();
|
||||
for (int i = 0; i < chargingPileEntities.size(); i++) {
|
||||
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_chang_pile);
|
||||
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_pile);
|
||||
String p = chargingPileEntities.get(i).getP();
|
||||
if (p != null) {
|
||||
// 解密geo
|
||||
@ -787,9 +816,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.btn_save_local:
|
||||
chargingStationBuilder.append("点击了保存本地的按钮 ,");
|
||||
initRoadSaveLocal(false);
|
||||
break;
|
||||
case R.id.btn_uploading:
|
||||
chargingStationBuilder.append("点击了保存本地的按钮 ,");
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj = false;
|
||||
@ -848,19 +879,14 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
showPoiEntity = new PoiEntity();
|
||||
}
|
||||
if (showPoiEntity.getTaskStatus() == 0 || showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 2 || showPoiEntity.getTaskStatus() == 5) {
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
initRoadSaveLocal(true);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||
// 首先批量保存充电站对应的充电桩数据
|
||||
saveChargingPileByChargingStation(poiDaoPoiEntity);
|
||||
saveChargingPileByChargingStation(showPoiEntity);
|
||||
Objects.requireNonNull(getActivity()).runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -876,9 +902,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
break;
|
||||
case R.id.tv_station_examine:
|
||||
chargingStationBuilder.append("点击了查重的按钮 ,");
|
||||
findingDuplicateByWork();
|
||||
break;
|
||||
case R.id.rl_panorama:
|
||||
chargingStationBuilder.append("点击了全景照片进行拍照 ,");
|
||||
Intent intentPanorama = new Intent(getActivity(), PhotographActivity.class);
|
||||
File PanoramaFile = PhotoUtils.showPhotoFile("a", latLng);
|
||||
intentPanorama.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
@ -886,6 +914,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
startActivityForResult(intentPanorama, 101);
|
||||
break;
|
||||
case R.id.rl_name:
|
||||
chargingStationBuilder.append("点击了名称照片进行拍照 ,");
|
||||
Intent intentName = new Intent(getActivity(), PhotographActivity.class);
|
||||
File nameFile = PhotoUtils.showPhotoFile("b", latLng);
|
||||
intentName.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
@ -893,6 +922,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
startActivityForResult(intentName, 102);
|
||||
break;
|
||||
case R.id.rl_internal_photos:
|
||||
chargingStationBuilder.append("点击了服务说明进行拍照 ,");
|
||||
Intent intentInternal = new Intent(getActivity(), PhotographActivity.class);
|
||||
File internalFile = PhotoUtils.showPhotoFile("c", latLng);
|
||||
intentInternal.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
@ -900,6 +930,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
startActivityForResult(intentInternal, 103);
|
||||
break;
|
||||
case R.id.rl_else:
|
||||
chargingStationBuilder.append("点击了充电站指引牌进行拍照 ,");
|
||||
Intent intentElse = new Intent(getActivity(), PhotographActivity.class);
|
||||
File elseFile = PhotoUtils.showPhotoFile("d", latLng);
|
||||
intentElse.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
@ -907,6 +938,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
startActivityForResult(intentElse, 104);
|
||||
break;
|
||||
case R.id.rl_scutcheon:
|
||||
chargingStationBuilder.append("点击了停车收费标牌进行拍照 ,");
|
||||
Intent intentScutcheon = new Intent(getActivity(), PhotographActivity.class);
|
||||
File scutcheonFile = PhotoUtils.showPhotoFile("e", latLng);
|
||||
intentScutcheon.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
@ -914,6 +946,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
startActivityForResult(intentScutcheon, 105);
|
||||
break;
|
||||
case R.id.linear_charging_pile:
|
||||
chargingStationBuilder.append("查看了recyclerView ,");
|
||||
initChargingPile();
|
||||
break;
|
||||
}
|
||||
@ -1372,7 +1405,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (showPoiEntity.getId()!=null){
|
||||
if (showPoiEntity.getId() != null) {
|
||||
List<ChargingPileEntity> chargingPileEntityList = PoiDatabase.getInstance(getActivity()).getChargingPileDao().getChargingPileByStationId(showPoiEntity.getId());
|
||||
if (chargingPileEntityList != null && !chargingPileEntityList.isEmpty()) {
|
||||
for (ChargingPileEntity chargingPileEntity : chargingPileEntityList) {
|
||||
@ -1430,6 +1463,18 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
chargingStationBuilder.append("onPause ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
chargingStationBuilder.append("onStop ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||
@ -1442,6 +1487,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
removablesLocality.get(i).remove();
|
||||
}
|
||||
removablesLocality.clear();
|
||||
|
||||
chargingStationBuilder.append("onDestroy ,");
|
||||
chargingStationBuilder.append("\r\n");
|
||||
FileUtils.writeFile(logFile.getAbsolutePath(), chargingStationBuilder.toString(), true);
|
||||
}
|
||||
|
||||
private void initEndReceiveTask(String url, PoiEntity poiEntity) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Color;
|
||||
@ -26,6 +27,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.github.lazylibrary.util.FileUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.hjq.permissions.OnPermissionCallback;
|
||||
import com.hjq.permissions.Permission;
|
||||
@ -41,7 +43,6 @@ import com.navinfo.outdoor.activity.FragmentManagement;
|
||||
import com.navinfo.outdoor.activity.PhotographActivity;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
import com.navinfo.outdoor.util.AWMp4ParserHelper;
|
||||
import com.navinfo.outdoor.util.UploadUtils;
|
||||
import com.navinfo.outdoor.bean.Info;
|
||||
import com.navinfo.outdoor.bean.PoiSaveBean;
|
||||
@ -70,13 +71,16 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* 寻宝-上报-其他的fragment
|
||||
*/
|
||||
@ -104,6 +108,8 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
private CheckBox checkPot;
|
||||
private Marker markerOther;
|
||||
private Point screenOtherPositions;
|
||||
private File logFile;
|
||||
private StringBuilder otherBuilder;
|
||||
|
||||
public static OtherFragment newInstance(Bundle bundle) {
|
||||
OtherFragment fragment = new OtherFragment();
|
||||
@ -181,8 +187,10 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {}
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
}
|
||||
});
|
||||
checkPot = findViewById(R.id.check_pot);
|
||||
checkPot.setOnClickListener(new View.OnClickListener() {
|
||||
@ -192,7 +200,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
moveLatlng(latLng, new TencentMap.CancelableCallback() {
|
||||
@Override
|
||||
public void onFinish() {
|
||||
BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
|
||||
BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.mipmap.icon_operation);
|
||||
markerOther.setIcon(otherDescriptor);
|
||||
screenOtherPositions = tencentMap.getProjection().toScreenLocation(latLng);
|
||||
//创建Marker对象之前,设置属性
|
||||
@ -203,9 +211,10 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
checkPot.setTextColor(Color.WHITE);
|
||||
checkPot.setChecked(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bag);
|
||||
BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_show);
|
||||
markerOther.setIcon(otherDescriptor);
|
||||
checkPot.setText("编辑");
|
||||
checkPot.setTextColor(Color.BLACK);
|
||||
@ -213,7 +222,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
}
|
||||
});
|
||||
} else {
|
||||
BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bag);
|
||||
BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_show);
|
||||
markerOther.setIcon(otherDescriptor);
|
||||
checkPot.setText("编辑");
|
||||
checkPot.setTextColor(Color.BLACK);
|
||||
@ -262,8 +271,10 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {}
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
}
|
||||
});
|
||||
//数据展示
|
||||
initShowPoi();
|
||||
@ -329,6 +340,28 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
otherUploadList = new ArrayList<>();
|
||||
SharedPreferences sharedPreferences = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.MESSAGE_TYPE, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor sharedEdit = sharedPreferences.edit();
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
DateFormat formatter = new SimpleDateFormat("yyyyMMdd");
|
||||
String newFormat = formatter.format(new Date(System.currentTimeMillis()));
|
||||
String pictures_time = sharedPreferences.getString("pictures_time", null);
|
||||
if (pictures_time==null){
|
||||
sharedEdit.putString("pictures_time",newFormat);
|
||||
sharedEdit.apply();
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
}else {
|
||||
if (pictures_time.equals(newFormat)){
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + pictures_time + ".txt");
|
||||
}else {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
}
|
||||
}
|
||||
otherBuilder = new StringBuilder();
|
||||
otherBuilder.append("OtherActivity-onCreate-initData ,");
|
||||
if (Constant.USHERED!=null){
|
||||
otherBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||
}
|
||||
}
|
||||
|
||||
private void initShowPoi() {
|
||||
@ -356,7 +389,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
latLng = latLineString.get(0);
|
||||
break;
|
||||
}
|
||||
BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bag);
|
||||
BitmapDescriptor otherDescriptor = Constant.MARKER_OTHER_SHOW;
|
||||
markerOther = tencentMap.addMarker(new MarkerOptions(latLng).icon(otherDescriptor).anchor(0.5f, 1.0f));
|
||||
markerOther.setZIndex(4);
|
||||
moveLatlng(latLng, null);
|
||||
@ -367,7 +400,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
latLng = new LatLng();
|
||||
latLng.setLongitude(Double.parseDouble(x));
|
||||
latLng.setLatitude(Double.parseDouble(y));
|
||||
BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bag);
|
||||
BitmapDescriptor otherDescriptor = Constant.MARKER_OTHER_SHOW;
|
||||
markerOther = tencentMap.addMarker(new MarkerOptions(latLng).icon(otherDescriptor).anchor(0.5f, 1.0f));
|
||||
markerOther.setZIndex(4);
|
||||
moveLatlng(latLng, null);
|
||||
@ -414,6 +447,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.rl_picture:
|
||||
otherBuilder.append("点击了第一个照片进行拍照 ,");
|
||||
Intent intentPicture = new Intent(getActivity(), PhotographActivity.class);
|
||||
File file = PhotoUtils.showPhotoFile("a", latLng);
|
||||
intentPicture.putExtra(Constant.INTENT_PHOTO_PATH, file.getPath());
|
||||
@ -421,6 +455,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
startActivityForResult(intentPicture, 101);
|
||||
break;
|
||||
case R.id.rl_pictures:
|
||||
otherBuilder.append("点击了第二个照片进行拍照 ,");
|
||||
Intent intentPictures = new Intent(getActivity(), PhotographActivity.class);
|
||||
File files = PhotoUtils.showPhotoFile("b", latLng);
|
||||
intentPictures.putExtra(Constant.INTENT_PHOTO_PATH, files.getPath());
|
||||
@ -428,9 +463,11 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
startActivityForResult(intentPictures, 102);
|
||||
break;
|
||||
case R.id.btn_other_local:
|
||||
otherBuilder.append("点击了保存本地的按钮,");
|
||||
initPoiSaveLocal(false);
|
||||
break;
|
||||
case R.id.btn_other_uploading:
|
||||
otherBuilder.append("点击了上传的按钮,");
|
||||
if (otherUploadList != null) {
|
||||
otherUploadList.clear();
|
||||
}
|
||||
@ -507,6 +544,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
Toast.makeText(getActivity(), "没有申请权限,请手动申请", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDenied(List<String> permissions, boolean never) {
|
||||
if (never) {
|
||||
@ -593,6 +631,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
Toast.makeText(getActivity(), "" + poiSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
@ -689,6 +728,18 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
otherBuilder.append("onPause ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
otherBuilder.append("onStop ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||
@ -697,6 +748,9 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
if (markerOther != null) {
|
||||
markerOther.remove();
|
||||
}
|
||||
otherBuilder.append("onDestroy ");
|
||||
otherBuilder.append("\r\n");
|
||||
FileUtils.writeFile(logFile.getAbsolutePath(), otherBuilder.toString(), true);
|
||||
}
|
||||
|
||||
private void initEndReceiveTask(String url, PoiEntity poiEntity) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Color;
|
||||
@ -27,6 +28,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.github.lazylibrary.util.FileUtils;
|
||||
import com.github.lazylibrary.util.StringUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.hjq.permissions.OnPermissionCallback;
|
||||
@ -43,7 +45,6 @@ import com.navinfo.outdoor.activity.FragmentManagement;
|
||||
import com.navinfo.outdoor.activity.PhotographActivity;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
import com.navinfo.outdoor.util.AWMp4ParserHelper;
|
||||
import com.navinfo.outdoor.util.UploadUtils;
|
||||
import com.navinfo.outdoor.bean.GetPhoneBean;
|
||||
import com.navinfo.outdoor.bean.Info;
|
||||
@ -80,6 +81,7 @@ import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@ -111,6 +113,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
private ArrayList<File> poiPicList;
|
||||
private Marker markerPoi;
|
||||
private Point screenPoiPositions;
|
||||
private File logFile;
|
||||
private StringBuilder poiBuilder;
|
||||
|
||||
public static PoiFragment newInstance(Bundle bundle) {
|
||||
PoiFragment fragment = new PoiFragment();
|
||||
@ -174,11 +178,12 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
checkBoxLife.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
poiBuilder.append("点击了点位编辑,");
|
||||
if (checkBoxLife.isChecked()) {
|
||||
moveLatlng(latLng, new TencentMap.CancelableCallback() {
|
||||
@Override
|
||||
public void onFinish() {
|
||||
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
|
||||
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.mipmap.icon_operation);
|
||||
markerPoi.setIcon(poiDescriptor);
|
||||
screenPoiPositions = tencentMap.getProjection().toScreenLocation(latLng);
|
||||
//创建Marker对象之前,设置属性
|
||||
@ -192,7 +197,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bags);
|
||||
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_show);
|
||||
markerPoi.setIcon(poiDescriptor);
|
||||
checkBoxLife.setText("编辑");
|
||||
checkBoxLife.setTextColor(Color.BLACK);
|
||||
@ -200,7 +205,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bags);
|
||||
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_show);
|
||||
markerPoi.setIcon(poiDescriptor);
|
||||
checkBoxLife.setText("编辑");
|
||||
checkBoxLife.setTextColor(Color.BLACK);
|
||||
@ -387,7 +392,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
latLng = latLineString.get(0);
|
||||
break;
|
||||
}
|
||||
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bags);
|
||||
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_show);
|
||||
markerPoi = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor).anchor(0.5f, 1.0f));
|
||||
markerPoi.setZIndex(4);
|
||||
moveLatlng(latLng, null);
|
||||
@ -398,7 +403,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
latLng = new LatLng();
|
||||
latLng.setLatitude(Double.parseDouble(y));
|
||||
latLng.setLongitude(Double.parseDouble(x));
|
||||
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bags);
|
||||
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_show);
|
||||
markerPoi = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor).anchor(0.5f, 1.0f));
|
||||
markerPoi.setZIndex(4);
|
||||
moveLatlng(latLng, null);
|
||||
@ -580,6 +585,28 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
poiBeans = new ArrayList<>();
|
||||
//存储
|
||||
poiPicList = new ArrayList<>();
|
||||
SharedPreferences sharedPreferences = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.MESSAGE_TYPE, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor sharedEdit = sharedPreferences.edit();
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
DateFormat formatter = new SimpleDateFormat("yyyyMMdd");
|
||||
String newFormat = formatter.format(new Date(System.currentTimeMillis()));
|
||||
String pictures_time = sharedPreferences.getString("pictures_time", null);
|
||||
if (pictures_time==null){
|
||||
sharedEdit.putString("pictures_time",newFormat);
|
||||
sharedEdit.apply();
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
}else {
|
||||
if (pictures_time.equals(newFormat)){
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + pictures_time + ".txt");
|
||||
}else {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
}
|
||||
}
|
||||
poiBuilder = new StringBuilder();
|
||||
poiBuilder.append("PoiActivity-onCreate-initData ,");
|
||||
if (Constant.USHERED!=null){
|
||||
poiBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
@ -595,9 +622,11 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.btn_save_local:
|
||||
poiBuilder.append("点击了保存本地的按钮,");
|
||||
initPoiSaveLocal(false);
|
||||
break;
|
||||
case R.id.btn_uploading:
|
||||
poiBuilder.append("点击了上传的按钮,");
|
||||
if (poiPicList != null) {
|
||||
poiPicList.clear();
|
||||
}
|
||||
@ -651,9 +680,11 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
break;
|
||||
case R.id.tv_poi_examine:
|
||||
poiBuilder.append("点击了查重的按钮,");
|
||||
findingDuplicateByWork();
|
||||
break;
|
||||
case R.id.rl_panorama:
|
||||
poiBuilder.append("点击了全景图的进行拍照,");
|
||||
Intent intentPanorama = new Intent(getActivity(), PhotographActivity.class);
|
||||
File filePanorama = PhotoUtils.showPhotoFile("a", latLng);
|
||||
intentPanorama.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
@ -661,6 +692,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
startActivityForResult(intentPanorama, 101);
|
||||
break;
|
||||
case R.id.rl_name:
|
||||
poiBuilder.append("点击了名称的进行拍照,");
|
||||
Intent intentName = new Intent(getActivity(), PhotographActivity.class);
|
||||
File fileName = PhotoUtils.showPhotoFile("b", latLng);
|
||||
intentName.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
@ -668,6 +700,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
startActivityForResult(intentName, 102);
|
||||
break;
|
||||
case R.id.rl_internal_photos:
|
||||
poiBuilder.append("点击了内部照片的进行拍照,");
|
||||
Intent intentInternal = new Intent(getActivity(), PhotographActivity.class);
|
||||
File fileInternal = PhotoUtils.showPhotoFile("c", latLng);
|
||||
intentInternal.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
@ -675,6 +708,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
startActivityForResult(intentInternal, 103);
|
||||
break;
|
||||
case R.id.rl_card:
|
||||
poiBuilder.append("点击了名片的进行拍照,");
|
||||
Intent intentCard = new Intent(getActivity(), PhotographActivity.class);
|
||||
File fileCard = PhotoUtils.showPhotoFile("d", latLng);
|
||||
intentCard.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
@ -682,6 +716,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
startActivityForResult(intentCard, 104);
|
||||
break;
|
||||
case R.id.rl_else:
|
||||
poiBuilder.append("点击了其他的进行拍照,");
|
||||
Intent intentElse = new Intent(getActivity(), PhotographActivity.class);
|
||||
File fileElse = PhotoUtils.showPhotoFile("e", latLng);
|
||||
intentElse.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||
@ -1007,6 +1042,18 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
poiBuilder.append("onPause,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
poiBuilder.append("onStop,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||
@ -1015,6 +1062,9 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
if (markerPoi != null) {
|
||||
markerPoi.remove();
|
||||
}
|
||||
poiBuilder.append("onDestroy ");
|
||||
poiBuilder.append("\r\n");
|
||||
FileUtils.writeFile(logFile.getAbsolutePath(), poiBuilder.toString(), true);
|
||||
}
|
||||
|
||||
private void initEndReceiveTask(String url, PoiEntity poiEntity) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
@ -21,6 +22,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.github.lazylibrary.util.FileUtils;
|
||||
import com.github.lazylibrary.util.StringUtils;
|
||||
import com.github.lazylibrary.util.ZipUtil;
|
||||
import com.google.gson.Gson;
|
||||
@ -67,6 +69,7 @@ import java.io.File;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@ -86,6 +89,8 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
private Marker markerPoiVideo;
|
||||
private TextView tvCombo;
|
||||
private TextView tvShort;
|
||||
private File logFile;
|
||||
private StringBuilder poiVideoBuilder;
|
||||
|
||||
public static PoiVideoFragment newInstance(Bundle bundle) {
|
||||
PoiVideoFragment fragment = new PoiVideoFragment();
|
||||
@ -187,6 +192,33 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
initShowPoi();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
SharedPreferences sharedPreferences = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.MESSAGE_TYPE, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor sharedEdit = sharedPreferences.edit();
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
DateFormat formatter = new SimpleDateFormat("yyyyMMdd");
|
||||
String newFormat = formatter.format(new Date(System.currentTimeMillis()));
|
||||
String pictures_time = sharedPreferences.getString("pictures_time", null);
|
||||
if (pictures_time==null){
|
||||
sharedEdit.putString("pictures_time",newFormat);
|
||||
sharedEdit.apply();
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
}else {
|
||||
if (pictures_time.equals(newFormat)){
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + pictures_time + ".txt");
|
||||
}else {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
}
|
||||
}
|
||||
poiVideoBuilder = new StringBuilder();
|
||||
poiVideoBuilder.append("PoiVideoActivity-onCreate-initData ,");
|
||||
if (Constant.USHERED!=null){
|
||||
poiVideoBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||
}
|
||||
}
|
||||
|
||||
private void initShowPoi() {
|
||||
// 添加信息:
|
||||
assert getArguments() != null;
|
||||
@ -211,7 +243,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
latLng = latLineString.get(0);
|
||||
break;
|
||||
}
|
||||
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_bag);
|
||||
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video_show);
|
||||
markerPoiVideo = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiVideoDescriptor).anchor(0.5f, 1.0f));
|
||||
markerPoiVideo.setZIndex(4);
|
||||
moveLatlng(latLng, null);
|
||||
@ -222,7 +254,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
latLng = new LatLng();
|
||||
latLng.setLongitude(Double.parseDouble(x));
|
||||
latLng.setLatitude(Double.parseDouble(y));
|
||||
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_bag);
|
||||
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video_show);
|
||||
markerPoiVideo = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiVideoDescriptor).anchor(0.5f, 1.0f));
|
||||
markerPoiVideo.setZIndex(4);
|
||||
moveLatlng(latLng, null);
|
||||
@ -300,6 +332,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.fm_poi_video_picture:
|
||||
poiVideoBuilder.append("点击了图片查看列表 ,");
|
||||
if (fmPoiVideoPic.getTag() == null) {
|
||||
Toast.makeText(getContext(), "还没有拍摄", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
@ -310,9 +343,11 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
startActivity(photoAlbumIntent);
|
||||
break;
|
||||
case R.id.btn_poi_video_save:
|
||||
poiVideoBuilder.append("点击了保存本地的按钮 ,");
|
||||
initPoiSaveLocal(false);
|
||||
break;
|
||||
case R.id.tv_short://手动拍摄
|
||||
poiVideoBuilder.append("点击了手动拍摄的按钮 ,");
|
||||
Intent intents = new Intent(getContext(), PicturesActivity.class);
|
||||
File filePath = AWMp4ParserHelper.getInstance().obtainJPGFilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath());
|
||||
intents.putExtra(Constant.INTENT_JPG_PATH, filePath.getAbsolutePath());
|
||||
@ -322,6 +357,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
startActivityForResult(intents, 0x102);
|
||||
break;
|
||||
case R.id.tv_combo://自动连拍:
|
||||
poiVideoBuilder.append("点击了自动连拍的按钮 ,");
|
||||
Intent intent = new Intent(getContext(), PicturesActivity.class);
|
||||
File fileJpgPath = AWMp4ParserHelper.getInstance().obtainJPGFilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath());
|
||||
intent.putExtra(Constant.INTENT_JPG_PATH, fileJpgPath.getAbsolutePath());
|
||||
@ -331,6 +367,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
startActivityForResult(intent, 0x101);
|
||||
break;
|
||||
case R.id.btn_poi_video_upload:
|
||||
poiVideoBuilder.append("点击了上传的按钮 ,");
|
||||
if (Constant.isPresent) {
|
||||
if (fmPoiVideoPic.getTag() != null) {
|
||||
List<File> videoFileList = (List<File>) fmPoiVideoPic.getTag();
|
||||
@ -562,6 +599,19 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
poiVideoBuilder.append("onPause ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
poiVideoBuilder.append("onStop ,");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||
@ -570,6 +620,9 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
if (markerPoiVideo != null) {
|
||||
markerPoiVideo.remove();
|
||||
}
|
||||
poiVideoBuilder.append("onDestroy ");
|
||||
poiVideoBuilder.append("\r\n");
|
||||
FileUtils.writeFile(logFile.getAbsolutePath(), poiVideoBuilder.toString(), true);
|
||||
}
|
||||
|
||||
private void initEndReceiveTask(String url, PoiEntity poiEntity) {
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
@ -20,6 +22,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.github.lazylibrary.util.FileUtils;
|
||||
import com.github.lazylibrary.util.StringUtils;
|
||||
import com.github.lazylibrary.util.ZipUtil;
|
||||
import com.google.gson.Gson;
|
||||
@ -66,6 +69,7 @@ import java.io.File;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@ -84,6 +88,8 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
private FrameLayout fmRoadPic;
|
||||
private Marker markerRoad;
|
||||
private LatLng latLng;
|
||||
private File logFile;
|
||||
private StringBuilder roadBuilder;
|
||||
|
||||
public static RoadFragment newInstance(Bundle bundle) {
|
||||
RoadFragment fragment = new RoadFragment();
|
||||
@ -184,6 +190,33 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
// disables();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
SharedPreferences sharedPreferences = Objects.requireNonNull(getActivity()).getSharedPreferences(Constant.MESSAGE_TYPE, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor sharedEdit = sharedPreferences.edit();
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
DateFormat formatter = new SimpleDateFormat("yyyyMMdd");
|
||||
String newFormat = formatter.format(new Date(System.currentTimeMillis()));
|
||||
String pictures_time = sharedPreferences.getString("pictures_time", null);
|
||||
if (pictures_time==null){
|
||||
sharedEdit.putString("pictures_time",newFormat);
|
||||
sharedEdit.apply();
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
}else {
|
||||
if (pictures_time.equals(newFormat)){
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + pictures_time + ".txt");
|
||||
}else {
|
||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||
}
|
||||
}
|
||||
roadBuilder = new StringBuilder();
|
||||
roadBuilder.append("RoadActivity-onCreate-initData ,");
|
||||
if (Constant.USHERED!=null){
|
||||
roadBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||
}
|
||||
}
|
||||
|
||||
private void initShowPoi() {
|
||||
// 添加信息:
|
||||
assert getArguments() != null;
|
||||
@ -208,7 +241,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
latLng = latLineString.get(0);
|
||||
break;
|
||||
}
|
||||
BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bag);
|
||||
BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_show);
|
||||
markerRoad = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor).anchor(0.5f, 1.0f));
|
||||
markerRoad.setZIndex(4);
|
||||
moveLatlng(latLng, null);
|
||||
@ -219,7 +252,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
latLng = new LatLng();
|
||||
latLng.setLongitude(Double.parseDouble(x));
|
||||
latLng.setLatitude(Double.parseDouble(y));
|
||||
BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bag);
|
||||
BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_show);
|
||||
markerRoad = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor).anchor(0.5f, 1.0f));
|
||||
markerRoad.setZIndex(4);
|
||||
moveLatlng(latLng, null);
|
||||
@ -313,9 +346,11 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.btn_road_save:
|
||||
roadBuilder.append("点击了保存本地的按钮 ,");
|
||||
initPoiSaveLocal(false);
|
||||
break;
|
||||
case R.id.fm_road_picture:
|
||||
roadBuilder.append("点击了图片查看列表 ,");
|
||||
if (fmRoadPic.getTag() == null) {
|
||||
Toast.makeText(getContext(), "还没有拍摄", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
@ -326,6 +361,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
startActivity(photoAlbumIntent);
|
||||
break;
|
||||
case R.id.tv_pictures:
|
||||
roadBuilder.append("点击了自动拍照的按钮 ,");
|
||||
Intent intent = new Intent(getContext(), PicturesActivity.class);
|
||||
File finalFile = AWMp4ParserHelper.getInstance().obtainJPGFilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath());
|
||||
intent.putExtra(Constant.INTENT_JPG_PATH, finalFile.getAbsolutePath());
|
||||
@ -335,6 +371,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
startActivityForResult(intent, 0x101);
|
||||
break;
|
||||
case R.id.road_upload:
|
||||
roadBuilder.append("点击了上传的按钮 ,");
|
||||
if (Constant.isPresent) {
|
||||
if (fmRoadPic.getTag() != null) {
|
||||
List<File> videoFileList = (List<File>) fmRoadPic.getTag();
|
||||
@ -572,6 +609,18 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
roadBuilder.append("onPause ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
roadBuilder.append("onStop ,");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (EventBus.getDefault().isRegistered(this))//加上判断
|
||||
@ -580,6 +629,9 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
if (markerRoad != null) {
|
||||
markerRoad.remove();
|
||||
}
|
||||
roadBuilder.append("onDestroy ,");
|
||||
roadBuilder.append("\r\n");
|
||||
FileUtils.writeFile(logFile.getAbsolutePath(), roadBuilder.toString(), true);
|
||||
}
|
||||
|
||||
private void initEndReceiveTask(String url, PoiEntity poiEntity) {
|
||||
|
@ -11,7 +11,6 @@ import android.graphics.BitmapFactory;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Matrix;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
@ -22,7 +21,6 @@ import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@ -65,7 +63,6 @@ import com.navinfo.outdoor.room.ChargingPileEntity;
|
||||
import com.navinfo.outdoor.room.PoiDao;
|
||||
import com.navinfo.outdoor.room.PoiDatabase;
|
||||
import com.navinfo.outdoor.room.PoiEntity;
|
||||
import com.navinfo.outdoor.util.Base64;
|
||||
import com.navinfo.outdoor.util.Geohash;
|
||||
import com.navinfo.outdoor.util.GeometryTools;
|
||||
import com.navinfo.outdoor.util.MapManager;
|
||||
@ -103,7 +100,6 @@ import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
@ -360,6 +356,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
public void onFinish() {
|
||||
PoiDatabase poiDatabase = PoiDatabase.getInstance(getContext());
|
||||
poiDao = poiDatabase.getPoiDao();
|
||||
treasureBuilder.append("onFinish-获取到当前位置,");
|
||||
refreshFilterData();
|
||||
//上传用户位置金纬度
|
||||
iniUserLocation();
|
||||
@ -594,7 +591,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
switch (list.get(i).getType()) {
|
||||
case 1://poi
|
||||
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bg1);
|
||||
BitmapDescriptor poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi);
|
||||
//poiDescriptor.getForager().setScale(50);
|
||||
assert latLng != null;
|
||||
Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor).alpha(0.9f)
|
||||
@ -609,7 +606,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
poiMarker.setClickable(true);
|
||||
break;
|
||||
case 2://充电站
|
||||
BitmapDescriptor chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bg1);
|
||||
BitmapDescriptor chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge);
|
||||
assert latLng != null;
|
||||
Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(chargeDescriptor).alpha(0.9f)
|
||||
.anchor(0.5f, 1.0f)
|
||||
@ -624,7 +621,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
|
||||
break;
|
||||
case 3://poi录像
|
||||
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video_bg1);
|
||||
BitmapDescriptor poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video);
|
||||
assert latLng != null;
|
||||
Marker poiVideoMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiVideoDescriptor).alpha(0.9f)
|
||||
.anchor(0.5f, 1.0f)
|
||||
@ -638,7 +635,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
poiVideoMarker.setClickable(true);
|
||||
break;
|
||||
case 4://道路录像
|
||||
BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bg);
|
||||
BitmapDescriptor roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road);
|
||||
assert latLng != null;
|
||||
Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor).alpha(0.9f)
|
||||
.anchor(0.5f, 1.0f)
|
||||
@ -652,7 +649,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
roadMarker.setClickable(true);
|
||||
break;
|
||||
case 5://其他
|
||||
BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg1);
|
||||
BitmapDescriptor otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other);
|
||||
assert latLng != null;
|
||||
Marker otherMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(otherDescriptor).alpha(0.9f)
|
||||
.anchor(0.5f, 1.0f)
|
||||
@ -666,7 +663,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
otherMarker.setClickable(true);
|
||||
break;
|
||||
case 6://面状任务
|
||||
BitmapDescriptor Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_facet_bg1);
|
||||
BitmapDescriptor Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_facet);
|
||||
assert latLng != null;
|
||||
Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Descriptor).alpha(0.9f)
|
||||
.anchor(0.5f, 1.0f)
|
||||
@ -794,17 +791,17 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
BitmapDescriptor descriptor = null;
|
||||
if (poiEntity.getType() == 1) {
|
||||
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bags);
|
||||
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_show);
|
||||
} else if (poiEntity.getType() == 2) {
|
||||
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bags);
|
||||
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_show);
|
||||
} else if (poiEntity.getType() == 3) {
|
||||
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_bag);
|
||||
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video_show);
|
||||
} else if (poiEntity.getType() == 4) {
|
||||
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bag);
|
||||
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_show);
|
||||
} else if (poiEntity.getType() == 5) {
|
||||
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bag);
|
||||
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_show);
|
||||
} else if (poiEntity.getType() == 6) {
|
||||
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_facet_bag);
|
||||
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_facet_show);
|
||||
}
|
||||
MapManager.getInstance().moveLatlng(latLng, null);
|
||||
if (bigMarker == null) {
|
||||
@ -939,7 +936,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
case 1://poi
|
||||
BitmapDescriptor poiDescriptor = null;
|
||||
if (poiEntity.getTaskStatus() == 1) {
|
||||
poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bg1);
|
||||
poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi);
|
||||
} else {
|
||||
poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.graypoi);
|
||||
}
|
||||
@ -959,7 +956,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
case 2://充电站
|
||||
BitmapDescriptor chargeDescriptor = null;
|
||||
if (poiEntity.getTaskStatus() == 1) {
|
||||
chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bg1);
|
||||
chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge);
|
||||
} else {
|
||||
chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.graycharge);
|
||||
}
|
||||
@ -979,9 +976,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
case 3://poi录像
|
||||
BitmapDescriptor poiVideoDescriptor = null;
|
||||
if (poiEntity.getTaskStatus() == 1) {
|
||||
poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video_bg1);
|
||||
poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video);
|
||||
} else {
|
||||
poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_have_bg1);
|
||||
poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.graypoivideo);
|
||||
}
|
||||
assert latLng != null;
|
||||
Marker poiVideoMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiVideoDescriptor)
|
||||
@ -999,7 +996,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
case 4://道路录像
|
||||
BitmapDescriptor roadDescriptor = null;
|
||||
if (poiEntity.getTaskStatus() == 1) {
|
||||
roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bg);
|
||||
roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road);
|
||||
} else {
|
||||
roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.grayroad);
|
||||
}
|
||||
@ -1019,7 +1016,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
case 5://其他
|
||||
BitmapDescriptor otherDescriptor = null;
|
||||
if (poiEntity.getTaskStatus() == 1) {
|
||||
otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg1);
|
||||
otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other);
|
||||
} else {
|
||||
otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.grayother);
|
||||
}
|
||||
@ -1039,7 +1036,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
case 6://面状任务
|
||||
BitmapDescriptor Descriptor = null;
|
||||
if (poiEntity.getTaskStatus() == 1) {
|
||||
Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_facet_bg1);
|
||||
Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_facet);
|
||||
} else {
|
||||
Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.grayfacet);
|
||||
}
|
||||
@ -1082,6 +1079,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "你poi页面还有未提交完的数据,之前的成果已保存,点击确定可继续作业", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
treasureBuilder.append("initSharePre-点击了poi,");
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
PoiFragment poiFragment = PoiFragment.newInstance(bundle);
|
||||
@ -1097,6 +1095,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "你充电站页面还有未提交完的数据", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
treasureBuilder.append("initSharePre-点击了充电站,");
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle);
|
||||
@ -1112,6 +1111,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "你poi录像页面还有未提交完的数据", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
treasureBuilder.append("initSharePre-点击了poi录像,");
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
|
||||
@ -1127,6 +1127,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "你道路页面还有未提交完的数据", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
treasureBuilder.append("initSharePre-点击了道路,");
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
RoadFragment roadFragment = RoadFragment.newInstance(bundle);
|
||||
@ -1142,6 +1143,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getContext()), "提示", "你其他页面还有未提交完的数据", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
treasureBuilder.append("initSharePre-点击了其他,");
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
OtherFragment otherFragment = OtherFragment.newInstance(bundle);
|
||||
@ -1513,19 +1515,19 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_MIUI;
|
||||
List<ShareDialog.Item> itemList = new ArrayList<>();
|
||||
if (upload.contains(1)) {
|
||||
itemList.add(new ShareDialog.Item(Objects.requireNonNull(getContext()), R.drawable.marker_poi_bg1, "POI"));
|
||||
itemList.add(new ShareDialog.Item(Objects.requireNonNull(getContext()), R.drawable.marker_poi, "POI"));
|
||||
}
|
||||
if (upload.contains(2)) {
|
||||
itemList.add(new ShareDialog.Item(Objects.requireNonNull(getContext()), R.drawable.marker_charge_bg1, "充电站"));
|
||||
itemList.add(new ShareDialog.Item(Objects.requireNonNull(getContext()), R.drawable.marker_charge, "充电站"));
|
||||
}
|
||||
if (upload.contains(3)) {
|
||||
itemList.add(new ShareDialog.Item(Objects.requireNonNull(getContext()), R.drawable.marker_poi_video_bg1, "POI录像"));
|
||||
itemList.add(new ShareDialog.Item(Objects.requireNonNull(getContext()), R.drawable.marker_poi_video, "POI录像"));
|
||||
}
|
||||
if (upload.contains(4)) {
|
||||
itemList.add(new ShareDialog.Item(Objects.requireNonNull(getContext()), R.drawable.marker_road_bg, "道路"));
|
||||
itemList.add(new ShareDialog.Item(Objects.requireNonNull(getContext()), R.drawable.marker_road, "道路"));
|
||||
}
|
||||
if (upload.contains(5)) {
|
||||
itemList.add(new ShareDialog.Item(Objects.requireNonNull(getContext()), R.drawable.marker_other_bg1, "其他"));
|
||||
itemList.add(new ShareDialog.Item(Objects.requireNonNull(getContext()), R.drawable.marker_other, "其他"));
|
||||
}
|
||||
Bundle bundle = new Bundle();
|
||||
PoiEntity poiEntity = new PoiEntity();
|
||||
@ -1543,27 +1545,27 @@ 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);
|
||||
PoiFragment poiFragment = PoiFragment.newInstance(bundle);
|
||||
showSlidingFragment(poiFragment);
|
||||
treasureBuilder.append("点击弹窗上的poi,");
|
||||
} else if (item.getText().equals("充电站")) {
|
||||
// showPoiMarkerByType(4, newPoiLatLng);
|
||||
ChargingStationFragment chargingStationFragment = ChargingStationFragment.newInstance(bundle);
|
||||
showSlidingFragment(chargingStationFragment);
|
||||
treasureBuilder.append("点击弹窗上的充电站,");
|
||||
} else if (item.getText().equals("POI录像")) {
|
||||
// showPoiMarkerByType(2, newPoiLatLng);
|
||||
poiEntity.setWork_type(1);
|
||||
bundle.putSerializable("poiEntity", poiEntity);
|
||||
PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
|
||||
showSlidingFragment(poiVideoFragment);
|
||||
treasureBuilder.append("点击弹窗上的poi录像,");
|
||||
} else if (item.getText().equals("道路")) {
|
||||
//showPoiMarkerByType(3, newPoiLatLng);
|
||||
RoadFragment roadFragment = RoadFragment.newInstance(bundle);
|
||||
showSlidingFragment(roadFragment);
|
||||
treasureBuilder.append("点击弹窗上的道路,");
|
||||
} else if (item.getText().equals("其他")) {
|
||||
// showPoiMarkerByType(5, newPoiLatLng);
|
||||
OtherFragment otherFragment = OtherFragment.newInstance(bundle);
|
||||
showSlidingFragment(otherFragment);
|
||||
treasureBuilder.append("点击弹窗上的其他,");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -1685,6 +1687,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
TencentMap.OnMarkerClickListener markerClickListener = new TencentMap.OnMarkerClickListener() {
|
||||
@Override
|
||||
public boolean onMarkerClick(Marker marker) {
|
||||
treasureBuilder.append("TencentMap.OnMarkerClickListener-点击了Marker,");
|
||||
LatLng latLng = marker.getPosition();
|
||||
ArrayList<LatLng> lngArrayList = new ArrayList<>();//存储的是内部的屏幕点坐标
|
||||
Projection projection = tencentMap.getProjection();
|
||||
@ -1876,6 +1879,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
*/
|
||||
public void customDialog(List<PoiEntity> list, Marker marker) {
|
||||
AlertDialog dialog = builder.create();
|
||||
treasureBuilder.append("customDialog-打开了自定义的dialog,");
|
||||
View dialogView = View.inflate(getActivity(), R.layout.layout_marker_dialog, null);
|
||||
dialog.setView(dialogView);
|
||||
Window win = dialog.getWindow();
|
||||
@ -1897,6 +1901,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
markerAdapter.setOnBankClick(new MarkerAdapter.OnBankClick() {
|
||||
@Override
|
||||
public void onClick(PoiEntity poiEntity) {
|
||||
treasureBuilder.append("customDialog-点击了item,");
|
||||
FragmentTransaction fragmentTransaction = supportFragmentManager.beginTransaction();
|
||||
if (poiEntity.getTaskStatus() == 0) {//网络未领取,
|
||||
initMarker(poiEntity, true);
|
||||
|
@ -4,7 +4,7 @@ import com.navinfo.outdoor.api.Constant;
|
||||
|
||||
public class HttpInterface {
|
||||
public static final String IP= "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
|
||||
public static final String IP_ = "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口
|
||||
public static final String IP_= "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口
|
||||
|
||||
public static final String USER_PATH ="/user/";//我的
|
||||
public static final String MSG_LIST_PATH ="/msgList/";//发现
|
||||
@ -13,9 +13,7 @@ public class HttpInterface {
|
||||
public static final String TASK_PATH ="/task/";//任务
|
||||
/*
|
||||
public static final String TEST_GUIDANCE_IP = "http://172.21.98.90:9999/m4";//引导页完成接口
|
||||
|
||||
public static final String APKIP = "http://172.23.139.4:8001/";
|
||||
|
||||
public static final String DATA_IP = "http://172.23.139.4:9999/m4";//接口*/
|
||||
|
||||
/*
|
||||
|
@ -36,6 +36,7 @@ public class PhotoUtils {
|
||||
return new File(Constant.PICTURE_FOLDER, d + time + "_p" + lat + "_a" + 0 + ".jpg");
|
||||
}
|
||||
|
||||
|
||||
public static String initEncode(LatLng latLng) {
|
||||
BitSet latents = getBits(latLng.latitude, -90, 90);
|
||||
BitSet lobbies = getBits(latLng.longitude, -180, 180);
|
||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
@ -21,7 +21,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:background="@drawable/marker_poi_bg1"
|
||||
android:background="@drawable/marker_poi"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_poi"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
@ -123,7 +123,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:background="@drawable/marker_poi_video_bg1"
|
||||
android:background="@drawable/marker_poi_video"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@ -222,7 +222,7 @@
|
||||
android:id="@+id/iv_road"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/marker_road_bg"
|
||||
android:background="@drawable/marker_road"
|
||||
app:layout_constraintLeft_toLeftOf="@id/view4"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@ -319,7 +319,7 @@
|
||||
android:id="@+id/iv_charging"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/marker_charge_bg1"
|
||||
android:background="@drawable/marker_charge"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@id/view5"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@ -414,7 +414,7 @@
|
||||
android:id="@+id/iv_other"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/marker_other_bg1"
|
||||
android:background="@drawable/marker_other"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@id/other_audit_view"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
@ -11,7 +11,7 @@
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:background="@drawable/marker_poi_bags"
|
||||
android:background="@drawable/marker_poi_show"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -249,7 +249,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_margin="2dp"
|
||||
android:background="@drawable/marker_poi_bg1" />
|
||||
android:background="@drawable/marker_poi" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@ -289,7 +289,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_margin="2dp"
|
||||
android:background="@drawable/marker_poi_bg1" />
|
||||
android:background="@drawable/marker_poi" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@ -328,7 +328,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_margin="2dp"
|
||||
android:background="@drawable/marker_poi_video_bg1" />
|
||||
android:background="@drawable/marker_poi_video" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@ -368,7 +368,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_margin="2dp"
|
||||
android:background="@drawable/marker_poi_video_bg1" />
|
||||
android:background="@drawable/marker_poi_video" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@ -407,7 +407,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_margin="2dp"
|
||||
android:background="@drawable/marker_road_bg" />
|
||||
android:background="@drawable/marker_road" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@ -445,7 +445,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_margin="2dp"
|
||||
android:background="@drawable/marker_road_bg" />
|
||||
android:background="@drawable/marker_road" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@ -483,7 +483,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_margin="2dp"
|
||||
android:background="@drawable/marker_charge_bg1" />
|
||||
android:background="@drawable/marker_charge" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@ -521,7 +521,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_margin="2dp"
|
||||
android:background="@drawable/marker_charge_bg1" />
|
||||
android:background="@drawable/marker_charge" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@ -559,7 +559,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_margin="2dp"
|
||||
android:background="@drawable/marker_other_bg1" />
|
||||
android:background="@drawable/marker_other" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@ -597,7 +597,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_margin="2dp"
|
||||
android:background="@drawable/marker_other_bg1" />
|
||||
android:background="@drawable/marker_other" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |