新增注册,忘记密码的接口
This commit is contained in:
commit
9a4917d3ec
@ -51,8 +51,6 @@
|
|||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.WhiteScreen">
|
android:theme="@style/Theme.WhiteScreen">
|
||||||
<activity android:name=".activity.PicturesActivity"
|
<activity android:name=".activity.PicturesActivity"
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|navigation"
|
|
||||||
android:screenOrientation="portrait"
|
|
||||||
>
|
>
|
||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
@ -103,8 +101,7 @@
|
|||||||
android:name="androidx.core.content.FileProvider"
|
android:name="androidx.core.content.FileProvider"
|
||||||
android:authorities="com.navinfo.outdoor.fileprovider"
|
android:authorities="com.navinfo.outdoor.fileprovider"
|
||||||
android:grantUriPermissions="true"
|
android:grantUriPermissions="true"
|
||||||
android:exported="false"
|
android:exported="false">
|
||||||
>
|
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||||
android:resource="@xml/file_paths" />
|
android:resource="@xml/file_paths" />
|
||||||
|
@ -471,8 +471,6 @@ public class FragmentManagement extends BaseActivity {
|
|||||||
fragmentTransaction.show(messageFragment);
|
fragmentTransaction.show(messageFragment);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
fragmentTransaction.commit();
|
fragmentTransaction.commit();
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,10 @@ import android.graphics.BitmapFactory;
|
|||||||
import android.graphics.Matrix;
|
import android.graphics.Matrix;
|
||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
import android.media.MediaMetadataRetriever;
|
import android.media.MediaMetadataRetriever;
|
||||||
|
import android.os.Bundle;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.os.SystemClock;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -21,9 +23,11 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.Chronometer;
|
||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.github.lazylibrary.util.DensityUtil;
|
import com.github.lazylibrary.util.DensityUtil;
|
||||||
@ -56,10 +60,13 @@ import com.tencent.tencentmap.mapsdk.maps.CameraUpdateFactory;
|
|||||||
import com.tencent.tencentmap.mapsdk.maps.TencentMap;
|
import com.tencent.tencentmap.mapsdk.maps.TencentMap;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.TextureMapView;
|
import com.tencent.tencentmap.mapsdk.maps.TextureMapView;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.UiSettings;
|
import com.tencent.tencentmap.mapsdk.maps.UiSettings;
|
||||||
|
import com.tencent.tencentmap.mapsdk.maps.interfaces.Removable;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
|
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptorFactory;
|
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptorFactory;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.CameraPosition;
|
import com.tencent.tencentmap.mapsdk.maps.model.CameraPosition;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||||
|
import com.tencent.tencentmap.mapsdk.maps.model.Marker;
|
||||||
|
import com.tencent.tencentmap.mapsdk.maps.model.MarkerOptions;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle;
|
import com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle;
|
||||||
|
|
||||||
|
|
||||||
@ -96,20 +103,26 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
private TextureMapView ivMap;
|
private TextureMapView ivMap;
|
||||||
private CheckBox captureVideo; // 拍摄视频
|
private CheckBox captureVideo; // 拍摄视频
|
||||||
private Button btnVideo, stopVideo;
|
private Button btnVideo, stopVideo;
|
||||||
private ImageView ivPic;
|
|
||||||
private String finalVideoPath; // 摄像后最终保存的文件名
|
private String finalVideoPath; // 摄像后最终保存的文件名
|
||||||
private File tmpFile; // 合并文件的临时文件路径
|
// private File tmpFile; // 合并文件的临时文件路径
|
||||||
private Timer timer;
|
private Timer timer;
|
||||||
private CsvTimerTask timerTask; // 执行定时写入csv文件的task
|
private CsvTimerTask timerTask; // 执行定时写入csv文件的task
|
||||||
private DateFormat formatter;
|
private DateFormat formatter;
|
||||||
private final long period = 1; // 记录csv文件的间隔时间,单位为秒
|
private final long period = 1; // 记录csv文件的间隔时间,单位为秒
|
||||||
private ViewGroup layerChange; // 切换地图和相机的父控件
|
private ViewGroup layerChange; // 切换地图和相机的父控件
|
||||||
private boolean isFinishActivity = false; // 是否需要关闭当前activity
|
private boolean isFinishActivity = false; // 是否需要关闭当前activity
|
||||||
|
private TextView videoChronometer;
|
||||||
|
private long recordingTime = 0;// 记录下来的总时间
|
||||||
|
private int oratation = -1; // 是否强制横屏拍摄,默认不强制,0-强制横屏 其他-任意
|
||||||
|
private List<Removable> removables;
|
||||||
|
private String uuId;
|
||||||
|
private ImageView ivPic;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayout() {
|
protected int getLayout() {
|
||||||
EventBus.getDefault().register(this);
|
EventBus.getDefault().register(this);
|
||||||
tmpFile = new File(Constant.PICTURE_FOLDER, "temp.mp4");
|
// tmpFile = new File(Constant.PICTURE_FOLDER, "temp.mp4");
|
||||||
formatter = new SimpleDateFormat("yyyyMMdd HHmmss");
|
formatter = new SimpleDateFormat("yyyyMMdd HHmmss");
|
||||||
return R.layout.activity_picture;
|
return R.layout.activity_picture;
|
||||||
}
|
}
|
||||||
@ -118,26 +131,30 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
|
|
||||||
if (getIntent()!=null) {
|
if (getIntent() != null) {
|
||||||
finalVideoPath = getIntent().getStringExtra(Constant.INTENT_VIDEO_PATH);
|
finalVideoPath = getIntent().getStringExtra(Constant.INTENT_VIDEO_PATH);
|
||||||
|
uuId = getIntent().getStringExtra("uuId");
|
||||||
|
oratation = getIntent().getIntExtra(Constant.INTENT_VIDEO_ORATATION, -1);
|
||||||
}
|
}
|
||||||
if (finalVideoPath == null) {
|
videoChronometer = findViewById(R.id.video_chronometer);
|
||||||
finalVideoPath = Constant.PICTURE_FOLDER+"/final.mp4";
|
// if (finalVideoPath == null) {
|
||||||
}
|
// finalVideoPath = Constant.PICTURE_FOLDER+"/final.mp4";
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
layerChange = findViewById(R.id.layer_change);
|
layerChange = findViewById(R.id.layer_change);
|
||||||
|
|
||||||
|
|
||||||
timer = new Timer();
|
timer = new Timer();
|
||||||
|
|
||||||
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||||
ivMap = (TextureMapView) findViewById(R.id.iv_map);
|
ivMap = (TextureMapView) findViewById(R.id.iv_map);
|
||||||
ivPic = findViewById(R.id.iv_pic);
|
|
||||||
btnVideo = findViewById(R.id.btn_video);
|
|
||||||
btnVideo.setOnClickListener(this::onClick);
|
|
||||||
btnSwitch = (Button) findViewById(R.id.btn_switch);
|
btnSwitch = (Button) findViewById(R.id.btn_switch);
|
||||||
btnSwitch.setOnClickListener(this::onClick);
|
btnSwitch.setOnClickListener(this::onClick);
|
||||||
// capturePicture = (ImageButton) findViewById(R.id.capturePicture);
|
// capturePicture = (ImageButton) findViewById(R.id.capturePicture);
|
||||||
// capturePicture.setOnClickListener(this::onClick);
|
// capturePicture.setOnClickListener(this::onClick);
|
||||||
|
ivPic = findViewById(R.id.iv_pic);
|
||||||
//相机记录器
|
//相机记录器
|
||||||
CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE);
|
CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE);
|
||||||
camera = findViewById(R.id.camera);
|
camera = findViewById(R.id.camera);
|
||||||
@ -147,12 +164,21 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
if (isChecked) { // 开始采集,设置按钮文字内容为“结束采集”
|
if (isChecked) { // 开始采集,设置按钮文字内容为“结束采集”
|
||||||
|
if (oratation == 0) { // oratation为0时,拍摄视频必须为横屏
|
||||||
|
// 如果当前手机是竖向,则不允许拍摄
|
||||||
|
if (camera.getVideoSize().getWidth() < camera.getVideoSize().getHeight()) {
|
||||||
|
Toast.makeText(PictureActivity.this, "不允许竖向拍摄...", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
captureVideo.setText("暂停采集");
|
captureVideo.setText("暂停采集");
|
||||||
// stopVideo.setEnabled(false);// 开始采集视频后,禁用停止采集的按钮,必须暂停采集后才可点击停止采集
|
// stopVideo.setEnabled(false);// 开始采集视频后,禁用停止采集的按钮,必须暂停采集后才可点击停止采集
|
||||||
startTakenVideo(); // 开始采集视频
|
startTakenVideo(); // 开始采集视频
|
||||||
} else {
|
} else {
|
||||||
stopTakenVideo();
|
stopTakenVideo();
|
||||||
captureVideo.setText("开始采集");
|
captureVideo.setText("开始采集");
|
||||||
|
// stopVideoAndFinish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -172,10 +198,10 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
SizeSelector dimensions = SizeSelectors.and(width, height); // Matches sizes bigger than 1000x2000.
|
SizeSelector dimensions = SizeSelectors.and(width, height); // Matches sizes bigger than 1000x2000.
|
||||||
// 获取屏幕信息
|
// 获取屏幕信息
|
||||||
int[] density = DensityUtil.getDeviceInfo(this);
|
int[] density = DensityUtil.getDeviceInfo(this);
|
||||||
int x=1920, y=1440;
|
int x = 1920, y = 1440;
|
||||||
if (density!=null&&density.length>1) {
|
if (density != null && density.length > 1) {
|
||||||
x = (density[0]>=density[1]?density[0]:density[1]);
|
x = (density[0] >= density[1] ? density[0] : density[1]);
|
||||||
y = (density[0]>=density[1]?density[1]:density[0]);
|
y = (density[0] >= density[1] ? density[1] : density[0]);
|
||||||
}
|
}
|
||||||
SizeSelector ratio = SizeSelectors.aspectRatio(AspectRatio.of(x, y), 0); // Matches 1:1 sizes.
|
SizeSelector ratio = SizeSelectors.aspectRatio(AspectRatio.of(x, y), 0); // Matches 1:1 sizes.
|
||||||
|
|
||||||
@ -185,7 +211,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
SizeSelectors.biggest() // If none is found, take the biggest
|
SizeSelectors.biggest() // If none is found, take the biggest
|
||||||
);
|
);
|
||||||
camera.setVideoSize(result);
|
camera.setVideoSize(result);
|
||||||
camera.setVideoBitRate(1920*1440);
|
camera.setVideoBitRate(1920 * 1440);
|
||||||
// camera.setAudioBitRate();
|
// camera.setAudioBitRate();
|
||||||
|
|
||||||
//获取地图
|
//获取地图
|
||||||
@ -205,7 +231,23 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
// Log.e("PictureActivity", frame.getTime()+"");
|
// Log.e("PictureActivity", frame.getTime()+"");
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
removables = new ArrayList<>();//存储轨迹的marker
|
||||||
|
if (uuId!=null){
|
||||||
|
List<File> videoFileListByUUID = AWMp4ParserHelper.getInstance().getVideoFileListByUUID(uuId);
|
||||||
|
if (videoFileListByUUID!=null){
|
||||||
|
List<LatLng> lineStringByVideoFileList = AWMp4ParserHelper.getInstance().getLineStringByVideoFileList(videoFileListByUUID);
|
||||||
|
for (int i = 0; i < lineStringByVideoFileList.size(); i++) {
|
||||||
|
LatLng latLng = lineStringByVideoFileList.get(i);
|
||||||
|
if (latLng!=null){
|
||||||
|
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(ic_baseline);
|
||||||
|
Marker marker = tencentMap.addMarker(new MarkerOptions(latLng).icon(pileDescriptor).alpha(0.9f)
|
||||||
|
.flat(true)
|
||||||
|
.clockwise(false));
|
||||||
|
removables.add(marker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
//相机预览监听
|
//相机预览监听
|
||||||
camera.addCameraListener(new CameraListener() {
|
camera.addCameraListener(new CameraListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -236,45 +278,49 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
super.onVideoTaken(result);
|
super.onVideoTaken(result);
|
||||||
Toast.makeText(PictureActivity.this, "暂停摄像", Toast.LENGTH_SHORT).show();
|
Toast.makeText(PictureActivity.this, "暂停摄像", Toast.LENGTH_SHORT).show();
|
||||||
showLoadingDialog();
|
showLoadingDialog();
|
||||||
new Thread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (result!=null) {
|
|
||||||
File currentFile = result.getFile();
|
|
||||||
if (finalVideoPath!=null) { // 有指定的视频文件名称,合并文件
|
|
||||||
if (new File(finalVideoPath).exists()) {
|
|
||||||
List<String> spliteFileList = new ArrayList<>();
|
|
||||||
spliteFileList.add(finalVideoPath);
|
|
||||||
spliteFileList.add(currentFile.getAbsolutePath());
|
|
||||||
try {
|
|
||||||
AWMp4ParserHelper.getInstance().mergeVideos(spliteFileList, tmpFile.getAbsolutePath());
|
|
||||||
if (tmpFile.exists()) {
|
|
||||||
File finalVideoFile = new File(finalVideoPath);
|
|
||||||
finalVideoFile.delete();
|
|
||||||
currentFile.delete();
|
|
||||||
tmpFile.renameTo(finalVideoFile);
|
|
||||||
} else {
|
|
||||||
Toast.makeText(PictureActivity.this, "视频合并失败!", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.e("PictureActivity", e.getMessage());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
currentFile.renameTo(new File(finalVideoPath));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
if (isFinishActivity) {
|
if (isFinishActivity) {
|
||||||
PictureActivity.this.finish();
|
PictureActivity.this.finish();
|
||||||
}
|
}
|
||||||
}
|
// new Thread(new Runnable() {
|
||||||
});
|
// @Override
|
||||||
}
|
// public void run() {
|
||||||
}).start();
|
// if (result!=null) {
|
||||||
|
// File currentFile = result.getFile();
|
||||||
|
// if (finalVideoPath!=null) { // 有指定的视频文件名称,合并文件
|
||||||
|
// if (new File(finalVideoPath).exists()) {
|
||||||
|
// List<String> spliteFileList = new ArrayList<>();
|
||||||
|
// spliteFileList.add(finalVideoPath);
|
||||||
|
// spliteFileList.add(currentFile.getAbsolutePath());
|
||||||
|
// try {
|
||||||
|
// AWMp4ParserHelper.getInstance().mergeVideos(spliteFileList, tmpFile.getAbsolutePath());
|
||||||
|
// if (tmpFile.exists()) {
|
||||||
|
// File finalVideoFile = new File(finalVideoPath);
|
||||||
|
// finalVideoFile.delete();
|
||||||
|
// currentFile.delete();
|
||||||
|
// tmpFile.renameTo(finalVideoFile);
|
||||||
|
// } else {
|
||||||
|
// Toast.makeText(PictureActivity.this, "视频合并失败!", Toast.LENGTH_SHORT).show();
|
||||||
|
// }
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// Log.e("PictureActivity", e.getMessage());
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// currentFile.renameTo(new File(finalVideoPath));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// runOnUiThread(new Runnable() {
|
||||||
|
// @Override
|
||||||
|
// public void run() {
|
||||||
|
// dismissLoadingDialog();
|
||||||
|
// if (isFinishActivity) {
|
||||||
|
// PictureActivity.this.finish();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// }).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -289,27 +335,33 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
/**
|
/**
|
||||||
* 获取当前视频的时间,记录csv文件时使用
|
* 获取当前视频的时间,记录csv文件时使用
|
||||||
* */
|
* */
|
||||||
long currentTime = AWMp4ParserHelper.getInstance().getVedioTotalTime(new File(finalVideoPath));
|
// long currentTime = AWMp4ParserHelper.getInstance().getVedioTotalTime(new File(finalVideoPath));
|
||||||
timerTask = new CsvTimerTask(new File(finalVideoPath+".txt"));
|
timerTask = new CsvTimerTask(new File(finalVideoPath + ".txt"));
|
||||||
|
timer.schedule(timerTask, 0, period * 1000);
|
||||||
// 开始采集,每隔2秒实时记录位置信息、视频时间以及设备时间
|
// // 开始采集,每隔2秒实时记录位置信息、视频时间以及设备时间
|
||||||
if (currentTime == 0) {
|
// if (currentTime == 0) {
|
||||||
timer.schedule(timerTask, 0, period*1000);
|
// timer.schedule(timerTask, 0, period*1000);
|
||||||
} else {
|
// } else {
|
||||||
timerTask.setCurrentVideoTime(currentTime/1000+1);
|
// timerTask.setCurrentVideoTime(currentTime/1000+1);
|
||||||
timer.schedule(timerTask, 1, period*1000);
|
// timer.schedule(timerTask, 1, period*1000);
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onVideoRecordingEnd() {
|
public void onVideoRecordingEnd() {
|
||||||
super.onVideoRecordingEnd();
|
super.onVideoRecordingEnd();
|
||||||
if (timerTask!=null){
|
if (timerTask != null) {
|
||||||
timerTask.cancel();
|
timerTask.cancel();
|
||||||
}else {
|
} else {
|
||||||
// Toast.makeText(PictureActivity.this, "请先拍照", Toast.LENGTH_SHORT).show();
|
// Toast.makeText(PictureActivity.this, "请先拍照", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
// 一段视频拍摄完成自动将当前拍摄路径加1
|
||||||
|
File finalVideoFile = new File(finalVideoPath);
|
||||||
|
if (finalVideoFile.exists()) {
|
||||||
|
int videoIndex = Integer.parseInt(finalVideoFile.getName().replace(".mp4", ""));
|
||||||
|
finalVideoPath = finalVideoFile.getParentFile().getAbsolutePath() + "/" + (videoIndex + 1) + ".mp4";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -317,12 +369,20 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
DisplayMetrics dm = new DisplayMetrics();
|
DisplayMetrics dm = new DisplayMetrics();
|
||||||
getWindowManager().getDefaultDisplay().getMetrics(dm);
|
getWindowManager().getDefaultDisplay().getMetrics(dm);
|
||||||
FrameLayout.LayoutParams layoutParamsMap = (FrameLayout.LayoutParams) ivMap.getLayoutParams();//相机的宽高
|
FrameLayout.LayoutParams layoutParamsMap = (FrameLayout.LayoutParams) ivMap.getLayoutParams();//相机的宽高
|
||||||
layoutParamsMap.height = dm.widthPixels/3;
|
layoutParamsMap.height = dm.widthPixels / 3;
|
||||||
layoutParamsMap.width = dm.heightPixels/3;
|
layoutParamsMap.width = dm.heightPixels / 3;
|
||||||
ivMap.setLayoutParams(layoutParamsMap);
|
ivMap.setLayoutParams(layoutParamsMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 将秒转化成小时分钟秒
|
||||||
|
private String formatMiss(long miss) {
|
||||||
|
String hh = miss / 3600 > 9 ? miss / 3600 + "" : "0" + miss / 3600;
|
||||||
|
String mm = (miss % 3600) / 60 > 9 ? (miss % 3600) / 60 + "" : "0" + (miss % 3600) / 60;
|
||||||
|
String ss = (miss % 3600) % 60 > 9 ? (miss % 3600) % 60 + "" : "0" + (miss % 3600) % 60;
|
||||||
|
return hh + ":" + mm + ":" + ss;
|
||||||
|
}
|
||||||
|
|
||||||
private void message(String content, Boolean important) {
|
private void message(String content, Boolean important) {
|
||||||
if (important) {
|
if (important) {
|
||||||
LOG.w(content);
|
LOG.w(content);
|
||||||
@ -359,37 +419,44 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
// startTakenVideo(); // 开始拍摄视频
|
// startTakenVideo(); // 开始拍摄视频
|
||||||
// break;
|
// break;
|
||||||
case R.id.btn_stop_video:
|
case R.id.btn_stop_video:
|
||||||
if (timerTask!=null){
|
stopVideoAndFinish();
|
||||||
timerTask.cancel();
|
|
||||||
Intent intent = new Intent();
|
|
||||||
intent.putExtra(Constant.INTENT_VIDEO_PATH, finalVideoPath);
|
|
||||||
setResult(0x101, intent);
|
|
||||||
}else {
|
|
||||||
Toast.makeText(this, "本段视频没有计时!", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
if (camera.isTakingVideo()) {
|
|
||||||
isFinishActivity = true;
|
|
||||||
camera.stopVideo();
|
|
||||||
} else {
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void stopVideoAndFinish() {
|
||||||
|
if (timerTask != null) {
|
||||||
|
timerTask.cancel();
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.putExtra(Constant.INTENT_VIDEO_PATH, finalVideoPath);
|
||||||
|
setResult(0x101, intent);
|
||||||
|
} else {
|
||||||
|
Toast.makeText(this, "本段视频没有计时!", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
if (camera.isTakingVideo()) {
|
||||||
|
showLoadingDialog();
|
||||||
|
isFinishActivity = true;
|
||||||
|
camera.stopVideo();
|
||||||
|
} else {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void startTakenVideo() {
|
private void startTakenVideo() {
|
||||||
if (camera.isTakingVideo()) {
|
if (camera.isTakingVideo()) {
|
||||||
Toast.makeText(this, "已经在拍摄中...", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "已经在拍摄中...", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
|
// DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||||
Calendar calendar = Calendar.getInstance();
|
// Calendar calendar = Calendar.getInstance();
|
||||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
// calendar.setTimeInMillis(System.currentTimeMillis());
|
||||||
String formatVideoName = formatter.format(calendar.getTime());
|
// String formatVideoName = formatter.format(calendar.getTime());
|
||||||
//文件
|
//文件
|
||||||
File file = new File(Constant.PICTURE_FOLDER, formatVideoName + ".mp4");
|
// String path = finalVideoPath.substring(finalVideoPath.length()-20);
|
||||||
|
if (finalVideoPath != null) {
|
||||||
|
File file = new File(finalVideoPath);
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
try {
|
try {
|
||||||
FileOutputStream fo = new FileOutputStream(file);
|
FileOutputStream fo = new FileOutputStream(file);
|
||||||
@ -403,6 +470,10 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
} else {
|
} else {
|
||||||
camera.takeVideo(file);
|
camera.takeVideo(file);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(this, "请录像", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -445,7 +516,6 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void btnSwich() {
|
public void btnSwich() {
|
||||||
|
|
||||||
DisplayMetrics dm = new DisplayMetrics();
|
DisplayMetrics dm = new DisplayMetrics();
|
||||||
getWindowManager().getDefaultDisplay().getMetrics(dm);
|
getWindowManager().getDefaultDisplay().getMetrics(dm);
|
||||||
System.out.println("width-display :" + dm.widthPixels);
|
System.out.println("width-display :" + dm.widthPixels);
|
||||||
@ -459,7 +529,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
|
|
||||||
layerChange.removeAllViews();
|
layerChange.removeAllViews();
|
||||||
if (widthMap > widthCamera) {
|
if (widthMap > widthCamera) {
|
||||||
ivPic.setVisibility(View.VISIBLE);
|
|
||||||
layoutParamsCamera.width = dm.widthPixels;
|
layoutParamsCamera.width = dm.widthPixels;
|
||||||
layoutParamsCamera.height = dm.heightPixels;
|
layoutParamsCamera.height = dm.heightPixels;
|
||||||
layoutParamsMap.height = heightCamera;
|
layoutParamsMap.height = heightCamera;
|
||||||
@ -469,7 +539,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
layerChange.addView(camera);
|
layerChange.addView(camera);
|
||||||
layerChange.addView(ivMap);
|
layerChange.addView(ivMap);
|
||||||
} else {
|
} else {
|
||||||
ivPic.setVisibility(View.GONE);
|
|
||||||
layoutParamsMap.height = dm.heightPixels;
|
layoutParamsMap.height = dm.heightPixels;
|
||||||
layoutParamsMap.width = dm.widthPixels;
|
layoutParamsMap.width = dm.widthPixels;
|
||||||
layoutParamsCamera.height = heightMap;
|
layoutParamsCamera.height = heightMap;
|
||||||
@ -497,6 +567,10 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
stopTakenVideo();
|
stopTakenVideo();
|
||||||
camera.destroy();
|
camera.destroy();
|
||||||
|
for (int i = 0; i < removables.size(); i++) {
|
||||||
|
removables.get(i).remove();
|
||||||
|
}
|
||||||
|
removables.clear();
|
||||||
timer.cancel();
|
timer.cancel();
|
||||||
if (EventBus.getDefault().isRegistered(this)) {
|
if (EventBus.getDefault().isRegistered(this)) {
|
||||||
EventBus.getDefault().unregister(this);
|
EventBus.getDefault().unregister(this);
|
||||||
@ -549,11 +623,31 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
|||||||
sb.append(Constant.currentLocation.getLatitude());
|
sb.append(Constant.currentLocation.getLatitude());
|
||||||
sb.append(",");
|
sb.append(",");
|
||||||
sb.append(Constant.currentLocation.getLongitude());
|
sb.append(Constant.currentLocation.getLongitude());
|
||||||
|
sb.append(",");
|
||||||
|
if (Constant.currentLocation.getBearing()!=0) {
|
||||||
|
sb.append(Constant.currentLocation.getBearing());
|
||||||
|
} else {
|
||||||
|
sb.append(Constant.currentLocation.getDirection());
|
||||||
|
}
|
||||||
sb.append("\r\n");
|
sb.append("\r\n");
|
||||||
|
LatLng latLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
|
||||||
|
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(ic_baseline);
|
||||||
|
Marker marker = tencentMap.addMarker(new MarkerOptions(latLng).icon(pileDescriptor).alpha(0.9f)
|
||||||
|
.flat(true)
|
||||||
|
.clockwise(false));
|
||||||
|
removables.add(marker);
|
||||||
FileUtils.writeFile(csvFile.getAbsolutePath(), sb.toString(), true);
|
FileUtils.writeFile(csvFile.getAbsolutePath(), sb.toString(), true);
|
||||||
currentVideoTime = currentVideoTime+period; //
|
currentVideoTime = currentVideoTime + period; //
|
||||||
|
recordingTime += period;
|
||||||
|
runOnUiThread(updateTimeRunnable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Runnable updateTimeRunnable = new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
videoChronometer.setText(formatMiss(recordingTime));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
@ -5,116 +5,541 @@ import androidx.annotation.Nullable;
|
|||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
import android.content.pm.ActivityInfo;
|
import android.content.pm.ActivityInfo;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.graphics.Matrix;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.util.DisplayMetrics;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.CompoundButton;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.github.lazylibrary.util.DensityUtil;
|
||||||
|
import com.github.lazylibrary.util.FileUtils;
|
||||||
import com.navinfo.outdoor.R;
|
import com.navinfo.outdoor.R;
|
||||||
import com.navinfo.outdoor.api.Constant;
|
import com.navinfo.outdoor.api.Constant;
|
||||||
import com.navinfo.outdoor.base.BaseActivity;
|
import com.navinfo.outdoor.base.BaseActivity;
|
||||||
|
import com.navinfo.outdoor.util.AWMp4ParserHelper;
|
||||||
|
import com.navinfo.outdoor.util.MyTecentLocationSource;
|
||||||
|
import com.otaliastudios.cameraview.CameraException;
|
||||||
import com.otaliastudios.cameraview.CameraListener;
|
import com.otaliastudios.cameraview.CameraListener;
|
||||||
import com.otaliastudios.cameraview.CameraLogger;
|
import com.otaliastudios.cameraview.CameraLogger;
|
||||||
import com.otaliastudios.cameraview.CameraView;
|
import com.otaliastudios.cameraview.CameraView;
|
||||||
|
import com.otaliastudios.cameraview.FileCallback;
|
||||||
|
import com.otaliastudios.cameraview.PictureResult;
|
||||||
import com.otaliastudios.cameraview.VideoResult;
|
import com.otaliastudios.cameraview.VideoResult;
|
||||||
import com.otaliastudios.cameraview.controls.Engine;
|
import com.otaliastudios.cameraview.controls.Engine;
|
||||||
import com.otaliastudios.cameraview.controls.Mode;
|
import com.otaliastudios.cameraview.controls.Mode;
|
||||||
|
import com.otaliastudios.cameraview.size.AspectRatio;
|
||||||
|
import com.otaliastudios.cameraview.size.SizeSelector;
|
||||||
|
import com.otaliastudios.cameraview.size.SizeSelectors;
|
||||||
|
import com.tencent.tencentmap.mapsdk.maps.CameraUpdate;
|
||||||
|
import com.tencent.tencentmap.mapsdk.maps.CameraUpdateFactory;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.MapView;
|
import com.tencent.tencentmap.mapsdk.maps.MapView;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.TencentMap;
|
import com.tencent.tencentmap.mapsdk.maps.TencentMap;
|
||||||
|
import com.tencent.tencentmap.mapsdk.maps.TextureMapView;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.UiSettings;
|
import com.tencent.tencentmap.mapsdk.maps.UiSettings;
|
||||||
|
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.MyLocationStyle;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileDescriptor;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Timer;
|
||||||
|
import java.util.TimerTask;
|
||||||
|
|
||||||
|
import static com.navinfo.outdoor.R.drawable.location;
|
||||||
|
import static com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE;
|
||||||
|
|
||||||
public class PicturesActivity extends BaseActivity implements View.OnClickListener {
|
public class PicturesActivity extends BaseActivity implements View.OnClickListener {
|
||||||
private static final CameraLogger LOG = CameraLogger.create("Picture");
|
private static final CameraLogger LOG = CameraLogger.create("Picture");
|
||||||
private com.otaliastudios.cameraview.CameraView cameraView;
|
private CameraView camera;
|
||||||
private android.widget.Button capuretVideo;
|
private long captureTime = 0;
|
||||||
private android.widget.Button btnStopVideo;
|
private android.widget.Button btnSwitch;
|
||||||
// private MapView ivMap;
|
private TencentMap tencentMap;
|
||||||
// private TencentMap tencentMap;
|
private MyLocationStyle locationStyle;
|
||||||
|
private TextureMapView ivMap;
|
||||||
|
private CheckBox captureVideo; // 拍摄视频
|
||||||
|
private Button btnVideo, stopVideo;
|
||||||
|
|
||||||
|
private String finalVideoPath; // 摄像后最终保存的文件名
|
||||||
|
private File tmpFile; // 合并文件的临时文件路径
|
||||||
|
private Timer timer;
|
||||||
|
private CsvTimerTask timerTask; // 执行定时写入csv文件的task
|
||||||
|
private DateFormat formatter;
|
||||||
|
private final long period = 1; // 记录csv文件的间隔时间,单位为秒
|
||||||
|
private ViewGroup layerChange; // 切换地图和相机的父控件
|
||||||
|
private boolean isFinishActivity = false; // 是否需要关闭当前activity
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayout() {
|
protected int getLayout() {
|
||||||
|
EventBus.getDefault().register(this);
|
||||||
|
tmpFile = new File(Constant.PICTURE_FOLDER, "temp.mp4");
|
||||||
|
formatter = new SimpleDateFormat("yyyyMMdd HHmmss");
|
||||||
return R.layout.activity_pictures;
|
return R.layout.activity_pictures;
|
||||||
}
|
}
|
||||||
//
|
|
||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
cameraView = (CameraView) findViewById(R.id.cameraView);
|
|
||||||
capuretVideo = (Button) findViewById(R.id.capuretVideo);
|
if (getIntent()!=null) {
|
||||||
capuretVideo.setOnClickListener(this::onClick);
|
finalVideoPath = getIntent().getStringExtra(Constant.INTENT_VIDEO_PATH);
|
||||||
btnStopVideo = (Button) findViewById(R.id.btn_stop_video);
|
}
|
||||||
btnStopVideo.setOnClickListener(this::onClick);
|
if (finalVideoPath == null) {
|
||||||
// ivMap = findViewById(R.id.iv_map);
|
finalVideoPath = Constant.PICTURE_FOLDER+"/final.mp4";
|
||||||
cameraView.setLifecycleOwner(this);
|
}
|
||||||
cameraView.setEngine(Engine.CAMERA1);
|
|
||||||
cameraView.setMode(Mode.VIDEO);
|
layerChange = findViewById(R.id.layer_change);
|
||||||
cameraView.addCameraListener(new CameraListener() {
|
|
||||||
|
timer = new Timer();
|
||||||
|
|
||||||
|
// this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||||
|
ivMap = (TextureMapView) findViewById(R.id.iv_map);
|
||||||
|
btnSwitch = (Button) findViewById(R.id.btn_switch);
|
||||||
|
btnSwitch.setOnClickListener(this::onClick);
|
||||||
|
// capturePicture = (ImageButton) findViewById(R.id.capturePicture);
|
||||||
|
// capturePicture.setOnClickListener(this::onClick);
|
||||||
|
//相机记录器
|
||||||
|
CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE);
|
||||||
|
camera = findViewById(R.id.camera);
|
||||||
|
camera.setOnClickListener(this::onClick);
|
||||||
|
captureVideo = findViewById(R.id.capuretVideo);
|
||||||
|
captureVideo.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
|
if (isChecked) { // 开始采集,设置按钮文字内容为“结束采集”
|
||||||
|
captureVideo.setText("暂停采集");
|
||||||
|
// stopVideo.setEnabled(false);// 开始采集视频后,禁用停止采集的按钮,必须暂停采集后才可点击停止采集
|
||||||
|
startTakenVideo(); // 开始采集视频
|
||||||
|
} else {
|
||||||
|
stopTakenVideo();
|
||||||
|
captureVideo.setText("开始采集");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
stopVideo = findViewById(R.id.btn_stop_video);
|
||||||
|
stopVideo.setOnClickListener(this::onClick);
|
||||||
|
//拍照权限
|
||||||
|
camera.setLifecycleOwner(this);
|
||||||
|
camera.setEngine(Engine.CAMERA1);
|
||||||
|
// camera.setVideoBitRate(5);
|
||||||
|
camera.setPreviewFrameRate(5); // 设置预览视频的帧率
|
||||||
|
|
||||||
|
|
||||||
|
// 设置视频可用的宽高size
|
||||||
|
SizeSelector width = SizeSelectors.maxWidth(1920);
|
||||||
|
SizeSelector height = SizeSelectors.maxHeight(1440);
|
||||||
|
SizeSelector dimensions = SizeSelectors.and(width, height); // Matches sizes bigger than 1000x2000.
|
||||||
|
// 获取屏幕信息
|
||||||
|
int[] density = DensityUtil.getDeviceInfo(this);
|
||||||
|
int x=1920, y=1440;
|
||||||
|
if (density!=null&&density.length>1) {
|
||||||
|
x = (density[0]>=density[1]?density[0]:density[1]);
|
||||||
|
y = (density[0]>=density[1]?density[1]:density[0]);
|
||||||
|
}
|
||||||
|
SizeSelector ratio = SizeSelectors.aspectRatio(AspectRatio.of(x, y), 0); // Matches 1:1 sizes.
|
||||||
|
|
||||||
|
SizeSelector result = SizeSelectors.or(
|
||||||
|
SizeSelectors.and(ratio, dimensions), // Try to match both constraints
|
||||||
|
ratio, // If none is found, at least try to match the aspect ratio
|
||||||
|
SizeSelectors.biggest() // If none is found, take the biggest
|
||||||
|
);
|
||||||
|
camera.setVideoSize(result);
|
||||||
|
camera.setVideoBitRate(1920*1440);
|
||||||
|
// camera.setAudioBitRate();
|
||||||
|
|
||||||
|
//获取地图
|
||||||
|
tencentMap = ivMap.getMap();
|
||||||
|
//获取地图UI 设置对象
|
||||||
|
UiSettings uiSettings = tencentMap.getUiSettings();
|
||||||
|
//设置logo的大小
|
||||||
|
uiSettings.setLogoScale(0.7f);
|
||||||
|
// uiSettings.setAllGesturesEnabled(false);
|
||||||
|
setLocMarkerStyle(); // 设置当前位置显示样式
|
||||||
|
|
||||||
|
// camera.addFrameProcessor(new FrameProcessor() {
|
||||||
|
// @Override
|
||||||
|
// public void process(@NonNull Frame frame) {
|
||||||
|
// Log.e("PictureActivity", frame.getTime()+"");
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
//相机预览监听
|
||||||
|
camera.addCameraListener(new CameraListener() {
|
||||||
|
@Override
|
||||||
|
public void onPictureTaken(@NonNull @NotNull PictureResult result) {
|
||||||
|
super.onPictureTaken(result);
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||||
|
String format = formatter.format(calendar.getTime());
|
||||||
|
//文件
|
||||||
|
File file = new File(Constant.PICTURE_FOLDER, format + ".jpg");
|
||||||
|
result.toFile(file, new FileCallback() {
|
||||||
|
@Override
|
||||||
|
public void onFileReady(@Nullable @org.jetbrains.annotations.Nullable File file) {
|
||||||
|
Toast.makeText(PicturesActivity.this, "保存成功:" + file.getPath(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (camera.isTakingVideo()) {
|
||||||
|
message("Captured while taking video. Size=" + result.getSize(), false);
|
||||||
|
}
|
||||||
|
long callbackTime = System.currentTimeMillis();
|
||||||
|
captureTime = callbackTime - 300;
|
||||||
|
Log.d("captureTime", captureTime + "");
|
||||||
|
}
|
||||||
|
|
||||||
|
//录像监听
|
||||||
@Override
|
@Override
|
||||||
public void onVideoTaken(@NonNull @NotNull VideoResult result) {
|
public void onVideoTaken(@NonNull @NotNull VideoResult result) {
|
||||||
super.onVideoTaken(result);
|
super.onVideoTaken(result);
|
||||||
Toast.makeText(PicturesActivity.this, "停止摄像", Toast.LENGTH_SHORT).show();
|
Toast.makeText(PicturesActivity.this, "暂停摄像", Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
showLoadingDialog();
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (result!=null) {
|
||||||
|
File currentFile = result.getFile();
|
||||||
|
if (finalVideoPath!=null) { // 有指定的视频文件名称,合并文件
|
||||||
|
if (new File(finalVideoPath).exists()) {
|
||||||
|
List<String> spliteFileList = new ArrayList<>();
|
||||||
|
spliteFileList.add(finalVideoPath);
|
||||||
|
spliteFileList.add(currentFile.getAbsolutePath());
|
||||||
|
try {
|
||||||
|
AWMp4ParserHelper.getInstance().mergeVideos(spliteFileList, tmpFile.getAbsolutePath());
|
||||||
|
if (tmpFile.exists()) {
|
||||||
|
File finalVideoFile = new File(finalVideoPath);
|
||||||
|
finalVideoFile.delete();
|
||||||
|
currentFile.delete();
|
||||||
|
tmpFile.renameTo(finalVideoFile);
|
||||||
|
} else {
|
||||||
|
Toast.makeText(PicturesActivity.this, "视频合并失败!", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e("PictureActivity", e.getMessage());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
currentFile.renameTo(new File(finalVideoPath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
if (isFinishActivity) {
|
||||||
|
PicturesActivity.this.finish();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// tencentMap = ivMap.getMap();
|
}
|
||||||
//获取地图UI 设置对象
|
}).start();
|
||||||
// UiSettings uiSettings = tencentMap.getUiSettings();
|
}
|
||||||
// //设置logo的大小
|
|
||||||
// uiSettings.setLogoScale(0.7f);
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCameraError(@NonNull @NotNull CameraException exception) {
|
||||||
|
super.onCameraError(exception);
|
||||||
|
Toast.makeText(PicturesActivity.this, exception.toString(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onVideoRecordingStart() {
|
||||||
|
super.onVideoRecordingStart();
|
||||||
|
/**
|
||||||
|
* 获取当前视频的时间,记录csv文件时使用
|
||||||
|
* */
|
||||||
|
long currentTime = AWMp4ParserHelper.getInstance().getVedioTotalTime(new File(finalVideoPath));
|
||||||
|
timerTask = new CsvTimerTask(new File(finalVideoPath+".txt"));
|
||||||
|
|
||||||
|
// 开始采集,每隔2秒实时记录位置信息、视频时间以及设备时间
|
||||||
|
if (currentTime == 0) {
|
||||||
|
timer.schedule(timerTask, 0, period*1000);
|
||||||
|
} else {
|
||||||
|
timerTask.setCurrentVideoTime(currentTime/1000+1);
|
||||||
|
timer.schedule(timerTask, 1, period*1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onVideoRecordingEnd() {
|
||||||
|
super.onVideoRecordingEnd();
|
||||||
|
if (timerTask!=null){
|
||||||
|
timerTask.cancel();
|
||||||
|
}else {
|
||||||
|
// Toast.makeText(PictureActivity.this, "请先拍照", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 修改相机的宽高为屏幕宽高的1/3
|
||||||
|
DisplayMetrics dm = new DisplayMetrics();
|
||||||
|
getWindowManager().getDefaultDisplay().getMetrics(dm);
|
||||||
|
FrameLayout.LayoutParams layoutParamsMap = (FrameLayout.LayoutParams) ivMap.getLayoutParams();//相机的宽高
|
||||||
|
layoutParamsMap.height = dm.heightPixels/3;
|
||||||
|
layoutParamsMap.width = dm.widthPixels/3;
|
||||||
|
ivMap.setLayoutParams(layoutParamsMap);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void message(String content, Boolean important) {
|
||||||
|
if (important) {
|
||||||
|
LOG.w(content);
|
||||||
|
Toast.makeText(this, content, Toast.LENGTH_SHORT).show();
|
||||||
|
} else {
|
||||||
|
LOG.i(content);
|
||||||
|
Toast.makeText(this, content, Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initData() {
|
protected void initData() {
|
||||||
super.initData();
|
super.initData();
|
||||||
|
camera.setMode(Mode.VIDEO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
case R.id.capuretVideo:
|
// case R.id.capuretVideo:
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
// DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
Calendar calendar = Calendar.getInstance();
|
// Calendar calendar = Calendar.getInstance();
|
||||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
// calendar.setTimeInMillis(System.currentTimeMillis());
|
||||||
String format = formatter.format(calendar.getTime());
|
// String format = formatter.format(calendar.getTime());
|
||||||
//文件
|
// //文件
|
||||||
File file = new File(Constant.PICTURE_FOLDER, format + ".mp4");
|
// File file = new File(Constant.PICTURE_FOLDER, format + ".mp4");
|
||||||
cameraView.takeVideo(file, 15000);
|
// cameraView.takeVideo(file, 15000);
|
||||||
|
// break;
|
||||||
|
case R.id.btn_stop_video:
|
||||||
|
if (timerTask!=null){
|
||||||
|
timerTask.cancel();
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.putExtra(Constant.INTENT_VIDEO_PATH, finalVideoPath);
|
||||||
|
setResult(0x101, intent);
|
||||||
|
}else {
|
||||||
|
Toast.makeText(this, "本段视频没有计时!", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
if (camera.isTakingVideo()) {
|
||||||
|
isFinishActivity = true;
|
||||||
|
camera.stopVideo();
|
||||||
|
} else {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case R.id.btn_switch:
|
||||||
|
btnSwich();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 开始采集
|
||||||
|
*/
|
||||||
|
private void startTakenVideo() {
|
||||||
|
if (camera.isTakingVideo()) {
|
||||||
|
Toast.makeText(this, "已经在拍摄中...", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||||
|
String formatVideoName = formatter.format(calendar.getTime());
|
||||||
|
//文件
|
||||||
|
File file = new File(Constant.PICTURE_FOLDER, formatVideoName + ".mp4");
|
||||||
|
if (file.exists()) {
|
||||||
|
try {
|
||||||
|
FileOutputStream fo = new FileOutputStream(file);
|
||||||
|
FileDescriptor fileDescriptor = fo.getFD();
|
||||||
|
camera.takeVideo(fileDescriptor);
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
camera.takeVideo(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void stopTakenVideo() {
|
||||||
|
if (camera.isTakingVideo()) {
|
||||||
|
camera.stopVideo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private Bitmap getBitMap(int resourceId) {
|
||||||
|
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), resourceId);
|
||||||
|
int width = bitmap.getWidth();
|
||||||
|
int height = bitmap.getHeight();
|
||||||
|
int newWidth = 55;
|
||||||
|
int newHeight = 55;
|
||||||
|
float widthScale = ((float) newWidth) / width;
|
||||||
|
float heightScale = ((float) newHeight) / height;
|
||||||
|
Matrix matrix = new Matrix();
|
||||||
|
matrix.postScale(widthScale, heightScale);
|
||||||
|
bitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix, true);
|
||||||
|
return bitmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置定位图标样式
|
||||||
|
*/
|
||||||
|
private void setLocMarkerStyle() {
|
||||||
|
tencentMap.setLocationSource(new MyTecentLocationSource(this));
|
||||||
|
tencentMap.setMyLocationEnabled(true);
|
||||||
|
|
||||||
|
locationStyle = new MyLocationStyle();
|
||||||
|
locationStyle = locationStyle.myLocationType(LOCATION_TYPE_LOCATION_ROTATE);
|
||||||
|
//创建图标
|
||||||
|
BitmapDescriptor bitmapDescriptor = BitmapDescriptorFactory.fromBitmap(getBitMap(location));
|
||||||
|
locationStyle.icon(bitmapDescriptor);
|
||||||
|
//设置定位圆形区域的边框宽度;
|
||||||
|
locationStyle.fillColor(getResources().getColor(android.R.color.transparent));
|
||||||
|
locationStyle.strokeWidth(1);
|
||||||
|
tencentMap.setMyLocationStyle(locationStyle);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void btnSwich() {
|
||||||
|
DisplayMetrics dm = new DisplayMetrics();
|
||||||
|
getWindowManager().getDefaultDisplay().getMetrics(dm);
|
||||||
|
System.out.println("width-display :" + dm.widthPixels);
|
||||||
|
System.out.println("heigth-display :" + dm.heightPixels);
|
||||||
|
FrameLayout.LayoutParams layoutParamsMap = (FrameLayout.LayoutParams) ivMap.getLayoutParams();//地图的宽高
|
||||||
|
int heightMap = ivMap.getMeasuredHeight();
|
||||||
|
int widthMap = ivMap.getMeasuredWidth();
|
||||||
|
FrameLayout.LayoutParams layoutParamsCamera = (FrameLayout.LayoutParams) camera.getLayoutParams();//相机的宽高
|
||||||
|
int heightCamera = camera.getMeasuredHeight();
|
||||||
|
int widthCamera = camera.getMeasuredWidth();
|
||||||
|
|
||||||
|
layerChange.removeAllViews();
|
||||||
|
if (widthMap > widthCamera) {
|
||||||
|
|
||||||
|
layoutParamsCamera.width = dm.widthPixels;
|
||||||
|
layoutParamsCamera.height = dm.heightPixels;
|
||||||
|
layoutParamsMap.height = heightCamera;
|
||||||
|
layoutParamsMap.width = widthCamera;
|
||||||
|
camera.setLayoutParams(layoutParamsCamera);
|
||||||
|
ivMap.setLayoutParams(layoutParamsMap);
|
||||||
|
layerChange.addView(camera);
|
||||||
|
layerChange.addView(ivMap);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
layoutParamsMap.height = dm.heightPixels;
|
||||||
|
layoutParamsMap.width = dm.widthPixels;
|
||||||
|
layoutParamsCamera.height = heightMap;
|
||||||
|
layoutParamsCamera.width = widthMap;
|
||||||
|
camera.setLayoutParams(layoutParamsCamera);
|
||||||
|
ivMap.setLayoutParams(layoutParamsMap);
|
||||||
|
layerChange.addView(ivMap);
|
||||||
|
layerChange.addView(camera);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
cameraView.open();
|
camera.open();
|
||||||
// ivMap.onResume();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
cameraView.close();
|
camera.close();
|
||||||
// ivMap.onPause();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
cameraView.destroy();
|
stopTakenVideo();
|
||||||
// ivMap.onDestroy();
|
camera.destroy();
|
||||||
|
timer.cancel();
|
||||||
|
if (EventBus.getDefault().isRegistered(this)) {
|
||||||
|
EventBus.getDefault().unregister(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
public void onEventMessageMainThread(Message msg) {
|
||||||
|
switch (msg.what) {
|
||||||
|
case Constant.EVENT_WHAT_LOCATION_CHANGE: // 用户位置更新
|
||||||
|
if (tencentMap!=null) {
|
||||||
|
CameraUpdate cameraSigma =
|
||||||
|
CameraUpdateFactory.newCameraPosition(new CameraPosition(
|
||||||
|
new LatLng(Constant.currentLocation.getLatitude(),Constant.currentLocation.getLongitude()), //中心点坐标,地图目标经纬度
|
||||||
|
16, //目标缩放级别
|
||||||
|
0, //目标倾斜角
|
||||||
|
0)); //目标旋转角 0~360° (正北方为0)
|
||||||
|
tencentMap.animateCamera(cameraSigma);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 记录视频拍摄的时间及经纬度
|
||||||
|
*/
|
||||||
|
private class CsvTimerTask extends TimerTask {
|
||||||
|
private File csvFile;
|
||||||
|
private long currentVideoTime; // 记录当前的视频时间
|
||||||
|
|
||||||
|
public CsvTimerTask(File csvFile) {
|
||||||
|
this.csvFile = csvFile;
|
||||||
|
if (!csvFile.exists()) {
|
||||||
|
csvFile.getParentFile().mkdirs();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrentVideoTime(long currentVideoTime) {
|
||||||
|
this.currentVideoTime = currentVideoTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
// 记录当前时间、视频时间、以及当前经纬度信息
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
sb.append(formatter.format(new Date())); // 记录当前时间
|
||||||
|
sb.append(",");
|
||||||
|
sb.append(currentVideoTime) ;// 记录视频时间
|
||||||
|
sb.append(",");
|
||||||
|
sb.append(Constant.currentLocation.getLatitude());
|
||||||
|
sb.append(",");
|
||||||
|
sb.append(Constant.currentLocation.getLongitude());
|
||||||
|
sb.append("\r\n");
|
||||||
|
FileUtils.writeFile(csvFile.getAbsolutePath(), sb.toString(), true);
|
||||||
|
currentVideoTime = currentVideoTime+period; //
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,6 +1,8 @@
|
|||||||
package com.navinfo.outdoor.activity;
|
package com.navinfo.outdoor.activity;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@ -41,6 +43,8 @@ import java.util.List;
|
|||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import static com.tencent.mapsdk.internal.aaa.getContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户资料
|
* 用户资料
|
||||||
*/
|
*/
|
||||||
@ -59,6 +63,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
|||||||
private String userphone;
|
private String userphone;
|
||||||
private String usermailbox;
|
private String usermailbox;
|
||||||
private String region_id;
|
private String region_id;
|
||||||
|
private SharedPreferences navInfo;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -76,6 +81,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
|||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
initJsonData();
|
initJsonData();
|
||||||
|
navInfo = getSharedPreferences("navInfo", Context.MODE_PRIVATE);
|
||||||
ivUser = findViewById(R.id.iv_user);
|
ivUser = findViewById(R.id.iv_user);
|
||||||
ivUser.setOnClickListener(this::onClick);
|
ivUser.setOnClickListener(this::onClick);
|
||||||
btnAttestation = findViewById(R.id.btn_attestation);
|
btnAttestation = findViewById(R.id.btn_attestation);
|
||||||
@ -103,6 +109,11 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
|||||||
finish();
|
finish();
|
||||||
break;
|
break;
|
||||||
case R.id.btn_gathering:
|
case R.id.btn_gathering:
|
||||||
|
String attestationName = navInfo.getString("attestationName", null);
|
||||||
|
if (attestationName == null || attestationName.equals("")) {
|
||||||
|
Toast.makeText(this, "请先实名认证", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
Intent gatheringIntent = new Intent(this, FragmentManagement.class);
|
Intent gatheringIntent = new Intent(this, FragmentManagement.class);
|
||||||
gatheringIntent.putExtra("tag", 24);
|
gatheringIntent.putExtra("tag", 24);
|
||||||
startActivity(gatheringIntent);
|
startActivity(gatheringIntent);
|
||||||
@ -153,6 +164,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
netWork();
|
netWork();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -173,11 +185,12 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
|||||||
public void onSuccess(Response<UserBean> response) {
|
public void onSuccess(Response<UserBean> response) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
|
Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
|
||||||
|
|
||||||
if (response.body().equals("0")) {
|
if (response.body().equals("0")) {
|
||||||
MessageDialog.show(UserActivity.this, "是否保存", "取消", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
MessageDialog.show(UserActivity.this, "是否保存", "取消", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
// Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -185,7 +198,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
|||||||
MessageDialog.show(UserActivity.this, "是否保存", "确定", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
MessageDialog.show(UserActivity.this, "是否保存", "确定", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
// Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "点击了取消", Toast.LENGTH_SHORT).show();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -22,9 +22,10 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Vector;
|
||||||
|
|
||||||
public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.ViewHolder> {
|
public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.ViewHolder> {
|
||||||
private List<PoiEntity> allRoad = new ArrayList<>();
|
private Vector<PoiEntity> allRoad = new Vector<>();
|
||||||
private Context context;
|
private Context context;
|
||||||
|
|
||||||
public StaySubmitAdapter(Context context) {
|
public StaySubmitAdapter(Context context) {
|
||||||
@ -55,6 +56,7 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
|
|||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
synchronized (allRoad) {
|
||||||
Iterator iterator = allRoad.iterator();
|
Iterator iterator = allRoad.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
PoiEntity poiEntity = (PoiEntity) iterator.next();
|
PoiEntity poiEntity = (PoiEntity) iterator.next();
|
||||||
@ -64,6 +66,7 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
handler.sendEmptyMessage(0x105);
|
handler.sendEmptyMessage(0x105);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
@ -84,10 +87,11 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
|
|||||||
holder.tvDay.setText(poiEntity.getCreateTime());
|
holder.tvDay.setText(poiEntity.getCreateTime());
|
||||||
//获取checkBox点击的记录
|
//获取checkBox点击的记录
|
||||||
holder.cbUnSubmit.setChecked(allRoad.get(position).isChecked());
|
holder.cbUnSubmit.setChecked(allRoad.get(position).isChecked());
|
||||||
holder.cbUnSubmit.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
holder.cbUnSubmit.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onClick(View v) {
|
||||||
allRoad.get(position).setChecked(isChecked);
|
holder.cbUnSubmit.setChecked(!poiEntity.isChecked());
|
||||||
|
poiEntity.setChecked(!poiEntity.isChecked());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (poiEntity.getIsLocalData() == 1){
|
if (poiEntity.getIsLocalData() == 1){
|
||||||
|
@ -66,7 +66,6 @@ public class Constant {
|
|||||||
public static final int TREASURE_CHECKED_WORD = 40;//poi 对地图页面marker 的一个展示 确定
|
public static final int TREASURE_CHECKED_WORD = 40;//poi 对地图页面marker 的一个展示 确定
|
||||||
public static final int CAPACITY_EVALUATION_PAGE = 1;//能力测评的页数
|
public static final int CAPACITY_EVALUATION_PAGE = 1;//能力测评的页数
|
||||||
public static final int POI_WORD = 2;//地图页面marker 的经纬都回传
|
public static final int POI_WORD = 2;//地图页面marker 的经纬都回传
|
||||||
public static final int FILTER_LIST = 4;//筛选列表所有数据地图显示
|
|
||||||
public static final int FILTER_LIST_ITEM = 5;//点击筛选的item
|
public static final int FILTER_LIST_ITEM = 5;//点击筛选的item
|
||||||
public static final int GATHER_GET = 6;//点击开始采集
|
public static final int GATHER_GET = 6;//点击开始采集
|
||||||
public static final int TREASURE_GATHER_GET_WORD = 7;//领取采集页面其他marker 的回传
|
public static final int TREASURE_GATHER_GET_WORD = 7;//领取采集页面其他marker 的回传
|
||||||
@ -103,8 +102,8 @@ public class Constant {
|
|||||||
public static final int EVENT_STAY_REFRESH = 44; // 刷新记录页面
|
public static final int EVENT_STAY_REFRESH = 44; // 刷新记录页面
|
||||||
|
|
||||||
public static final int EVENT_WORK_HOME = 45; //切换到寻宝
|
public static final int EVENT_WORK_HOME = 45; //切换到寻宝
|
||||||
public static final int EVENT_WORK_UNPOLYGON = 46; //面妆任务点立即采集
|
public static final int PICTURE_VIDEO_WORD = 48; //视频页面崩溃后发给poi录像和道路
|
||||||
public static String USER_ATTESTATION_NAME; //实名认证姓名 银行卡
|
|
||||||
public static int NUMBER = 200; //任务个数
|
public static int NUMBER = 200; //任务个数
|
||||||
public static int LIMIT_TTPE = -1; //权限类型,普通任务-0,专属任务-1
|
public static int LIMIT_TTPE = -1; //权限类型,普通任务-0,专属任务-1
|
||||||
public static int TASK_TYPE = -1; // 任务类型
|
public static int TASK_TYPE = -1; // 任务类型
|
||||||
@ -127,6 +126,7 @@ public class Constant {
|
|||||||
public static MapView treasureMap;
|
public static MapView treasureMap;
|
||||||
|
|
||||||
public static final String INTENT_VIDEO_PATH = "INTENT_VIDEO_PATH"; // 拍照界面指定的视频文件保存位置
|
public static final String INTENT_VIDEO_PATH = "INTENT_VIDEO_PATH"; // 拍照界面指定的视频文件保存位置
|
||||||
|
public static final String INTENT_VIDEO_ORATATION = "INTENT_VIDEO_ORATATION"; // 视频拍摄时屏幕方向 0-强制横屏 其他-任意
|
||||||
|
|
||||||
public static boolean IS_FILTER_LIST_ITEM =true;//poi页面的查重
|
public static boolean IS_FILTER_LIST_ITEM =true;//poi页面的查重
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.navinfo.outdoor.api;
|
package com.navinfo.outdoor.api;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
|
import android.os.StrictMode;
|
||||||
|
|
||||||
import com.lzy.okgo.OkGo;
|
import com.lzy.okgo.OkGo;
|
||||||
import com.lzy.okgo.cache.CacheEntity;
|
import com.lzy.okgo.cache.CacheEntity;
|
||||||
@ -79,11 +80,12 @@ public class UserApplication extends Application {
|
|||||||
//builder.cookieJar(new CookieJarImpl(new MemoryCookieStore()));
|
//builder.cookieJar(new CookieJarImpl(new MemoryCookieStore()));
|
||||||
//超时时间设置,默认60秒
|
//超时时间设置,默认60秒
|
||||||
//全局的读取超时时间
|
//全局的读取超时时间
|
||||||
builder.readTimeout(50000, TimeUnit.MILLISECONDS);
|
|
||||||
|
builder.readTimeout(0, TimeUnit.MILLISECONDS);
|
||||||
//全局的写入超时时间
|
//全局的写入超时时间
|
||||||
builder.writeTimeout(50000, TimeUnit.MILLISECONDS);
|
builder.writeTimeout(0, TimeUnit.MILLISECONDS);
|
||||||
//全局的连接超时时间
|
//全局的连接超时时间
|
||||||
builder.connectTimeout(50000, TimeUnit.MILLISECONDS);
|
builder.connectTimeout(0, TimeUnit.MILLISECONDS);
|
||||||
OkGo.getInstance().init(this)
|
OkGo.getInstance().init(this)
|
||||||
.setOkHttpClient(builder.build())
|
.setOkHttpClient(builder.build())
|
||||||
//全局统一缓存模式,默认不使用缓存,可以不传
|
//全局统一缓存模式,默认不使用缓存,可以不传
|
||||||
@ -95,6 +97,10 @@ public class UserApplication extends Application {
|
|||||||
//全局统一超时重连次数,默认为三次,那么最差的情况会请求4次(一次原始请求,三次重连请求),不需要可以设置为0;
|
//全局统一超时重连次数,默认为三次,那么最差的情况会请求4次(一次原始请求,三次重连请求),不需要可以设置为0;
|
||||||
.setRetryCount(0);
|
.setRetryCount(0);
|
||||||
|
|
||||||
|
StrictMode.VmPolicy.Builder picBuilder = new StrictMode.VmPolicy.Builder();
|
||||||
|
StrictMode.setVmPolicy(picBuilder.build());
|
||||||
|
picBuilder.detectFileUriExposure();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,10 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||||||
import com.navinfo.outdoor.R;
|
import com.navinfo.outdoor.R;
|
||||||
import com.navinfo.outdoor.api.UserApplication;
|
import com.navinfo.outdoor.api.UserApplication;
|
||||||
import com.gyf.immersionbar.ImmersionBar;
|
import com.gyf.immersionbar.ImmersionBar;
|
||||||
|
import com.navinfo.outdoor.util.NetWorkUtils;
|
||||||
|
|
||||||
|
import java.util.Timer;
|
||||||
|
import java.util.TimerTask;
|
||||||
|
|
||||||
|
|
||||||
public abstract class BaseActivity extends AppCompatActivity {
|
public abstract class BaseActivity extends AppCompatActivity {
|
||||||
@ -64,6 +68,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
protected void initMVP() {
|
protected void initMVP() {
|
||||||
}
|
}
|
||||||
public void showLoadingDialog() {
|
public void showLoadingDialog() {
|
||||||
|
if (NetWorkUtils.iConnected(this)) { // 当前网络可用
|
||||||
alertDialog = new AlertDialog.Builder(this).create();
|
alertDialog = new AlertDialog.Builder(this).create();
|
||||||
alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable());
|
alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable());
|
||||||
alertDialog.setCancelable(false);
|
alertDialog.setCancelable(false);
|
||||||
@ -71,12 +76,56 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
if (keyCode == KeyEvent.KEYCODE_SEARCH || keyCode == KeyEvent.KEYCODE_BACK)
|
if (keyCode == KeyEvent.KEYCODE_SEARCH || keyCode == KeyEvent.KEYCODE_BACK)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
});
|
});
|
||||||
//loading样式
|
//loading样式
|
||||||
View view = LayoutInflater.from(this).inflate(R.layout.loading, null);
|
View view = LayoutInflater.from(this).inflate(R.layout.loading, null);
|
||||||
alertDialog.setView(view);
|
alertDialog.setView(view);
|
||||||
alertDialog.setCanceledOnTouchOutside(false);
|
alertDialog.setCanceledOnTouchOutside(false);
|
||||||
alertDialog.show();
|
alertDialog.show();
|
||||||
|
initTimer();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(this, "网络不可用", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void showFileLoadingDialog() {
|
||||||
|
if (NetWorkUtils.iConnected(this)) { // 当前网络可用
|
||||||
|
alertDialog = new AlertDialog.Builder(this).create();
|
||||||
|
alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable());
|
||||||
|
alertDialog.setCancelable(false);
|
||||||
|
alertDialog.setOnKeyListener((dialog, keyCode, event) -> {
|
||||||
|
if (keyCode == KeyEvent.KEYCODE_SEARCH || keyCode == KeyEvent.KEYCODE_BACK)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
|
||||||
|
});
|
||||||
|
//loading样式
|
||||||
|
View view = LayoutInflater.from(this).inflate(R.layout.loading, null);
|
||||||
|
alertDialog.setView(view);
|
||||||
|
alertDialog.setCanceledOnTouchOutside(false);
|
||||||
|
alertDialog.show();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(this, "网络不可用", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initTimer() {
|
||||||
|
Timer timer = new Timer(true);
|
||||||
|
TimerTask timerTask = new TimerTask() {
|
||||||
|
int countTime = 20;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (countTime > 0) {
|
||||||
|
countTime--;
|
||||||
|
}
|
||||||
|
if (countTime == 1) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
timer.schedule(timerTask, 1000, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLoadingDialogText(String s) {
|
public void setLoadingDialogText(String s) {
|
||||||
|
@ -9,11 +9,14 @@ import android.util.Log;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.CheckResult;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.navinfo.outdoor.R;
|
import com.navinfo.outdoor.R;
|
||||||
import com.navinfo.outdoor.api.Constant;
|
import com.navinfo.outdoor.api.Constant;
|
||||||
|
import com.navinfo.outdoor.room.ChargingPileEntity;
|
||||||
|
import com.navinfo.outdoor.room.PoiEntity;
|
||||||
import com.navinfo.outdoor.util.FragmentBackHandler;
|
import com.navinfo.outdoor.util.FragmentBackHandler;
|
||||||
import com.navinfo.outdoor.util.GPSUtils;
|
import com.navinfo.outdoor.util.GPSUtils;
|
||||||
|
|
||||||
@ -103,4 +106,28 @@ public abstract class BaseDrawerFragment extends BaseFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected abstract PoiEntity initPoiEntityByUI( PoiEntity entity);
|
||||||
|
protected abstract PoiCheckResult checkPoiEntity(PoiEntity entity);
|
||||||
|
protected abstract ChargingPileEntity initChargingPileEntityByUI( ChargingPileEntity entity);
|
||||||
|
protected abstract PoiCheckResult checkChargingPileEntity(ChargingPileEntity entity);
|
||||||
|
public class PoiCheckResult {
|
||||||
|
private int code; // 0 检查成功,1:失败
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
public int getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(int code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsg() {
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMsg(String msg) {
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,8 @@ import android.graphics.Color;
|
|||||||
import android.graphics.drawable.ColorDrawable;
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Message;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -27,6 +29,9 @@ import com.navinfo.outdoor.util.BackHandlerHelper;
|
|||||||
import com.navinfo.outdoor.util.FragmentBackHandler;
|
import com.navinfo.outdoor.util.FragmentBackHandler;
|
||||||
import com.navinfo.outdoor.util.NetWorkUtils;
|
import com.navinfo.outdoor.util.NetWorkUtils;
|
||||||
|
|
||||||
|
import java.util.Timer;
|
||||||
|
import java.util.TimerTask;
|
||||||
|
|
||||||
|
|
||||||
public abstract class BaseFragment extends Fragment implements FragmentBackHandler {
|
public abstract class BaseFragment extends Fragment implements FragmentBackHandler {
|
||||||
|
|
||||||
@ -57,8 +62,7 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initEvent() {
|
public void initEvent() {}
|
||||||
}
|
|
||||||
|
|
||||||
protected <T extends View> T findViewById(@IdRes int id) {
|
protected <T extends View> T findViewById(@IdRes int id) {
|
||||||
return getView().findViewById(id);
|
return getView().findViewById(id);
|
||||||
@ -81,7 +85,27 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
|
|||||||
//loading样式
|
//loading样式
|
||||||
View view = LayoutInflater.from(getContext()).inflate(R.layout.loading, null);
|
View view = LayoutInflater.from(getContext()).inflate(R.layout.loading, null);
|
||||||
alertDialog.setView(view);
|
alertDialog.setView(view);
|
||||||
|
alertDialog.setCanceledOnTouchOutside(false);
|
||||||
|
alertDialog.show();
|
||||||
|
initTimer();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(getActivity(), "网络不可用", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void showFileLoadingDialog() {
|
||||||
|
if (NetWorkUtils.iConnected(getContext())) { // 当前网络可用
|
||||||
|
alertDialog = new AlertDialog.Builder(getActivity()).create();
|
||||||
|
alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable());
|
||||||
|
alertDialog.setCancelable(false);
|
||||||
|
alertDialog.setOnKeyListener((dialog, keyCode, event) -> {
|
||||||
|
if (keyCode == KeyEvent.KEYCODE_SEARCH || keyCode == KeyEvent.KEYCODE_BACK)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
|
||||||
|
});
|
||||||
|
//loading样式
|
||||||
|
View view = LayoutInflater.from(getContext()).inflate(R.layout.loading, null);
|
||||||
|
alertDialog.setView(view);
|
||||||
alertDialog.setCanceledOnTouchOutside(false);
|
alertDialog.setCanceledOnTouchOutside(false);
|
||||||
alertDialog.show();
|
alertDialog.show();
|
||||||
} else {
|
} else {
|
||||||
@ -89,6 +113,26 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initTimer() {
|
||||||
|
Timer timer = new Timer(true);
|
||||||
|
TimerTask timerTask = new TimerTask() {
|
||||||
|
int countTime = 20;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (countTime > 0) {
|
||||||
|
countTime--;
|
||||||
|
}
|
||||||
|
if (countTime == 1) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
timer.schedule(timerTask, 1000, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setLoadingDialogText(String s) {
|
public void setLoadingDialogText(String s) {
|
||||||
//给loading 添加文字
|
//给loading 添加文字
|
||||||
TextView view = alertDialog.findViewById(R.id.progressBar_tx);
|
TextView view = alertDialog.findViewById(R.id.progressBar_tx);
|
||||||
@ -108,18 +152,14 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void initMvp() {
|
protected void initMvp() {}
|
||||||
}
|
|
||||||
|
|
||||||
protected void initData() {
|
protected void initData() {}
|
||||||
}
|
|
||||||
|
|
||||||
protected void initView() {
|
protected void initView() {}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package com.navinfo.outdoor.bean;
|
|||||||
|
|
||||||
public class GetPriceBean {
|
public class GetPriceBean {
|
||||||
|
|
||||||
|
|
||||||
private Integer code;
|
private Integer code;
|
||||||
private String message;
|
private String message;
|
||||||
private BodyBean body;
|
private BodyBean body;
|
||||||
@ -38,6 +39,8 @@ public class GetPriceBean {
|
|||||||
private Double rewardPrice;
|
private Double rewardPrice;
|
||||||
private Double poiPushPrice;
|
private Double poiPushPrice;
|
||||||
private Double poiNonepushPrice;
|
private Double poiNonepushPrice;
|
||||||
|
private Double poivideoPushPrice;
|
||||||
|
private Double poivideoNonepushPrice;
|
||||||
private Double roadPushPrice;
|
private Double roadPushPrice;
|
||||||
private Double roadNonepushPrice;
|
private Double roadNonepushPrice;
|
||||||
private Double csPushPrice;
|
private Double csPushPrice;
|
||||||
@ -102,6 +105,22 @@ public class GetPriceBean {
|
|||||||
this.poiNonepushPrice = poiNonepushPrice;
|
this.poiNonepushPrice = poiNonepushPrice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Double getPoivideoPushPrice() {
|
||||||
|
return poivideoPushPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPoivideoPushPrice(Double poivideoPushPrice) {
|
||||||
|
this.poivideoPushPrice = poivideoPushPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getPoivideoNonepushPrice() {
|
||||||
|
return poivideoNonepushPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPoivideoNonepushPrice(Double poivideoNonepushPrice) {
|
||||||
|
this.poivideoNonepushPrice = poivideoNonepushPrice;
|
||||||
|
}
|
||||||
|
|
||||||
public Double getRoadPushPrice() {
|
public Double getRoadPushPrice() {
|
||||||
return roadPushPrice;
|
return roadPushPrice;
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,10 @@ import android.content.Intent;
|
|||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.provider.MediaStore;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -51,6 +53,7 @@ import com.navinfo.outdoor.room.PoiEntity;
|
|||||||
import com.navinfo.outdoor.util.Geohash;
|
import com.navinfo.outdoor.util.Geohash;
|
||||||
import com.navinfo.outdoor.util.GeometryTools;
|
import com.navinfo.outdoor.util.GeometryTools;
|
||||||
import com.navinfo.outdoor.util.PhotoPathUtil;
|
import com.navinfo.outdoor.util.PhotoPathUtil;
|
||||||
|
import com.navinfo.outdoor.util.PhotoUtils;
|
||||||
import com.navinfo.outdoor.util.PictureUtil;
|
import com.navinfo.outdoor.util.PictureUtil;
|
||||||
import com.navinfo.outdoor.util.ToastUtil;
|
import com.navinfo.outdoor.util.ToastUtil;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||||
@ -78,16 +81,17 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
private CheckBox checkBoxLife, checkBoxRight;
|
private CheckBox checkBoxLife, checkBoxRight;
|
||||||
private Spinner spinnerType, spinnerScutcheon, spinnerStake;
|
private Spinner spinnerType, spinnerScutcheon, spinnerStake;
|
||||||
String[] type = new String[]{"地上五层", "地上四层", "地上三层", "地上二层", "地上一层", "地下一层", "地下二层", "地下三层", "地下四层", "地下五层"};
|
String[] type = new String[]{"地上五层", "地上四层", "地上三层", "地上二层", "地上一层", "地下一层", "地下二层", "地下三层", "地下四层", "地下五层"};
|
||||||
String[] scutcheon = new String[]{"存在","不存在"};
|
String[] scutcheon = new String[]{"存在", "不存在"};
|
||||||
String[] stake = new String[]{"可以使用", "不可使用", "维修中", "建设中", "规划中"};
|
String[] stake = new String[]{"可以使用", "不可使用", "维修中", "建设中", "规划中"};
|
||||||
private ArrayAdapter<String> adapterType, adapterScutcheon, adapterStake;
|
private ArrayAdapter<String> adapterType, adapterScutcheon, adapterStake;
|
||||||
private RelativeLayout rlPanorama, rlCoding, rlEquipment, rlFacility, rlUsable, rlAvailable, rlParking, rlNumber, rlScutcheon, rlDevice;
|
private RelativeLayout rlPanorama, rlCoding, rlEquipment, rlFacility, rlUsable, rlAvailable, rlParking, rlNumber, rlScutcheon, rlDevice;
|
||||||
private ImageView ivPanorama, ivCoding, ivEquipment, ivFacility, ivUsable, ivAvailable, ivParking, ivNumber, ivScutcheon, ivDevice;
|
private ImageView ivPanorama, ivCoding, ivEquipment, ivFacility, ivUsable, ivAvailable, ivParking, ivNumber, ivScutcheon, ivDevice;
|
||||||
|
private TextView tvPanorama, tvCoding, tvEquipment, tvFacility, tvUsable, tvAvailable, tvParking, tvNumber, tvScutcheon, tvDevice;
|
||||||
private ChargingPileDao chargingPileDao;
|
private ChargingPileDao chargingPileDao;
|
||||||
private int cp_floor = 1;
|
private int cp_floor = 1;
|
||||||
private int sign_exist = 0;
|
private int sign_exist = 0;
|
||||||
private int cp_availableState = 0;
|
private int cp_availableState = 0;
|
||||||
private String buffer1="",buffer2="",buffer3="",buffer4="",buffer5="";
|
private String buffer1 = "", buffer2 = "", buffer3 = "", buffer4 = "", buffer5 = "";
|
||||||
private StringBuffer openType = new StringBuffer();
|
private StringBuffer openType = new StringBuffer();
|
||||||
private CheckBox checkButton1, checkButton2, checkButton3, checkButton4, checkButton5;
|
private CheckBox checkButton1, checkButton2, checkButton3, checkButton4, checkButton5;
|
||||||
private String pid;
|
private String pid;
|
||||||
@ -108,6 +112,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
|
|
||||||
private ArrayList<File> phoneLists;
|
private ArrayList<File> phoneLists;
|
||||||
private PoiEntity poiEntity;
|
private PoiEntity poiEntity;
|
||||||
|
private File file;
|
||||||
|
|
||||||
public static ChargingPileFragment newInstance(Bundle bundle) {
|
public static ChargingPileFragment newInstance(Bundle bundle) {
|
||||||
ChargingPileFragment fragment = new ChargingPileFragment();
|
ChargingPileFragment fragment = new ChargingPileFragment();
|
||||||
@ -162,14 +167,14 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
checkBoxLife.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
checkBoxLife.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
if (isChecked){
|
if (isChecked) {
|
||||||
checkBoxLife.setText("保存");
|
checkBoxLife.setText("保存");
|
||||||
checkBoxLife.setTextColor(Color.WHITE);
|
checkBoxLife.setTextColor(Color.WHITE);
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.MAIN_CHARGING_PILE;
|
obtain.what = Constant.MAIN_CHARGING_PILE;
|
||||||
obtain.obj = latLng;
|
obtain.obj = latLng;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
}else {
|
} else {
|
||||||
checkBoxLife.setText("编辑");
|
checkBoxLife.setText("编辑");
|
||||||
checkBoxLife.setTextColor(Color.BLACK);
|
checkBoxLife.setTextColor(Color.BLACK);
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
@ -186,11 +191,11 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
buffer1="1,";
|
buffer1 = "1,";
|
||||||
buffer2="";
|
buffer2 = "";
|
||||||
buffer3="";
|
buffer3 = "";
|
||||||
buffer4="";
|
buffer4 = "";
|
||||||
buffer5="";
|
buffer5 = "";
|
||||||
checkButton2.setChecked(false);
|
checkButton2.setChecked(false);
|
||||||
checkButton3.setChecked(false);
|
checkButton3.setChecked(false);
|
||||||
checkButton4.setChecked(false);
|
checkButton4.setChecked(false);
|
||||||
@ -203,10 +208,10 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
buffer2="2,";
|
buffer2 = "2,";
|
||||||
checkButton1.setChecked(false);
|
checkButton1.setChecked(false);
|
||||||
}else {
|
} else {
|
||||||
buffer2="";
|
buffer2 = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -215,10 +220,10 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
buffer3="3,";
|
buffer3 = "3,";
|
||||||
checkButton1.setChecked(false);
|
checkButton1.setChecked(false);
|
||||||
}else {
|
} else {
|
||||||
buffer3="";
|
buffer3 = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -227,10 +232,10 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
buffer4="4,";
|
buffer4 = "4,";
|
||||||
checkButton1.setChecked(false);
|
checkButton1.setChecked(false);
|
||||||
}else {
|
} else {
|
||||||
buffer4="";
|
buffer4 = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -239,10 +244,10 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
buffer5="5,";
|
buffer5 = "5,";
|
||||||
checkButton1.setChecked(false);
|
checkButton1.setChecked(false);
|
||||||
}else {
|
} else {
|
||||||
buffer5="";
|
buffer5 = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -358,33 +363,43 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
rlPanorama = findViewById(R.id.rl_panorama);
|
rlPanorama = findViewById(R.id.rl_panorama);
|
||||||
rlPanorama.setOnClickListener(this::onClick);
|
rlPanorama.setOnClickListener(this::onClick);
|
||||||
ivPanorama = findViewById(R.id.iv_panorama);
|
ivPanorama = findViewById(R.id.iv_panorama);
|
||||||
|
tvPanorama = findViewById(R.id.tv_panorama);
|
||||||
rlCoding = findViewById(R.id.rl_coding);
|
rlCoding = findViewById(R.id.rl_coding);
|
||||||
rlCoding.setOnClickListener(this::onClick);
|
rlCoding.setOnClickListener(this::onClick);
|
||||||
ivCoding = findViewById(R.id.iv_coding);
|
ivCoding = findViewById(R.id.iv_coding);
|
||||||
|
tvCoding = findViewById(R.id.tv_coding);
|
||||||
rlEquipment = findViewById(R.id.rl_equipment);
|
rlEquipment = findViewById(R.id.rl_equipment);
|
||||||
rlEquipment.setOnClickListener(this::onClick);
|
rlEquipment.setOnClickListener(this::onClick);
|
||||||
ivEquipment = findViewById(R.id.iv_equipment);
|
ivEquipment = findViewById(R.id.iv_equipment);
|
||||||
|
tvEquipment = findViewById(R.id.tv_equipment);
|
||||||
rlFacility = findViewById(R.id.rl_facility);
|
rlFacility = findViewById(R.id.rl_facility);
|
||||||
rlFacility.setOnClickListener(this::onClick);
|
rlFacility.setOnClickListener(this::onClick);
|
||||||
ivFacility = findViewById(R.id.iv_facility);
|
ivFacility = findViewById(R.id.iv_facility);
|
||||||
|
tvFacility = findViewById(R.id.tv_facility);
|
||||||
rlUsable = findViewById(R.id.rl_usable);
|
rlUsable = findViewById(R.id.rl_usable);
|
||||||
rlUsable.setOnClickListener(this::onClick);
|
rlUsable.setOnClickListener(this::onClick);
|
||||||
ivUsable = findViewById(R.id.iv_usable);
|
ivUsable = findViewById(R.id.iv_usable);
|
||||||
|
tvUsable = findViewById(R.id.tv_usable);
|
||||||
rlAvailable = findViewById(R.id.rl_available);
|
rlAvailable = findViewById(R.id.rl_available);
|
||||||
rlAvailable.setOnClickListener(this::onClick);
|
rlAvailable.setOnClickListener(this::onClick);
|
||||||
ivAvailable = findViewById(R.id.iv_available);
|
ivAvailable = findViewById(R.id.iv_available);
|
||||||
|
tvAvailable = findViewById(R.id.tv_available);
|
||||||
rlParking = findViewById(R.id.rl_parking);
|
rlParking = findViewById(R.id.rl_parking);
|
||||||
rlParking.setOnClickListener(this::onClick);
|
rlParking.setOnClickListener(this::onClick);
|
||||||
ivParking = findViewById(R.id.iv_parking);
|
ivParking = findViewById(R.id.iv_parking);
|
||||||
|
tvParking = findViewById(R.id.tv_parking);
|
||||||
rlNumber = findViewById(R.id.rl_number);
|
rlNumber = findViewById(R.id.rl_number);
|
||||||
rlNumber.setOnClickListener(this::onClick);
|
rlNumber.setOnClickListener(this::onClick);
|
||||||
ivNumber = findViewById(R.id.iv_number);
|
ivNumber = findViewById(R.id.iv_number);
|
||||||
|
tvNumber = findViewById(R.id.tv_number);
|
||||||
rlScutcheon = findViewById(R.id.rl_scutcheon);
|
rlScutcheon = findViewById(R.id.rl_scutcheon);
|
||||||
rlScutcheon.setOnClickListener(this::onClick);
|
rlScutcheon.setOnClickListener(this::onClick);
|
||||||
ivScutcheon = findViewById(R.id.iv_scutcheon);
|
ivScutcheon = findViewById(R.id.iv_scutcheon);
|
||||||
|
tvScutcheon = findViewById(R.id.tv_scutcheon);
|
||||||
rlDevice = findViewById(R.id.rl_device);
|
rlDevice = findViewById(R.id.rl_device);
|
||||||
rlDevice.setOnClickListener(this::onClick);
|
rlDevice.setOnClickListener(this::onClick);
|
||||||
ivDevice = findViewById(R.id.iv_device);
|
ivDevice = findViewById(R.id.iv_device);
|
||||||
|
tvDevice = findViewById(R.id.tv_device);
|
||||||
editDescribe = findViewById(R.id.edit_describe);
|
editDescribe = findViewById(R.id.edit_describe);
|
||||||
btnSaveLocal = findViewById(R.id.btn_save_local);
|
btnSaveLocal = findViewById(R.id.btn_save_local);
|
||||||
btnSaveLocal.setOnClickListener(this::onClick);
|
btnSaveLocal.setOnClickListener(this::onClick);
|
||||||
@ -540,17 +555,13 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
|
|
||||||
private void initShowPileSharePre() {
|
private void initShowPileSharePre() {
|
||||||
station = getArguments().getString("station");
|
station = getArguments().getString("station");
|
||||||
if (station!=null){
|
if (station != null) {
|
||||||
poiEntity = new Gson().fromJson(station, PoiEntity.class);
|
poiEntity = new Gson().fromJson(station, PoiEntity.class);
|
||||||
pid = poiEntity.getId();
|
pid = poiEntity.getId();
|
||||||
taskId = poiEntity.getTaskId();
|
taskId = poiEntity.getTaskId();
|
||||||
String x = poiEntity.getX();
|
|
||||||
String y = poiEntity.getY();
|
|
||||||
if (x != null && y != null) {
|
|
||||||
latLng = new LatLng();
|
latLng = new LatLng();
|
||||||
latLng.setLatitude(Double.parseDouble(y));
|
latLng.setLatitude(Constant.currentLocation.getLatitude());
|
||||||
latLng.setLongitude(Double.parseDouble(x));
|
latLng.setLongitude(Constant.currentLocation.getLongitude());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// 添加信息:
|
// 添加信息:
|
||||||
ChargingPileEntity chargingPileEntity = (ChargingPileEntity) getArguments().getSerializable("chargingPileEntity");
|
ChargingPileEntity chargingPileEntity = (ChargingPileEntity) getArguments().getSerializable("chargingPileEntity");
|
||||||
@ -559,12 +570,16 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
if (name != null) {
|
if (name != null) {
|
||||||
tvNameContent.setText(name + "");
|
tvNameContent.setText(name + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
String p = chargingPileEntity.getP();
|
String p = chargingPileEntity.getP();
|
||||||
|
|
||||||
if (p != null) {
|
if (p != null) {
|
||||||
latLng = GeometryTools.createLatLng(p);
|
// 解密geo
|
||||||
|
String decodeGeometry = Geohash.getInstance().decode(p);
|
||||||
|
latLng = GeometryTools.createLatLng(decodeGeometry);
|
||||||
}
|
}
|
||||||
String memo = chargingPileEntity.getMemo();
|
String memo = chargingPileEntity.getMemo();
|
||||||
if (memo != null&&!memo.equals("")) {
|
if (memo != null && !memo.equals("")) {
|
||||||
editDescribe.setText(memo);
|
editDescribe.setText(memo);
|
||||||
}
|
}
|
||||||
String fid = chargingPileEntity.getFid();
|
String fid = chargingPileEntity.getFid();
|
||||||
@ -596,8 +611,10 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
String[] split = photo.split("/");
|
String[] split = photo.split("/");
|
||||||
if (split[split.length - 1].startsWith("a")) {
|
if (split[split.length - 1].startsWith("a")) {
|
||||||
Glide.with(getActivity()).load(photo).into(ivPanorama);
|
Glide.with(getActivity()).load(photo).into(ivPanorama);
|
||||||
|
tvPanorama.setTag(photo);
|
||||||
} else if (split[split.length - 1].startsWith("b")) {
|
} else if (split[split.length - 1].startsWith("b")) {
|
||||||
Glide.with(getActivity()).load(photo).into(ivCoding);
|
Glide.with(getActivity()).load(photo).into(ivCoding);
|
||||||
|
tvCoding.setTag(photo);
|
||||||
} else if (split[split.length - 1].startsWith("c")) {
|
} else if (split[split.length - 1].startsWith("c")) {
|
||||||
cList.add(photo);
|
cList.add(photo);
|
||||||
} else if (split[split.length - 1].startsWith("d")) {
|
} else if (split[split.length - 1].startsWith("d")) {
|
||||||
@ -617,21 +634,31 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
switch (list.size()) {
|
switch (list.size()) {
|
||||||
case 1:
|
case 1:
|
||||||
Glide.with(getActivity()).load(list.get(0)).into(ivEquipment);
|
Glide.with(getActivity()).load(list.get(0)).into(ivEquipment);
|
||||||
|
tvEquipment.setTag(list.get(0));
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
Glide.with(getActivity()).load(list.get(0)).into(ivEquipment);
|
Glide.with(getActivity()).load(list.get(0)).into(ivEquipment);
|
||||||
|
tvEquipment.setTag(list.get(0));
|
||||||
Glide.with(getActivity()).load(list.get(1)).into(ivFacility);
|
Glide.with(getActivity()).load(list.get(1)).into(ivFacility);
|
||||||
|
tvFacility.setTag(list.get(1));
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
Glide.with(getActivity()).load(list.get(0)).into(ivEquipment);
|
Glide.with(getActivity()).load(list.get(0)).into(ivEquipment);
|
||||||
|
tvEquipment.setTag(list.get(0));
|
||||||
Glide.with(getActivity()).load(list.get(1)).into(ivFacility);
|
Glide.with(getActivity()).load(list.get(1)).into(ivFacility);
|
||||||
|
tvFacility.setTag(list.get(1));
|
||||||
Glide.with(getActivity()).load(list.get(2)).into(ivScutcheon);
|
Glide.with(getActivity()).load(list.get(2)).into(ivScutcheon);
|
||||||
|
tvScutcheon.setTag(list.get(2));
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
Glide.with(getActivity()).load(list.get(0)).into(ivEquipment);
|
Glide.with(getActivity()).load(list.get(0)).into(ivEquipment);
|
||||||
|
tvEquipment.setTag(list.get(0));
|
||||||
Glide.with(getActivity()).load(list.get(1)).into(ivFacility);
|
Glide.with(getActivity()).load(list.get(1)).into(ivFacility);
|
||||||
|
tvFacility.setTag(list.get(1));
|
||||||
Glide.with(getActivity()).load(list.get(2)).into(ivScutcheon);
|
Glide.with(getActivity()).load(list.get(2)).into(ivScutcheon);
|
||||||
|
tvScutcheon.setTag(list.get(2));
|
||||||
Glide.with(getActivity()).load(list.get(3)).into(ivDevice);
|
Glide.with(getActivity()).load(list.get(3)).into(ivDevice);
|
||||||
|
tvDevice.setTag(list.get(3));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -640,10 +667,13 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
switch (list.size()) {
|
switch (list.size()) {
|
||||||
case 1:
|
case 1:
|
||||||
Glide.with(getActivity()).load(list.get(0)).into(ivUsable);
|
Glide.with(getActivity()).load(list.get(0)).into(ivUsable);
|
||||||
|
tvUsable.setTag(list.get(0));
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
Glide.with(getActivity()).load(list.get(0)).into(ivUsable);
|
Glide.with(getActivity()).load(list.get(0)).into(ivUsable);
|
||||||
|
tvUsable.setTag(list.get(0));
|
||||||
Glide.with(getActivity()).load(list.get(1)).into(ivAvailable);
|
Glide.with(getActivity()).load(list.get(1)).into(ivAvailable);
|
||||||
|
tvAvailable.setTag(list.get(1));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -652,10 +682,13 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
switch (list.size()) {
|
switch (list.size()) {
|
||||||
case 1:
|
case 1:
|
||||||
Glide.with(getActivity()).load(list.get(0)).into(ivParking);
|
Glide.with(getActivity()).load(list.get(0)).into(ivParking);
|
||||||
|
tvParking.setTag(list.get(0));
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
Glide.with(getActivity()).load(list.get(0)).into(ivParking);
|
Glide.with(getActivity()).load(list.get(0)).into(ivParking);
|
||||||
|
tvParking.setTag(list.get(0));
|
||||||
Glide.with(getActivity()).load(list.get(1)).into(ivNumber);
|
Glide.with(getActivity()).load(list.get(1)).into(ivNumber);
|
||||||
|
tvNumber.setTag(list.get(1));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -710,138 +743,12 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
public void onGranted(List<String> permissions, boolean all) {
|
public void onGranted(List<String> permissions, boolean all) {
|
||||||
if (all) {
|
if (all) {
|
||||||
//保存数据库:
|
//保存数据库:
|
||||||
ChargingPileEntity chargingPileEntity = new ChargingPileEntity();
|
ChargingPileEntity chargingPileEntity = initChargingPileEntityByUI(new ChargingPileEntity());
|
||||||
ArrayList<String> photoBean = new ArrayList<>();
|
PoiCheckResult poiCheckResult = checkChargingPileEntity(chargingPileEntity);
|
||||||
if (latLng == null || latLng.equals("")) {
|
if (poiCheckResult.getCode() == 1) {
|
||||||
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), poiCheckResult.getMsg()+"", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
String encode = Geohash.getInstance().encode(latLng.latitude,latLng.longitude);
|
|
||||||
chargingPileEntity.setP(encode);
|
|
||||||
// poiEntity.setX(String.valueOf(latLng.longitude));
|
|
||||||
// poiEntity.setY(String.valueOf(latLng.latitude));
|
|
||||||
|
|
||||||
}
|
|
||||||
String name = tvNameContent.getText().toString().trim();//名称
|
|
||||||
if (name == null || name.equals("")) {
|
|
||||||
Toast.makeText(getActivity(), "请输入 名称", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
chargingPileEntity.setName(name);
|
|
||||||
}
|
|
||||||
String tagPanorama = (String) ivPanorama.getTag();
|
|
||||||
if (tagPanorama == null) {
|
|
||||||
Toast.makeText(getActivity(), "请拍照 全景图", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
photoBean.add(tagPanorama);
|
|
||||||
}
|
|
||||||
String tagCoding = (String) ivCoding.getTag();
|
|
||||||
if (tagCoding == null) {
|
|
||||||
Toast.makeText(getActivity(), "请拍照 充电桩编码", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
photoBean.add(tagCoding);
|
|
||||||
}
|
|
||||||
String tagEquipment = (String) ivEquipment.getTag();
|
|
||||||
if (tagEquipment == null ) {
|
|
||||||
Toast.makeText(getActivity(), "请拍照 设备标牌", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
photoBean.add(tagEquipment);
|
|
||||||
}
|
|
||||||
String tagFacility = (String) ivFacility.getTag();
|
|
||||||
if (sign_exist != 0) {
|
|
||||||
if (tagFacility == null) {
|
|
||||||
Toast.makeText(getActivity(), "请拍照 设备标牌", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
photoBean.add(tagFacility);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (tagFacility != null ) {
|
|
||||||
photoBean.add(tagFacility);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String tagScutcheon = (String) ivScutcheon.getTag();
|
|
||||||
if (sign_exist == 1) {
|
|
||||||
if (tagScutcheon == null ) {
|
|
||||||
Toast.makeText(getActivity(), "请拍照 设备编码", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
photoBean.add(tagScutcheon);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String tagDevice = (String) ivDevice.getTag();
|
|
||||||
if (sign_exist == 1) {
|
|
||||||
if (tagDevice == null) {
|
|
||||||
Toast.makeText(getActivity(), "请拍照 设备标牌", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
photoBean.add(tagDevice);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String tagUsable = (String) ivUsable.getTag();
|
|
||||||
if (tagUsable == null) {
|
|
||||||
Toast.makeText(getActivity(), "请拍照 可用状态", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
photoBean.add(tagUsable);
|
|
||||||
}
|
|
||||||
String tagAvailable = (String) ivAvailable.getTag();
|
|
||||||
if (tagAvailable != null) {
|
|
||||||
photoBean.add(tagAvailable);
|
|
||||||
}
|
|
||||||
String tagParking = (String) ivParking.getTag();
|
|
||||||
if (tagParking == null ) {
|
|
||||||
Toast.makeText(getActivity(), "请拍照 停车位编号", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
photoBean.add(tagPanorama);
|
|
||||||
}
|
|
||||||
String tagNumber = (String) ivNumber.getTag();
|
|
||||||
if (tagNumber != null ) {
|
|
||||||
photoBean.add(tagNumber);
|
|
||||||
}
|
|
||||||
chargingPileEntity.setPhotos(photoBean);
|
|
||||||
|
|
||||||
if ("".equals(buffer1)&&"".equals(buffer2)&&"".equals(buffer3)&&"".equals(buffer4)&&"".equals(buffer5)) {
|
|
||||||
Toast.makeText(getActivity(), "开放状态未勾选", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (buffer1!=null&&!buffer1.equals("")&&buffer1.length()>0){
|
|
||||||
openType.delete(0,openType.length());
|
|
||||||
openType.append(buffer1);
|
|
||||||
String charAt = openType.deleteCharAt(openType.length() - 1).toString();
|
|
||||||
chargingPileEntity.setCp_openType(charAt);
|
|
||||||
}else {
|
|
||||||
openType.delete(0,openType.length());
|
|
||||||
openType.append(buffer2);
|
|
||||||
openType.append(buffer3);
|
|
||||||
openType.append(buffer4);
|
|
||||||
openType.append(buffer5);
|
|
||||||
String charAt = openType.deleteCharAt(openType.length() - 1).toString();
|
|
||||||
chargingPileEntity.setCp_openType(charAt);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cp_floor != 0) {
|
|
||||||
chargingPileEntity.setCp_floor(cp_floor);
|
|
||||||
}
|
|
||||||
chargingPileEntity.setSign_exist(sign_exist);
|
|
||||||
chargingPileEntity.setCp_availableState(cp_availableState);
|
|
||||||
String describe = editDescribe.getText().toString().trim();
|
|
||||||
if (describe != null && !describe.equals("")) {
|
|
||||||
chargingPileEntity.setMemo(describe);
|
|
||||||
}
|
|
||||||
if (pid == null) {
|
|
||||||
Toast.makeText(getActivity(), "没有对应的充电站Id", Toast.LENGTH_SHORT).show();
|
|
||||||
} else {
|
|
||||||
chargingPileEntity.setFid(pid);
|
|
||||||
}
|
|
||||||
chargingPileEntity.setTaskStatus(2); // 设置当前充电桩任务状态为本地保存但未上传
|
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -849,7 +756,7 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (result[0]!=0) {
|
if (result[0] != 0) {
|
||||||
ToastUtil.showShort(getActivity(), "充电桩保存成功");
|
ToastUtil.showShort(getActivity(), "充电桩保存成功");
|
||||||
|
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
@ -884,45 +791,65 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
break;
|
break;
|
||||||
case R.id.rl_panorama:
|
case R.id.rl_panorama:
|
||||||
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
file = PhotoUtils.showPhotoFile("a",latLng);
|
||||||
|
intentPanorama.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
|
||||||
startActivityForResult(intentPanorama, 101);
|
startActivityForResult(intentPanorama, 101);
|
||||||
initPileSharePre();
|
initPileSharePre();
|
||||||
break;
|
break;
|
||||||
case R.id.rl_coding:
|
case R.id.rl_coding:
|
||||||
Intent intentCoding = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentCoding = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
file = PhotoUtils.showPhotoFile("b", latLng);
|
||||||
|
intentCoding.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
|
||||||
startActivityForResult(intentCoding, 102);
|
startActivityForResult(intentCoding, 102);
|
||||||
initPileSharePre();
|
initPileSharePre();
|
||||||
break;
|
break;
|
||||||
case R.id.rl_equipment:
|
case R.id.rl_equipment:
|
||||||
Intent intentEquipment = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentEquipment = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
file = PhotoUtils.showPhotoFile("c", latLng);
|
||||||
|
intentEquipment.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
|
||||||
startActivityForResult(intentEquipment, 103);
|
startActivityForResult(intentEquipment, 103);
|
||||||
initPileSharePre();
|
initPileSharePre();
|
||||||
break;
|
break;
|
||||||
case R.id.rl_facility:
|
case R.id.rl_facility:
|
||||||
Intent intentFacility = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentFacility = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
file = PhotoUtils.showPhotoFile("c", latLng);
|
||||||
|
intentFacility.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
|
||||||
startActivityForResult(intentFacility, 104);
|
startActivityForResult(intentFacility, 104);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_scutcheon:
|
case R.id.rl_scutcheon:
|
||||||
Intent intentScutcheon = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentScutcheon = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
file = PhotoUtils.showPhotoFile("c",latLng);
|
||||||
|
intentScutcheon.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
|
||||||
startActivityForResult(intentScutcheon, 105);
|
startActivityForResult(intentScutcheon, 105);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_device:
|
case R.id.rl_device:
|
||||||
Intent intentDevice = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentDevice = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
file = PhotoUtils.showPhotoFile("c", latLng);
|
||||||
|
intentDevice.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
|
||||||
startActivityForResult(intentDevice, 106);
|
startActivityForResult(intentDevice, 106);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_usable:
|
case R.id.rl_usable:
|
||||||
Intent intentUsable = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentUsable = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
file = PhotoUtils.showPhotoFile("d", latLng);
|
||||||
|
intentUsable.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
|
||||||
startActivityForResult(intentUsable, 107);
|
startActivityForResult(intentUsable, 107);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_available:
|
case R.id.rl_available:
|
||||||
Intent intentAvailable = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentAvailable = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
file = PhotoUtils.showPhotoFile("d", latLng);
|
||||||
|
intentAvailable.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
|
||||||
startActivityForResult(intentAvailable, 108);
|
startActivityForResult(intentAvailable, 108);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_parking:
|
case R.id.rl_parking:
|
||||||
Intent intentParking = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentParking = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
file = PhotoUtils.showPhotoFile("e", latLng);
|
||||||
|
intentParking.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
|
||||||
startActivityForResult(intentParking, 109);
|
startActivityForResult(intentParking, 109);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_number:
|
case R.id.rl_number:
|
||||||
Intent intentNumber = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentNumber = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
file = PhotoUtils.showPhotoFile("e",latLng);
|
||||||
|
intentNumber.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
|
||||||
startActivityForResult(intentNumber, 110);
|
startActivityForResult(intentNumber, 110);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -980,49 +907,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
// }).build();
|
// }).build();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
private void phoneList() {
|
|
||||||
phoneLists = new ArrayList<>();
|
|
||||||
String ivPanoramaTag = (String) ivPanorama.getTag();
|
|
||||||
if (ivPanoramaTag!=null){
|
|
||||||
phoneLists.add(new File(ivPanoramaTag));
|
|
||||||
}
|
|
||||||
String ivCodingTag = (String) ivCoding.getTag();
|
|
||||||
if (ivCodingTag!=null){
|
|
||||||
phoneLists.add(new File(ivCodingTag));
|
|
||||||
}
|
|
||||||
String ivEquipmentTag = (String) ivEquipment.getTag();
|
|
||||||
if (ivEquipmentTag!=null){
|
|
||||||
phoneLists.add(new File(ivEquipmentTag));
|
|
||||||
}
|
|
||||||
String ivFacilityTag = (String) ivFacility.getTag();
|
|
||||||
if (ivFacilityTag!=null){
|
|
||||||
phoneLists.add(new File(ivFacilityTag));
|
|
||||||
}
|
|
||||||
String ivUsableTag = (String) ivUsable.getTag();
|
|
||||||
if (ivUsableTag!=null){
|
|
||||||
phoneLists.add(new File(ivUsableTag));
|
|
||||||
}
|
|
||||||
String ivAvailableTag = (String) ivAvailable.getTag();
|
|
||||||
if (ivAvailableTag!=null){
|
|
||||||
phoneLists.add(new File(ivAvailableTag));
|
|
||||||
}
|
|
||||||
String ivParkingTag = (String) ivParking.getTag();
|
|
||||||
if (ivParkingTag!=null){
|
|
||||||
phoneLists.add(new File(ivParkingTag));
|
|
||||||
}
|
|
||||||
String ivNumberTag = (String) ivNumber.getTag();
|
|
||||||
if (ivNumberTag!=null){
|
|
||||||
phoneLists.add(new File(ivNumberTag));
|
|
||||||
}
|
|
||||||
String ivDeviceTag = (String) ivDevice.getTag();
|
|
||||||
if (ivDeviceTag!=null){
|
|
||||||
phoneLists.add(new File(ivDeviceTag));
|
|
||||||
}
|
|
||||||
String ivScutcheonTag = (String) ivScutcheon.getTag();
|
|
||||||
if (ivScutcheonTag!=null){
|
|
||||||
phoneLists.add(new File(ivScutcheonTag));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1043,87 +927,11 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
//获取Editor对象
|
//获取Editor对象
|
||||||
SharedPreferences.Editor edit = poi.edit();
|
SharedPreferences.Editor edit = poi.edit();
|
||||||
//根据要保存的数据的类型,调用对应的put方法,
|
//根据要保存的数据的类型,调用对应的put方法,
|
||||||
ChargingPileEntity chargingPileEntity = new ChargingPileEntity();
|
ChargingPileEntity chargingPileEntity = initChargingPileEntityByUI(new ChargingPileEntity());
|
||||||
ArrayList<String> photo = new ArrayList<>();
|
|
||||||
if (latLng != null) {
|
|
||||||
chargingPileEntity.setP(latLng.latitude+","+latLng.longitude);
|
|
||||||
}
|
|
||||||
String name = tvNameContent.getText().toString().trim();//名称
|
|
||||||
if (name != null &&!name.equals("")) {
|
|
||||||
chargingPileEntity.setName(name);
|
|
||||||
}
|
|
||||||
if (cp_floor != 0) {
|
|
||||||
chargingPileEntity.setCp_floor(cp_floor);
|
|
||||||
}
|
|
||||||
String tagPanorama = (String) ivPanorama.getTag();
|
|
||||||
if (tagPanorama != null &&!tagPanorama.equals("")) {
|
|
||||||
photo.add(tagPanorama);
|
|
||||||
}
|
|
||||||
String tagCoding = (String) ivCoding.getTag();
|
|
||||||
if (tagCoding != null&&!tagCoding.equals("")) {
|
|
||||||
photo.add(tagCoding);
|
|
||||||
}
|
|
||||||
String tagEquipment = (String) ivEquipment.getTag();
|
|
||||||
if (tagEquipment != null&&!tagEquipment.equals("")) {
|
|
||||||
photo.add(tagEquipment);
|
|
||||||
}
|
|
||||||
String tagFacility = (String) ivFacility.getTag();
|
|
||||||
if (tagFacility != null&&!tagFacility.equals("")) {
|
|
||||||
photo.add(tagFacility);
|
|
||||||
}
|
|
||||||
String tagScutcheon = (String) ivScutcheon.getTag();
|
|
||||||
if (tagScutcheon != null&&!tagScutcheon.equals("")) {
|
|
||||||
photo.add(tagScutcheon);
|
|
||||||
}
|
|
||||||
String tagDevice = (String) ivDevice.getTag();
|
|
||||||
if (tagDevice != null&&!tagDevice.equals("")) {
|
|
||||||
photo.add(tagDevice);
|
|
||||||
}
|
|
||||||
String tagUsable = (String) ivUsable.getTag();
|
|
||||||
if (tagUsable != null &&!tagUsable.equals("")) {
|
|
||||||
photo.add(tagUsable);
|
|
||||||
}
|
|
||||||
String tagAvailable = (String) ivAvailable.getTag();
|
|
||||||
if (tagAvailable != null&&!tagAvailable.equals("")) {
|
|
||||||
photo.add(tagAvailable);
|
|
||||||
}
|
|
||||||
String tagParking = (String) ivParking.getTag();
|
|
||||||
if (tagParking != null&&!tagParking.equals("")) {
|
|
||||||
photo.add(tagPanorama);
|
|
||||||
}
|
|
||||||
String tagNumber = (String) ivNumber.getTag();
|
|
||||||
if (tagNumber != null&&!tagNumber.equals("")) {
|
|
||||||
photo.add(tagNumber);
|
|
||||||
}
|
|
||||||
chargingPileEntity.setPhotos(photo);
|
|
||||||
chargingPileEntity.setSign_exist(sign_exist);
|
|
||||||
chargingPileEntity.setCp_availableState(cp_availableState);
|
|
||||||
String describe = editDescribe.getText().toString().trim();
|
|
||||||
if (describe != null && !describe.equals("")) {
|
|
||||||
chargingPileEntity.setMemo(describe);
|
|
||||||
}
|
|
||||||
if (pid != null) {
|
|
||||||
chargingPileEntity.setFid(pid);
|
|
||||||
}
|
|
||||||
if (buffer1!=null&&!buffer1.equals("")){
|
|
||||||
chargingPileEntity.setCp_openType(buffer1);
|
|
||||||
}else {
|
|
||||||
openType.reverse();
|
|
||||||
openType.append(buffer2);
|
|
||||||
openType.append(buffer3);
|
|
||||||
openType.append(buffer4);
|
|
||||||
openType.append(buffer5);
|
|
||||||
if (openType!=null&&!"".equals(openType)&&openType.length()>0) {
|
|
||||||
String charAt = openType.deleteCharAt(openType.length() - 1).toString();
|
|
||||||
chargingPileEntity.setCp_openType(charAt);
|
|
||||||
} else {
|
|
||||||
chargingPileEntity.setCp_openType("");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String newChargingPileEntity = new Gson().toJson(chargingPileEntity);
|
String newChargingPileEntity = new Gson().toJson(chargingPileEntity);
|
||||||
//以键值对的形式添加新值。
|
//以键值对的形式添加新值。
|
||||||
edit.putString("chargingPileEntity", newChargingPileEntity);
|
edit.putString("chargingPileEntity", newChargingPileEntity);
|
||||||
if (station!=null){
|
if (station != null) {
|
||||||
edit.putString("poiEntity", station);
|
edit.putString("poiEntity", station);
|
||||||
}
|
}
|
||||||
//提交新值。必须执行,否则前面的操作都无效。
|
//提交新值。必须执行,否则前面的操作都无效。
|
||||||
@ -1135,11 +943,15 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
if (requestCode == 101 && resultCode == RESULT_OK) {
|
if (requestCode == 101 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (file == null || !file.exists()) {
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Toast.makeText(getContext(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
|
||||||
takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
return;
|
||||||
ivPanorama.setTag(takePhotoPath1);
|
|
||||||
ivPanorama.setImageBitmap(bitmap);//显示图像
|
}else {
|
||||||
|
String s = PhotoUtils.showPhotoAndGetPath(file, ivPanorama);
|
||||||
|
tvPanorama.setTag(s);
|
||||||
|
}
|
||||||
|
file=null;
|
||||||
/* int height = bitmap.getHeight();
|
/* int height = bitmap.getHeight();
|
||||||
int width = bitmap.getWidth();
|
int width = bitmap.getWidth();
|
||||||
if (height > width) {
|
if (height > width) {
|
||||||
@ -1156,11 +968,15 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
|
|
||||||
}*/
|
}*/
|
||||||
} else if (requestCode == 102 && resultCode == RESULT_OK) {
|
} else if (requestCode == 102 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (file == null || !file.exists()) {
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Toast.makeText(getContext(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
|
||||||
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
return;
|
||||||
ivCoding.setTag(takePhotoPath2);
|
|
||||||
ivCoding.setImageBitmap(bitmap);//显示图像
|
}else {
|
||||||
|
String s = PhotoUtils.showPhotoAndGetPath(file, ivCoding);
|
||||||
|
tvCoding.setTag(s);
|
||||||
|
}
|
||||||
|
file=null;
|
||||||
/* int height = bitmap.getHeight();
|
/* int height = bitmap.getHeight();
|
||||||
int width = bitmap.getWidth();
|
int width = bitmap.getWidth();
|
||||||
if (height > width) {
|
if (height > width) {
|
||||||
@ -1177,11 +993,16 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
|
|
||||||
}*/
|
}*/
|
||||||
} else if (requestCode == 103 && resultCode == RESULT_OK) {
|
} else if (requestCode == 103 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (file == null || !file.exists()) {
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Toast.makeText(getContext(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
|
||||||
takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
return;
|
||||||
ivEquipment.setImageBitmap(bitmap);//显示图像
|
|
||||||
ivEquipment.setTag(takePhotoPath3);
|
}else {
|
||||||
|
String s = PhotoUtils.showPhotoAndGetPath(file, ivEquipment);
|
||||||
|
tvEquipment.setTag(s);
|
||||||
|
}
|
||||||
|
file=null;
|
||||||
|
|
||||||
/* int height = bitmap.getHeight();
|
/* int height = bitmap.getHeight();
|
||||||
int width = bitmap.getWidth();
|
int width = bitmap.getWidth();
|
||||||
if (height > width) {
|
if (height > width) {
|
||||||
@ -1198,11 +1019,15 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
|
|
||||||
}*/
|
}*/
|
||||||
} else if (requestCode == 104 && resultCode == RESULT_OK) {
|
} else if (requestCode == 104 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (file == null || !file.exists()) {
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Toast.makeText(getContext(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
|
||||||
takePhotoPath4 = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
return;
|
||||||
ivFacility.setTag(takePhotoPath4);
|
|
||||||
ivFacility.setImageBitmap(bitmap);//显示图像
|
}else {
|
||||||
|
String s = PhotoUtils.showPhotoAndGetPath(file, ivFacility);
|
||||||
|
tvFacility.setTag(s);
|
||||||
|
}
|
||||||
|
file=null;
|
||||||
/* int height = bitmap.getHeight();
|
/* int height = bitmap.getHeight();
|
||||||
int width = bitmap.getWidth();
|
int width = bitmap.getWidth();
|
||||||
if (height > width) {
|
if (height > width) {
|
||||||
@ -1219,11 +1044,16 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
|
|
||||||
}*/
|
}*/
|
||||||
} else if (requestCode == 105 && resultCode == RESULT_OK) {
|
} else if (requestCode == 105 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (file == null || !file.exists()) {
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Toast.makeText(getContext(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
|
||||||
takePhotoPath5 = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
return;
|
||||||
ivScutcheon.setTag(takePhotoPath5);
|
|
||||||
ivScutcheon.setImageBitmap(bitmap);//显示图像
|
}else {
|
||||||
|
String s = PhotoUtils.showPhotoAndGetPath(file, ivScutcheon);
|
||||||
|
tvScutcheon.setTag(s);
|
||||||
|
}
|
||||||
|
file=null;
|
||||||
|
|
||||||
/* int height = bitmap.getHeight();
|
/* int height = bitmap.getHeight();
|
||||||
int width = bitmap.getWidth();
|
int width = bitmap.getWidth();
|
||||||
if (height > width) {
|
if (height > width) {
|
||||||
@ -1240,11 +1070,15 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
|
|
||||||
}*/
|
}*/
|
||||||
} else if (requestCode == 106 && resultCode == RESULT_OK) {
|
} else if (requestCode == 106 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (file == null || !file.exists()) {
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Toast.makeText(getContext(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
|
||||||
takePhotoPath6 = PhotoPathUtil.getTakePhotoPath(data, "c",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
return;
|
||||||
ivDevice.setTag(takePhotoPath6);
|
|
||||||
ivDevice.setImageBitmap(bitmap);//显示图像
|
}else {
|
||||||
|
String s = PhotoUtils.showPhotoAndGetPath(file, ivDevice);
|
||||||
|
tvDevice.setTag(s);
|
||||||
|
}
|
||||||
|
file=null;
|
||||||
/* int height = bitmap.getHeight();
|
/* int height = bitmap.getHeight();
|
||||||
int width = bitmap.getWidth();
|
int width = bitmap.getWidth();
|
||||||
if (height > width) {
|
if (height > width) {
|
||||||
@ -1261,11 +1095,15 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
|
|
||||||
}*/
|
}*/
|
||||||
} else if (requestCode == 107 && resultCode == RESULT_OK) {
|
} else if (requestCode == 107 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (file == null || !file.exists()) {
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Toast.makeText(getContext(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
|
||||||
takePhotoPath7 = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
return;
|
||||||
ivUsable.setTag(takePhotoPath7);
|
|
||||||
ivUsable.setImageBitmap(bitmap);//显示图像
|
}else {
|
||||||
|
String s = PhotoUtils.showPhotoAndGetPath(file, ivUsable);
|
||||||
|
tvUsable.setTag(s);
|
||||||
|
}
|
||||||
|
file=null;
|
||||||
/* int height = bitmap.getHeight();
|
/* int height = bitmap.getHeight();
|
||||||
int width = bitmap.getWidth();
|
int width = bitmap.getWidth();
|
||||||
if (height > width) {
|
if (height > width) {
|
||||||
@ -1282,11 +1120,15 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
|
|
||||||
}*/
|
}*/
|
||||||
} else if (requestCode == 108 && resultCode == RESULT_OK) {
|
} else if (requestCode == 108 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (file == null || !file.exists()) {
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Toast.makeText(getContext(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
|
||||||
takePhotoPath8 = PhotoPathUtil.getTakePhotoPath(data, "d",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
return;
|
||||||
ivAvailable.setTag(takePhotoPath8);
|
|
||||||
ivAvailable.setImageBitmap(bitmap);//显示图像
|
}else {
|
||||||
|
String s = PhotoUtils.showPhotoAndGetPath(file, ivAvailable);
|
||||||
|
tvAvailable.setTag(s);
|
||||||
|
}
|
||||||
|
file=null;
|
||||||
/* int height = bitmap.getHeight();
|
/* int height = bitmap.getHeight();
|
||||||
int width = bitmap.getWidth();
|
int width = bitmap.getWidth();
|
||||||
if (height > width) {
|
if (height > width) {
|
||||||
@ -1303,11 +1145,15 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
|
|
||||||
}*/
|
}*/
|
||||||
} else if (requestCode == 109 && resultCode == RESULT_OK) {
|
} else if (requestCode == 109 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (file == null || !file.exists()) {
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Toast.makeText(getContext(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
|
||||||
takePhotoPath9 = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
return;
|
||||||
ivParking.setImageBitmap(bitmap);//显示图像
|
|
||||||
ivParking.setTag(takePhotoPath9);
|
}else {
|
||||||
|
String s = PhotoUtils.showPhotoAndGetPath(file, ivParking);
|
||||||
|
tvParking.setTag(s);
|
||||||
|
}
|
||||||
|
file=null;
|
||||||
/* int height = bitmap.getHeight();
|
/* int height = bitmap.getHeight();
|
||||||
int width = bitmap.getWidth();
|
int width = bitmap.getWidth();
|
||||||
if (height > width) {
|
if (height > width) {
|
||||||
@ -1324,11 +1170,15 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
|
|
||||||
}*/
|
}*/
|
||||||
} else if (requestCode == 110 && resultCode == RESULT_OK) {
|
} else if (requestCode == 110 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (file == null || !file.exists()) {
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Toast.makeText(getContext(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
|
||||||
takePhotoPath10 = PhotoPathUtil.getTakePhotoPath(data, "e",Geohash.getInstance().encode(latLng.latitude,latLng.longitude));
|
return;
|
||||||
ivNumber.setImageBitmap(bitmap);//显示图像
|
|
||||||
ivNumber.setTag(takePhotoPath10);
|
}else {
|
||||||
|
String s = PhotoUtils.showPhotoAndGetPath(file, ivNumber);
|
||||||
|
tvNumber.setTag(s);
|
||||||
|
}
|
||||||
|
file=null;
|
||||||
/* int height = bitmap.getHeight();
|
/* int height = bitmap.getHeight();
|
||||||
int width = bitmap.getWidth();
|
int width = bitmap.getWidth();
|
||||||
if (height > width) {
|
if (height > width) {
|
||||||
@ -1356,4 +1206,161 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ChargingPileEntity initChargingPileEntityByUI(ChargingPileEntity chargingPileEntity) {
|
||||||
|
ArrayList<String> photo = new ArrayList<>();
|
||||||
|
if (latLng != null) {
|
||||||
|
String encode = Geohash.getInstance().encode(latLng.latitude, latLng.longitude);
|
||||||
|
chargingPileEntity.setP(encode);
|
||||||
|
}
|
||||||
|
String name = tvNameContent.getText().toString().trim();//名称
|
||||||
|
if (name != null && !name.equals("")) {
|
||||||
|
chargingPileEntity.setName(name);
|
||||||
|
}
|
||||||
|
if (cp_floor != 0) {
|
||||||
|
chargingPileEntity.setCp_floor(cp_floor);
|
||||||
|
}
|
||||||
|
String tagPanorama = (String) tvPanorama.getTag();
|
||||||
|
if (tagPanorama != null && !tagPanorama.equals("")) {
|
||||||
|
photo.add(tagPanorama);
|
||||||
|
}
|
||||||
|
String tagCoding = (String) tvCoding.getTag();
|
||||||
|
if (tagCoding != null && !tagCoding.equals("")) {
|
||||||
|
photo.add(tagCoding);
|
||||||
|
}
|
||||||
|
String tagEquipment = (String) tvEquipment.getTag();
|
||||||
|
if (tagEquipment != null && !tagEquipment.equals("")) {
|
||||||
|
photo.add(tagEquipment);
|
||||||
|
}
|
||||||
|
String tagFacility = (String) tvFacility.getTag();
|
||||||
|
if (tagFacility != null && !tagFacility.equals("")) {
|
||||||
|
photo.add(tagFacility);
|
||||||
|
}
|
||||||
|
String tagScutcheon = (String) tvScutcheon.getTag();
|
||||||
|
if (tagScutcheon != null && !tagScutcheon.equals("")) {
|
||||||
|
photo.add(tagScutcheon);
|
||||||
|
}
|
||||||
|
String tagDevice = (String) tvDevice.getTag();
|
||||||
|
if (tagDevice != null && !tagDevice.equals("")) {
|
||||||
|
photo.add(tagDevice);
|
||||||
|
}
|
||||||
|
String tagUsable = (String) tvUsable.getTag();
|
||||||
|
if (tagUsable != null && !tagUsable.equals("")) {
|
||||||
|
photo.add(tagUsable);
|
||||||
|
}
|
||||||
|
String tagAvailable = (String) tvAvailable.getTag();
|
||||||
|
if (tagAvailable != null && !tagAvailable.equals("")) {
|
||||||
|
photo.add(tagAvailable);
|
||||||
|
}
|
||||||
|
String tagParking = (String) tvParking.getTag();
|
||||||
|
if (tagParking != null && !tagParking.equals("")) {
|
||||||
|
photo.add(tagPanorama);
|
||||||
|
}
|
||||||
|
String tagNumber = (String) tvNumber.getTag();
|
||||||
|
if (tagNumber != null && !tagNumber.equals("")) {
|
||||||
|
photo.add(tagNumber);
|
||||||
|
}
|
||||||
|
chargingPileEntity.setPhotos(photo);
|
||||||
|
chargingPileEntity.setSign_exist(sign_exist);
|
||||||
|
chargingPileEntity.setCp_availableState(cp_availableState);
|
||||||
|
String describe = editDescribe.getText().toString().trim();
|
||||||
|
if (describe != null && !describe.equals("")) {
|
||||||
|
chargingPileEntity.setMemo(describe);
|
||||||
|
}
|
||||||
|
if (pid != null) {
|
||||||
|
chargingPileEntity.setFid(pid);
|
||||||
|
}
|
||||||
|
if (buffer1 != null && !buffer1.equals("")) {
|
||||||
|
chargingPileEntity.setCp_openType(buffer1);
|
||||||
|
} else {
|
||||||
|
openType.reverse();
|
||||||
|
openType.append(buffer2);
|
||||||
|
openType.append(buffer3);
|
||||||
|
openType.append(buffer4);
|
||||||
|
openType.append(buffer5);
|
||||||
|
if (openType != null && !"".equals(openType) && openType.length() > 0) {
|
||||||
|
String charAt = openType.deleteCharAt(openType.length() - 1).toString();
|
||||||
|
chargingPileEntity.setCp_openType(charAt);
|
||||||
|
} else {
|
||||||
|
chargingPileEntity.setCp_openType("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return chargingPileEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PoiCheckResult checkChargingPileEntity(ChargingPileEntity entity) {
|
||||||
|
PoiCheckResult poiCheckResult = new PoiCheckResult();
|
||||||
|
if (entity.getP()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请确定点位");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if (entity.getName()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请输入 名称");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if (entity.getCp_openType()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("开放状态未勾选");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if (tvPanorama.getTag()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请拍照 全景图");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if (tvCoding.getTag()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请拍照 充电桩编码");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if (tvEquipment.getTag()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请拍照 设备标牌");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if (sign_exist!=0){
|
||||||
|
if ( tvFacility.getTag()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请拍照 设备标牌");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (sign_exist==1){
|
||||||
|
if (tvScutcheon.getTag() == null) {
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请拍照 设备标牌");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if (tvDevice.getTag() == null) {
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请拍照 设备标牌");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( tvUsable.getTag() == null) {
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请拍照 可用状态");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if ( tvParking.getTag() == null) {
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请拍照 停车位编号");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PoiEntity initPoiEntityByUI(PoiEntity entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PoiCheckResult checkPoiEntity(PoiEntity entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
@ -4,8 +4,10 @@ import android.content.Intent;
|
|||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.provider.MediaStore;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -62,6 +64,8 @@ import com.navinfo.outdoor.room.PoiEntity;
|
|||||||
import com.navinfo.outdoor.ui.view.ContactView;
|
import com.navinfo.outdoor.ui.view.ContactView;
|
||||||
import com.navinfo.outdoor.util.Geohash;
|
import com.navinfo.outdoor.util.Geohash;
|
||||||
import com.navinfo.outdoor.util.PhotoPathUtil;
|
import com.navinfo.outdoor.util.PhotoPathUtil;
|
||||||
|
import com.navinfo.outdoor.util.PhotoUtils;
|
||||||
|
import com.navinfo.outdoor.util.ToastUtil;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
@ -91,6 +95,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
private RelativeLayout rlPanorama, rlName, rlInternalPhotos, rlElse, rlScutcheon, rlNull;
|
private RelativeLayout rlPanorama, rlName, rlInternalPhotos, rlElse, rlScutcheon, rlNull;
|
||||||
private ImageView ivPanorama, ivName, ivInternal, ivElse, ivScutcheon;
|
private ImageView ivPanorama, ivName, ivInternal, ivElse, ivScutcheon;
|
||||||
private TextView tvExamine;
|
private TextView tvExamine;
|
||||||
|
private TextView tvPanorama, tvName, tvInternal, tvElse, tvScutcheon;
|
||||||
private EditText editNameContent, editSiteContent;
|
private EditText editNameContent, editSiteContent;
|
||||||
private ArrayList<PhoneBean> poiBeans;
|
private ArrayList<PhoneBean> poiBeans;
|
||||||
private Button btnSaveLocal;
|
private Button btnSaveLocal;
|
||||||
@ -118,6 +123,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
private ContactView contactView;
|
private ContactView contactView;
|
||||||
private ArrayList<File> chargingStationList;
|
private ArrayList<File> chargingStationList;
|
||||||
|
|
||||||
|
// private ArrayList<File> fileList;
|
||||||
|
private File photoFile; // 拍照保存的路径
|
||||||
|
|
||||||
public static ChargingStationFragment newInstance(Bundle bundle) {
|
public static ChargingStationFragment newInstance(Bundle bundle) {
|
||||||
ChargingStationFragment fragment = new ChargingStationFragment();
|
ChargingStationFragment fragment = new ChargingStationFragment();
|
||||||
fragment.setArguments(bundle);
|
fragment.setArguments(bundle);
|
||||||
@ -216,7 +224,11 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
rlElse.setOnClickListener(this::onClick);
|
rlElse.setOnClickListener(this::onClick);
|
||||||
rlScutcheon = findViewById(R.id.rl_scutcheon);
|
rlScutcheon = findViewById(R.id.rl_scutcheon);
|
||||||
rlScutcheon.setOnClickListener(this::onClick);
|
rlScutcheon.setOnClickListener(this::onClick);
|
||||||
|
tvPanorama = findViewById(R.id.tv_panorama);
|
||||||
|
tvElse = findViewById(R.id.tv_else);
|
||||||
|
tvInternal = findViewById(R.id.tv_internal);
|
||||||
|
tvName = findViewById(R.id.tv_name);
|
||||||
|
tvScutcheon = findViewById(R.id.tv_scutcheon);
|
||||||
/* recyclerPhone = findViewById(R.id.recycler_phone);
|
/* recyclerPhone = findViewById(R.id.recycler_phone);
|
||||||
recyclerPhone.setLayoutManager(new LinearLayoutManager(getContext()));
|
recyclerPhone.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
recyclerPhone.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
|
recyclerPhone.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
|
||||||
@ -408,9 +420,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
private void initShowPoi() {
|
private void initShowPoi() {
|
||||||
// 添加信息:
|
// 添加信息:
|
||||||
showPoiEntity = (PoiEntity) getArguments().getSerializable("poiEntity");
|
showPoiEntity = (PoiEntity) getArguments().getSerializable("poiEntity");
|
||||||
if (showPoiEntity.getTaskStatus()==1||showPoiEntity.getTaskStatus()==5){
|
if (showPoiEntity.getTaskStatus() == 1 || showPoiEntity.getTaskStatus() == 5) {
|
||||||
tvExamine.setVisibility(View.GONE);
|
tvExamine.setVisibility(View.GONE);
|
||||||
}else {
|
} else {
|
||||||
tvExamine.setVisibility(View.VISIBLE);
|
tvExamine.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
String name = showPoiEntity.getName();//名称
|
String name = showPoiEntity.getName();//名称
|
||||||
@ -436,7 +448,16 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
editDescribe.setText(describe);
|
editDescribe.setText(describe);
|
||||||
}
|
}
|
||||||
int station_type = showPoiEntity.getStation_type();
|
int station_type = showPoiEntity.getStation_type();
|
||||||
spinnerType.setSelection(station_type, true);
|
if (station_type==1){
|
||||||
|
spinnerType.setSelection(0, true);
|
||||||
|
}else if (station_type==2){
|
||||||
|
spinnerType.setSelection(1, true);
|
||||||
|
}else if (station_type==3){
|
||||||
|
spinnerType.setSelection(2, true);
|
||||||
|
}else if (station_type==4){
|
||||||
|
spinnerType.setSelection(3, true);
|
||||||
|
}
|
||||||
|
|
||||||
String telPhone = showPoiEntity.getTelPhone();
|
String telPhone = showPoiEntity.getTelPhone();
|
||||||
if (telPhone != null && !telPhone.equals("")) {
|
if (telPhone != null && !telPhone.equals("")) {
|
||||||
String[] phones = telPhone.split("\\|");
|
String[] phones = telPhone.split("\\|");
|
||||||
@ -499,19 +520,19 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
String[] split = photo.split("/");
|
String[] split = photo.split("/");
|
||||||
if (split[split.length - 1].startsWith("a")) {
|
if (split[split.length - 1].startsWith("a")) {
|
||||||
Glide.with(getActivity()).load(photo).into(ivPanorama);
|
Glide.with(getActivity()).load(photo).into(ivPanorama);
|
||||||
ivPanorama.setTag(photo);
|
tvPanorama.setTag(photo);
|
||||||
} else if (split[split.length - 1].startsWith("b")) {
|
} else if (split[split.length - 1].startsWith("b")) {
|
||||||
Glide.with(getActivity()).load(photo).into(ivName);
|
Glide.with(getActivity()).load(photo).into(ivName);
|
||||||
ivName.setTag(photo);
|
tvName.setTag(photo);
|
||||||
} else if (split[split.length - 1].startsWith("c")) {
|
} else if (split[split.length - 1].startsWith("c")) {
|
||||||
Glide.with(getActivity()).load(photo).into(ivInternal);
|
Glide.with(getActivity()).load(photo).into(ivInternal);
|
||||||
ivInternal.setTag(photo);
|
tvInternal.setTag(photo);
|
||||||
} else if (split[split.length - 1].startsWith("d")) {
|
} else if (split[split.length - 1].startsWith("d")) {
|
||||||
Glide.with(getActivity()).load(photo).into(ivElse);
|
Glide.with(getActivity()).load(photo).into(ivElse);
|
||||||
ivElse.setTag(photo);
|
tvElse.setTag(photo);
|
||||||
} else if (split[split.length - 1].startsWith("e")) {
|
} else if (split[split.length - 1].startsWith("e")) {
|
||||||
Glide.with(getActivity()).load(photo).into(ivScutcheon);
|
Glide.with(getActivity()).load(photo).into(ivScutcheon);
|
||||||
ivScutcheon.setTag(photo);
|
tvScutcheon.setTag(photo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -549,7 +570,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
obtain.what = Constant.CHARGING_STATION;
|
obtain.what = Constant.CHARGING_STATION;
|
||||||
obtain.obj = showStation;
|
obtain.obj = showStation;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
}else {
|
} else {
|
||||||
Message obtains = Message.obtain();
|
Message obtains = Message.obtain();
|
||||||
obtains.what = Constant.CHARGING_STATION_PILE;
|
obtains.what = Constant.CHARGING_STATION_PILE;
|
||||||
obtains.obj = null;
|
obtains.obj = null;
|
||||||
@ -676,14 +697,14 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
chargingStationList = new ArrayList<>();
|
chargingStationList = new ArrayList<>();
|
||||||
String tagPanorama = (String) ivPanorama.getTag();
|
String tagPanorama = (String) tvPanorama.getTag();
|
||||||
if (tagPanorama == null) {
|
if (tagPanorama == null) {
|
||||||
Toast.makeText(getContext(), "请拍照", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "请拍照", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
chargingStationList.add(new File(tagPanorama));
|
chargingStationList.add(new File(tagPanorama));
|
||||||
}
|
}
|
||||||
String tagName = (String) ivName.getTag();
|
String tagName = (String) tvName.getTag();
|
||||||
if (tagName == null) {
|
if (tagName == null) {
|
||||||
Toast.makeText(getContext(), "请拍照", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "请拍照", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
@ -691,21 +712,21 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
chargingStationList.add(new File(tagName));
|
chargingStationList.add(new File(tagName));
|
||||||
}
|
}
|
||||||
if (existence == 0) {
|
if (existence == 0) {
|
||||||
String tagInternal = (String) ivInternal.getTag();
|
String tagInternal = (String) tvInternal.getTag();
|
||||||
if (tagInternal == null) {
|
if (tagInternal == null) {
|
||||||
Toast.makeText(getContext(), "请拍照", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "请拍照", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
chargingStationList.add(new File(tagInternal));
|
chargingStationList.add(new File(tagInternal));
|
||||||
}
|
}
|
||||||
String tagElse = (String) ivElse.getTag();
|
String tagElse = (String) tvElse.getTag();
|
||||||
if (tagElse == null) {
|
if (tagElse == null) {
|
||||||
Toast.makeText(getContext(), "请拍照", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "请拍照", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
chargingStationList.add(new File(tagElse));
|
chargingStationList.add(new File(tagElse));
|
||||||
}
|
}
|
||||||
String tagScutcheon = (String) ivScutcheon.getTag();
|
String tagScutcheon = (String) tvScutcheon.getTag();
|
||||||
if (tagScutcheon == null) {
|
if (tagScutcheon == null) {
|
||||||
Toast.makeText(getContext(), "请拍照", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "请拍照", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
@ -737,22 +758,32 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
break;
|
break;
|
||||||
case R.id.rl_panorama:
|
case R.id.rl_panorama:
|
||||||
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
photoFile = PhotoUtils.showPhotoFile("a", latLng);
|
||||||
|
intentPanorama.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile));
|
||||||
startActivityForResult(intentPanorama, 101);
|
startActivityForResult(intentPanorama, 101);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_name:
|
case R.id.rl_name:
|
||||||
Intent intentName = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentName = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
photoFile = PhotoUtils.showPhotoFile("b", latLng);
|
||||||
|
intentName.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile));
|
||||||
startActivityForResult(intentName, 102);
|
startActivityForResult(intentName, 102);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_internal_photos:
|
case R.id.rl_internal_photos:
|
||||||
Intent intentInternal = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentInternal = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
photoFile = PhotoUtils.showPhotoFile("c", latLng);
|
||||||
|
intentInternal.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile));
|
||||||
startActivityForResult(intentInternal, 103);
|
startActivityForResult(intentInternal, 103);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_else:
|
case R.id.rl_else:
|
||||||
Intent intentElse = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentElse = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
photoFile = PhotoUtils.showPhotoFile("d", latLng);
|
||||||
|
intentElse.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile));
|
||||||
startActivityForResult(intentElse, 104);
|
startActivityForResult(intentElse, 104);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_scutcheon:
|
case R.id.rl_scutcheon:
|
||||||
Intent intentScutcheon = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentScutcheon = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
photoFile = PhotoUtils.showPhotoFile("e", latLng);
|
||||||
|
intentScutcheon.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile));
|
||||||
startActivityForResult(intentScutcheon, 105);
|
startActivityForResult(intentScutcheon, 105);
|
||||||
break;
|
break;
|
||||||
case R.id.linear_charging_pile:
|
case R.id.linear_charging_pile:
|
||||||
@ -853,85 +884,12 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
public void onGranted(List<String> permissions, boolean all) {
|
public void onGranted(List<String> permissions, boolean all) {
|
||||||
if (all) {
|
if (all) {
|
||||||
//保存数据库:
|
//保存数据库:
|
||||||
PoiEntity poiEntity = showPoiEntity;
|
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
||||||
List<Info> infoPhoto = new ArrayList<>();
|
PoiCheckResult poiCheckResult = checkPoiEntity(poiEntity);
|
||||||
String name = editNameContent.getText().toString().trim();//名称
|
if (poiCheckResult.getCode() == 1) {
|
||||||
if (name == null || name.equals("")) {
|
Toast.makeText(getActivity(), poiCheckResult.getMsg()+"", Toast.LENGTH_SHORT).show();
|
||||||
Toast.makeText(getActivity(), "请输入充电站 名称", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
poiEntity.setName(name);
|
|
||||||
}
|
}
|
||||||
String site = editSiteContent.getText().toString().trim();
|
|
||||||
if (site != null && !site.equals("")) {
|
|
||||||
poiEntity.setAddress(site);
|
|
||||||
}
|
|
||||||
if (latLng == null) {
|
|
||||||
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
String encode = Geohash.getInstance().encode(latLng.latitude, latLng.longitude);
|
|
||||||
poiEntity.setGeoWkt(encode);
|
|
||||||
poiEntity.setX(String.valueOf(latLng.longitude));
|
|
||||||
poiEntity.setY(String.valueOf(latLng.latitude));
|
|
||||||
}
|
|
||||||
String describe = editDescribe.getText().toString().trim();
|
|
||||||
if (describe != null && !describe.equals("")) {
|
|
||||||
poiEntity.setMemo(describe);
|
|
||||||
}
|
|
||||||
boolean phoneBean = contactView.getPhoneBean();
|
|
||||||
if (phoneBean) {
|
|
||||||
String list = contactView.getList();
|
|
||||||
poiEntity.setTelPhone(list);
|
|
||||||
}
|
|
||||||
String tagPanorama = (String) ivPanorama.getTag();
|
|
||||||
if (tagPanorama == null) {
|
|
||||||
Toast.makeText(getActivity(), "请拍照 全景图", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
infoPhoto.add(new Info(tagPanorama));
|
|
||||||
}
|
|
||||||
String tagName = (String) ivName.getTag();
|
|
||||||
if (tagName == null) {
|
|
||||||
Toast.makeText(getActivity(), "请拍照 名称照片", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
infoPhoto.add(new Info(tagName));
|
|
||||||
}
|
|
||||||
if (existence == 0) {
|
|
||||||
String tagInternal = (String) ivInternal.getTag();
|
|
||||||
if (tagInternal == null) {
|
|
||||||
Toast.makeText(getActivity(), "请拍照 服务说明", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
infoPhoto.add(new Info(tagInternal));
|
|
||||||
}
|
|
||||||
String tagElse = (String) ivElse.getTag();
|
|
||||||
if (tagElse == null) {
|
|
||||||
Toast.makeText(getActivity(), "请拍照 充电站指引牌", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
infoPhoto.add(new Info(tagElse));
|
|
||||||
}
|
|
||||||
String tagScutcheon = (String) ivScutcheon.getTag();
|
|
||||||
if (tagScutcheon == null) {
|
|
||||||
Toast.makeText(getActivity(), "请拍照 收费标牌", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
infoPhoto.add(new Info(tagScutcheon));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
poiEntity.setExistence(existence);
|
|
||||||
poiEntity.setPhotoInfo(infoPhoto);
|
|
||||||
poiEntity.setStation_type(station_type);
|
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
|
||||||
String format = formatter.format(calendar.getTime());
|
|
||||||
poiEntity.setCreateTime(format);
|
|
||||||
poiEntity.setType(2);
|
|
||||||
poiEntity.setTaskStatus(2);
|
|
||||||
poiEntity.setIsLocalData(1);
|
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -962,7 +920,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void stationUploadByNetWork(PoiEntity poiEntity, ArrayList<File> chargingStationList) {
|
private void stationUploadByNetWork(PoiEntity poiEntity, ArrayList<File> chargingStationList) {
|
||||||
showLoadingDialog();
|
showFileLoadingDialog();
|
||||||
if (poiEntity == null || poiEntity.getBodyId() == 0) {
|
if (poiEntity == null || poiEntity.getBodyId() == 0) {
|
||||||
Toast.makeText(getActivity(), "没有保存本地", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "没有保存本地", Toast.LENGTH_SHORT).show();
|
||||||
Log.e("TAG", "poiUploadByNetWork: " + poiEntity.getBodyId() + chargingStationList);
|
Log.e("TAG", "poiUploadByNetWork: " + poiEntity.getBodyId() + chargingStationList);
|
||||||
@ -1106,7 +1064,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(ChargingStationBean chargingStationBean, int id) {
|
public void onSuccess(ChargingStationBean chargingStationBean, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
|
if (chargingStationBean.getCode() == 200) {
|
||||||
bodyId = chargingStationBean.getBody();
|
bodyId = chargingStationBean.getBody();
|
||||||
|
if (bodyId != null && bodyId != 0) {
|
||||||
poiEntity.setBodyId(bodyId);
|
poiEntity.setBodyId(bodyId);
|
||||||
poiEntity.setTaskStatus(3);
|
poiEntity.setTaskStatus(3);
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@ -1130,6 +1090,12 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(getContext(), "" + chargingStationBean.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(getContext(), "" + chargingStationBean.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1143,60 +1109,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String initShowStation() {
|
private String initShowStation() {
|
||||||
PoiEntity poiEntity = showPoiEntity;
|
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
||||||
List<Info> infoPhoto = new ArrayList<>();
|
|
||||||
String name = editNameContent.getText().toString().trim();//名称
|
|
||||||
if (name != null && !name.equals("")) {
|
|
||||||
poiEntity.setName(name);
|
|
||||||
}
|
|
||||||
String site = editSiteContent.getText().toString().trim();
|
|
||||||
if (site != null && !site.equals("")) {
|
|
||||||
poiEntity.setAddress(site);
|
|
||||||
}
|
|
||||||
if (latLng != null) {
|
|
||||||
poiEntity.setX(String.valueOf(latLng.longitude));
|
|
||||||
poiEntity.setY(String.valueOf(latLng.latitude));
|
|
||||||
}
|
|
||||||
String describe = editDescribe.getText().toString().trim();
|
|
||||||
if (describe != null && !describe.equals("")) {
|
|
||||||
poiEntity.setMemo(describe);
|
|
||||||
}
|
|
||||||
boolean phoneBean = contactView.getPhoneBean();
|
|
||||||
if (phoneBean) {
|
|
||||||
String list = contactView.getList();
|
|
||||||
poiEntity.setTelPhone(list);
|
|
||||||
}
|
|
||||||
String tagPanorama = (String) ivPanorama.getTag();
|
|
||||||
if (tagPanorama != null && !tagPanorama.equals("")) {
|
|
||||||
infoPhoto.add(new Info(tagPanorama));
|
|
||||||
}
|
|
||||||
String tagName = (String) ivName.getTag();
|
|
||||||
if (tagName != null && !tagName.equals("")) {
|
|
||||||
infoPhoto.add(new Info(tagName));
|
|
||||||
}
|
|
||||||
String tagInternal = (String) ivInternal.getTag();
|
|
||||||
if (tagInternal != null && !tagInternal.equals("")) {
|
|
||||||
infoPhoto.add(new Info(tagInternal));
|
|
||||||
}
|
|
||||||
String tagElse = (String) ivElse.getTag();
|
|
||||||
if (tagElse != null && !tagElse.equals("")) {
|
|
||||||
infoPhoto.add(new Info(tagElse));
|
|
||||||
}
|
|
||||||
String tagScutcheon = (String) ivScutcheon.getTag();
|
|
||||||
if (tagScutcheon != null && !tagScutcheon.equals("")) {
|
|
||||||
infoPhoto.add(new Info(tagScutcheon));
|
|
||||||
}
|
|
||||||
poiEntity.setPhotoInfo(infoPhoto);
|
|
||||||
poiEntity.setStation_type(station_type);
|
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
|
||||||
String format = formatter.format(calendar.getTime());
|
|
||||||
poiEntity.setCreateTime(format);
|
|
||||||
poiEntity.setExistence(existence);
|
|
||||||
poiEntity.setType(2);
|
|
||||||
poiEntity.setTaskStatus(2);
|
|
||||||
poiEntity.setIsLocalData(1);
|
|
||||||
String newPoiEntity = new Gson().toJson(poiEntity);
|
String newPoiEntity = new Gson().toJson(poiEntity);
|
||||||
return newPoiEntity;
|
return newPoiEntity;
|
||||||
}
|
}
|
||||||
@ -1220,61 +1133,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
//获取Editor对象
|
//获取Editor对象
|
||||||
SharedPreferences.Editor edit = poi.edit();
|
SharedPreferences.Editor edit = poi.edit();
|
||||||
//根据要保存的数据的类型,调用对应的put方法,
|
//根据要保存的数据的类型,调用对应的put方法,
|
||||||
|
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
||||||
PoiEntity poiEntity = showPoiEntity;
|
|
||||||
List<Info> infoPhoto = new ArrayList<>();
|
|
||||||
String name = editNameContent.getText().toString().trim();//名称
|
|
||||||
if (name != null && !name.equals("")) {
|
|
||||||
poiEntity.setName(name);
|
|
||||||
}
|
|
||||||
String site = editSiteContent.getText().toString().trim();
|
|
||||||
if (site != null && !site.equals("")) {
|
|
||||||
poiEntity.setAddress(site);
|
|
||||||
}
|
|
||||||
if (latLng != null) {
|
|
||||||
poiEntity.setX(String.valueOf(latLng.longitude));
|
|
||||||
poiEntity.setY(String.valueOf(latLng.latitude));
|
|
||||||
}
|
|
||||||
String describe = editDescribe.getText().toString().trim();
|
|
||||||
if (describe != null && !describe.equals("")) {
|
|
||||||
poiEntity.setMemo(describe);
|
|
||||||
}
|
|
||||||
boolean phoneBean = contactView.getPhoneBean();
|
|
||||||
if (phoneBean) {
|
|
||||||
String list = contactView.getList();
|
|
||||||
poiEntity.setTelPhone(list);
|
|
||||||
}
|
|
||||||
String tagPanorama = (String) ivPanorama.getTag();
|
|
||||||
if (tagPanorama != null && !tagPanorama.equals("")) {
|
|
||||||
infoPhoto.add(new Info(tagPanorama));
|
|
||||||
}
|
|
||||||
String tagName = (String) ivName.getTag();
|
|
||||||
if (tagName != null && !tagName.equals("")) {
|
|
||||||
infoPhoto.add(new Info(tagName));
|
|
||||||
}
|
|
||||||
String tagInternal = (String) ivInternal.getTag();
|
|
||||||
if (tagInternal != null && !tagInternal.equals("")) {
|
|
||||||
infoPhoto.add(new Info(tagInternal));
|
|
||||||
}
|
|
||||||
String tagElse = (String) ivElse.getTag();
|
|
||||||
if (tagElse != null && !tagElse.equals("")) {
|
|
||||||
infoPhoto.add(new Info(tagElse));
|
|
||||||
}
|
|
||||||
String tagScutcheon = (String) ivScutcheon.getTag();
|
|
||||||
if (tagScutcheon != null && !tagScutcheon.equals("")) {
|
|
||||||
infoPhoto.add(new Info(tagScutcheon));
|
|
||||||
}
|
|
||||||
poiEntity.setPhotoInfo(infoPhoto);
|
|
||||||
poiEntity.setStation_type(station_type);
|
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
|
||||||
String format = formatter.format(calendar.getTime());
|
|
||||||
poiEntity.setCreateTime(format);
|
|
||||||
poiEntity.setExistence(existence);
|
|
||||||
poiEntity.setType(2);
|
|
||||||
poiEntity.setTaskStatus(2);
|
|
||||||
poiEntity.setIsLocalData(1);
|
|
||||||
String newPoiEntity = new Gson().toJson(poiEntity);
|
String newPoiEntity = new Gson().toJson(poiEntity);
|
||||||
//以键值对的形式添加新值。
|
//以键值对的形式添加新值。
|
||||||
edit.putString("poiEntity", newPoiEntity);
|
edit.putString("poiEntity", newPoiEntity);
|
||||||
@ -1287,11 +1146,13 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
if (requestCode == 101 && resultCode == RESULT_OK) {
|
if (requestCode == 101 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (photoFile == null || !photoFile.exists()) {
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
ToastUtil.showShort(getActivity(), "取消拍照");
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
return;
|
||||||
ivPanorama.setTag(takePhotoPath);
|
}
|
||||||
ivPanorama.setImageBitmap(bitmap);//显示图像
|
String photoPath = PhotoUtils.showPhotoAndGetPath(photoFile, ivPanorama);
|
||||||
|
tvPanorama.setTag(photoPath);
|
||||||
|
photoFile = null;
|
||||||
/* int height = bitmap.getHeight();
|
/* int height = bitmap.getHeight();
|
||||||
int width = bitmap.getWidth();
|
int width = bitmap.getWidth();
|
||||||
if (height > width) {
|
if (height > width) {
|
||||||
@ -1308,11 +1169,13 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
|
|
||||||
}*/
|
}*/
|
||||||
} else if (requestCode == 102 && resultCode == RESULT_OK) {
|
} else if (requestCode == 102 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (photoFile == null || !photoFile.exists()) {
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
ToastUtil.showShort(getActivity(), "取消拍照");
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "b", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
return;
|
||||||
ivName.setTag(takePhotoPath);
|
}
|
||||||
ivName.setImageBitmap(bitmap);//显示图像
|
String photoPath = PhotoUtils.showPhotoAndGetPath(photoFile, ivName);
|
||||||
|
tvName.setTag(photoPath);
|
||||||
|
photoFile = null;
|
||||||
/*int height = bitmap.getHeight();
|
/*int height = bitmap.getHeight();
|
||||||
int width = bitmap.getWidth();
|
int width = bitmap.getWidth();
|
||||||
if (height > width) {
|
if (height > width) {
|
||||||
@ -1329,11 +1192,13 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
|
|
||||||
}*/
|
}*/
|
||||||
} else if (requestCode == 103 && resultCode == RESULT_OK) {
|
} else if (requestCode == 103 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (photoFile == null || !photoFile.exists()) {
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
ToastUtil.showShort(getActivity(), "取消拍照");
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
return;
|
||||||
ivInternal.setTag(takePhotoPath);
|
}
|
||||||
ivInternal.setImageBitmap(bitmap);//显示图像
|
String photoPath = PhotoUtils.showPhotoAndGetPath(photoFile, ivInternal);
|
||||||
|
tvInternal.setTag(photoPath);
|
||||||
|
photoFile = null;
|
||||||
/*int height = bitmap.getHeight();
|
/*int height = bitmap.getHeight();
|
||||||
int width = bitmap.getWidth();
|
int width = bitmap.getWidth();
|
||||||
if (height > width) {
|
if (height > width) {
|
||||||
@ -1350,11 +1215,13 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
|
|
||||||
}*/
|
}*/
|
||||||
} else if (requestCode == 104 && resultCode == RESULT_OK) {
|
} else if (requestCode == 104 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (photoFile == null || !photoFile.exists()) {
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
ToastUtil.showShort(getActivity(), "取消拍照");
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "d", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
return;
|
||||||
ivElse.setTag(takePhotoPath);
|
}
|
||||||
ivElse.setImageBitmap(bitmap);//显示图像
|
String photoPath = PhotoUtils.showPhotoAndGetPath(photoFile, ivElse);
|
||||||
|
tvElse.setTag(photoPath);
|
||||||
|
photoFile = null;
|
||||||
/* int height = bitmap.getHeight();
|
/* int height = bitmap.getHeight();
|
||||||
int width = bitmap.getWidth();
|
int width = bitmap.getWidth();
|
||||||
if (height > width) {
|
if (height > width) {
|
||||||
@ -1371,11 +1238,13 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
|
|
||||||
}*/
|
}*/
|
||||||
} else if (requestCode == 105 && resultCode == RESULT_OK) {
|
} else if (requestCode == 105 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (photoFile == null || !photoFile.exists()) {
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
ToastUtil.showShort(getActivity(), "取消拍照");
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "e", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
return;
|
||||||
ivScutcheon.setTag(takePhotoPath);
|
}
|
||||||
ivScutcheon.setImageBitmap(bitmap);//显示图像
|
String photoPath = PhotoUtils.showPhotoAndGetPath(photoFile, ivScutcheon);
|
||||||
|
tvScutcheon.setTag(photoPath);
|
||||||
|
photoFile = null;
|
||||||
/* int height = bitmap.getHeight();
|
/* int height = bitmap.getHeight();
|
||||||
int width = bitmap.getWidth();
|
int width = bitmap.getWidth();
|
||||||
if (height > width) {
|
if (height > width) {
|
||||||
@ -1465,11 +1334,129 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
public void run() {
|
public void run() {
|
||||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||||
if (poiDaoPoiEntity != null) {
|
if (poiDaoPoiEntity != null) {
|
||||||
if (poiDaoPoiEntity.getTaskStatus()==5){
|
if (poiDaoPoiEntity.getTaskStatus() == 5) {
|
||||||
poiDao.deletePoiEntity(poiDaoPoiEntity);
|
poiDao.deletePoiEntity(poiDaoPoiEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PoiEntity initPoiEntityByUI(PoiEntity poiEntity) {
|
||||||
|
List<Info> infoPhoto = new ArrayList<>();
|
||||||
|
String name = editNameContent.getText().toString().trim();//名称
|
||||||
|
if (name != null && !name.equals("")) {
|
||||||
|
poiEntity.setName(name);
|
||||||
|
}
|
||||||
|
String site = editSiteContent.getText().toString().trim();
|
||||||
|
if (site != null && !site.equals("")) {
|
||||||
|
poiEntity.setAddress(site);
|
||||||
|
}
|
||||||
|
if (latLng != null) {
|
||||||
|
String encode = Geohash.getInstance().encode(latLng.latitude, latLng.longitude);
|
||||||
|
poiEntity.setGeoWkt(encode);
|
||||||
|
poiEntity.setX(String.valueOf(latLng.longitude));
|
||||||
|
poiEntity.setY(String.valueOf(latLng.latitude));
|
||||||
|
}
|
||||||
|
String describe = editDescribe.getText().toString().trim();
|
||||||
|
if (describe != null && !describe.equals("")) {
|
||||||
|
poiEntity.setMemo(describe);
|
||||||
|
}
|
||||||
|
boolean phoneBean = contactView.getPhoneBean();
|
||||||
|
if (phoneBean) {
|
||||||
|
String list = contactView.getList();
|
||||||
|
poiEntity.setTelPhone(list);
|
||||||
|
}
|
||||||
|
String tagPanorama = (String) tvPanorama.getTag();
|
||||||
|
if (tagPanorama != null && !tagPanorama.equals("")) {
|
||||||
|
infoPhoto.add(new Info(tagPanorama));
|
||||||
|
}
|
||||||
|
String tagName = (String) tvName.getTag();
|
||||||
|
if (tagName != null && !tagName.equals("")) {
|
||||||
|
infoPhoto.add(new Info(tagName));
|
||||||
|
}
|
||||||
|
String tagInternal = (String) tvInternal.getTag();
|
||||||
|
if (tagInternal != null && !tagInternal.equals("")) {
|
||||||
|
infoPhoto.add(new Info(tagInternal));
|
||||||
|
}
|
||||||
|
String tagElse = (String) tvElse.getTag();
|
||||||
|
if (tagElse != null && !tagElse.equals("")) {
|
||||||
|
infoPhoto.add(new Info(tagElse));
|
||||||
|
}
|
||||||
|
String tagScutcheon = (String) tvScutcheon.getTag();
|
||||||
|
if (tagScutcheon != null && !tagScutcheon.equals("")) {
|
||||||
|
infoPhoto.add(new Info(tagScutcheon));
|
||||||
|
}
|
||||||
|
poiEntity.setPhotoInfo(infoPhoto);
|
||||||
|
poiEntity.setStation_type(station_type);
|
||||||
|
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||||
|
String format = formatter.format(calendar.getTime());
|
||||||
|
poiEntity.setCreateTime(format);
|
||||||
|
poiEntity.setExistence(existence);
|
||||||
|
poiEntity.setType(2);
|
||||||
|
poiEntity.setTaskStatus(2);
|
||||||
|
poiEntity.setIsLocalData(1);
|
||||||
|
return poiEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PoiCheckResult checkPoiEntity(PoiEntity entity) {
|
||||||
|
PoiCheckResult poiCheckResult = new PoiCheckResult();
|
||||||
|
if (entity.getName()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请输入 名称");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if (tvPanorama.getTag()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请拍照 全景图");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if (tvName.getTag()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请拍照 名称照片");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if (entity.getExistence()==0){
|
||||||
|
if (tvInternal.getTag()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请拍照 服务说明");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if (tvElse.getTag()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请拍照 充电站指引牌");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if (tvScutcheon.getTag()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请拍照 收费标牌");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (entity.getX()==null&&entity.getY()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请确定 点位");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if (entity.getTelPhone()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请输入 手机号");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ChargingPileEntity initChargingPileEntityByUI(ChargingPileEntity entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PoiCheckResult checkChargingPileEntity(ChargingPileEntity entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
@ -23,6 +23,7 @@ import com.navinfo.outdoor.adapter.FilterAdapter;
|
|||||||
import com.navinfo.outdoor.api.Constant;
|
import com.navinfo.outdoor.api.Constant;
|
||||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||||
import com.navinfo.outdoor.bean.JobSearchBean;
|
import com.navinfo.outdoor.bean.JobSearchBean;
|
||||||
|
import com.navinfo.outdoor.room.ChargingPileEntity;
|
||||||
import com.navinfo.outdoor.room.PoiDao;
|
import com.navinfo.outdoor.room.PoiDao;
|
||||||
import com.navinfo.outdoor.room.PoiDatabase;
|
import com.navinfo.outdoor.room.PoiDatabase;
|
||||||
import com.navinfo.outdoor.room.PoiEntity;
|
import com.navinfo.outdoor.room.PoiEntity;
|
||||||
@ -293,14 +294,17 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
|
|
||||||
case R.id.btn_filter:
|
case R.id.btn_filter:
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.FILTER_LIST;
|
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||||
obtain.obj = poiEntities;
|
obtain.obj = true;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
break;
|
|
||||||
|
|
||||||
|
Message mainButtonVisiableMsg = Message.obtain();
|
||||||
|
mainButtonVisiableMsg.what = Constant.MAIN_BUTTON_VISIABLE;
|
||||||
|
mainButtonVisiableMsg.obj = View.VISIBLE;
|
||||||
|
EventBus.getDefault().post(mainButtonVisiableMsg);
|
||||||
|
break;
|
||||||
case R.id.cl_number:
|
case R.id.cl_number:
|
||||||
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"200", "500", "1000"}, new OnMenuItemClickListener() {
|
BottomMenu.show((AppCompatActivity) getContext(), new String[]{"200", "500", "1000"}, new OnMenuItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -435,4 +439,23 @@ public class FilterFragment extends BaseDrawerFragment implements View.OnClickLi
|
|||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PoiEntity initPoiEntityByUI(PoiEntity entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected PoiCheckResult checkPoiEntity(PoiEntity entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ChargingPileEntity initChargingPileEntityByUI(ChargingPileEntity entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PoiCheckResult checkChargingPileEntity(ChargingPileEntity entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,21 +2,30 @@ package com.navinfo.outdoor.fragment;
|
|||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.lzy.okgo.model.HttpParams;
|
||||||
import com.navinfo.outdoor.R;
|
import com.navinfo.outdoor.R;
|
||||||
|
import com.navinfo.outdoor.api.Constant;
|
||||||
import com.navinfo.outdoor.base.BaseFragment;
|
import com.navinfo.outdoor.base.BaseFragment;
|
||||||
|
import com.navinfo.outdoor.bean.UserBean;
|
||||||
|
import com.navinfo.outdoor.http.Callback;
|
||||||
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 忘记密码页面
|
* 忘记密码页面
|
||||||
*/
|
*/
|
||||||
public class ForgetPawFragment extends BaseFragment implements View.OnClickListener{
|
public class ForgetPawFragment extends BaseFragment implements View.OnClickListener {
|
||||||
private ImageView ivFinish;
|
private ImageView ivFinish;
|
||||||
private TextView title,tvForgetPaw, forgetPawGetNote;
|
private TextView forgetPawGetNote;
|
||||||
private EditText etForgetPawPhone, etForgetPawNote, etForgetPawPaw, etForgetPawConfirmPaw;
|
private EditText etForgetPawPhone, etForgetPawNote, etForgetPawPaw, etForgetPawConfirmPaw;
|
||||||
|
private Button btnForgetPaw;
|
||||||
|
private String sessionId;
|
||||||
|
|
||||||
public static ForgetPawFragment newInstance(Bundle bundle) {
|
public static ForgetPawFragment newInstance(Bundle bundle) {
|
||||||
ForgetPawFragment fragment = new ForgetPawFragment();
|
ForgetPawFragment fragment = new ForgetPawFragment();
|
||||||
@ -33,30 +42,129 @@ public class ForgetPawFragment extends BaseFragment implements View.OnClickListe
|
|||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
ivFinish = findViewById(R.id.iv_forgePaw_finish);
|
ivFinish = findViewById(R.id.iv_forgePaw_finish);
|
||||||
|
ivFinish.setOnClickListener(this);
|
||||||
etForgetPawPhone = findViewById(R.id.et_forgetPaw_phone);
|
etForgetPawPhone = findViewById(R.id.et_forgetPaw_phone);
|
||||||
etForgetPawNote = findViewById(R.id.et_forgetPaw_note);
|
etForgetPawNote = findViewById(R.id.et_forgetPaw_note);
|
||||||
etForgetPawPaw = findViewById(R.id.et_forgetPaw_paw);
|
etForgetPawPaw = findViewById(R.id.et_forgetPaw_paw);
|
||||||
etForgetPawConfirmPaw = findViewById(R.id.et_forgetPaw_confirm_paw);
|
etForgetPawConfirmPaw = findViewById(R.id.et_forgetPaw_confirm_paw);
|
||||||
forgetPawGetNote = findViewById(R.id.forgetPaw_get_note);
|
forgetPawGetNote = findViewById(R.id.forgetPaw_get_note);
|
||||||
tvForgetPaw = findViewById(R.id.tv_forgetPaw);
|
|
||||||
ivFinish.setOnClickListener(this);
|
|
||||||
forgetPawGetNote.setOnClickListener(this);
|
forgetPawGetNote.setOnClickListener(this);
|
||||||
|
btnForgetPaw = findViewById(R.id.btn_forgetPaw);
|
||||||
|
btnForgetPaw.setOnClickListener(this::onClick);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void initData() {
|
|
||||||
super.initData();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()){
|
switch (v.getId()) {
|
||||||
case R.id.iv_forgePaw_finish:
|
case R.id.iv_forgePaw_finish:
|
||||||
getActivity().finish();
|
getActivity().finish();
|
||||||
break;
|
break;
|
||||||
case R.id.forgetPaw_get_note:
|
case R.id.forgetPaw_get_note:
|
||||||
Toast.makeText(getActivity(), "忘记密码获取验证码", Toast.LENGTH_SHORT).show();
|
initGetNote();
|
||||||
|
break;
|
||||||
|
case R.id.btn_forgetPaw:
|
||||||
|
initForgetPaw();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initForgetPaw() {
|
||||||
|
HttpParams httpParams = new HttpParams();
|
||||||
|
String mobile = etForgetPawPhone.getText().toString().trim();
|
||||||
|
if (mobile == null || mobile.equals("")) {
|
||||||
|
Toast.makeText(getContext(), "请输入手机号", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
httpParams.put("mobile", mobile);
|
||||||
|
}
|
||||||
|
String code = etForgetPawNote.getText().toString().trim();
|
||||||
|
if (code == null || code.equals("")) {
|
||||||
|
Toast.makeText(getContext(), "请获取短信验证码", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
httpParams.put("code", code);
|
||||||
|
}
|
||||||
|
String password = etForgetPawPaw.getText().toString().trim();
|
||||||
|
if (password == null || password.equals("")) {
|
||||||
|
Toast.makeText(getContext(), "请输入密码", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
httpParams.put("password", password);
|
||||||
|
}
|
||||||
|
String conFirmPaw = etForgetPawConfirmPaw.getText().toString().trim();
|
||||||
|
if (conFirmPaw == null || conFirmPaw.equals("")) {
|
||||||
|
Toast.makeText(getContext(), "请输入确认密码", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!conFirmPaw.equals(password)) {
|
||||||
|
Toast.makeText(getContext(), "密码和确认密码请保持一致", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
if (sessionId == null || sessionId.equals("")) {
|
||||||
|
Toast.makeText(getContext(), "请短信获取验证码", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
httpParams.put("sessionId", sessionId);
|
||||||
|
}
|
||||||
|
long time=System.currentTimeMillis();
|
||||||
|
httpParams.put("datetime",time);
|
||||||
|
showLoadingDialog();
|
||||||
|
OkGoBuilder.getInstance()
|
||||||
|
.Builder(getActivity())
|
||||||
|
.url(HttpInterface.USER_FORGET_PASSWORD)
|
||||||
|
.token(null)
|
||||||
|
.params(httpParams)
|
||||||
|
.cls(UserBean.class)
|
||||||
|
.postRequest(new Callback<UserBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(UserBean response, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
Toast.makeText(getActivity(), e.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initGetNote() {
|
||||||
|
HttpParams httpParams = new HttpParams();
|
||||||
|
String mobile = etForgetPawPhone.getText().toString().trim();
|
||||||
|
if (mobile == null || mobile.equals("")) {
|
||||||
|
Toast.makeText(getContext(), "请输入手机号", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
httpParams.put("telephone", mobile);
|
||||||
|
}
|
||||||
|
httpParams.put("type", 2);
|
||||||
|
showLoadingDialog();
|
||||||
|
OkGoBuilder.getInstance()
|
||||||
|
.Builder(getActivity())
|
||||||
|
.url(HttpInterface.USER_MESSAGE)
|
||||||
|
.cls(UserBean.class)
|
||||||
|
.token(Constant.ACCESS_TOKEN)
|
||||||
|
.params(httpParams)
|
||||||
|
.getRequest(new Callback<UserBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(UserBean response, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
if (response.getCode() == 200) {
|
||||||
|
sessionId = String.valueOf(response.getBody());
|
||||||
|
}
|
||||||
|
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
@ -27,6 +27,7 @@ import com.navinfo.outdoor.room.InsertAndUpdateUtils;
|
|||||||
import com.navinfo.outdoor.room.PoiDao;
|
import com.navinfo.outdoor.room.PoiDao;
|
||||||
import com.navinfo.outdoor.room.PoiDatabase;
|
import com.navinfo.outdoor.room.PoiDatabase;
|
||||||
import com.navinfo.outdoor.room.PoiEntity;
|
import com.navinfo.outdoor.room.PoiEntity;
|
||||||
|
import com.navinfo.outdoor.util.Geohash;
|
||||||
import com.navinfo.outdoor.util.GeometryTools;
|
import com.navinfo.outdoor.util.GeometryTools;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
|
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptorFactory;
|
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptorFactory;
|
||||||
@ -131,22 +132,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
if (poiEntity.getDist() != null) {
|
if (poiEntity.getDist() != null) {
|
||||||
tvDistance.setText("距离:" + format5(Double.valueOf(poiEntity.getDist()) / 1000) + "km");
|
tvDistance.setText("距离:" + format5(Double.valueOf(poiEntity.getDist()) / 1000) + "km");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (poiEntity.getTaskStatus() < 2) {
|
|
||||||
double latitude = Constant.currentLocation.getLatitude();
|
|
||||||
double longitude = Constant.currentLocation.getLongitude();
|
|
||||||
LatLng startLatLng = new LatLng(latitude, longitude); //用户当前位置
|
|
||||||
LatLng endLatLng = new LatLng(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX()));
|
|
||||||
double v = GeometryTools.distanceToDouble(startLatLng, endLatLng);
|
|
||||||
if (v > 5000) {
|
|
||||||
Message obtain = Message.obtain();
|
|
||||||
obtain.what = Constant.EVENT_WORK_UNPOLYGON;
|
|
||||||
obtain.obj = true;
|
|
||||||
EventBus.getDefault().post(obtain);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
int taskStatus = poiEntity.getTaskStatus();
|
int taskStatus = poiEntity.getTaskStatus();
|
||||||
initViewByTaskStatus(taskStatus);
|
initViewByTaskStatus(taskStatus);
|
||||||
@ -190,33 +175,26 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
case R.id.btn_cancel_get://结束领取
|
case R.id.btn_cancel_get://结束领取
|
||||||
if (poiEntity != null) {
|
if (poiEntity != null) {
|
||||||
int type = poiEntity.getType();
|
initEndReceiveTask(HttpInterface.UNRECEIVED_POLYGON_TASK, poiEntity.getTaskId(), poiEntity);
|
||||||
if (type == 6) {
|
|
||||||
initUnPolygonTask(HttpInterface.UNRECEIVED_POLYGON_TASK, poiEntity.getTaskId(), poiEntity);
|
|
||||||
} else {
|
|
||||||
new Thread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
poiDao.deletePoiEntity(poiEntity);
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
btnGetTask.setVisibility(View.VISIBLE);
|
|
||||||
btnCancelGet.setVisibility(View.GONE);
|
|
||||||
btnGather.setVisibility(View.VISIBLE);
|
|
||||||
btnFinishGather.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case R.id.btn_get_task://领取任务
|
case R.id.btn_get_task://领取任务
|
||||||
|
/* if (poiEntity.getTaskStatus() < 2) {
|
||||||
|
double latitude = Constant.currentLocation.getLatitude();
|
||||||
|
double longitude = Constant.currentLocation.getLongitude();
|
||||||
|
LatLng startLatLng = new LatLng(latitude, longitude); //用户当前位置
|
||||||
|
LatLng endLatLng = new LatLng(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX()));
|
||||||
|
double geometry = GeometryTools.distanceToDouble(startLatLng, endLatLng);
|
||||||
|
if (geometry > 5000) {
|
||||||
|
Toast.makeText(getActivity(), "作业不在领取范围内,无法领取", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
if (poiEntity != null) {
|
if (poiEntity != null) {
|
||||||
int type = poiEntity.getType();
|
int type = poiEntity.getType();
|
||||||
if (type == 6) {//面状任务的领取类型
|
if (type == 6) {//面状任务的领取类型
|
||||||
initPolygonTask(HttpInterface.RECEIVED_POLYGON_TASK, poiEntity.getTaskId(), false, poiEntity);
|
initPolygonTask(HttpInterface.RECEIVED_POLYGON_TASK, poiEntity.getTaskId(), false);
|
||||||
} else if (type == 1) {//poi的领取类型
|
} else if (type == 1) {//poi的领取类型
|
||||||
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK, poiEntity.getTaskId(), false, poiEntity, 1);
|
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK, poiEntity.getTaskId(), false, poiEntity, 1);
|
||||||
} else if (type == 2) {//充电站的领取类型
|
} else if (type == 2) {//充电站的领取类型
|
||||||
@ -231,13 +209,24 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case R.id.btn_gather://立即采集
|
case R.id.btn_gather://立即采集
|
||||||
|
if (poiEntity.getTaskStatus() < 2) {
|
||||||
|
double latitude = Constant.currentLocation.getLatitude();
|
||||||
|
double longitude = Constant.currentLocation.getLongitude();
|
||||||
|
LatLng startLatLng = new LatLng(latitude, longitude); //用户当前位置
|
||||||
|
LatLng endLatLng = new LatLng(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX()));
|
||||||
|
double geometry = GeometryTools.distanceToDouble(startLatLng, endLatLng);
|
||||||
|
if (geometry > 5000) {
|
||||||
|
Toast.makeText(getActivity(), "作业不在领取范围内,无法领取", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (poiEntity != null) {
|
if (poiEntity != null) {
|
||||||
int type = poiEntity.getType();
|
int type = poiEntity.getType();
|
||||||
if (type == 6) {
|
if (type == 6) {
|
||||||
int taskStatus = poiEntity.getTaskStatus();
|
int taskStatus = poiEntity.getTaskStatus();
|
||||||
if (taskStatus != 1) {
|
if (taskStatus != 1) {
|
||||||
|
|
||||||
initPolygonTask(HttpInterface.RECEIVED_POLYGON_TASK, poiEntity.getTaskId(), true, poiEntity);
|
initPolygonTask(HttpInterface.RECEIVED_POLYGON_TASK, poiEntity.getTaskId(), true);
|
||||||
} else {
|
} else {
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@ -327,7 +316,9 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
chargingStationEntity.setType(Integer.valueOf(stationBean.getType()));
|
chargingStationEntity.setType(Integer.valueOf(stationBean.getType()));
|
||||||
chargingStationEntity.setTaskStatus(statusId);
|
chargingStationEntity.setTaskStatus(statusId);
|
||||||
chargingStationEntity.setIsLocalData(1);
|
chargingStationEntity.setIsLocalData(1);
|
||||||
String geo = stationBean.getGeo();
|
|
||||||
|
String encodeStr = stationBean.getGeo();
|
||||||
|
String geo = Geohash.getInstance().decode(encodeStr);
|
||||||
chargingStationEntity.setGeoWkt(geo);
|
chargingStationEntity.setGeoWkt(geo);
|
||||||
Geometry geometry = GeometryTools.createGeometry(geo);
|
Geometry geometry = GeometryTools.createGeometry(geo);
|
||||||
if (geometry.getGeometryType().equals("Point")) {//点
|
if (geometry.getGeometryType().equals("Point")) {//点
|
||||||
@ -358,9 +349,10 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
InsertAndUpdateUtils.getInstance().insertOrUpdateChargingPile(getActivity(), chargingPileEntityList);
|
InsertAndUpdateUtils.getInstance().insertOrUpdateChargingPile(getActivity(), chargingPileEntityList);
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取当前位置的marker
|
//获取当前位置的marker
|
||||||
senMessageMarker(chargingStationEntity.getType(), chargingStationEntity.getY(), chargingStationEntity.getX());
|
// senMessageMarker(chargingStationEntity.getType(), chargingStationEntity.getY(), chargingStationEntity.getX());
|
||||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(),chargingStationEntity);
|
// InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(),chargingStationEntity);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -405,9 +397,9 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param url 面妆任务领取任务
|
* @param url 面妆任务领取任务
|
||||||
* @param poiEntity
|
* @param
|
||||||
*/
|
*/
|
||||||
private void initPolygonTask(String url, int taskId, boolean aBoolean, PoiEntity poiEntity) {
|
private void initPolygonTask(String url, int taskId, boolean aBoolean) {
|
||||||
if (taskId == 0) {
|
if (taskId == 0) {
|
||||||
Toast.makeText(getContext(), "无此任务", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "无此任务", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
@ -430,7 +422,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
polygonEntity.setTaskId(listBean.getId());
|
polygonEntity.setTaskId(listBean.getId());
|
||||||
polygonEntity.setName(listBean.getName());
|
polygonEntity.setName(listBean.getName());
|
||||||
polygonEntity.setType(Integer.valueOf(listBean.getType()));
|
polygonEntity.setType(Integer.valueOf(listBean.getType()));
|
||||||
String geo = listBean.getGeo();
|
String encodeStr = listBean.getGeo();
|
||||||
|
String geo = Geohash.getInstance().decode(encodeStr);
|
||||||
polygonEntity.setGeoWkt(geo);
|
polygonEntity.setGeoWkt(geo);
|
||||||
Geometry geometry = GeometryTools.createGeometry(geo);
|
Geometry geometry = GeometryTools.createGeometry(geo);
|
||||||
if (geometry.getGeometryType().equals("Point")) {//点
|
if (geometry.getGeometryType().equals("Point")) {//点
|
||||||
@ -460,10 +453,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
if (aBoolean) {
|
if (aBoolean) {
|
||||||
initCompleteTask(HttpInterface.COMPLETE, GatherGetFragment.this.poiEntity.getTaskId(), true, polygonEntity);
|
initCompleteTask(HttpInterface.COMPLETE, GatherGetFragment.this.poiEntity.getTaskId(), true, polygonEntity);
|
||||||
}
|
}
|
||||||
Message obtain = Message.obtain();
|
|
||||||
obtain.what = Constant.EVENT_WORK_UNPOLYGON;
|
|
||||||
obtain.obj = false;
|
|
||||||
EventBus.getDefault().post(obtain);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -482,21 +471,24 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param url 面妆任务结束领取
|
* @param url 所以类型的结束领取
|
||||||
* @param poiEntity
|
* @param poiEntity
|
||||||
*/
|
*/
|
||||||
private void initUnPolygonTask(String url, int taskId, PoiEntity poiEntity) {
|
private void initEndReceiveTask(String url, int taskId, PoiEntity poiEntity) {
|
||||||
if (taskId == 0) {
|
if (taskId == 0) {
|
||||||
Toast.makeText(getContext(), "无此任务", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "无此任务", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showLoadingDialog();
|
showLoadingDialog();
|
||||||
|
HttpParams httpParams = new HttpParams();
|
||||||
|
httpParams.put("taskIds",taskId);
|
||||||
|
httpParams.put("auditIds","");
|
||||||
OkGoBuilder.getInstance()
|
OkGoBuilder.getInstance()
|
||||||
.Builder(getActivity())
|
.Builder(getActivity())
|
||||||
.url(url + "/" + taskId)
|
.url(url)
|
||||||
|
.params(httpParams)
|
||||||
.cls(UnPolygonTaskBean.class)
|
.cls(UnPolygonTaskBean.class)
|
||||||
.token(Constant.ACCESS_TOKEN)
|
.token(Constant.ACCESS_TOKEN)
|
||||||
.params(new HttpParams())
|
|
||||||
.getRequest(new Callback<UnPolygonTaskBean>() {
|
.getRequest(new Callback<UnPolygonTaskBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(UnPolygonTaskBean response, int id) {
|
public void onSuccess(UnPolygonTaskBean response, int id) {
|
||||||
@ -509,11 +501,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
Log.d("TAG", "run: "+response.getMessage());
|
||||||
initViewByTaskStatus(0);
|
initViewByTaskStatus(0);
|
||||||
Message obtain = Message.obtain();
|
|
||||||
obtain.what = Constant.EVENT_WORK_UNPOLYGON;
|
|
||||||
obtain.obj = false;
|
|
||||||
EventBus.getDefault().post(obtain);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -558,16 +547,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
initViewByTaskStatus(1);
|
|
||||||
Message obtain = Message.obtain();
|
|
||||||
obtain.what = Constant.EVENT_WORK_UNPOLYGON;
|
|
||||||
obtain.obj = true;
|
|
||||||
EventBus.getDefault().post(obtain);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
@ -607,16 +586,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
poiDao.deleteFormTaskID(taskId);
|
poiDao.deleteFormTaskID(taskId);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
initViewByTaskStatus(0);
|
|
||||||
Message obtain = Message.obtain();
|
|
||||||
obtain.what = Constant.EVENT_WORK_UNPOLYGON;
|
|
||||||
obtain.obj = true;
|
|
||||||
EventBus.getDefault().post(obtain);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
|
|
||||||
@ -669,7 +638,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
poiListEntity.setIsExclusive(listBean.getIsExclusive());
|
poiListEntity.setIsExclusive(listBean.getIsExclusive());
|
||||||
poiListEntity.setTaskStatus(statusId);
|
poiListEntity.setTaskStatus(statusId);
|
||||||
poiListEntity.setIsLocalData(1);
|
poiListEntity.setIsLocalData(1);
|
||||||
String geo = listBean.getGeo();
|
String encodeStr = listBean.getGeo();
|
||||||
|
String geo = Geohash.getInstance().decode(encodeStr);
|
||||||
poiListEntity.setGeoWkt(geo);
|
poiListEntity.setGeoWkt(geo);
|
||||||
Geometry geometry = GeometryTools.createGeometry(geo);
|
Geometry geometry = GeometryTools.createGeometry(geo);
|
||||||
if (geometry.getGeometryType().equals("Point")) {//点
|
if (geometry.getGeometryType().equals("Point")) {//点
|
||||||
@ -685,9 +655,12 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
poiListEntity.setX(latPolygon.get(0).longitude + "");
|
poiListEntity.setX(latPolygon.get(0).longitude + "");
|
||||||
poiListEntity.setY(latPolygon.get(0).latitude + "");
|
poiListEntity.setY(latPolygon.get(0).latitude + "");
|
||||||
}
|
}
|
||||||
|
if (poiListEntity.getTaskStatus()!=1){
|
||||||
// 通知地图界面显示当前编辑数据的marker
|
// 通知地图界面显示当前编辑数据的marker
|
||||||
senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX());
|
senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX());
|
||||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
|
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
|
||||||
|
}
|
||||||
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -779,7 +752,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
poiListEntity.setIsExclusive(listBean.getIsExclusive());
|
poiListEntity.setIsExclusive(listBean.getIsExclusive());
|
||||||
poiListEntity.setTaskStatus(statusId);
|
poiListEntity.setTaskStatus(statusId);
|
||||||
poiListEntity.setIsLocalData(1);
|
poiListEntity.setIsLocalData(1);
|
||||||
String geo = listBean.getGeo();
|
String encodeStr = listBean.getGeo();
|
||||||
|
String geo = Geohash.getInstance().decode(encodeStr);
|
||||||
poiListEntity.setGeoWkt(geo);
|
poiListEntity.setGeoWkt(geo);
|
||||||
Geometry geometry = GeometryTools.createGeometry(geo);
|
Geometry geometry = GeometryTools.createGeometry(geo);
|
||||||
if (geometry.getGeometryType().equals("Point")) {//点
|
if (geometry.getGeometryType().equals("Point")) {//点
|
||||||
@ -795,9 +769,12 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
poiListEntity.setX(latPolygon.get(0).longitude + "");
|
poiListEntity.setX(latPolygon.get(0).longitude + "");
|
||||||
poiListEntity.setY(latPolygon.get(0).latitude + "");
|
poiListEntity.setY(latPolygon.get(0).latitude + "");
|
||||||
}
|
}
|
||||||
|
if (poiListEntity.getTaskStatus()!=1){
|
||||||
// 通知地图界面显示当前编辑数据的marker
|
// 通知地图界面显示当前编辑数据的marker
|
||||||
senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX());
|
senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX());
|
||||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
|
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
|
||||||
|
}
|
||||||
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
package com.navinfo.outdoor.fragment;
|
package com.navinfo.outdoor.fragment;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.provider.MediaStore;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -36,8 +40,10 @@ import com.navinfo.outdoor.bean.BankPathBean;
|
|||||||
import com.navinfo.outdoor.bean.BankPhoneBean;
|
import com.navinfo.outdoor.bean.BankPhoneBean;
|
||||||
import com.navinfo.outdoor.http.DialogCallback;
|
import com.navinfo.outdoor.http.DialogCallback;
|
||||||
import com.navinfo.outdoor.http.HttpInterface;
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
|
import com.navinfo.outdoor.util.Geohash;
|
||||||
import com.navinfo.outdoor.util.GetJsonDataUtil;
|
import com.navinfo.outdoor.util.GetJsonDataUtil;
|
||||||
import com.navinfo.outdoor.util.PhotoPathUtil;
|
import com.navinfo.outdoor.util.PhotoPathUtil;
|
||||||
|
import com.navinfo.outdoor.util.PhotoUtils;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
|
|
||||||
@ -61,6 +67,10 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
|||||||
private ArrayList<File> gatheringList;
|
private ArrayList<File> gatheringList;
|
||||||
private ArrayList<BankPathBean> jsonBean;
|
private ArrayList<BankPathBean> jsonBean;
|
||||||
private String value;
|
private String value;
|
||||||
|
private SharedPreferences navInfo;
|
||||||
|
private SharedPreferences.Editor navInfoEditor;
|
||||||
|
private File gatherFile;
|
||||||
|
private String file;
|
||||||
|
|
||||||
|
|
||||||
public static GatheringFragment newInstance(Bundle bundle) {
|
public static GatheringFragment newInstance(Bundle bundle) {
|
||||||
@ -78,6 +88,8 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
|||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
|
navInfoEditor = getActivity().getSharedPreferences("navInfo", Context.MODE_PRIVATE).edit();
|
||||||
|
navInfo = getActivity().getSharedPreferences("navInfo", Context.MODE_PRIVATE);
|
||||||
ivGathering = findViewById(R.id.iv_gathering);
|
ivGathering = findViewById(R.id.iv_gathering);
|
||||||
ivGathering.setOnClickListener(this::onClick);
|
ivGathering.setOnClickListener(this::onClick);
|
||||||
imageBank = findViewById(R.id.iv_bank);
|
imageBank = findViewById(R.id.iv_bank);
|
||||||
@ -87,8 +99,9 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
|||||||
btnBank = findViewById(R.id.btn_bank);
|
btnBank = findViewById(R.id.btn_bank);
|
||||||
btnBank.setOnClickListener(this::onClick);
|
btnBank.setOnClickListener(this::onClick);
|
||||||
tvName = (TextView) findViewById(R.id.tv_name);
|
tvName = (TextView) findViewById(R.id.tv_name);
|
||||||
if (Constant.USER_ATTESTATION_NAME != null) {
|
String attestationName = navInfo.getString("attestationName", null);
|
||||||
tvName.setText(Constant.USER_ATTESTATION_NAME);
|
if (attestationName!= null&&!attestationName.equals("")) {
|
||||||
|
tvName.setText(attestationName);
|
||||||
}
|
}
|
||||||
etBankNum = (EditText) findViewById(R.id.et_bank_num);
|
etBankNum = (EditText) findViewById(R.id.et_bank_num);
|
||||||
gatheringCamera = (ImageView) findViewById(R.id.gathering_camera);
|
gatheringCamera = (ImageView) findViewById(R.id.gathering_camera);
|
||||||
@ -153,7 +166,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void gatheringNetWork() {
|
private void gatheringNetWork() {
|
||||||
showLoadingDialog();
|
|
||||||
gatheringList = new ArrayList<>();
|
gatheringList = new ArrayList<>();
|
||||||
File gatheringFile = new File(gatheringPath);
|
File gatheringFile = new File(gatheringPath);
|
||||||
if (!gatheringFile.exists()) {
|
if (!gatheringFile.exists()) {
|
||||||
@ -166,7 +179,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
|||||||
Toast.makeText(getContext(), "银行卡号不能为空", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "银行卡号不能为空", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
showLoadingDialog();
|
||||||
OkGo
|
OkGo
|
||||||
// 请求方式和请求url
|
// 请求方式和请求url
|
||||||
.<BankPhoneBean>post(HttpInterface.USER_BANKCARD_UP_DATA)
|
.<BankPhoneBean>post(HttpInterface.USER_BANKCARD_UP_DATA)
|
||||||
@ -181,16 +194,17 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
|||||||
public void onSuccess(Response<BankPhoneBean> response) {
|
public void onSuccess(Response<BankPhoneBean> response) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
|
Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
|
||||||
if (response.body().equals("0")) {
|
if (response.code() == 200) {
|
||||||
MessageDialog.show((AppCompatActivity) getActivity(), "是否绑定银行卡", "取消", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
MessageDialog.show((AppCompatActivity) getActivity(), "绑定成功", "确定", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
// Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
|
navInfoEditor.putString("bankAccount",value);
|
||||||
|
navInfoEditor.commit();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
MessageDialog.show((AppCompatActivity) getActivity(), "是否绑定银行卡", "确定", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
MessageDialog.show((AppCompatActivity) getActivity(), "绑定失败", "取消", "取消", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
// Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
|
// Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
|
||||||
@ -225,12 +239,15 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
|||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
gatherFile = new File(Constant.PICTURE_FOLDER+"/aaaaaa.jpg");
|
||||||
|
PhotoUtils.showPhotoFile("a", null);
|
||||||
|
intentPanorama.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(gatherFile));
|
||||||
startActivityForResult(intentPanorama, 400);
|
startActivityForResult(intentPanorama, 400);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
gatheringPath = PhotoPathUtil.getTakePhotoPath(data, "", "");
|
file = PhotoPathUtil.getTakePhotoPath(data, "", "");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -161,7 +161,7 @@ public class HasSubmitFragment extends BaseFragment implements View.OnClickListe
|
|||||||
public void onError(Throwable e, int id) {
|
public void onError(Throwable e, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
Log.d("TAG", "onError: " + e.getMessage());
|
Log.d("TAG", "onError: " + e.getMessage());
|
||||||
Toast.makeText(getContext(), "请求失败", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), e.getMessage()+"", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,10 @@ import android.content.Intent;
|
|||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.provider.MediaStore;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -18,8 +20,10 @@ import android.widget.EditText;
|
|||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
@ -46,12 +50,14 @@ import com.navinfo.outdoor.http.Callback;
|
|||||||
import com.navinfo.outdoor.http.DialogCallback;
|
import com.navinfo.outdoor.http.DialogCallback;
|
||||||
import com.navinfo.outdoor.http.HttpInterface;
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
|
import com.navinfo.outdoor.room.ChargingPileEntity;
|
||||||
import com.navinfo.outdoor.room.InsertAndUpdateUtils;
|
import com.navinfo.outdoor.room.InsertAndUpdateUtils;
|
||||||
import com.navinfo.outdoor.room.PoiDao;
|
import com.navinfo.outdoor.room.PoiDao;
|
||||||
import com.navinfo.outdoor.room.PoiDatabase;
|
import com.navinfo.outdoor.room.PoiDatabase;
|
||||||
import com.navinfo.outdoor.room.PoiEntity;
|
import com.navinfo.outdoor.room.PoiEntity;
|
||||||
import com.navinfo.outdoor.util.Geohash;
|
import com.navinfo.outdoor.util.Geohash;
|
||||||
import com.navinfo.outdoor.util.PhotoPathUtil;
|
import com.navinfo.outdoor.util.PhotoPathUtil;
|
||||||
|
import com.navinfo.outdoor.util.PhotoUtils;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
@ -77,8 +83,10 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
private EditText editTaskName, editOtherDescribe;
|
private EditText editTaskName, editOtherDescribe;
|
||||||
private RelativeLayout rlPicture;
|
private RelativeLayout rlPicture;
|
||||||
private ImageView ivPicture;
|
private ImageView ivPicture;
|
||||||
|
private TextView tvPicture;
|
||||||
private RelativeLayout rlPictures;
|
private RelativeLayout rlPictures;
|
||||||
private ImageView ivPictures;
|
private ImageView ivPictures;
|
||||||
|
private TextView tvPictures;
|
||||||
private Button btnOtherLocal;
|
private Button btnOtherLocal;
|
||||||
private Button btnOtherUploading;
|
private Button btnOtherUploading;
|
||||||
private PoiDatabase poiDatabase;
|
private PoiDatabase poiDatabase;
|
||||||
@ -88,6 +96,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
private int station_type = 5;
|
private int station_type = 5;
|
||||||
private ArrayList<File> otherUploadList;
|
private ArrayList<File> otherUploadList;
|
||||||
private CheckBox checkPot;
|
private CheckBox checkPot;
|
||||||
|
private File file;
|
||||||
|
|
||||||
public static OtherFragment newInstance(Bundle bundle) {
|
public static OtherFragment newInstance(Bundle bundle) {
|
||||||
OtherFragment fragment = new OtherFragment();
|
OtherFragment fragment = new OtherFragment();
|
||||||
@ -187,6 +196,8 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
rlPicture = findViewById(R.id.rl_picture);
|
rlPicture = findViewById(R.id.rl_picture);
|
||||||
rlPicture.setOnClickListener(this::onClick);
|
rlPicture.setOnClickListener(this::onClick);
|
||||||
ivPicture = findViewById(R.id.iv_picture);
|
ivPicture = findViewById(R.id.iv_picture);
|
||||||
|
tvPicture = findViewById(R.id.tv_picture);
|
||||||
|
tvPictures = findViewById(R.id.tv_pictures);
|
||||||
rlPictures = findViewById(R.id.rl_pictures);
|
rlPictures = findViewById(R.id.rl_pictures);
|
||||||
rlPictures.setOnClickListener(this::onClick);
|
rlPictures.setOnClickListener(this::onClick);
|
||||||
ivPictures = findViewById(R.id.iv_pictures);
|
ivPictures = findViewById(R.id.iv_pictures);
|
||||||
@ -285,17 +296,16 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
}else if (station_type==7){
|
}else if (station_type==7){
|
||||||
spinnerOther.setSelection(2, true);
|
spinnerOther.setSelection(2, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (showPoiEntity.getPhotoInfo() != null) {
|
if (showPoiEntity.getPhotoInfo() != null) {
|
||||||
for (int i = 0; i < showPoiEntity.getPhotoInfo().size(); i++) {
|
for (int i = 0; i < showPoiEntity.getPhotoInfo().size(); i++) {
|
||||||
String photo = showPoiEntity.getPhotoInfo().get(i).getPhoto();
|
String photo = showPoiEntity.getPhotoInfo().get(i).getPhoto();
|
||||||
String[] split = photo.split("/");
|
String[] split = photo.split("/");
|
||||||
if (split[split.length - 1].startsWith("a")) {
|
if (split[split.length - 1].startsWith("a")) {
|
||||||
Glide.with(getActivity()).load(photo).into(ivPicture);
|
Glide.with(getActivity()).load(photo).into(ivPicture);
|
||||||
ivPicture.setTag(photo);
|
tvPicture.setTag(photo);
|
||||||
} else if (split[split.length - 1].startsWith("b")) {
|
} else if (split[split.length - 1].startsWith("b")) {
|
||||||
Glide.with(getActivity()).load(photo).into(ivPictures);
|
Glide.with(getActivity()).load(photo).into(ivPictures);
|
||||||
ivPictures.setTag(photo);
|
tvPictures.setTag(photo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -311,13 +321,15 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
case R.id.rl_picture:
|
case R.id.rl_picture:
|
||||||
Intent intentPicture = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentPicture = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
file = PhotoUtils.showPhotoFile("a", latLng);
|
||||||
|
intentPicture.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
|
||||||
startActivityForResult(intentPicture, 101);
|
startActivityForResult(intentPicture, 101);
|
||||||
initOtherSharePre();
|
|
||||||
break;
|
break;
|
||||||
case R.id.rl_pictures:
|
case R.id.rl_pictures:
|
||||||
Intent intentPictures = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentPictures = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
file = PhotoUtils.showPhotoFile("b",latLng);
|
||||||
|
intentPictures.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
|
||||||
startActivityForResult(intentPictures, 102);
|
startActivityForResult(intentPictures, 102);
|
||||||
initOtherSharePre();
|
|
||||||
break;
|
break;
|
||||||
case R.id.btn_other_local:
|
case R.id.btn_other_local:
|
||||||
initPoiSaveLocal(false);
|
initPoiSaveLocal(false);
|
||||||
@ -340,7 +352,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
} else {
|
} else {
|
||||||
otherUploadList.add(new File(tagPicture));
|
otherUploadList.add(new File(tagPicture));
|
||||||
}
|
}
|
||||||
String tagPictures = (String) ivPictures.getTag();
|
String tagPictures = (String) tvPictures.getTag();
|
||||||
if (tagPictures == null) {
|
if (tagPictures == null) {
|
||||||
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
@ -376,53 +388,12 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
public void onGranted(List<String> permissions, boolean all) {
|
public void onGranted(List<String> permissions, boolean all) {
|
||||||
if (all) {
|
if (all) {
|
||||||
//保存数据库:
|
//保存数据库:
|
||||||
PoiEntity poiEntity = showPoiEntity;
|
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
||||||
List<Info> infoList = new ArrayList<>();
|
PoiCheckResult poiCheckResult = checkPoiEntity(poiEntity);
|
||||||
String name = editTaskName.getText().toString().trim();//名称
|
if (poiCheckResult.getCode() == 1) {
|
||||||
if (name == null || name.equals("")) {
|
Toast.makeText(getActivity(), poiCheckResult.getMsg()+"", Toast.LENGTH_SHORT).show();
|
||||||
Toast.makeText(getActivity(), "请输入poi 名称", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
poiEntity.setName(name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (latLng == null) {
|
|
||||||
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
String encode = Geohash.getInstance().encode(latLng.latitude, latLng.longitude);
|
|
||||||
poiEntity.setGeoWkt(encode);
|
|
||||||
poiEntity.setX(String.valueOf(latLng.longitude));
|
|
||||||
poiEntity.setY(String.valueOf(latLng.latitude));
|
|
||||||
}
|
|
||||||
String describe = editOtherDescribe.getText().toString().trim();
|
|
||||||
if (describe != null&&!describe.equals("")) {
|
|
||||||
poiEntity.setMemo(describe);
|
|
||||||
}
|
|
||||||
String tagPicture = (String) ivPicture.getTag();
|
|
||||||
if (tagPicture == null) {
|
|
||||||
Toast.makeText(getActivity(), "请 拍照", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
infoList.add(new Info(tagPicture));
|
|
||||||
}
|
|
||||||
String tagPictures = (String) ivPictures.getTag();
|
|
||||||
if (tagPictures == null) {
|
|
||||||
Toast.makeText(getActivity(), "请 拍照", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
infoList.add(new Info(tagPictures));
|
|
||||||
}
|
|
||||||
poiEntity.setStation_type(station_type);
|
|
||||||
poiEntity.setPhotoInfo(infoList);
|
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
|
||||||
String format = formatter.format(calendar.getTime());
|
|
||||||
poiEntity.setCreateTime(format);
|
|
||||||
poiEntity.setType(5);
|
|
||||||
poiEntity.setTaskStatus(2);
|
|
||||||
poiEntity.setIsLocalData(1);
|
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -452,7 +423,6 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void otherUploadByNet(int body, List<File> otherUploadList) {
|
private void otherUploadByNet(int body, List<File> otherUploadList) {
|
||||||
if (body == 0) {
|
if (body == 0) {
|
||||||
Toast.makeText(getActivity(), "没有保存本地", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "没有保存本地", Toast.LENGTH_SHORT).show();
|
||||||
@ -518,7 +488,9 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(PoiSaveBean poiSaveBean, int id) {
|
public void onSuccess(PoiSaveBean poiSaveBean, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
|
if (poiSaveBean.getCode()==200){
|
||||||
Integer body = poiSaveBean.getBody();
|
Integer body = poiSaveBean.getBody();
|
||||||
|
if (body!=null&&body!=0){
|
||||||
poiEntity.setBodyId(body);
|
poiEntity.setBodyId(body);
|
||||||
poiEntity.setTaskStatus(3);
|
poiEntity.setTaskStatus(3);
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@ -538,6 +510,15 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
|
}else {
|
||||||
|
Toast.makeText(getActivity(), ""+poiSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
Toast.makeText(getActivity(), ""+poiSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -550,6 +531,11 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
dismissDialog();
|
dismissDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||||
|
super.onSaveInstanceState(outState);
|
||||||
|
initOtherSharePre();
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 防止当页面崩溃后出现数据丢失
|
* 防止当页面崩溃后出现数据丢失
|
||||||
*/
|
*/
|
||||||
@ -562,39 +548,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
//获取Editor对象
|
//获取Editor对象
|
||||||
SharedPreferences.Editor edit = poi.edit();
|
SharedPreferences.Editor edit = poi.edit();
|
||||||
//根据要保存的数据的类型,调用对应的put方法,
|
//根据要保存的数据的类型,调用对应的put方法,
|
||||||
PoiEntity poiEntity = showPoiEntity;
|
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
||||||
ArrayList<Info> arrayList = new ArrayList<>();
|
|
||||||
String name = editTaskName.getText().toString().trim();//名称
|
|
||||||
if (name != null && !name.equals("")) {
|
|
||||||
poiEntity.setName(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (latLng != null) {
|
|
||||||
poiEntity.setX(String.valueOf(latLng.longitude));
|
|
||||||
poiEntity.setY(String.valueOf(latLng.latitude));
|
|
||||||
}
|
|
||||||
String describe = editOtherDescribe.getText().toString().trim();
|
|
||||||
if (describe != null && !describe.equals("")) {
|
|
||||||
poiEntity.setMemo(describe);
|
|
||||||
}
|
|
||||||
String tagPicture = (String) ivPicture.getTag();
|
|
||||||
if (tagPicture != null && !tagPicture.equals("")) {
|
|
||||||
arrayList.add(new Info(tagPicture));
|
|
||||||
}
|
|
||||||
String tagPictures = (String) ivPictures.getTag();
|
|
||||||
if (tagPictures != null && !tagPictures.equals("")) {
|
|
||||||
arrayList.add(new Info(tagPictures));
|
|
||||||
}
|
|
||||||
poiEntity.setPhotoInfo(arrayList);
|
|
||||||
poiEntity.setStation_type(station_type);
|
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
|
||||||
String format = formatter.format(calendar.getTime());
|
|
||||||
poiEntity.setCreateTime(format);
|
|
||||||
poiEntity.setType(5);
|
|
||||||
poiEntity.setTaskStatus(2);
|
|
||||||
poiEntity.setIsLocalData(1);
|
|
||||||
String newPoiEntity = new Gson().toJson(poiEntity);
|
String newPoiEntity = new Gson().toJson(poiEntity);
|
||||||
//以键值对的形式添加新值。
|
//以键值对的形式添加新值。
|
||||||
edit.putString("poiEntity", newPoiEntity);
|
edit.putString("poiEntity", newPoiEntity);
|
||||||
@ -607,50 +561,25 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
if (requestCode == 101 && resultCode == RESULT_OK) {
|
if (requestCode == 101 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (file == null || !file.exists()) {
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Toast.makeText(getContext(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
|
||||||
//照片路径
|
return;
|
||||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
}else {
|
||||||
ivPicture.setTag(takePhotoPath);
|
String s = PhotoUtils.showPhotoAndGetPath(file, ivPicture);
|
||||||
ivPicture.setImageBitmap(bitmap);//显示图像
|
tvPicture.setTag(s);
|
||||||
/* int height = bitmap.getHeight();
|
|
||||||
int width = bitmap.getWidth();
|
|
||||||
if (height > width) {
|
|
||||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
|
||||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
|
||||||
@Override
|
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
|
||||||
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
|
|
||||||
startActivityForResult(intent, 101);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
});
|
file=null;
|
||||||
} else {
|
|
||||||
|
|
||||||
|
|
||||||
}*/
|
|
||||||
} else if (requestCode == 102 && resultCode == RESULT_OK) {
|
} else if (requestCode == 102 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
|
||||||
//照片路径
|
//照片路径
|
||||||
String takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
if (file == null || !file.exists()) {
|
||||||
ivPictures.setTag(takePhotoPath2);
|
Toast.makeText(getContext(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
|
||||||
ivPictures.setImageBitmap(bitmap);//显示图像
|
return;
|
||||||
/*int height = bitmap.getHeight();
|
|
||||||
int width = bitmap.getWidth();
|
|
||||||
if (height > width) {
|
|
||||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
|
||||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
|
||||||
@Override
|
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
|
||||||
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
|
|
||||||
startActivityForResult(intent, 102);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}*/
|
}else {
|
||||||
|
String s = PhotoUtils.showPhotoAndGetPath(file, ivPictures);
|
||||||
|
tvPictures.setTag(s);
|
||||||
|
}
|
||||||
|
file=null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -672,4 +601,78 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PoiEntity initPoiEntityByUI(PoiEntity poiEntity) {
|
||||||
|
ArrayList<Info> arrayList = new ArrayList<>();
|
||||||
|
String name = editTaskName.getText().toString().trim();//名称
|
||||||
|
if (name != null && !name.equals("")) {
|
||||||
|
poiEntity.setName(name);
|
||||||
|
}
|
||||||
|
if (latLng != null) {
|
||||||
|
String encode = Geohash.getInstance().encode(latLng.latitude, latLng.longitude);
|
||||||
|
poiEntity.setGeoWkt(encode);
|
||||||
|
poiEntity.setX(String.valueOf(latLng.longitude));
|
||||||
|
poiEntity.setY(String.valueOf(latLng.latitude));
|
||||||
|
}
|
||||||
|
String describe = editOtherDescribe.getText().toString().trim();
|
||||||
|
if (describe != null && !describe.equals("")) {
|
||||||
|
poiEntity.setMemo(describe);
|
||||||
|
}
|
||||||
|
String tagPicture = (String) tvPicture.getTag();
|
||||||
|
if (tagPicture != null && !tagPicture.equals("")) {
|
||||||
|
arrayList.add(new Info(tagPicture));
|
||||||
|
}
|
||||||
|
String tagPictures = (String) tvPictures.getTag();
|
||||||
|
if (tagPictures != null && !tagPictures.equals("")) {
|
||||||
|
arrayList.add(new Info(tagPictures));
|
||||||
|
}
|
||||||
|
poiEntity.setPhotoInfo(arrayList);
|
||||||
|
poiEntity.setStation_type(station_type);
|
||||||
|
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||||
|
String format = formatter.format(calendar.getTime());
|
||||||
|
poiEntity.setCreateTime(format);
|
||||||
|
poiEntity.setType(5);
|
||||||
|
poiEntity.setTaskStatus(2);
|
||||||
|
poiEntity.setIsLocalData(1);
|
||||||
|
return poiEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PoiCheckResult checkPoiEntity(PoiEntity entity) {
|
||||||
|
PoiCheckResult poiCheckResult = new PoiCheckResult();
|
||||||
|
if (entity.getName()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请输入 名称");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if (tvPicture.getTag()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请 拍照");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if ( tvPictures.getTag()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请 拍照");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if (entity.getX()==null&&entity.getY()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请确定点位");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ChargingPileEntity initChargingPileEntityByUI(ChargingPileEntity entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PoiCheckResult checkChargingPileEntity(ChargingPileEntity entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -4,8 +4,10 @@ import android.content.Intent;
|
|||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.provider.MediaStore;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -51,6 +53,7 @@ import com.navinfo.outdoor.http.Callback;
|
|||||||
import com.navinfo.outdoor.http.DialogCallback;
|
import com.navinfo.outdoor.http.DialogCallback;
|
||||||
import com.navinfo.outdoor.http.HttpInterface;
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
|
import com.navinfo.outdoor.room.ChargingPileEntity;
|
||||||
import com.navinfo.outdoor.room.InsertAndUpdateUtils;
|
import com.navinfo.outdoor.room.InsertAndUpdateUtils;
|
||||||
import com.navinfo.outdoor.room.PoiDao;
|
import com.navinfo.outdoor.room.PoiDao;
|
||||||
import com.navinfo.outdoor.room.PoiDatabase;
|
import com.navinfo.outdoor.room.PoiDatabase;
|
||||||
@ -59,6 +62,7 @@ import com.navinfo.outdoor.ui.view.ContactView;
|
|||||||
import com.navinfo.outdoor.util.Geohash;
|
import com.navinfo.outdoor.util.Geohash;
|
||||||
import com.navinfo.outdoor.util.NetWorkUtils;
|
import com.navinfo.outdoor.util.NetWorkUtils;
|
||||||
import com.navinfo.outdoor.util.PhotoPathUtil;
|
import com.navinfo.outdoor.util.PhotoPathUtil;
|
||||||
|
import com.navinfo.outdoor.util.PhotoUtils;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
@ -82,6 +86,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
private EditText editDescribe;
|
private EditText editDescribe;
|
||||||
private RelativeLayout rlPanorama, rlName, rlInternalPhotos, rlCard, rlElse;
|
private RelativeLayout rlPanorama, rlName, rlInternalPhotos, rlCard, rlElse;
|
||||||
private ImageView ivPanorama, ivName, ivInternal, ivCard, ivElse;
|
private ImageView ivPanorama, ivName, ivInternal, ivCard, ivElse;
|
||||||
|
private TextView tvPanorama, tvName, tvInternal, tvCard, tvElse;
|
||||||
public TextView tvExamine;
|
public TextView tvExamine;
|
||||||
private EditText editNameContent, editSiteContent;
|
private EditText editNameContent, editSiteContent;
|
||||||
private ArrayList<PhoneBean> poiBeans;
|
private ArrayList<PhoneBean> poiBeans;
|
||||||
@ -105,6 +110,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
private ContactView contactView;
|
private ContactView contactView;
|
||||||
private ArrayList<File> poiPicList;
|
private ArrayList<File> poiPicList;
|
||||||
private String tagPanorama;
|
private String tagPanorama;
|
||||||
|
private File file;
|
||||||
|
|
||||||
public static PoiFragment newInstance(Bundle bundle) {
|
public static PoiFragment newInstance(Bundle bundle) {
|
||||||
PoiFragment fragment = new PoiFragment();
|
PoiFragment fragment = new PoiFragment();
|
||||||
@ -190,11 +196,18 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
tvExamine.setOnClickListener(this::onClick);
|
tvExamine.setOnClickListener(this::onClick);
|
||||||
editDescribe = findViewById(R.id.edit_describe);
|
editDescribe = findViewById(R.id.edit_describe);
|
||||||
ivPanorama = findViewById(R.id.iv_panorama);
|
ivPanorama = findViewById(R.id.iv_panorama);
|
||||||
|
tvPanorama = findViewById(R.id.tv_panorama);
|
||||||
ivName = findViewById(R.id.iv_name);
|
ivName = findViewById(R.id.iv_name);
|
||||||
|
tvName = findViewById(R.id.tv_name);
|
||||||
ivInternal = findViewById(R.id.iv_internal);
|
ivInternal = findViewById(R.id.iv_internal);
|
||||||
linearContact = findViewById(R.id.linear_contact);
|
tvInternal = findViewById(R.id.tv_internal);
|
||||||
|
|
||||||
ivCard = findViewById(R.id.iv_card);
|
ivCard = findViewById(R.id.iv_card);
|
||||||
|
tvCard = findViewById(R.id.tv_card);
|
||||||
|
|
||||||
ivElse = findViewById(R.id.iv_else);
|
ivElse = findViewById(R.id.iv_else);
|
||||||
|
tvElse = findViewById(R.id.tv_else);
|
||||||
|
linearContact = findViewById(R.id.linear_contact);
|
||||||
rlPanorama = findViewById(R.id.rl_panorama);
|
rlPanorama = findViewById(R.id.rl_panorama);
|
||||||
rlPanorama.setOnClickListener(this::onClick);
|
rlPanorama.setOnClickListener(this::onClick);
|
||||||
rlName = findViewById(R.id.rl_name);
|
rlName = findViewById(R.id.rl_name);
|
||||||
@ -403,19 +416,19 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
String[] split = photo.split("/");
|
String[] split = photo.split("/");
|
||||||
if (split[split.length - 1].startsWith("a")) {
|
if (split[split.length - 1].startsWith("a")) {
|
||||||
Glide.with(getActivity()).load(photo).into(ivPanorama);
|
Glide.with(getActivity()).load(photo).into(ivPanorama);
|
||||||
ivPanorama.setTag(photo);
|
tvPanorama.setTag(photo);
|
||||||
} else if (split[split.length - 1].startsWith("b")) {
|
} else if (split[split.length - 1].startsWith("b")) {
|
||||||
Glide.with(getActivity()).load(photo).into(ivName);
|
Glide.with(getActivity()).load(photo).into(ivName);
|
||||||
ivName.setTag(photo);
|
tvName.setTag(photo);
|
||||||
} else if (split[split.length - 1].startsWith("c")) {
|
} else if (split[split.length - 1].startsWith("c")) {
|
||||||
Glide.with(getActivity()).load(photo).into(ivInternal);
|
Glide.with(getActivity()).load(photo).into(ivInternal);
|
||||||
ivInternal.setTag(photo);
|
tvInternal.setTag(photo);
|
||||||
} else if (split[split.length - 1].startsWith("d")) {
|
} else if (split[split.length - 1].startsWith("d")) {
|
||||||
Glide.with(getActivity()).load(photo).into(ivCard);
|
Glide.with(getActivity()).load(photo).into(ivCard);
|
||||||
ivCard.setTag(photo);
|
tvCard.setTag(photo);
|
||||||
} else if (split[split.length - 1].startsWith("e")) {
|
} else if (split[split.length - 1].startsWith("e")) {
|
||||||
Glide.with(getActivity()).load(photo).into(ivElse);
|
Glide.with(getActivity()).load(photo).into(ivElse);
|
||||||
ivElse.setTag(photo);
|
tvElse.setTag(photo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -509,7 +522,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
break;
|
break;
|
||||||
case R.id.btn_uploading:
|
case R.id.btn_uploading:
|
||||||
poiPicList = new ArrayList<>();
|
poiPicList = new ArrayList<>();
|
||||||
String tagPanorama = (String) ivPanorama.getTag();
|
|
||||||
String name = editNameContent.getText().toString().trim();//名称
|
String name = editNameContent.getText().toString().trim();//名称
|
||||||
if (name == null || name.equals("")) {
|
if (name == null || name.equals("")) {
|
||||||
Toast.makeText(getActivity(), "请输入poi 名称", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "请输入poi 名称", Toast.LENGTH_SHORT).show();
|
||||||
@ -519,13 +532,14 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
String tagPanorama = (String) tvPanorama.getTag();
|
||||||
if (tagPanorama == null) {
|
if (tagPanorama == null) {
|
||||||
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
poiPicList.add(new File(tagPanorama));
|
poiPicList.add(new File(tagPanorama));
|
||||||
}
|
}
|
||||||
String tagName = (String) ivName.getTag();
|
String tagName = (String)tvName.getTag();
|
||||||
if (tagName == null) {
|
if (tagName == null) {
|
||||||
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
@ -533,15 +547,15 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
poiPicList.add(new File(tagName));
|
poiPicList.add(new File(tagName));
|
||||||
}
|
}
|
||||||
|
|
||||||
String tagInternal = (String) ivInternal.getTag();
|
String tagInternal = (String) tvInternal.getTag();
|
||||||
if (tagInternal != null) {
|
if (tagInternal != null) {
|
||||||
poiPicList.add(new File(tagInternal));
|
poiPicList.add(new File(tagInternal));
|
||||||
}
|
}
|
||||||
String tagElse = (String) ivElse.getTag();
|
String tagElse = (String) tvElse.getTag();
|
||||||
if (tagElse != null) {
|
if (tagElse != null) {
|
||||||
poiPicList.add(new File(tagElse));
|
poiPicList.add(new File(tagElse));
|
||||||
}
|
}
|
||||||
String tagCard = (String) ivCard.getTag();
|
String tagCard = (String) tvCard.getTag();
|
||||||
if (tagCard != null) {
|
if (tagCard != null) {
|
||||||
poiPicList.add(new File(tagCard));
|
poiPicList.add(new File(tagCard));
|
||||||
}
|
}
|
||||||
@ -568,22 +582,32 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
break;
|
break;
|
||||||
case R.id.rl_panorama:
|
case R.id.rl_panorama:
|
||||||
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
file = PhotoUtils.showPhotoFile("a", latLng);;
|
||||||
|
intentPanorama.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
|
||||||
startActivityForResult(intentPanorama, 101);
|
startActivityForResult(intentPanorama, 101);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_name:
|
case R.id.rl_name:
|
||||||
Intent intentName = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentName = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
file =PhotoUtils.showPhotoFile("b", latLng);
|
||||||
|
intentName.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
|
||||||
startActivityForResult(intentName, 102);
|
startActivityForResult(intentName, 102);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_internal_photos:
|
case R.id.rl_internal_photos:
|
||||||
Intent intentInternal = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentInternal = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
file =PhotoUtils.showPhotoFile("c", latLng);
|
||||||
|
intentInternal.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
|
||||||
startActivityForResult(intentInternal, 103);
|
startActivityForResult(intentInternal, 103);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_card:
|
case R.id.rl_card:
|
||||||
Intent intentCard = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentCard = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
file =PhotoUtils.showPhotoFile("d", latLng);
|
||||||
|
intentCard.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
|
||||||
startActivityForResult(intentCard, 104);
|
startActivityForResult(intentCard, 104);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_else:
|
case R.id.rl_else:
|
||||||
Intent intentElse = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent intentElse = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
file =PhotoUtils.showPhotoFile("e",latLng);
|
||||||
|
intentElse.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
|
||||||
startActivityForResult(intentElse, 105);
|
startActivityForResult(intentElse, 105);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -627,75 +651,12 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
public void onGranted(List<String> permissions, boolean all) {
|
public void onGranted(List<String> permissions, boolean all) {
|
||||||
if (all) {
|
if (all) {
|
||||||
//保存数据库:
|
//保存数据库:
|
||||||
PoiEntity poiEntity = showPoiEntity;
|
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
||||||
ArrayList<Info> infoPhoto = new ArrayList<>();
|
PoiCheckResult poiCheckResult = checkPoiEntity(poiEntity);
|
||||||
String name = editNameContent.getText().toString().trim();//名称
|
if (poiCheckResult.getCode() == 1) {
|
||||||
if (name == null || name.equals("")) {
|
Toast.makeText(getActivity(), poiCheckResult.getMsg()+"", Toast.LENGTH_SHORT).show();
|
||||||
Toast.makeText(getActivity(), "请输入poi 名称", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
poiEntity.setName(name);
|
|
||||||
}
|
}
|
||||||
String site = editSiteContent.getText().toString().trim();
|
|
||||||
if (site != null && !site.equals("")) {
|
|
||||||
poiEntity.setAddress(site);
|
|
||||||
}
|
|
||||||
if (latLng == null) {
|
|
||||||
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
String encode = Geohash.getInstance().encode(latLng.latitude, latLng.longitude);
|
|
||||||
poiEntity.setGeoWkt(encode);
|
|
||||||
poiEntity.setX(String.valueOf(latLng.longitude));
|
|
||||||
poiEntity.setY(String.valueOf(latLng.latitude));
|
|
||||||
}
|
|
||||||
|
|
||||||
String describe = editDescribe.getText().toString().trim();
|
|
||||||
if (describe != null && !describe.equals("")) {
|
|
||||||
poiEntity.setMemo(describe);
|
|
||||||
}
|
|
||||||
boolean phoneBean = contactView.getPhoneBean();
|
|
||||||
if (phoneBean) {
|
|
||||||
String list = contactView.getList();
|
|
||||||
poiEntity.setTelPhone(list);
|
|
||||||
}
|
|
||||||
tagPanorama = (String) ivPanorama.getTag();
|
|
||||||
if (tagPanorama == null) {
|
|
||||||
Toast.makeText(getActivity(), "请拍照 全景图", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
infoPhoto.add(new Info(tagPanorama));
|
|
||||||
}
|
|
||||||
String tagName = (String) ivName.getTag();
|
|
||||||
if (tagName == null) {
|
|
||||||
Toast.makeText(getActivity(), "请拍照 名称", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
infoPhoto.add(new Info(tagName));
|
|
||||||
}
|
|
||||||
|
|
||||||
String tagInternal = (String) ivInternal.getTag();
|
|
||||||
if (tagInternal != null) {
|
|
||||||
infoPhoto.add(new Info(tagInternal));
|
|
||||||
}
|
|
||||||
String tagElse = (String) ivElse.getTag();
|
|
||||||
if (tagElse != null) {
|
|
||||||
infoPhoto.add(new Info(tagElse));
|
|
||||||
}
|
|
||||||
String tagCard = (String) ivCard.getTag();
|
|
||||||
if (tagCard != null) {
|
|
||||||
infoPhoto.add(new Info(tagCard));
|
|
||||||
}
|
|
||||||
poiEntity.setPhotoInfo(infoPhoto);
|
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
|
||||||
String format = formatter.format(calendar.getTime());
|
|
||||||
poiEntity.setCreateTime(format);
|
|
||||||
poiEntity.setExistence(existence);
|
|
||||||
poiEntity.setType(1);
|
|
||||||
poiEntity.setTaskStatus(2);
|
|
||||||
poiEntity.setIsLocalData(1);
|
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -790,8 +751,9 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(PoiSaveBean poiSaveBean, int id) {
|
public void onSuccess(PoiSaveBean poiSaveBean, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
|
if (poiSaveBean.getCode()==200){
|
||||||
Integer body = poiSaveBean.getBody();
|
Integer body = poiSaveBean.getBody();
|
||||||
if (body!=null){
|
if (body!=null&&body!=0){
|
||||||
poiEntity.setBodyId(body);
|
poiEntity.setBodyId(body);
|
||||||
poiEntity.setTaskStatus(3);
|
poiEntity.setTaskStatus(3);
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@ -811,7 +773,13 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
|
}else {
|
||||||
|
Toast.makeText(getActivity(), ""+poiSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
Toast.makeText(getActivity(), ""+poiSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -837,64 +805,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
//获取Editor对象
|
//获取Editor对象
|
||||||
SharedPreferences.Editor edit = poi.edit();
|
SharedPreferences.Editor edit = poi.edit();
|
||||||
//根据要保存的数据的类型,调用对应的put方法,
|
//根据要保存的数据的类型,调用对应的put方法,
|
||||||
PoiEntity poiEntity = showPoiEntity;
|
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
||||||
ArrayList<Info> infoPhoto = new ArrayList<>();
|
|
||||||
String name = editNameContent.getText().toString().trim();//名称
|
|
||||||
if (name != null && !name.equals("")) {
|
|
||||||
poiEntity.setName(name);
|
|
||||||
}
|
|
||||||
String site = editSiteContent.getText().toString().trim();
|
|
||||||
if (site != null && !site.equals("")) {
|
|
||||||
poiEntity.setAddress(site);
|
|
||||||
}
|
|
||||||
if (latLng != null) {
|
|
||||||
String encode = Geohash.getInstance().encode(latLng.latitude, latLng.longitude);
|
|
||||||
poiEntity.setGeoWkt(encode);
|
|
||||||
poiEntity.setX(String.valueOf(latLng.longitude));
|
|
||||||
poiEntity.setY(String.valueOf(latLng.latitude));
|
|
||||||
}
|
|
||||||
String describe = editDescribe.getText().toString().trim();
|
|
||||||
if (describe != null && !describe.equals("")) {
|
|
||||||
poiEntity.setMemo(describe);
|
|
||||||
}
|
|
||||||
boolean phoneBean = contactView.getPhoneBean();
|
|
||||||
if (phoneBean) {
|
|
||||||
String list = contactView.getList();
|
|
||||||
poiEntity.setTelPhone(list);
|
|
||||||
} else {
|
|
||||||
Toast.makeText(getActivity(), "请输入手机号", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String tagPanorama = (String) ivPanorama.getTag();
|
|
||||||
if (tagPanorama != null && !tagPanorama.equals("")) {
|
|
||||||
infoPhoto.add(new Info(tagPanorama));
|
|
||||||
}
|
|
||||||
String tagName = (String) ivName.getTag();
|
|
||||||
if (tagName != null && !tagName.equals("")) {
|
|
||||||
infoPhoto.add(new Info(tagName));
|
|
||||||
}
|
|
||||||
String tagInternal = (String) ivInternal.getTag();
|
|
||||||
if (tagInternal != null && !tagInternal.equals("")) {
|
|
||||||
infoPhoto.add(new Info(tagInternal));
|
|
||||||
}
|
|
||||||
String tagElse = (String) ivElse.getTag();
|
|
||||||
if (tagElse != null && !tagElse.equals("")) {
|
|
||||||
infoPhoto.add(new Info(tagElse));
|
|
||||||
}
|
|
||||||
String tagCard = (String) ivCard.getTag();
|
|
||||||
if (tagCard != null && !tagCard.equals("")) {
|
|
||||||
infoPhoto.add(new Info(tagCard));
|
|
||||||
}
|
|
||||||
poiEntity.setPhotoInfo(infoPhoto);
|
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
|
||||||
String format = formatter.format(calendar.getTime());
|
|
||||||
poiEntity.setCreateTime(format);
|
|
||||||
poiEntity.setExistence(existence);
|
|
||||||
poiEntity.setType(1);
|
|
||||||
poiEntity.setTaskStatus(2);
|
|
||||||
poiEntity.setIsLocalData(1);
|
|
||||||
String newPoiEntity = new Gson().toJson(poiEntity);
|
String newPoiEntity = new Gson().toJson(poiEntity);
|
||||||
//以键值对的形式添加新值。
|
//以键值对的形式添加新值。
|
||||||
edit.putString("poiEntity", newPoiEntity);
|
edit.putString("poiEntity", newPoiEntity);
|
||||||
@ -908,11 +819,14 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
if (requestCode == 101 && resultCode == RESULT_OK) {
|
if (requestCode == 101 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (file==null||!file.exists()){
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Toast.makeText(getActivity(), "请先拍照", Toast.LENGTH_SHORT).show();
|
||||||
String takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
return;
|
||||||
ivPanorama.setTag(takePhotoPath1);
|
}else {
|
||||||
ivPanorama.setImageBitmap(bitmap);//显示图像
|
String s = PhotoUtils.showPhotoAndGetPath(file, ivPanorama);
|
||||||
|
tvPanorama.setTag(s);
|
||||||
|
}
|
||||||
|
file=null;
|
||||||
/* int height = bitmap.getHeight();
|
/* int height = bitmap.getHeight();
|
||||||
int width = bitmap.getWidth();
|
int width = bitmap.getWidth();
|
||||||
if (height > width) {
|
if (height > width) {
|
||||||
@ -929,11 +843,16 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
|
|
||||||
}*/
|
}*/
|
||||||
} else if (requestCode == 102 && resultCode == RESULT_OK) {
|
} else if (requestCode == 102 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
if (file==null||!file.exists()){
|
||||||
String takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
Toast.makeText(getActivity(), "请先拍照", Toast.LENGTH_SHORT).show();
|
||||||
ivName.setTag(takePhotoPath2);
|
return;
|
||||||
ivName.setImageBitmap(bitmap);//显示图像
|
}else {
|
||||||
|
String s = PhotoUtils.showPhotoAndGetPath(file, ivName);
|
||||||
|
tvName.setTag(s);
|
||||||
|
}
|
||||||
|
file=null;
|
||||||
|
|
||||||
/* int height = bitmap.getHeight();
|
/* int height = bitmap.getHeight();
|
||||||
int width = bitmap.getWidth();
|
int width = bitmap.getWidth();
|
||||||
if (height > width) {
|
if (height > width) {
|
||||||
@ -950,11 +869,14 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
|
|
||||||
}*/
|
}*/
|
||||||
} else if (requestCode == 103 && resultCode == RESULT_OK) {
|
} else if (requestCode == 103 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (file==null||!file.exists()){
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Toast.makeText(getActivity(), "请先拍照", Toast.LENGTH_SHORT).show();
|
||||||
String takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
return;
|
||||||
ivInternal.setTag(takePhotoPath3);
|
}else {
|
||||||
ivInternal.setImageBitmap(bitmap);//显示图像
|
String s = PhotoUtils.showPhotoAndGetPath(file, ivInternal);
|
||||||
|
tvInternal.setTag(s);
|
||||||
|
}
|
||||||
|
file=null;
|
||||||
/*int height = bitmap.getHeight();
|
/*int height = bitmap.getHeight();
|
||||||
int width = bitmap.getWidth();
|
int width = bitmap.getWidth();
|
||||||
if (height > width) {
|
if (height > width) {
|
||||||
@ -971,11 +893,14 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
|
|
||||||
}*/
|
}*/
|
||||||
} else if (requestCode == 104 && resultCode == RESULT_OK) {
|
} else if (requestCode == 104 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (file==null||!file.exists()){
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Toast.makeText(getActivity(), "请先拍照", Toast.LENGTH_SHORT).show();
|
||||||
String takePhotoPath4 = PhotoPathUtil.getTakePhotoPath(data, "d", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
return;
|
||||||
ivCard.setTag(takePhotoPath4);
|
}else {
|
||||||
ivCard.setImageBitmap(bitmap);//显示图像
|
String s = PhotoUtils.showPhotoAndGetPath(file, ivCard);
|
||||||
|
tvCard.setTag(s);
|
||||||
|
}
|
||||||
|
file = null;
|
||||||
/* int height = bitmap.getHeight();
|
/* int height = bitmap.getHeight();
|
||||||
int width = bitmap.getWidth();
|
int width = bitmap.getWidth();
|
||||||
if (height > width) {
|
if (height > width) {
|
||||||
@ -992,11 +917,14 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
|
|
||||||
}*/
|
}*/
|
||||||
} else if (requestCode == 105 && resultCode == RESULT_OK) {
|
} else if (requestCode == 105 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (file==null||!file.exists()){
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Toast.makeText(getActivity(), "请先拍照", Toast.LENGTH_SHORT).show();
|
||||||
String takePhotoPath5 = PhotoPathUtil.getTakePhotoPath(data, "e", Geohash.getInstance().encode(latLng.latitude, latLng.longitude));
|
return;
|
||||||
ivElse.setTag(takePhotoPath5);
|
}else {
|
||||||
ivElse.setImageBitmap(bitmap);//显示图像
|
String s = PhotoUtils.showPhotoAndGetPath(file, ivElse);
|
||||||
|
tvElse.setTag(s);
|
||||||
|
}
|
||||||
|
file = null;
|
||||||
/* int height = bitmap.getHeight();
|
/* int height = bitmap.getHeight();
|
||||||
int width = bitmap.getWidth();
|
int width = bitmap.getWidth();
|
||||||
if (height > width) {
|
if (height > width) {
|
||||||
@ -1040,5 +968,106 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PoiEntity initPoiEntityByUI(PoiEntity poiEntity) {
|
||||||
|
ArrayList<Info> infoPhoto = new ArrayList<>();
|
||||||
|
String name = editNameContent.getText().toString().trim();//名称
|
||||||
|
if (name != null && !name.equals("")) {
|
||||||
|
poiEntity.setName(name);
|
||||||
|
}
|
||||||
|
String site = editSiteContent.getText().toString().trim();
|
||||||
|
if (site != null && !site.equals("")) {
|
||||||
|
poiEntity.setAddress(site);
|
||||||
|
}
|
||||||
|
if (latLng != null) {
|
||||||
|
String encode = Geohash.getInstance().encode(latLng.latitude, latLng.longitude);
|
||||||
|
poiEntity.setGeoWkt(encode);
|
||||||
|
poiEntity.setX(String.valueOf(latLng.longitude));
|
||||||
|
poiEntity.setY(String.valueOf(latLng.latitude));
|
||||||
|
}
|
||||||
|
String describe = editDescribe.getText().toString().trim();
|
||||||
|
if (describe != null && !describe.equals("")) {
|
||||||
|
poiEntity.setMemo(describe);
|
||||||
|
}
|
||||||
|
boolean phoneBean = contactView.getPhoneBean();
|
||||||
|
if (phoneBean) {
|
||||||
|
String list = contactView.getList();
|
||||||
|
poiEntity.setTelPhone(list);
|
||||||
|
|
||||||
|
}
|
||||||
|
String tagPanorama = (String) tvPanorama.getTag();
|
||||||
|
if (tagPanorama != null && !tagPanorama.equals("")) {
|
||||||
|
infoPhoto.add(new Info(tagPanorama));
|
||||||
|
}
|
||||||
|
String tagName = (String) tvName.getTag();
|
||||||
|
if (tagName != null && !tagName.equals("")) {
|
||||||
|
infoPhoto.add(new Info(tagName));
|
||||||
|
}
|
||||||
|
String tagInternal = (String) tvInternal.getTag();
|
||||||
|
if (tagInternal != null && !tagInternal.equals("")) {
|
||||||
|
infoPhoto.add(new Info(tagInternal));
|
||||||
|
}
|
||||||
|
String tagElse = (String) tvElse.getTag();
|
||||||
|
if (tagElse != null && !tagElse.equals("")) {
|
||||||
|
infoPhoto.add(new Info(tagElse));
|
||||||
|
}
|
||||||
|
String tagCard = (String) tvCard.getTag();
|
||||||
|
if (tagCard != null && !tagCard.equals("")) {
|
||||||
|
infoPhoto.add(new Info(tagCard));
|
||||||
|
}
|
||||||
|
poiEntity.setPhotoInfo(infoPhoto);
|
||||||
|
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||||
|
String format = formatter.format(calendar.getTime());
|
||||||
|
poiEntity.setCreateTime(format);
|
||||||
|
poiEntity.setExistence(existence);
|
||||||
|
poiEntity.setType(1);
|
||||||
|
poiEntity.setTaskStatus(2);
|
||||||
|
poiEntity.setIsLocalData(1);
|
||||||
|
return poiEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PoiCheckResult checkPoiEntity(PoiEntity entity) {
|
||||||
|
PoiCheckResult poiCheckResult = new PoiCheckResult();
|
||||||
|
if (entity.getName()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请输入 名称");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if (tvPanorama.getTag()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请 拍照");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if (tvName.getTag()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请 拍照");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if (entity.getX()==null&&entity.getY()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请确定 点位");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if (entity.getTelPhone()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请输入 手机号");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ChargingPileEntity initChargingPileEntityByUI(ChargingPileEntity entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PoiCheckResult checkChargingPileEntity(ChargingPileEntity entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -14,6 +14,7 @@ import android.widget.AdapterView;
|
|||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.RadioButton;
|
import android.widget.RadioButton;
|
||||||
import android.widget.RadioGroup;
|
import android.widget.RadioGroup;
|
||||||
@ -27,6 +28,7 @@ import androidx.annotation.Nullable;
|
|||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.github.lazylibrary.util.FileUtils;
|
import com.github.lazylibrary.util.FileUtils;
|
||||||
|
import com.github.lazylibrary.util.StringUtils;
|
||||||
import com.github.lazylibrary.util.ZipUtil;
|
import com.github.lazylibrary.util.ZipUtil;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.hjq.permissions.OnPermissionCallback;
|
import com.hjq.permissions.OnPermissionCallback;
|
||||||
@ -52,6 +54,7 @@ import com.navinfo.outdoor.http.Callback;
|
|||||||
import com.navinfo.outdoor.http.DialogCallback;
|
import com.navinfo.outdoor.http.DialogCallback;
|
||||||
import com.navinfo.outdoor.http.HttpInterface;
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
|
import com.navinfo.outdoor.room.ChargingPileEntity;
|
||||||
import com.navinfo.outdoor.room.InsertAndUpdateUtils;
|
import com.navinfo.outdoor.room.InsertAndUpdateUtils;
|
||||||
import com.navinfo.outdoor.room.PoiDao;
|
import com.navinfo.outdoor.room.PoiDao;
|
||||||
import com.navinfo.outdoor.room.PoiDatabase;
|
import com.navinfo.outdoor.room.PoiDatabase;
|
||||||
@ -61,6 +64,7 @@ import com.navinfo.outdoor.util.GeometryTools;
|
|||||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
@ -81,7 +85,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
private RadioButton rbCar;
|
private RadioButton rbCar;
|
||||||
private RadioButton rbBicycle;
|
private RadioButton rbBicycle;
|
||||||
private RadioButton rbWalking;
|
private RadioButton rbWalking;
|
||||||
private RadioButton rbManual;
|
|
||||||
private EditText etDesc;
|
private EditText etDesc;
|
||||||
private Button btnRoadSave;
|
private Button btnRoadSave;
|
||||||
private RadioGroup rgType;
|
private RadioGroup rgType;
|
||||||
@ -91,6 +94,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
private Button btnPoiVideoUpload;
|
private Button btnPoiVideoUpload;
|
||||||
private String videoPath;
|
private String videoPath;
|
||||||
private File fileZip;
|
private File fileZip;
|
||||||
|
private FrameLayout fmPoiVideoPic;
|
||||||
|
|
||||||
public static PoiVideoFragment newInstance(Bundle bundle) {
|
public static PoiVideoFragment newInstance(Bundle bundle) {
|
||||||
PoiVideoFragment fragment = new PoiVideoFragment();
|
PoiVideoFragment fragment = new PoiVideoFragment();
|
||||||
@ -102,7 +106,14 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
protected int getLayout() {
|
protected int getLayout() {
|
||||||
return R.layout.poi_video_fragment;
|
return R.layout.poi_video_fragment;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
if (!EventBus.getDefault().isRegistered(this)) {//加上判断
|
||||||
|
EventBus.getDefault().register(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
@ -140,42 +151,46 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
rbCar = (RadioButton) findViewById(R.id.rb_car);
|
rbCar = (RadioButton) findViewById(R.id.rb_car);
|
||||||
rbBicycle = (RadioButton) findViewById(R.id.rb_bicycle);
|
rbBicycle = (RadioButton) findViewById(R.id.rb_bicycle);
|
||||||
rbWalking = (RadioButton) findViewById(R.id.rb_walking);
|
rbWalking = (RadioButton) findViewById(R.id.rb_walking);
|
||||||
rbManual = (RadioButton) findViewById(R.id.rb_manual);
|
|
||||||
etDesc = (EditText) findViewById(R.id.et_desc);
|
etDesc = (EditText) findViewById(R.id.et_desc);
|
||||||
|
fmPoiVideoPic = findViewById(R.id.fm_poi_video_picture);
|
||||||
btnRoadSave = (Button) findViewById(R.id.btn_poi_video_save);
|
btnRoadSave = (Button) findViewById(R.id.btn_poi_video_save);
|
||||||
btnRoadSave.setOnClickListener(this::onClick);
|
btnRoadSave.setOnClickListener(this::onClick);
|
||||||
btnPoiVideoUpload = findViewById(R.id.btn_poi_video_upload);
|
btnPoiVideoUpload = findViewById(R.id.btn_poi_video_upload);
|
||||||
btnPoiVideoUpload.setOnClickListener(this::onClick);
|
btnPoiVideoUpload.setOnClickListener(this::onClick);
|
||||||
rgType = (RadioGroup) findViewById(R.id.rg_type);
|
rgType = (RadioGroup) findViewById(R.id.rg_type);
|
||||||
ivPoiVideoPicture.setOnClickListener(new View.OnClickListener() {
|
fmPoiVideoPic.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (v.getTag() == null) {
|
if (v.getTag() == null || ((List<File>) v.getTag()).size() == 0) {
|
||||||
Toast.makeText(getActivity(), "还没有拍摄视频!", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "还没有拍摄视频!", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
File videoFile = (File) v.getTag();
|
|
||||||
|
File finalFile = AWMp4ParserHelper.getInstance().obtainMp4FilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath());
|
||||||
Intent intent = new Intent(getContext(), PictureActivity.class);
|
Intent intent = new Intent(getContext(), PictureActivity.class);
|
||||||
intent.putExtra(Constant.INTENT_VIDEO_PATH, videoFile.getAbsolutePath());
|
intent.putExtra("uuId", showPoiEntity.getId());
|
||||||
|
intent.putExtra(Constant.INTENT_VIDEO_PATH, finalFile.getAbsolutePath());
|
||||||
startActivityForResult(intent, 0x101);
|
startActivityForResult(intent, 0x101);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
ivPoiVideoPicture.setOnLongClickListener(new View.OnLongClickListener() {
|
fmPoiVideoPic.setOnLongClickListener(new View.OnLongClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onLongClick(View v) {
|
public boolean onLongClick(View v) {
|
||||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "对否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
MessageDialog.show((AppCompatActivity) getContext(), "提示", "对否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
File videoFile = (File) ivPoiVideoPicture.getTag();
|
List<File> videoFiles = (List<File>) fmPoiVideoPic.getTag();
|
||||||
if (videoFile != null) {
|
if (videoFiles!=null){
|
||||||
videoFile.delete();
|
for (int i = 0; i < videoFiles.size(); i++) {
|
||||||
//获取文件名
|
//获取文件名
|
||||||
String csvFileName = videoFile.getName() + ".txt";
|
String csvFileName = videoFiles.get(i).getName() + ".txt";
|
||||||
File cavFile = new File(videoFile.getParent(), csvFileName);
|
File cavFile = new File(videoFiles.get(i).getParent(), csvFileName);
|
||||||
|
videoFiles.clear();
|
||||||
cavFile.delete();
|
cavFile.delete();
|
||||||
ivPoiVideoPicture.setImageDrawable(null);
|
ivPoiVideoPicture.setImageDrawable(null);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -198,15 +213,30 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
showPictureType(work_type);
|
showPictureType(work_type);
|
||||||
String describe = showPoiEntity.getMemo();//任务描述
|
String describe = showPoiEntity.getMemo();//任务描述
|
||||||
if (describe != null && !describe.equals("")) {
|
if (describe != null && !describe.equals("")) {
|
||||||
etDesc.setText(describe+"");
|
etDesc.setText(describe + "");
|
||||||
}
|
}
|
||||||
String photo = showPoiEntity.getPhoto();
|
String photoList = showPoiEntity.getPhoto();
|
||||||
if (photo != null) {
|
if (!StringUtils.isEmpty(photoList)) {
|
||||||
|
String[] photos = photoList.split(",");
|
||||||
|
List<File> videoFileList = new ArrayList<>();
|
||||||
|
boolean isImageLoad = false;
|
||||||
|
if (photos != null && photos.length > 0) {
|
||||||
|
for (int i = 0; i < photos.length; i++) {
|
||||||
|
String photo = photos[i];
|
||||||
|
if (!StringUtils.isEmpty(photo)) {
|
||||||
File videoFile = new File(photo);
|
File videoFile = new File(photo);
|
||||||
if (videoFile.exists()) {
|
videoFileList.add(new File(photo));
|
||||||
|
if (videoFile.getPath().contains("0.mp4")&&!videoFile.getPath().contains("0.mp4.txt")){
|
||||||
|
if (videoFile.exists() && !isImageLoad) {
|
||||||
// 使用glide加载视频的第一帧
|
// 使用glide加载视频的第一帧
|
||||||
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivPoiVideoPicture, 500);
|
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivPoiVideoPicture, 500);
|
||||||
ivPoiVideoPicture.setTag(videoFile);
|
isImageLoad = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fmPoiVideoPic.setTag(videoFileList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -225,32 +255,19 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
btnRoadSave.setEnabled(false);
|
btnRoadSave.setEnabled(false);
|
||||||
rbCar.setEnabled(false);
|
rbCar.setEnabled(false);
|
||||||
rbWalking.setEnabled(false);
|
rbWalking.setEnabled(false);
|
||||||
rbManual.setEnabled(false);
|
|
||||||
rbBicycle.setEnabled(false);
|
rbBicycle.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onEvent(Message data) {
|
||||||
|
if (data.what == Constant.PICTURE_VIDEO_WORD) {
|
||||||
|
if ((boolean)data.obj){
|
||||||
|
initPoiVideoSharePre();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取本地视频的第一帧
|
|
||||||
*
|
|
||||||
* @param localPath
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Bitmap getLocalVideoBitmap(String localPath) {
|
|
||||||
Bitmap bitmap = null;
|
|
||||||
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
|
|
||||||
try {
|
|
||||||
//根据文件路径获取缩略图
|
|
||||||
retriever.setDataSource(localPath);
|
|
||||||
//获得第一帧图片
|
|
||||||
bitmap = retriever.getFrameAtTime();
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} finally {
|
|
||||||
retriever.release();
|
|
||||||
}
|
|
||||||
return bitmap;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@ -260,35 +277,39 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
break;
|
break;
|
||||||
case R.id.tv_pictures:
|
case R.id.tv_pictures:
|
||||||
// 根据用户点击的时间为视频名称赋值
|
// 根据用户点击的时间为视频名称赋值
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
|
// DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||||
String videoFormatName = formatter.format(new Date());
|
// String videoFormatName = formatter.format(new Date());
|
||||||
Intent intent = new Intent(getContext(), PictureActivity.class);
|
Intent intent = new Intent(getContext(), PictureActivity.class);
|
||||||
intent.putExtra(Constant.INTENT_VIDEO_PATH, Constant.PICTURE_FOLDER + "/" + videoFormatName + ".mp4");
|
File finalFile = AWMp4ParserHelper.getInstance().obtainMp4FilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath());
|
||||||
|
intent.putExtra(Constant.INTENT_VIDEO_PATH, finalFile.getAbsolutePath());
|
||||||
|
intent.putExtra("uuId", showPoiEntity.getId());
|
||||||
startActivityForResult(intent, 0x101);
|
startActivityForResult(intent, 0x101);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.btn_poi_video_upload:
|
case R.id.btn_poi_video_upload:
|
||||||
ArrayList<File> videoFileList = new ArrayList<>();
|
showFileLoadingDialog();
|
||||||
if (ivPoiVideoPicture.getTag() != null) {
|
setLoadingDialogText("压缩中...");
|
||||||
showLoadingDialog();
|
if (fmPoiVideoPic.getTag() != null) {
|
||||||
File videoFile = (File) ivPoiVideoPicture.getTag();
|
List<File> videoFileList = (List<File>) fmPoiVideoPic.getTag();
|
||||||
videoFileList.add(videoFile);
|
|
||||||
File file = new File(videoFile.getPath()+".txt");
|
|
||||||
videoFileList.add(file);
|
|
||||||
fileZip = new File(Constant.PICTURE_FOLDER, "files" + ".zip");
|
fileZip = new File(Constant.PICTURE_FOLDER, "files" + ".zip");
|
||||||
ZipUtil.zipFiles(videoFileList, fileZip, null);
|
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
ZipUtil.zipFiles(videoFileList, fileZip, null);
|
||||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||||
if (poiDaoPoiEntity == null || poiDaoPoiEntity.getTaskStatus() == 1 || poiDaoPoiEntity.getTaskStatus() == 2 || poiDaoPoiEntity.getTaskStatus() == 0) {
|
if (poiDaoPoiEntity == null || poiDaoPoiEntity.getTaskStatus() == 1 || poiDaoPoiEntity.getTaskStatus() == 2 || poiDaoPoiEntity.getTaskStatus() == 0) {
|
||||||
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
initPoiSaveLocal(true);
|
initPoiSaveLocal(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
dismissLoadingDialog();
|
||||||
poiVideoUpload(poiDaoPoiEntity.getBodyId(), fileZip);
|
poiVideoUpload(poiDaoPoiEntity.getBodyId(), fileZip);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -296,7 +317,8 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
|
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
}else {
|
} else {
|
||||||
|
dismissLoadingDialog();
|
||||||
Toast.makeText(getContext(), "请录像", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "请录像", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -305,97 +327,21 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void initPoiSaveLocal(boolean isLocal) {
|
public void initPoiSaveLocal(boolean isLocal) {
|
||||||
|
|
||||||
XXPermissions.with(getContext())
|
XXPermissions.with(getContext())
|
||||||
.permission(Permission.MANAGE_EXTERNAL_STORAGE)
|
.permission(Permission.MANAGE_EXTERNAL_STORAGE)
|
||||||
.request(new OnPermissionCallback() {
|
.request(new OnPermissionCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onGranted(List<String> permissions, boolean all) {
|
public void onGranted(List<String> permissions, boolean all) {
|
||||||
if (all) {
|
if (all) {
|
||||||
PoiEntity poiEntity = showPoiEntity;
|
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
||||||
String roadName = etRoadName.getText().toString().trim();
|
PoiCheckResult poiCheckResult = checkPoiEntity(poiEntity);
|
||||||
if (roadName != null && !roadName.equals("")) {
|
if (poiCheckResult.getCode() == 1) {
|
||||||
poiEntity.setName(roadName + "");
|
Toast.makeText(getActivity(), poiCheckResult.getMsg()+"", Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
|
||||||
DateFormat formatters = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
|
|
||||||
Calendar calendars = Calendar.getInstance();
|
|
||||||
calendars.setTimeInMillis(System.currentTimeMillis());
|
|
||||||
String formats = formatters.format(calendars.getTime());
|
|
||||||
String city = Constant.currentLocation.getCity();//返回当前位置的城市.
|
|
||||||
String district = Constant.currentLocation.getDistrict();//返回当前位置的区县.
|
|
||||||
StringBuilder sb = new StringBuilder("poi录像上报");
|
|
||||||
if (city != null && !"".equals(city)) {
|
|
||||||
sb.append("-");
|
|
||||||
sb.append(city);
|
|
||||||
}
|
|
||||||
if (district != null && !"".equals(district)) {
|
|
||||||
sb.append(district);
|
|
||||||
}
|
|
||||||
sb.append("-").append(formats);
|
|
||||||
poiEntity.setName(sb.toString());
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
etRoadName.setText(sb);
|
|
||||||
etRoadName.setEnabled(false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
int pictureType = getPictureType();
|
|
||||||
if (pictureType == -1) {
|
|
||||||
Toast.makeText(getContext(), "请选择拍照方式", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
poiEntity.setWork_type(pictureType);
|
|
||||||
}
|
}
|
||||||
String desc = etDesc.getText().toString().trim();
|
|
||||||
if (desc != null && !desc.equals("")) {
|
|
||||||
poiEntity.setMemo(desc);
|
|
||||||
}
|
|
||||||
if (showPoiEntity != null) {
|
|
||||||
if (showPoiEntity.getTaskId() != 0) {
|
|
||||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File videoFile = (File) ivPoiVideoPicture.getTag();
|
|
||||||
if (videoFile == null ) {
|
|
||||||
Toast.makeText(getActivity(), "请录像", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
|
|
||||||
String path = videoFile.getPath() + ".txt";
|
|
||||||
poiEntity.setPhoto(videoFile.getAbsolutePath());
|
|
||||||
List<String> strings = FileUtils.readFileToList(path, "utf-8");
|
|
||||||
ArrayList<LatLng> latLngs = new ArrayList<>();
|
|
||||||
for (int i = 0; i < strings.size(); i++) {
|
|
||||||
String[] split = strings.get(i).split(",");
|
|
||||||
LatLng latLng = new LatLng();
|
|
||||||
latLng.setLatitude(Double.valueOf(split[2]));
|
|
||||||
latLng.setLongitude(Double.valueOf(split[3]));
|
|
||||||
latLngs.add(latLng);
|
|
||||||
}
|
|
||||||
if (strings.size() == 1) {
|
|
||||||
LatLng latLng = latLngs.get(0);
|
|
||||||
latLngs.add(latLng);
|
|
||||||
}
|
|
||||||
String lineString = GeometryTools.getLineString(latLngs);
|
|
||||||
Log.d("TAG", "onGranted: " + lineString);
|
|
||||||
poiEntity.setGeoWkt(lineString);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
|
||||||
String format = formatter.format(calendar.getTime());
|
|
||||||
poiEntity.setCreateTime(format);
|
|
||||||
poiEntity.setType(3);
|
|
||||||
poiEntity.setTaskStatus(2);
|
|
||||||
poiEntity.setIsLocalData(1);
|
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
//
|
|
||||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@ -423,6 +369,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void poiVideoUpload(int poiVideoBody, File fileZip) {
|
private void poiVideoUpload(int poiVideoBody, File fileZip) {
|
||||||
if (poiVideoBody == 0) {
|
if (poiVideoBody == 0) {
|
||||||
Toast.makeText(getActivity(), "请先保存本地在上传", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "请先保存本地在上传", Toast.LENGTH_SHORT).show();
|
||||||
@ -491,6 +438,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(PoiVideoBean poiVideoBean, int id) {
|
public void onSuccess(PoiVideoBean poiVideoBean, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
|
if (poiVideoBean.getCode() == 200) {
|
||||||
Integer poiVideoBody = poiVideoBean.getBody();
|
Integer poiVideoBody = poiVideoBean.getBody();
|
||||||
if (poiVideoBody != null && poiVideoBody != 0) {
|
if (poiVideoBody != null && poiVideoBody != 0) {
|
||||||
poiEntity.setBodyId(poiVideoBody);
|
poiEntity.setBodyId(poiVideoBody);
|
||||||
@ -513,9 +461,11 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), ""+poiVideoBean.getMessage(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "" + poiVideoBean.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(getActivity(), "" + poiVideoBean.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -534,11 +484,12 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
|
|
||||||
if (requestCode == 0x101 && resultCode == 0x101) {
|
if (requestCode == 0x101 && resultCode == 0x101) {
|
||||||
if (data != null && data.hasExtra(Constant.INTENT_VIDEO_PATH)) {
|
if (data != null && data.hasExtra(Constant.INTENT_VIDEO_PATH)) {
|
||||||
videoPath = data.getStringExtra(Constant.INTENT_VIDEO_PATH);
|
String videoPath = data.getStringExtra(Constant.INTENT_VIDEO_PATH);
|
||||||
File videoFile = new File(videoPath);
|
File videoFile = new File(videoPath);
|
||||||
if (videoFile.exists()) {
|
if (videoFile.exists()) {
|
||||||
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivPoiVideoPicture, 500);
|
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivPoiVideoPicture, 500);
|
||||||
ivPoiVideoPicture.setTag(videoFile);
|
List<File> videoFileListByUUID = AWMp4ParserHelper.getInstance().getVideoFileListByUUID(showPoiEntity.getId());
|
||||||
|
fmPoiVideoPic.setTag(videoFileListByUUID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -562,28 +513,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
//获取Editor对象
|
//获取Editor对象
|
||||||
SharedPreferences.Editor edit = poi.edit();
|
SharedPreferences.Editor edit = poi.edit();
|
||||||
//根据要保存的数据的类型,调用对应的put方法,
|
//根据要保存的数据的类型,调用对应的put方法,
|
||||||
|
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
||||||
PoiEntity poiEntity = new PoiEntity();
|
|
||||||
String roadName = etRoadName.getText().toString().trim();
|
|
||||||
if (roadName != null && !roadName.equals("")) {
|
|
||||||
poiEntity.setName(roadName);
|
|
||||||
}
|
|
||||||
int pictureType = getPictureType();
|
|
||||||
if (pictureType != -1) {
|
|
||||||
poiEntity.setWork_type(pictureType);
|
|
||||||
}
|
|
||||||
String desc = etDesc.getText().toString().trim();
|
|
||||||
if (desc != null && !desc.equals("")) {
|
|
||||||
poiEntity.setMemo(desc);
|
|
||||||
}
|
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
|
||||||
String format = formatter.format(calendar.getTime());
|
|
||||||
poiEntity.setCreateTime(format);
|
|
||||||
poiEntity.setType(3);
|
|
||||||
poiEntity.setTaskStatus(2);
|
|
||||||
poiEntity.setIsLocalData(1);
|
|
||||||
String newPoiEntity = new Gson().toJson(poiEntity);
|
String newPoiEntity = new Gson().toJson(poiEntity);
|
||||||
//以键值对的形式添加新值。
|
//以键值对的形式添加新值。
|
||||||
edit.putString("poiEntity", newPoiEntity);
|
edit.putString("poiEntity", newPoiEntity);
|
||||||
@ -601,8 +531,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
return 1;
|
return 1;
|
||||||
} else if (rbWalking != null && rbWalking.isChecked()) {
|
} else if (rbWalking != null && rbWalking.isChecked()) {
|
||||||
return 2;
|
return 2;
|
||||||
} else if (rbManual != null && rbManual.isChecked()) {
|
|
||||||
return 3;
|
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -618,9 +546,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
case 2:
|
case 2:
|
||||||
rbWalking.setChecked(true);
|
rbWalking.setChecked(true);
|
||||||
break;
|
break;
|
||||||
case 3:
|
|
||||||
rbManual.setChecked(true);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -633,12 +559,97 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||||
if (poiDaoPoiEntity!=null) {
|
if (poiDaoPoiEntity != null) {
|
||||||
if (poiDaoPoiEntity.getTaskStatus()==5){
|
if (poiDaoPoiEntity.getTaskStatus() == 5) {
|
||||||
poiDao.deletePoiEntity(poiDaoPoiEntity);
|
poiDao.deletePoiEntity(poiDaoPoiEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PoiEntity initPoiEntityByUI(PoiEntity poiEntity) {
|
||||||
|
String roadName = etRoadName.getText().toString().trim();
|
||||||
|
if (roadName != null && !roadName.equals("")) {
|
||||||
|
poiEntity.setName(roadName + "");
|
||||||
|
} else {
|
||||||
|
DateFormat formatters = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
|
||||||
|
Calendar calendars = Calendar.getInstance();
|
||||||
|
calendars.setTimeInMillis(System.currentTimeMillis());
|
||||||
|
String formats = formatters.format(calendars.getTime());
|
||||||
|
String city = Constant.currentLocation.getCity();//返回当前位置的城市.
|
||||||
|
String district = Constant.currentLocation.getDistrict();//返回当前位置的区县.
|
||||||
|
StringBuilder sb = new StringBuilder("poi录像上报");
|
||||||
|
if (city != null && !"".equals(city)) {
|
||||||
|
sb.append("-");
|
||||||
|
sb.append(city);
|
||||||
|
}
|
||||||
|
if (district != null && !"".equals(district)) {
|
||||||
|
sb.append(district);
|
||||||
|
}
|
||||||
|
sb.append("-").append(formats);
|
||||||
|
poiEntity.setName(sb.toString());
|
||||||
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
etRoadName.setText(sb);
|
||||||
|
etRoadName.setEnabled(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
int pictureType = getPictureType();
|
||||||
|
if (pictureType != -1) {
|
||||||
|
poiEntity.setWork_type(pictureType);
|
||||||
|
}
|
||||||
|
String desc = etDesc.getText().toString().trim();
|
||||||
|
if (desc != null && !desc.equals("")) {
|
||||||
|
poiEntity.setDescribe(desc);
|
||||||
|
}
|
||||||
|
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||||
|
String format = formatter.format(calendar.getTime());
|
||||||
|
poiEntity.setCreateTime(format);
|
||||||
|
poiEntity.setType(3);
|
||||||
|
poiEntity.setTaskStatus(2);
|
||||||
|
poiEntity.setIsLocalData(1);
|
||||||
|
if (fmPoiVideoPic.getTag() != null &&!((List<File>) fmPoiVideoPic.getTag()).isEmpty()) {
|
||||||
|
List<LatLng> lineStringByVideoFileList = AWMp4ParserHelper.getInstance().getLineStringByVideoFileList((List<File>) fmPoiVideoPic.getTag());
|
||||||
|
String lineString = GeometryTools.getLineString(lineStringByVideoFileList);
|
||||||
|
Log.d("TAG", "onGranted: " + lineString);
|
||||||
|
String photoStr = AWMp4ParserHelper.getInstance().getVideoFileListStr((List<File>) fmPoiVideoPic.getTag());
|
||||||
|
poiEntity.setPhoto(photoStr);
|
||||||
|
if (lineString != null) {
|
||||||
|
poiEntity.setGeoWkt(lineString);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return poiEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PoiCheckResult checkPoiEntity(PoiEntity entity) {
|
||||||
|
PoiCheckResult poiCheckResult = new PoiCheckResult();
|
||||||
|
if (entity.getPhoto()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请录像");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if (entity.getWork_type()==-1){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请选择录像方式");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ChargingPileEntity initChargingPileEntityByUI(ChargingPileEntity entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PoiCheckResult checkChargingPileEntity(ChargingPileEntity entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
@ -3,23 +3,33 @@ package com.navinfo.outdoor.fragment;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.lzy.okgo.model.HttpParams;
|
||||||
import com.navinfo.outdoor.R;
|
import com.navinfo.outdoor.R;
|
||||||
import com.navinfo.outdoor.activity.LoginActivity;
|
import com.navinfo.outdoor.activity.LoginActivity;
|
||||||
|
import com.navinfo.outdoor.api.Constant;
|
||||||
import com.navinfo.outdoor.base.BaseFragment;
|
import com.navinfo.outdoor.base.BaseFragment;
|
||||||
|
import com.navinfo.outdoor.bean.UserBean;
|
||||||
|
import com.navinfo.outdoor.http.Callback;
|
||||||
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 注册页面
|
* 注册页面
|
||||||
*/
|
*/
|
||||||
public class RegisterFragment extends BaseFragment implements View.OnClickListener{
|
public class RegisterFragment extends BaseFragment implements View.OnClickListener {
|
||||||
|
|
||||||
|
|
||||||
private EditText etRegisterPhone, etRegisterNote, etRegisterReferrer, etRegisterPaw, etRegisterConfirmPaw;
|
private EditText etRegisterPhone, etRegisterNote, etRegisterReferrer, etRegisterPaw, etRegisterConfirmPaw;
|
||||||
private ImageView ivRegisterCheck,ivFinish;
|
private ImageView ivRegisterCheck, ivFinish;
|
||||||
private TextView haveGoLogin, tvRegister,registerGetNote;
|
private TextView haveGoLogin, registerGetNote;
|
||||||
|
private Button btnRegister;
|
||||||
|
private String sessionId;
|
||||||
|
|
||||||
public static RegisterFragment newInstance(Bundle bundle) {
|
public static RegisterFragment newInstance(Bundle bundle) {
|
||||||
RegisterFragment fragment = new RegisterFragment();
|
RegisterFragment fragment = new RegisterFragment();
|
||||||
@ -35,18 +45,21 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
|
|||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
ivFinish =findViewById(R.id.iv_register_finish);
|
ivFinish = findViewById(R.id.iv_register_finish);
|
||||||
etRegisterPhone =findViewById(R.id.et_register_phone);
|
ivFinish.setOnClickListener(this::onClick);
|
||||||
|
etRegisterPhone = findViewById(R.id.et_register_phone);
|
||||||
etRegisterNote = findViewById(R.id.et_register_note);
|
etRegisterNote = findViewById(R.id.et_register_note);
|
||||||
registerGetNote = findViewById(R.id.register_get_note);
|
registerGetNote = findViewById(R.id.register_get_note);
|
||||||
|
registerGetNote.setOnClickListener(this::onClick);
|
||||||
etRegisterReferrer = findViewById(R.id.et_register_referrer);
|
etRegisterReferrer = findViewById(R.id.et_register_referrer);
|
||||||
etRegisterPaw =findViewById(R.id.et_register_paw);
|
etRegisterPaw = findViewById(R.id.et_register_paw);
|
||||||
etRegisterConfirmPaw = findViewById(R.id.et_register_confirm_paw);
|
etRegisterConfirmPaw = findViewById(R.id.et_register_confirm_paw);
|
||||||
ivRegisterCheck = findViewById(R.id.iv_register_check);
|
ivRegisterCheck = findViewById(R.id.iv_register_check);
|
||||||
haveGoLogin = findViewById(R.id.have_go_login);
|
haveGoLogin = findViewById(R.id.have_go_login);
|
||||||
tvRegister =findViewById(R.id.tv_register);
|
|
||||||
ivFinish.setOnClickListener(this::onClick);
|
|
||||||
haveGoLogin.setOnClickListener(this::onClick);
|
haveGoLogin.setOnClickListener(this::onClick);
|
||||||
|
btnRegister = findViewById(R.id.btn_register);
|
||||||
|
btnRegister.setOnClickListener(this::onClick);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -57,7 +70,7 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()){
|
switch (v.getId()) {
|
||||||
case R.id.iv_register_finish:
|
case R.id.iv_register_finish:
|
||||||
getActivity().finish();
|
getActivity().finish();
|
||||||
break;
|
break;
|
||||||
@ -65,6 +78,113 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
|
|||||||
Intent registerLogin = new Intent(getActivity(), LoginActivity.class);
|
Intent registerLogin = new Intent(getActivity(), LoginActivity.class);
|
||||||
startActivity(registerLogin);
|
startActivity(registerLogin);
|
||||||
break;
|
break;
|
||||||
|
case R.id.btn_register:
|
||||||
|
initRegister();
|
||||||
|
case R.id.register_get_note:
|
||||||
|
initGetNote();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initGetNote() {
|
||||||
|
HttpParams httpParams = new HttpParams();
|
||||||
|
String mobile = etRegisterPhone.getText().toString().trim();
|
||||||
|
if (mobile == null || mobile.equals("")) {
|
||||||
|
Toast.makeText(getContext(), "请输入手机号", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
httpParams.put("telephone", mobile);
|
||||||
|
}
|
||||||
|
httpParams.put("type", 1);
|
||||||
|
showLoadingDialog();
|
||||||
|
OkGoBuilder.getInstance()
|
||||||
|
.Builder(getActivity())
|
||||||
|
.url(HttpInterface.USER_MESSAGE)
|
||||||
|
.cls(UserBean.class)
|
||||||
|
.token(null)
|
||||||
|
.params(httpParams)
|
||||||
|
.getRequest(new Callback<UserBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(UserBean response, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
if (response.getCode() == 200) {
|
||||||
|
sessionId = String.valueOf(response.getBody());
|
||||||
|
}
|
||||||
|
Toast.makeText(getActivity(), response.getMessage()+ "", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initRegister() {
|
||||||
|
HttpParams httpParams = new HttpParams();
|
||||||
|
String mobile = etRegisterPhone.getText().toString().trim();
|
||||||
|
if (mobile == null || mobile.equals("")) {
|
||||||
|
Toast.makeText(getContext(), "请输入手机号", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
httpParams.put("mobile", mobile);
|
||||||
|
}
|
||||||
|
String code = etRegisterNote.getText().toString().trim();
|
||||||
|
if (code == null || code.equals("")) {
|
||||||
|
Toast.makeText(getContext(), "请获取短信验证码", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
httpParams.put("code", code);
|
||||||
|
}
|
||||||
|
String password = etRegisterPaw.getText().toString().trim();
|
||||||
|
if (password == null || password.equals("")) {
|
||||||
|
Toast.makeText(getContext(), "请输入密码", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
httpParams.put("password", password);
|
||||||
|
}
|
||||||
|
String conFirmPaw = etRegisterConfirmPaw.getText().toString().trim();
|
||||||
|
if (conFirmPaw == null || conFirmPaw.equals("")) {
|
||||||
|
Toast.makeText(getContext(), "请输入确认密码", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!conFirmPaw.equals(password)) {
|
||||||
|
Toast.makeText(getContext(), "密码和确认密码请保持一致", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
if (sessionId == null||sessionId.equals("")) {
|
||||||
|
Toast.makeText(getContext(), "请短信获取验证码", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
httpParams.put("sessionId", sessionId);
|
||||||
|
}
|
||||||
|
long time=System.currentTimeMillis();
|
||||||
|
httpParams.put("datetime",time);
|
||||||
|
showLoadingDialog();
|
||||||
|
OkGoBuilder.getInstance()
|
||||||
|
.Builder(getActivity())
|
||||||
|
.url(HttpInterface.USER_REGISTER)
|
||||||
|
.token(null)
|
||||||
|
.params(httpParams)
|
||||||
|
.cls(UserBean.class)
|
||||||
|
.postRequest(new Callback<UserBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(UserBean response, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
if (response.getCode() == 200) {
|
||||||
|
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
Toast.makeText(getActivity(), e.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
@ -14,6 +14,7 @@ import android.widget.AdapterView;
|
|||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.RadioButton;
|
import android.widget.RadioButton;
|
||||||
import android.widget.RadioGroup;
|
import android.widget.RadioGroup;
|
||||||
@ -24,13 +25,19 @@ import android.widget.Toast;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.github.lazylibrary.util.FileUtils;
|
import com.github.lazylibrary.util.FileUtils;
|
||||||
|
import com.github.lazylibrary.util.StringUtils;
|
||||||
import com.github.lazylibrary.util.ZipUtil;
|
import com.github.lazylibrary.util.ZipUtil;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.hjq.permissions.OnPermissionCallback;
|
import com.hjq.permissions.OnPermissionCallback;
|
||||||
import com.hjq.permissions.Permission;
|
import com.hjq.permissions.Permission;
|
||||||
import com.hjq.permissions.XXPermissions;
|
import com.hjq.permissions.XXPermissions;
|
||||||
|
import com.kongzue.dialog.interfaces.OnDialogButtonClickListener;
|
||||||
|
import com.kongzue.dialog.util.BaseDialog;
|
||||||
|
import com.kongzue.dialog.util.DialogSettings;
|
||||||
|
import com.kongzue.dialog.v3.MessageDialog;
|
||||||
import com.lzy.okgo.OkGo;
|
import com.lzy.okgo.OkGo;
|
||||||
import com.lzy.okgo.model.HttpParams;
|
import com.lzy.okgo.model.HttpParams;
|
||||||
import com.lzy.okgo.model.Response;
|
import com.lzy.okgo.model.Response;
|
||||||
@ -46,6 +53,7 @@ import com.navinfo.outdoor.http.Callback;
|
|||||||
import com.navinfo.outdoor.http.DialogCallback;
|
import com.navinfo.outdoor.http.DialogCallback;
|
||||||
import com.navinfo.outdoor.http.HttpInterface;
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
|
import com.navinfo.outdoor.room.ChargingPileEntity;
|
||||||
import com.navinfo.outdoor.room.InsertAndUpdateUtils;
|
import com.navinfo.outdoor.room.InsertAndUpdateUtils;
|
||||||
import com.navinfo.outdoor.room.PoiDao;
|
import com.navinfo.outdoor.room.PoiDao;
|
||||||
import com.navinfo.outdoor.room.PoiDatabase;
|
import com.navinfo.outdoor.room.PoiDatabase;
|
||||||
@ -55,6 +63,7 @@ import com.navinfo.outdoor.util.GeometryTools;
|
|||||||
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -65,6 +74,8 @@ import java.util.Calendar;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 寻宝-点击上传弹窗-道路
|
* 寻宝-点击上传弹窗-道路
|
||||||
*/
|
*/
|
||||||
@ -76,7 +87,6 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
private RadioButton rbCar;
|
private RadioButton rbCar;
|
||||||
private RadioButton rbBicycle;
|
private RadioButton rbBicycle;
|
||||||
private RadioButton rbWalking;
|
private RadioButton rbWalking;
|
||||||
private RadioButton rbManual;
|
|
||||||
private EditText etDesc;
|
private EditText etDesc;
|
||||||
private Button btnRoadSave;
|
private Button btnRoadSave;
|
||||||
private RadioGroup rgType;
|
private RadioGroup rgType;
|
||||||
@ -84,8 +94,8 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
private PoiDao poiDao;
|
private PoiDao poiDao;
|
||||||
private PoiEntity showPoiEntity;
|
private PoiEntity showPoiEntity;
|
||||||
private Button roadUpload;
|
private Button roadUpload;
|
||||||
private String videoPath;
|
|
||||||
private File fileZip;
|
private File fileZip;
|
||||||
|
private FrameLayout fmRoadPic;
|
||||||
|
|
||||||
public static RoadFragment newInstance(Bundle bundle) {
|
public static RoadFragment newInstance(Bundle bundle) {
|
||||||
RoadFragment fragment = new RoadFragment();
|
RoadFragment fragment = new RoadFragment();
|
||||||
@ -98,6 +108,14 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
return R.layout.fragment_road;
|
return R.layout.fragment_road;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
if (!EventBus.getDefault().isRegistered(this)) {//加上判断
|
||||||
|
EventBus.getDefault().register(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
@ -134,26 +152,62 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
rbCar = (RadioButton) findViewById(R.id.rb_car);
|
rbCar = (RadioButton) findViewById(R.id.rb_car);
|
||||||
rbBicycle = (RadioButton) findViewById(R.id.rb_bicycle);
|
rbBicycle = (RadioButton) findViewById(R.id.rb_bicycle);
|
||||||
rbWalking = (RadioButton) findViewById(R.id.rb_walking);
|
rbWalking = (RadioButton) findViewById(R.id.rb_walking);
|
||||||
rbManual = (RadioButton) findViewById(R.id.rb_manual);
|
|
||||||
etDesc = (EditText) findViewById(R.id.et_desc);
|
etDesc = (EditText) findViewById(R.id.et_desc);
|
||||||
|
fmRoadPic = findViewById(R.id.fm_road_picture);
|
||||||
btnRoadSave = (Button) findViewById(R.id.btn_road_save);
|
btnRoadSave = (Button) findViewById(R.id.btn_road_save);
|
||||||
btnRoadSave.setOnClickListener(this::onClick);
|
btnRoadSave.setOnClickListener(this::onClick);
|
||||||
rgType = (RadioGroup) findViewById(R.id.rg_type);
|
rgType = (RadioGroup) findViewById(R.id.rg_type);
|
||||||
roadUpload = findViewById(R.id.road_upload);
|
roadUpload = findViewById(R.id.road_upload);
|
||||||
roadUpload.setOnClickListener(this::onClick);
|
roadUpload.setOnClickListener(this::onClick);
|
||||||
ivRoadPicture.setOnClickListener(new View.OnClickListener() {
|
showPictureType(1);
|
||||||
|
fmRoadPic.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (v.getTag() == null) {
|
if (v.getTag() == null || ((List<File>)v.getTag()).size()==0) {
|
||||||
Toast.makeText(getActivity(), "还没有拍摄视频!", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "还没有拍摄视频!", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
File videoFile = (File) v.getTag();
|
|
||||||
|
File finalFile = AWMp4ParserHelper.getInstance().obtainMp4FilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath());
|
||||||
Intent intent = new Intent(getContext(), PictureActivity.class);
|
Intent intent = new Intent(getContext(), PictureActivity.class);
|
||||||
intent.putExtra(Constant.INTENT_VIDEO_PATH, videoFile.getAbsolutePath());
|
intent.putExtra(Constant.INTENT_VIDEO_PATH, finalFile.getAbsolutePath());
|
||||||
|
intent.putExtra(Constant.INTENT_VIDEO_ORATATION, 0);
|
||||||
|
intent.putExtra("uuId", showPoiEntity.getId());
|
||||||
startActivityForResult(intent, 0x101);
|
startActivityForResult(intent, 0x101);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
fmRoadPic.setOnLongClickListener(new View.OnLongClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onLongClick(View v) {
|
||||||
|
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||||
|
MessageDialog.show((AppCompatActivity) getContext(), "提示", "对否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
|
List<File> videoFiles = (List<File>) fmRoadPic.getTag();
|
||||||
|
if (videoFiles!=null){
|
||||||
|
for (int i = 0; i < videoFiles.size(); i++) {
|
||||||
|
String csvFileName = videoFiles.get(i).getName() + ".txt";
|
||||||
|
File cavFile = new File(videoFiles.get(i).getParent(), csvFileName);
|
||||||
|
videoFiles.clear();
|
||||||
|
cavFile.delete();
|
||||||
|
ivRoadPicture.setImageDrawable(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// File videoFile = (File) fmRoadPic.getTag();
|
||||||
|
// if (videoFile != null) {
|
||||||
|
// videoFile.delete();
|
||||||
|
// //获取文件名
|
||||||
|
// String csvFileName = videoFile.getName() + ".txt";
|
||||||
|
// File cavFile = new File(videoFile.getParent(), csvFileName);
|
||||||
|
// cavFile.delete();
|
||||||
|
// ivRoadPicture.setImageDrawable(null);
|
||||||
|
// }
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
//数据展示
|
//数据展示
|
||||||
initShowPoi();
|
initShowPoi();
|
||||||
//禁用可操作性控件
|
//禁用可操作性控件
|
||||||
@ -175,13 +229,28 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
if (describe != null && !describe.equals("")) {
|
if (describe != null && !describe.equals("")) {
|
||||||
etDesc.setText(describe);
|
etDesc.setText(describe);
|
||||||
}
|
}
|
||||||
String photo = showPoiEntity.getPhoto();
|
String photoList = showPoiEntity.getPhoto();
|
||||||
if (photo != null) {
|
if (!StringUtils.isEmpty(photoList)) {
|
||||||
|
String[] photos = photoList.split(",");
|
||||||
|
List<File> videoFileList = new ArrayList<>();
|
||||||
|
boolean isImageLoad = false;
|
||||||
|
if (photos!=null&&photos.length>0) {
|
||||||
|
for (int i = 0; i < photos.length; i++) {
|
||||||
|
String photo = photos[i];
|
||||||
|
if (!StringUtils.isEmpty(photo)) {
|
||||||
File videoFile = new File(photo);
|
File videoFile = new File(photo);
|
||||||
if (videoFile.exists()) {
|
videoFileList.add(new File(photo));
|
||||||
|
if (videoFile.getPath().contains("0.mp4")&&!videoFile.getPath().contains("0.mp4.txt")){
|
||||||
|
if (videoFile.exists() && !isImageLoad) {
|
||||||
// 使用glide加载视频的第一帧
|
// 使用glide加载视频的第一帧
|
||||||
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivRoadPicture, 500);
|
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivRoadPicture, 500);
|
||||||
ivRoadPicture.setTag(videoFile);
|
isImageLoad = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fmRoadPic.setTag(videoFileList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -202,36 +271,16 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
btnRoadSave.setEnabled(false);
|
btnRoadSave.setEnabled(false);
|
||||||
rbCar.setEnabled(false);
|
rbCar.setEnabled(false);
|
||||||
rbBicycle.setEnabled(false);
|
rbBicycle.setEnabled(false);
|
||||||
rbManual.setEnabled(false);
|
|
||||||
rbWalking.setEnabled(false);
|
rbWalking.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Subscribe
|
||||||
protected void initData() {
|
public void onEvent(Message data) {
|
||||||
super.initData();
|
if (data.what == Constant.PICTURE_VIDEO_WORD) {
|
||||||
// infos = new ArrayList<>();
|
if ((boolean)data.obj){
|
||||||
|
initRoadSharePre();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取本地视频的第一帧
|
|
||||||
*
|
|
||||||
* @param localPath
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Bitmap getLocalVideoBitmap(String localPath) {
|
|
||||||
Bitmap bitmap = null;
|
|
||||||
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
|
|
||||||
try {
|
|
||||||
//根据文件路径获取缩略图
|
|
||||||
retriever.setDataSource(localPath);
|
|
||||||
//获得第一帧图片
|
|
||||||
bitmap = retriever.getFrameAtTime();
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} finally {
|
|
||||||
retriever.release();
|
|
||||||
}
|
}
|
||||||
return bitmap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -243,25 +292,25 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
case R.id.tv_pictures:
|
case R.id.tv_pictures:
|
||||||
|
|
||||||
// 根据用户点击的时间为视频名称赋值
|
// 根据用户点击的时间为视频名称赋值
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
|
// DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||||
String videoFormatName = formatter.format(new Date());
|
// String videoFormatName = formatter.format(new Date());
|
||||||
Intent intent = new Intent(getContext(), PictureActivity.class);
|
Intent intent = new Intent(getContext(), PictureActivity.class);
|
||||||
intent.putExtra(Constant.INTENT_VIDEO_PATH, Constant.PICTURE_FOLDER + "/" + videoFormatName + ".mp4");
|
File finalFile = AWMp4ParserHelper.getInstance().obtainMp4FilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath());
|
||||||
|
intent.putExtra(Constant.INTENT_VIDEO_PATH, finalFile.getAbsolutePath());
|
||||||
|
intent.putExtra(Constant.INTENT_VIDEO_ORATATION, 0);
|
||||||
|
intent.putExtra("uuId", showPoiEntity.getId());
|
||||||
startActivityForResult(intent, 0x101);
|
startActivityForResult(intent, 0x101);
|
||||||
break;
|
break;
|
||||||
case R.id.road_upload:
|
case R.id.road_upload:
|
||||||
ArrayList<File> videoFileList = new ArrayList<>();
|
showFileLoadingDialog();
|
||||||
if (ivRoadPicture.getTag() != null) {
|
setLoadingDialogText("压缩中...");
|
||||||
showLoadingDialog();
|
if (fmRoadPic.getTag() != null) {
|
||||||
File videoFile = (File) ivRoadPicture.getTag();
|
List<File> videoFileList = (List<File>) fmRoadPic.getTag();
|
||||||
videoFileList.add(videoFile);
|
|
||||||
File file = new File(videoFile.getPath() + ".txt");
|
|
||||||
videoFileList.add(file);
|
|
||||||
fileZip = new File(Constant.PICTURE_FOLDER, "files" + ".zip");
|
fileZip = new File(Constant.PICTURE_FOLDER, "files" + ".zip");
|
||||||
ZipUtil.zipFiles(videoFileList, fileZip, null);
|
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
ZipUtil.zipFiles(videoFileList, fileZip, null);
|
||||||
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
PoiEntity poiDaoPoiEntity = poiDao.getPoiEntity(showPoiEntity.getId());
|
||||||
if (poiDaoPoiEntity == null || poiDaoPoiEntity.getTaskStatus() == 1 || poiDaoPoiEntity.getTaskStatus() == 2 || poiDaoPoiEntity.getTaskStatus() == 0) {
|
if (poiDaoPoiEntity == null || poiDaoPoiEntity.getTaskStatus() == 1 || poiDaoPoiEntity.getTaskStatus() == 2 || poiDaoPoiEntity.getTaskStatus() == 0) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
@ -270,6 +319,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
dismissLoadingDialog();
|
||||||
poiVideoUpload(poiDaoPoiEntity.getBodyId(), fileZip);
|
poiVideoUpload(poiDaoPoiEntity.getBodyId(), fileZip);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -278,10 +328,10 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
}else {
|
}else {
|
||||||
|
dismissLoadingDialog();
|
||||||
Toast.makeText(getContext(), "请录像", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "请录像", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -294,83 +344,12 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
@Override
|
@Override
|
||||||
public void onGranted(List<String> permissions, boolean all) {
|
public void onGranted(List<String> permissions, boolean all) {
|
||||||
if (all) {
|
if (all) {
|
||||||
PoiEntity poiEntity = showPoiEntity;
|
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
||||||
String roadName = etRoadName.getText().toString().trim();
|
PoiCheckResult poiCheckResult = checkPoiEntity(poiEntity);
|
||||||
if (roadName != null && !roadName.equals("")) {
|
if (poiCheckResult.getCode() == 1) {
|
||||||
poiEntity.setName(roadName);
|
Toast.makeText(getActivity(), poiCheckResult.getMsg()+"", Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
|
||||||
DateFormat formatters = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
|
|
||||||
Calendar calendars = Calendar.getInstance();
|
|
||||||
calendars.setTimeInMillis(System.currentTimeMillis());
|
|
||||||
String formats = formatters.format(calendars.getTime());
|
|
||||||
String city = Constant.currentLocation.getCity();//返回当前位置的城市.
|
|
||||||
String district = Constant.currentLocation.getDistrict();//返回当前位置的区县.
|
|
||||||
StringBuffer sb = new StringBuffer("道路录像上报");
|
|
||||||
if (city != null && !"".equals(city)) {
|
|
||||||
sb.append("-");
|
|
||||||
sb.append(city);
|
|
||||||
}
|
|
||||||
if (district != null && !"".equals(district)) {
|
|
||||||
sb.append(district);
|
|
||||||
}
|
|
||||||
sb.append("-").append(formats);
|
|
||||||
poiEntity.setName(sb.toString());
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
etRoadName.setText(sb);
|
|
||||||
etRoadName.setEnabled(false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
String desc = etDesc.getText().toString().trim();
|
|
||||||
if (desc != null && !desc.equals("")) {
|
|
||||||
poiEntity.setDescribe(desc);
|
|
||||||
}
|
|
||||||
if (showPoiEntity != null) {
|
|
||||||
if (showPoiEntity.getTaskId() != 0) {
|
|
||||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ivRoadPicture.getTag() == null) {
|
|
||||||
Toast.makeText(getActivity(), "请录像", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
File videoFile = (File) ivRoadPicture.getTag();
|
|
||||||
String path = videoFile.getPath() + ".txt";
|
|
||||||
poiEntity.setPhoto(videoFile.getAbsolutePath());
|
|
||||||
List<String> strings = FileUtils.readFileToList(path, "utf-8");
|
|
||||||
ArrayList<LatLng> latLngs = new ArrayList<>();
|
|
||||||
for (int i = 0; i < strings.size(); i++) {
|
|
||||||
String[] split = strings.get(i).split(",");
|
|
||||||
LatLng latLng = new LatLng();
|
|
||||||
latLng.setLatitude(Double.valueOf(split[2]));
|
|
||||||
latLng.setLongitude(Double.valueOf(split[3]));
|
|
||||||
latLngs.add(latLng);
|
|
||||||
}
|
}
|
||||||
if (strings.size() == 1) {
|
|
||||||
LatLng latLng = latLngs.get(0);
|
|
||||||
latLngs.add(latLng);
|
|
||||||
}
|
|
||||||
String lineString = GeometryTools.getLineString(latLngs);
|
|
||||||
Log.d("TAG", "onGranted: " + lineString);
|
|
||||||
poiEntity.setGeoWkt(lineString);
|
|
||||||
}
|
|
||||||
int pictureType = getPictureType();
|
|
||||||
if (pictureType == -1) {
|
|
||||||
Toast.makeText(getContext(), "请选择拍照方式", Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
}else {
|
|
||||||
poiEntity.setWork_type(pictureType);
|
|
||||||
}
|
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
|
||||||
String format = formatter.format(calendar.getTime());
|
|
||||||
poiEntity.setCreateTime(format);
|
|
||||||
poiEntity.setType(4);
|
|
||||||
poiEntity.setTaskStatus(2);
|
|
||||||
poiEntity.setIsLocalData(1);
|
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -401,6 +380,9 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void poiVideoUpload(int body, File fileZip) {
|
private void poiVideoUpload(int body, File fileZip) {
|
||||||
if (body == 0) {
|
if (body == 0) {
|
||||||
Toast.makeText(getContext(), "请先保存本地在上传", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "请先保存本地在上传", Toast.LENGTH_SHORT).show();
|
||||||
@ -469,6 +451,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(RoadSaveBean roadSaveBean, int id) {
|
public void onSuccess(RoadSaveBean roadSaveBean, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
|
if (roadSaveBean.getCode()==200){
|
||||||
Integer roadBody = roadSaveBean.getBody();
|
Integer roadBody = roadSaveBean.getBody();
|
||||||
if (roadBody!=null&&roadBody!=0){
|
if (roadBody!=null&&roadBody!=0){
|
||||||
poiEntity.setBodyId(roadBody);
|
poiEntity.setBodyId(roadBody);
|
||||||
@ -493,6 +476,10 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
}else {
|
}else {
|
||||||
Toast.makeText(getContext(), ""+roadSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), ""+roadSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
Toast.makeText(getContext(), ""+roadSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -513,17 +500,43 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
if (requestCode == 0x101) {
|
if (requestCode == 0x101) {
|
||||||
if (resultCode == 0x101) {
|
if (resultCode == 0x101) {
|
||||||
if (data != null && data.hasExtra(Constant.INTENT_VIDEO_PATH)) {
|
if (data != null && data.hasExtra(Constant.INTENT_VIDEO_PATH)) {
|
||||||
videoPath = data.getStringExtra(Constant.INTENT_VIDEO_PATH);
|
// 扫描照片目录中当前视频的所有视频文件
|
||||||
|
|
||||||
|
String videoPath = data.getStringExtra(Constant.INTENT_VIDEO_PATH);
|
||||||
File videoFile = new File(videoPath);
|
File videoFile = new File(videoPath);
|
||||||
|
if (videoFile.exists()) {
|
||||||
|
Bitmap bitmap = AWMp4ParserHelper.getInstance().getLocalVideoBitmap(videoPath);
|
||||||
|
int height = bitmap.getHeight();
|
||||||
|
int width = bitmap.getWidth();
|
||||||
|
if (height>width){
|
||||||
|
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||||
|
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新录像,要求横屏录像", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
|
Intent intentPanorama = new Intent(getActivity(),PictureActivity.class);
|
||||||
|
File finalFile = AWMp4ParserHelper.getInstance().obtainMp4FilePath(new File(Constant.PICTURE_FOLDER, showPoiEntity.getId()).getAbsolutePath());
|
||||||
|
intentPanorama.putExtra(Constant.INTENT_VIDEO_PATH, finalFile.getAbsolutePath());
|
||||||
|
intentPanorama.putExtra(Constant.INTENT_VIDEO_ORATATION, 0);
|
||||||
|
startActivityForResult(intentPanorama, 0x101);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}else {
|
||||||
if (videoFile.exists()) {
|
if (videoFile.exists()) {
|
||||||
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivRoadPicture, 500);
|
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivRoadPicture, 500);
|
||||||
ivRoadPicture.setTag(videoFile);
|
List<File> videoFileListByUUID = AWMp4ParserHelper.getInstance().getVideoFileListByUUID(showPoiEntity.getId());
|
||||||
|
fmRoadPic.setTag(videoFileListByUUID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
@ -542,33 +555,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
//获取Editor对象
|
//获取Editor对象
|
||||||
SharedPreferences.Editor edit = poi.edit();
|
SharedPreferences.Editor edit = poi.edit();
|
||||||
//根据要保存的数据的类型,调用对应的put方法,
|
//根据要保存的数据的类型,调用对应的put方法,
|
||||||
|
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
||||||
PoiEntity poiEntity = new PoiEntity();
|
|
||||||
String roadName = etRoadName.getText().toString().trim();
|
|
||||||
if (roadName != null && !roadName.equals("")) {
|
|
||||||
poiEntity.setName(roadName);
|
|
||||||
}
|
|
||||||
int pictureType = getPictureType();
|
|
||||||
if (pictureType != -1) {
|
|
||||||
poiEntity.setWork_type(pictureType);
|
|
||||||
}
|
|
||||||
String desc = etDesc.getText().toString().trim();
|
|
||||||
if (desc != null && !desc.equals("")) {
|
|
||||||
poiEntity.setDescribe(desc);
|
|
||||||
}
|
|
||||||
if (showPoiEntity != null) {
|
|
||||||
if (showPoiEntity.getTaskId() != 0) {
|
|
||||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
|
||||||
String format = formatter.format(calendar.getTime());
|
|
||||||
poiEntity.setCreateTime(format);
|
|
||||||
poiEntity.setType(4);
|
|
||||||
poiEntity.setTaskStatus(2);
|
|
||||||
poiEntity.setIsLocalData(1);
|
|
||||||
String newPoiEntity = new Gson().toJson(poiEntity);
|
String newPoiEntity = new Gson().toJson(poiEntity);
|
||||||
//以键值对的形式添加新值。
|
//以键值对的形式添加新值。
|
||||||
edit.putString("poiEntity", newPoiEntity);
|
edit.putString("poiEntity", newPoiEntity);
|
||||||
@ -585,8 +572,6 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
return 1;
|
return 1;
|
||||||
} else if (rbWalking != null && rbWalking.isChecked()) {
|
} else if (rbWalking != null && rbWalking.isChecked()) {
|
||||||
return 2;
|
return 2;
|
||||||
} else if (rbManual != null && rbManual.isChecked()) {
|
|
||||||
return 3;
|
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -602,9 +587,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
case 2:
|
case 2:
|
||||||
rbWalking.setChecked(true);
|
rbWalking.setChecked(true);
|
||||||
break;
|
break;
|
||||||
case 3:
|
|
||||||
rbManual.setChecked(true);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -625,4 +608,90 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PoiEntity initPoiEntityByUI(PoiEntity poiEntity) {
|
||||||
|
String roadName = etRoadName.getText().toString().trim();
|
||||||
|
if (roadName != null && !roadName.equals("")) {
|
||||||
|
poiEntity.setName(roadName);
|
||||||
|
} else {
|
||||||
|
DateFormat formatters = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
|
||||||
|
Calendar calendars = Calendar.getInstance();
|
||||||
|
calendars.setTimeInMillis(System.currentTimeMillis());
|
||||||
|
String formats = formatters.format(calendars.getTime());
|
||||||
|
String city = Constant.currentLocation.getCity();//返回当前位置的城市.
|
||||||
|
String district = Constant.currentLocation.getDistrict();//返回当前位置的区县.
|
||||||
|
StringBuffer sb = new StringBuffer("道路录像上报");
|
||||||
|
if (city != null && !"".equals(city)) {
|
||||||
|
sb.append("-");
|
||||||
|
sb.append(city);
|
||||||
|
}
|
||||||
|
if (district != null && !"".equals(district)) {
|
||||||
|
sb.append(district);
|
||||||
|
}
|
||||||
|
sb.append("-").append(formats);
|
||||||
|
poiEntity.setName(sb.toString());
|
||||||
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
etRoadName.setText(sb);
|
||||||
|
etRoadName.setEnabled(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
int pictureType = getPictureType();
|
||||||
|
if (pictureType != -1) {
|
||||||
|
poiEntity.setWork_type(pictureType);
|
||||||
|
}
|
||||||
|
String desc = etDesc.getText().toString().trim();
|
||||||
|
if (desc != null && !desc.equals("")) {
|
||||||
|
poiEntity.setDescribe(desc);
|
||||||
|
}
|
||||||
|
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||||
|
String format = formatter.format(calendar.getTime());
|
||||||
|
poiEntity.setCreateTime(format);
|
||||||
|
poiEntity.setType(4);
|
||||||
|
poiEntity.setTaskStatus(2);
|
||||||
|
poiEntity.setIsLocalData(1);
|
||||||
|
if (fmRoadPic.getTag() != null &&!((List<File>) fmRoadPic.getTag()).isEmpty()) {
|
||||||
|
List<LatLng> lineStringByVideoFileList = AWMp4ParserHelper.getInstance().getLineStringByVideoFileList((List<File>) fmRoadPic.getTag());
|
||||||
|
String lineString = GeometryTools.getLineString(lineStringByVideoFileList);
|
||||||
|
Log.d("TAG", "onGranted: " + lineString);
|
||||||
|
String photoStr = AWMp4ParserHelper.getInstance().getVideoFileListStr((List<File>) fmRoadPic.getTag());
|
||||||
|
poiEntity.setPhoto(photoStr);
|
||||||
|
if (lineString != null) {
|
||||||
|
poiEntity.setGeoWkt(lineString);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return poiEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PoiCheckResult checkPoiEntity(PoiEntity entity) {
|
||||||
|
PoiCheckResult poiCheckResult = new PoiCheckResult();
|
||||||
|
if (entity.getPhoto()==null){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请录像");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
if (entity.getWork_type()==-1){
|
||||||
|
poiCheckResult.setCode(1);
|
||||||
|
poiCheckResult.setMsg("请选择录像方式");
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
return poiCheckResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ChargingPileEntity initChargingPileEntityByUI(ChargingPileEntity entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PoiCheckResult checkChargingPileEntity(ChargingPileEntity entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
@ -23,11 +23,16 @@ import com.kongzue.dialog.util.BaseDialog;
|
|||||||
import com.kongzue.dialog.util.DialogSettings;
|
import com.kongzue.dialog.util.DialogSettings;
|
||||||
import com.kongzue.dialog.v3.BottomMenu;
|
import com.kongzue.dialog.v3.BottomMenu;
|
||||||
import com.kongzue.dialog.v3.MessageDialog;
|
import com.kongzue.dialog.v3.MessageDialog;
|
||||||
|
import com.lzy.okgo.model.HttpParams;
|
||||||
import com.navinfo.outdoor.R;
|
import com.navinfo.outdoor.R;
|
||||||
import com.navinfo.outdoor.activity.FragmentManagement;
|
import com.navinfo.outdoor.activity.FragmentManagement;
|
||||||
import com.navinfo.outdoor.adapter.StaySubmitAdapter;
|
import com.navinfo.outdoor.adapter.StaySubmitAdapter;
|
||||||
import com.navinfo.outdoor.api.Constant;
|
import com.navinfo.outdoor.api.Constant;
|
||||||
import com.navinfo.outdoor.base.BaseFragment;
|
import com.navinfo.outdoor.base.BaseFragment;
|
||||||
|
import com.navinfo.outdoor.bean.UnPolygonTaskBean;
|
||||||
|
import com.navinfo.outdoor.http.Callback;
|
||||||
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
|
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||||
import com.navinfo.outdoor.room.PoiDao;
|
import com.navinfo.outdoor.room.PoiDao;
|
||||||
import com.navinfo.outdoor.room.PoiDatabase;
|
import com.navinfo.outdoor.room.PoiDatabase;
|
||||||
import com.navinfo.outdoor.room.PoiEntity;
|
import com.navinfo.outdoor.room.PoiEntity;
|
||||||
@ -38,6 +43,7 @@ import org.greenrobot.eventbus.EventBus;
|
|||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,6 +68,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
|||||||
fragment.setArguments(bundle);
|
fragment.setArguments(bundle);
|
||||||
return fragment;
|
return fragment;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
@ -72,7 +79,6 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLayout() {
|
protected int getLayout() {
|
||||||
return R.layout.fragment_stay_submit;
|
return R.layout.fragment_stay_submit;
|
||||||
@ -122,18 +128,13 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
|||||||
});
|
});
|
||||||
refreshData();
|
refreshData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onEvent(Message data) {
|
public void onEvent(Message data) {
|
||||||
if (data.what == Constant.EVENT_STAY_REFRESH) {
|
if (data.what == Constant.EVENT_STAY_REFRESH) {
|
||||||
if ((boolean)data.obj){
|
Toast.makeText(getContext(), (String) data.obj, Toast.LENGTH_SHORT).show();
|
||||||
Toast.makeText(getContext(), "提交成功", Toast.LENGTH_SHORT).show();
|
|
||||||
}else {
|
|
||||||
Toast.makeText(getContext(), "提交失败", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
refreshData();
|
refreshData();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,27 +203,26 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
|||||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
MessageDialog.show((AppCompatActivity) getContext(), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
staySubmitAdapter.setAllCheckedDelete();
|
initRequest(staySubmitAdapter.getAllRoad());
|
||||||
refreshData();
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case R.id.btn_stay_submit://提交
|
case R.id.btn_stay_submit://提交
|
||||||
if (poiEntities==null){
|
if (poiEntities == null) {
|
||||||
poiEntities = new ArrayList<>();
|
poiEntities = new ArrayList<>();
|
||||||
}
|
}
|
||||||
poiEntities.clear();
|
poiEntities.clear();
|
||||||
List<PoiEntity> allRoad = staySubmitAdapter.getAllRoad();
|
List<PoiEntity> allRoad = staySubmitAdapter.getAllRoad();
|
||||||
for (int i = 0; i < allRoad.size(); i++) {
|
for (int i = 0; i < allRoad.size(); i++) {
|
||||||
if (allRoad.get(i).isChecked()){
|
if (allRoad.get(i).isChecked()) {
|
||||||
poiEntities.add(allRoad.get(i));
|
poiEntities.add(allRoad.get(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (poiEntities.size()>0){
|
if (poiEntities.size() > 0) {
|
||||||
showLoadingDialog();
|
showFileLoadingDialog();
|
||||||
PoiSaveUtils.getInstance(getActivity()).uploadPoiEntityBatch(poiEntities);
|
PoiSaveUtils.getInstance(getActivity()).uploadPoiEntityBatch(poiEntities);
|
||||||
}else {
|
} else {
|
||||||
Toast.makeText(getContext(), "请选择要删除的条目数据", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "请选择要删除的条目数据", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,32 +230,99 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initRequest(List<PoiEntity> allRoad) {
|
||||||
|
showLoadingDialog();
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
ArrayList<PoiEntity> poiEntities = new ArrayList<>();
|
||||||
|
synchronized (allRoad) {
|
||||||
|
Iterator iterator = allRoad.iterator();
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
PoiEntity poiEntity = (PoiEntity) iterator.next();
|
||||||
|
if (poiEntity.isChecked()) {
|
||||||
|
poiEntities.add(poiEntity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
;
|
||||||
|
}
|
||||||
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
String taskIds = "";
|
||||||
|
String auditIds = "";
|
||||||
|
for (int i = 0; i < poiEntities.size(); i++) {
|
||||||
|
if (poiEntities.get(i).getTaskStatus() == 2) {
|
||||||
|
taskIds += poiEntities.get(i).getTaskId()+",";
|
||||||
|
} else if (poiEntities.get(i).getTaskStatus() == 3) {
|
||||||
|
auditIds += poiEntities.get(i).getBodyId()+",";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taskIds!=null&&!taskIds.equals("")){
|
||||||
|
taskIds = taskIds.substring(0,taskIds.length() - 1);
|
||||||
|
}
|
||||||
|
if (auditIds!=null&&!auditIds.equals("")){
|
||||||
|
auditIds = auditIds.substring(0,auditIds.length() - 1);
|
||||||
|
}
|
||||||
|
HttpParams httpParams = new HttpParams();
|
||||||
|
httpParams.put("taskIds", taskIds);
|
||||||
|
httpParams.put("auditIds", auditIds);
|
||||||
|
OkGoBuilder.getInstance()
|
||||||
|
.Builder(getActivity())
|
||||||
|
.url(HttpInterface.UNRECEIVED_POLYGON_TASK)
|
||||||
|
.params(httpParams)
|
||||||
|
.token(Constant.ACCESS_TOKEN)
|
||||||
|
.cls(UnPolygonTaskBean.class)
|
||||||
|
.getRequest(new Callback<UnPolygonTaskBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(UnPolygonTaskBean response, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
if (response.getCode()==200){
|
||||||
|
staySubmitAdapter.setAllCheckedDelete();
|
||||||
|
}
|
||||||
|
Toast.makeText(getContext(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
|
Toast.makeText(getContext(), e.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
public void refreshData() {
|
public void refreshData() {
|
||||||
|
|
||||||
if (roadEntities == null) {
|
if (roadEntities == null) {
|
||||||
roadEntities = new ArrayList<>();
|
roadEntities = new ArrayList<>();
|
||||||
}else {
|
} else {
|
||||||
roadEntities.clear();
|
roadEntities.clear();
|
||||||
}
|
}
|
||||||
if (newEntities == null) {
|
if (newEntities == null) {
|
||||||
newEntities = new ArrayList<>();
|
newEntities = new ArrayList<>();
|
||||||
}else {
|
} else {
|
||||||
newEntities.clear();
|
newEntities.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
List<PoiEntity> roadAll = roadDao.getAllPoi();
|
List<PoiEntity> roadAll = roadDao.getAllPoiByRecoder();
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
roadEntities.clear();
|
roadEntities.clear();
|
||||||
for (int i = 0; i < roadAll.size(); i++) {
|
roadEntities.addAll(roadAll);
|
||||||
if (roadAll.get(i).getType()!=6){
|
// for (int i = 0; i < roadAll.size(); i++) {
|
||||||
roadEntities.add(roadAll.get(i));
|
// if (roadAll.get(i).getType()!=6){
|
||||||
}
|
// roadEntities.add(roadAll.get(i));
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
Log.d("TAG", "run: " + roadEntities.toString());
|
Log.d("TAG", "run: " + roadEntities.toString());
|
||||||
staySubmitAdapter.setAllRoad(roadEntities);
|
staySubmitAdapter.setAllRoad(roadEntities);
|
||||||
staySubmitAdapter.notifyDataSetChanged();
|
staySubmitAdapter.notifyDataSetChanged();
|
||||||
|
@ -160,7 +160,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
bitmapDescriptor3 = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
|
bitmapDescriptor3 = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
|
||||||
bitmapDescriptor4 = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
|
bitmapDescriptor4 = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
|
||||||
bitmapDescriptor5 = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
|
bitmapDescriptor5 = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
|
||||||
|
|
||||||
EventBus.getDefault().register(this);
|
EventBus.getDefault().register(this);
|
||||||
//fragment 管理器
|
//fragment 管理器
|
||||||
supportFragmentManager = getActivity().getSupportFragmentManager();
|
supportFragmentManager = getActivity().getSupportFragmentManager();
|
||||||
@ -243,7 +242,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
refreshFilterData();
|
refreshFilterData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCancel() {
|
public void onCancel() {
|
||||||
}
|
}
|
||||||
@ -334,14 +332,12 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "数据为空", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "数据为空", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 设置地图宽高为屏幕的宽高
|
// 设置地图宽高为屏幕的宽高
|
||||||
int[] widtHeight = DensityUtil.getDeviceInfo(getActivity());
|
int[] widtHeight = DensityUtil.getDeviceInfo(getActivity());
|
||||||
treasureMap.getLayoutParams().width = widtHeight[0];
|
treasureMap.getLayoutParams().width = widtHeight[0];
|
||||||
@ -384,7 +380,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void initList (TencentLocation tencentLocation){
|
private void initList(TencentLocation tencentLocation) {
|
||||||
int task_type = Constant.TASK_TYPE;
|
int task_type = Constant.TASK_TYPE;
|
||||||
int limit_type = Constant.LIMIT_TTPE;
|
int limit_type = Constant.LIMIT_TTPE;
|
||||||
int taskStatus = Constant.TASK_STASTUS;
|
int taskStatus = Constant.TASK_STASTUS;
|
||||||
@ -433,7 +429,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
List<JobSearchBean.BodyBean.ListBean> list = response.getBody().getList();
|
List<JobSearchBean.BodyBean.ListBean> list = response.getBody().getList();
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
JobSearchBean.BodyBean.ListBean listBean = list.get(i);
|
JobSearchBean.BodyBean.ListBean listBean = list.get(i);
|
||||||
String geo = list.get(i).getGeo();
|
String encodeStr = list.get(i).getGeo();
|
||||||
|
// 解密geo
|
||||||
|
String geo = Geohash.getInstance().decode(encodeStr);
|
||||||
|
listBean.setGeo(geo);
|
||||||
Log.d("TAG", "onSuccess: " + geo);
|
Log.d("TAG", "onSuccess: " + geo);
|
||||||
Geometry geometry = GeometryTools.createGeometry(geo);
|
Geometry geometry = GeometryTools.createGeometry(geo);
|
||||||
LatLng latLng = null;
|
LatLng latLng = null;
|
||||||
@ -566,7 +565,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
dismissDialog();
|
dismissDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initMarker (PoiEntity poiEntity){
|
public void initMarker(PoiEntity poiEntity) {
|
||||||
sliding_layout.setPanelHeight(0);
|
sliding_layout.setPanelHeight(0);
|
||||||
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
|
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
|
||||||
for (int i = 0; i < removablesMarker.size(); i++) {
|
for (int i = 0; i < removablesMarker.size(); i++) {
|
||||||
@ -606,12 +605,13 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
Polygon polygon = tencentMap.addPolygon(new PolygonOptions().
|
Polygon polygon = tencentMap.addPolygon(new PolygonOptions().
|
||||||
//连接封闭图形的点
|
//连接封闭图形的点
|
||||||
addAll(latPolygon).
|
addAll(latPolygon).
|
||||||
//填充颜色为红色
|
//填充颜色为浅蓝色
|
||||||
fillColor(Color.parseColor("#97E0E7EC")).
|
fillColor(Color.parseColor("#97E0E7EC")).
|
||||||
//边线颜色为黑色
|
//边线颜色为黑色
|
||||||
strokeColor(0xff000000).
|
strokeColor(0xff000000).
|
||||||
//边线宽度15像素
|
//边线宽度15像素
|
||||||
strokeWidth(25));
|
strokeWidth(25));
|
||||||
|
|
||||||
polygon.setZIndex(1);
|
polygon.setZIndex(1);
|
||||||
removablesMarker.add(polygon);
|
removablesMarker.add(polygon);
|
||||||
com.vividsolutions.jts.geom.Point centroid = geometry.getCentroid();
|
com.vividsolutions.jts.geom.Point centroid = geometry.getCentroid();
|
||||||
@ -627,17 +627,17 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
BitmapDescriptor descriptor = null;
|
BitmapDescriptor descriptor = null;
|
||||||
if (poiEntity.getType() == 1) {
|
if (poiEntity.getType()==1){
|
||||||
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bags);
|
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bags);
|
||||||
} else if (poiEntity.getType() == 2) {
|
}else if (poiEntity.getType()==2){
|
||||||
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bags);
|
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bags);
|
||||||
} else if (poiEntity.getType() == 3) {
|
}else if (poiEntity.getType()==3){
|
||||||
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_bag);
|
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_bag);
|
||||||
} else if (poiEntity.getType() == 4) {
|
}else if (poiEntity.getType()==4){
|
||||||
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bag);
|
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bag);
|
||||||
} else if (poiEntity.getType() == 5) {
|
}else if (poiEntity.getType()==5){
|
||||||
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bag);
|
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bag);
|
||||||
} else if (poiEntity.getType() == 6) {
|
}else if (poiEntity.getType()==6){
|
||||||
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bag);
|
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bag);
|
||||||
}
|
}
|
||||||
if (bigMarker == null) {
|
if (bigMarker == null) {
|
||||||
@ -662,10 +662,17 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void initThread () {
|
private void initThread() {
|
||||||
int taskStatus = Constant.TASK_STASTUS;
|
int taskStatus = Constant.TASK_STASTUS;
|
||||||
int type = Constant.TASK_TYPE;
|
int type = Constant.TASK_TYPE;
|
||||||
int limit = Constant.LIMIT_TTPE;
|
int limit = Constant.LIMIT_TTPE;
|
||||||
|
if (taskStatus == 0) {
|
||||||
|
Message obtain = Message.obtain();
|
||||||
|
obtain.what = Constant.JOB_SEARCH_POI_WORD;
|
||||||
|
obtain.obj = null;
|
||||||
|
EventBus.getDefault().post(obtain);
|
||||||
|
return;
|
||||||
|
}
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -691,6 +698,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
List<LatLng> latLineString = GeometryTools.getLatLngs(geo);
|
||||||
// 构造 PolylineOpitons
|
// 构造 PolylineOpitons
|
||||||
PolylineOptions polylineOptions = new PolylineOptions()
|
PolylineOptions polylineOptions = new PolylineOptions()
|
||||||
|
.alpha(0.5f)
|
||||||
|
|
||||||
.addAll(latLineString)
|
.addAll(latLineString)
|
||||||
// 折线设置圆形线头
|
// 折线设置圆形线头
|
||||||
.lineCap(true)
|
.lineCap(true)
|
||||||
@ -713,8 +722,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
Polygon polygon = tencentMap.addPolygon(new PolygonOptions().
|
Polygon polygon = tencentMap.addPolygon(new PolygonOptions().
|
||||||
//连接封闭图形的点
|
//连接封闭图形的点
|
||||||
addAll(latPolygon).
|
addAll(latPolygon).
|
||||||
//填充颜色为红色
|
//填充颜色为浅蓝色
|
||||||
fillColor(Color.parseColor("#97E0E74C")).
|
fillColor(Color.parseColor("#97E0E7EC")).
|
||||||
//边线颜色为黑色
|
//边线颜色为黑色
|
||||||
strokeColor(0xff00ff00).
|
strokeColor(0xff00ff00).
|
||||||
//边线宽度15像素
|
//边线宽度15像素
|
||||||
@ -740,10 +749,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
}
|
}
|
||||||
switch (Integer.valueOf(poiEntity.getType())) {
|
switch (Integer.valueOf(poiEntity.getType())) {
|
||||||
case 1://poi
|
case 1://poi
|
||||||
BitmapDescriptor poiDescriptor = null;
|
BitmapDescriptor poiDescriptor=null;
|
||||||
if (poiEntity.getTaskStatus() == 1) {
|
if (poiEntity.getTaskStatus()==1){
|
||||||
poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bg1);
|
poiDescriptor= BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bg1);
|
||||||
} else {
|
}else {
|
||||||
poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.graypoi);
|
poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.graypoi);
|
||||||
}
|
}
|
||||||
Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor).alpha(0.9f)
|
Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor).alpha(0.9f)
|
||||||
@ -754,14 +763,12 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
poiMarker.setTitle(poiEntity.getName() + "");
|
poiMarker.setTitle(poiEntity.getName() + "");
|
||||||
poiMarker.setTag(poiEntity);
|
poiMarker.setTag(poiEntity);
|
||||||
removablesLocality.add(poiMarker);
|
removablesLocality.add(poiMarker);
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 2://充电站
|
case 2://充电站
|
||||||
BitmapDescriptor chargeDescriptor = null;
|
BitmapDescriptor chargeDescriptor = null;
|
||||||
if (poiEntity.getTaskStatus() == 1) {
|
if (poiEntity.getTaskStatus()==1){
|
||||||
chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bg1);
|
chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_charge_bg1);
|
||||||
} else {
|
}else {
|
||||||
chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.graycharge);
|
chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.graycharge);
|
||||||
}
|
}
|
||||||
Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(chargeDescriptor).alpha(0.9f)
|
Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(chargeDescriptor).alpha(0.9f)
|
||||||
@ -775,9 +782,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
break;
|
break;
|
||||||
case 3://poi录像
|
case 3://poi录像
|
||||||
BitmapDescriptor poiVideoDescriptor = null;
|
BitmapDescriptor poiVideoDescriptor = null;
|
||||||
if (poiEntity.getTaskStatus() == 1) {
|
if (poiEntity.getTaskStatus()==1){
|
||||||
poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video_bg1);
|
poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_video_bg1);
|
||||||
} else {
|
}else {
|
||||||
poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_have_bg);
|
poiVideoDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_have_bg);
|
||||||
}
|
}
|
||||||
Marker poiVideoMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiVideoDescriptor).alpha(0.9f)
|
Marker poiVideoMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiVideoDescriptor).alpha(0.9f)
|
||||||
@ -790,10 +797,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
removablesLocality.add(poiVideoMarker);
|
removablesLocality.add(poiVideoMarker);
|
||||||
break;
|
break;
|
||||||
case 4://道路录像
|
case 4://道路录像
|
||||||
BitmapDescriptor roadDescriptor = null;
|
BitmapDescriptor roadDescriptor =null;
|
||||||
if (poiEntity.getTaskStatus() == 1) {
|
if (poiEntity.getTaskStatus()==1){
|
||||||
roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bg);
|
roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_road_bg);
|
||||||
} else {
|
}else {
|
||||||
roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.grayroad);
|
roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.grayroad);
|
||||||
}
|
}
|
||||||
Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor).alpha(0.9f)
|
Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor).alpha(0.9f)
|
||||||
@ -807,9 +814,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
break;
|
break;
|
||||||
case 5://其他
|
case 5://其他
|
||||||
BitmapDescriptor otherDescriptor = null;
|
BitmapDescriptor otherDescriptor = null;
|
||||||
if (poiEntity.getTaskStatus() == 1) {
|
if (poiEntity.getTaskStatus()==1){
|
||||||
otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg1);
|
otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bg1);
|
||||||
} else {
|
}else {
|
||||||
otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.grayother);
|
otherDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.grayother);
|
||||||
}
|
}
|
||||||
Marker otherMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(otherDescriptor).alpha(0.9f)
|
Marker otherMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(otherDescriptor).alpha(0.9f)
|
||||||
@ -822,10 +829,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
removablesLocality.add(otherMarker);
|
removablesLocality.add(otherMarker);
|
||||||
break;
|
break;
|
||||||
case 6://面状任务
|
case 6://面状任务
|
||||||
BitmapDescriptor Descriptor = null;
|
BitmapDescriptor Descriptor =null;
|
||||||
if (poiEntity.getTaskStatus() == 1) {
|
if (poiEntity.getTaskStatus()==1){
|
||||||
Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_bg);
|
Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_bg);
|
||||||
} else {
|
}else {
|
||||||
Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_have_bag);
|
Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_have_bag);
|
||||||
}
|
}
|
||||||
Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Descriptor).alpha(0.9f)
|
Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Descriptor).alpha(0.9f)
|
||||||
@ -849,6 +856,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void initSharePre () {
|
private void initSharePre () {
|
||||||
//根据保存时所用的name属性,获取SharedPreferences对象
|
//根据保存时所用的name属性,获取SharedPreferences对象
|
||||||
SharedPreferences dataFile = getActivity().getSharedPreferences(Constant.DATA_FILE, 0);
|
SharedPreferences dataFile = getActivity().getSharedPreferences(Constant.DATA_FILE, 0);
|
||||||
@ -1487,20 +1495,11 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* header 头部布局
|
|
||||||
*
|
|
||||||
* @param view
|
|
||||||
*/
|
|
||||||
public void initHeader (View view){
|
|
||||||
dragView.removeAllViews();
|
|
||||||
dragView.addView(view);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将fragment显示到抽屉内
|
* 将fragment显示到抽屉内
|
||||||
*/
|
*/
|
||||||
private void showSlidingFragment (BaseDrawerFragment fragment){
|
private void showSlidingFragment(BaseDrawerFragment fragment) {
|
||||||
fragmentTransaction = supportFragmentManager.beginTransaction();
|
fragmentTransaction = supportFragmentManager.beginTransaction();
|
||||||
int[] deviceInfo = DensityUtil.getDeviceInfo(getActivity());
|
int[] deviceInfo = DensityUtil.getDeviceInfo(getActivity());
|
||||||
sliding_layout.setPanelHeight(deviceInfo[1] / 2);
|
sliding_layout.setPanelHeight(deviceInfo[1] / 2);
|
||||||
@ -1517,7 +1516,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
if (chargingStationFragment != null) {
|
if (chargingStationFragment != null) {
|
||||||
fragmentTransaction.hide(chargingStationFragment);
|
fragmentTransaction.hide(chargingStationFragment);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (!(fragment instanceof PoiFragment)) {
|
if (!(fragment instanceof PoiFragment)) {
|
||||||
PoiFragment poiFragment = (PoiFragment) supportFragmentManager.findFragmentByTag(PoiFragment.class.getName());
|
PoiFragment poiFragment = (PoiFragment) supportFragmentManager.findFragmentByTag(PoiFragment.class.getName());
|
||||||
if (poiFragment != null) {
|
if (poiFragment != null) {
|
||||||
@ -1540,23 +1538,23 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
fragmentTransaction.addToBackStack(null);
|
fragmentTransaction.addToBackStack(null);
|
||||||
fragmentTransaction.commit();
|
fragmentTransaction.commit();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查网络状态
|
* 检查网络状态
|
||||||
*/
|
*/
|
||||||
private void checkNetWork () {
|
private void checkNetWork() {
|
||||||
if (NetWorkUtils.iConnected(getContext())) { // 当前网络可用
|
if (NetWorkUtils.iConnected(getContext())) { // 当前网络可用
|
||||||
checkMyLocation();
|
checkMyLocation();
|
||||||
} else { // 当前网络不可用
|
} else { // 当前网络不可用
|
||||||
|
dismissLoadingDialog();
|
||||||
ToastUtil.showShort(getContext(), Constant.NETWORK_UNAVAILABLE);
|
ToastUtil.showShort(getContext(), Constant.NETWORK_UNAVAILABLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查所需权限
|
* 检查所需权限
|
||||||
*/
|
*/
|
||||||
private void checkMyLocation () {
|
private void checkMyLocation() {
|
||||||
|
|
||||||
// 1.判断是否拥有定位的权限
|
// 1.判断是否拥有定位的权限
|
||||||
// 1.1 拥有权限进行相应操作
|
// 1.1 拥有权限进行相应操作
|
||||||
// 1.2 没有权限申请权限
|
// 1.2 没有权限申请权限
|
||||||
@ -1564,25 +1562,23 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
// 1.2.1.1 用户给予权限进行相应操作
|
// 1.2.1.1 用户给予权限进行相应操作
|
||||||
// 1.2.1.2 用户没有给予权限 作出相应提示
|
// 1.2.1.2 用户没有给予权限 作出相应提示
|
||||||
// 1.2.2 某些5.0权限的手机执行相应操作
|
// 1.2.2 某些5.0权限的手机执行相应操作
|
||||||
|
|
||||||
XXPermissions.with(this)
|
XXPermissions.with(this)
|
||||||
.permission(Permission.ACCESS_COARSE_LOCATION)
|
.permission(Permission.ACCESS_COARSE_LOCATION)
|
||||||
.request(new OnPermissionCallback() {
|
.request(new OnPermissionCallback() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onGranted(List<String> permissions, boolean all) {
|
public void onGranted(List<String> permissions, boolean all) {
|
||||||
if (all) {
|
if (all) {
|
||||||
//建立定位
|
//建立定位
|
||||||
initLocation();
|
initLocation();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
dismissLoadingDialog();
|
||||||
Toast.makeText(getActivity(), "申请权限失败", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "申请权限失败", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDenied(List<String> permissions, boolean never) {
|
public void onDenied(List<String> permissions, boolean never) {
|
||||||
if (never) {
|
if (never) {
|
||||||
|
dismissLoadingDialog();
|
||||||
Toast.makeText(getActivity(), "被永久拒绝授权,请手动授予定位权限", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "被永久拒绝授权,请手动授予定位权限", Toast.LENGTH_SHORT).show();
|
||||||
// 如果是被永久拒绝就跳转到应用权限系统设置页面
|
// 如果是被永久拒绝就跳转到应用权限系统设置页面
|
||||||
XXPermissions.startPermissionActivity(getActivity(), permissions);
|
XXPermissions.startPermissionActivity(getActivity(), permissions);
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
package com.navinfo.outdoor.fragment;
|
package com.navinfo.outdoor.fragment;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.provider.MediaStore;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
@ -26,7 +30,9 @@ import com.navinfo.outdoor.base.BaseFragment;
|
|||||||
import com.navinfo.outdoor.bean.NameAuthenticationBean;
|
import com.navinfo.outdoor.bean.NameAuthenticationBean;
|
||||||
import com.navinfo.outdoor.http.DialogCallback;
|
import com.navinfo.outdoor.http.DialogCallback;
|
||||||
import com.navinfo.outdoor.http.HttpInterface;
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
|
import com.navinfo.outdoor.util.Geohash;
|
||||||
import com.navinfo.outdoor.util.PhotoPathUtil;
|
import com.navinfo.outdoor.util.PhotoPathUtil;
|
||||||
|
import com.navinfo.outdoor.util.PhotoUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -54,6 +60,8 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
private TextView tvCard2;
|
private TextView tvCard2;
|
||||||
private ImageView ivHera3;
|
private ImageView ivHera3;
|
||||||
private TextView tvCard3;
|
private TextView tvCard3;
|
||||||
|
private SharedPreferences.Editor navInfoEditor;
|
||||||
|
private File file;
|
||||||
|
|
||||||
|
|
||||||
public static UserAttestationFragment newInstance(Bundle bundle) {
|
public static UserAttestationFragment newInstance(Bundle bundle) {
|
||||||
@ -79,6 +87,7 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
|
navInfoEditor = getActivity().getSharedPreferences("navInfo", Context.MODE_PRIVATE).edit();
|
||||||
ivAttestation = findViewById(R.id.iv_attestation);
|
ivAttestation = findViewById(R.id.iv_attestation);
|
||||||
ivAttestation.setOnClickListener(this);
|
ivAttestation.setOnClickListener(this);
|
||||||
ivAttestation1 = findViewById(R.id.iv_attestation1);
|
ivAttestation1 = findViewById(R.id.iv_attestation1);
|
||||||
@ -107,22 +116,42 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
break;
|
break;
|
||||||
case R.id.iv_attestation1:
|
case R.id.iv_attestation1:
|
||||||
Intent ivAttestation1 = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent ivAttestation1 = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
file = PhotoUtils.showPhotoFile("a", null);
|
||||||
|
ivAttestation1.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
|
||||||
startActivityForResult(ivAttestation1, 100);
|
startActivityForResult(ivAttestation1, 100);
|
||||||
break;
|
break;
|
||||||
case R.id.iv_attestation2:
|
case R.id.iv_attestation2:
|
||||||
Intent ivAttestation2 = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent ivAttestation2 = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
file = PhotoUtils.showPhotoFile("a", null);
|
||||||
|
ivAttestation2.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
|
||||||
startActivityForResult(ivAttestation2, 200);
|
startActivityForResult(ivAttestation2, 200);
|
||||||
break;
|
break;
|
||||||
case R.id.iv_attestation3:
|
case R.id.iv_attestation3:
|
||||||
Intent ivAttestation3 = new Intent("android.media.action.IMAGE_CAPTURE");
|
Intent ivAttestation3 = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
file = PhotoUtils.showPhotoFile("a", null);
|
||||||
|
ivAttestation3.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
|
||||||
startActivityForResult(ivAttestation3, 300);
|
startActivityForResult(ivAttestation3, 300);
|
||||||
break;
|
break;
|
||||||
case R.id.btn_attestation:
|
case R.id.btn_attestation:
|
||||||
|
if (etAttestationName.getText().toString() == null || etAttestationName.getText().toString().equals("")) {
|
||||||
|
Toast.makeText(getContext(), "姓名不能为空,请输入姓名", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!chineseNameTest(etAttestationName.getText().toString())){
|
||||||
|
Toast.makeText(getActivity(), "请输入中文名字", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!checkNum(etNamePhone.getText().toString().trim())) {
|
||||||
|
Toast.makeText(getContext(), "身份证号错误,请重新输入", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
nameAuthentication();
|
nameAuthentication();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
*/
|
||||||
public boolean checkNum(String text) {
|
public boolean checkNum(String text) {
|
||||||
Pattern patternSfzhm1 = Pattern
|
Pattern patternSfzhm1 = Pattern
|
||||||
.compile("^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$");
|
.compile("^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$");
|
||||||
@ -135,7 +164,16 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
else return true;
|
else return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 中文效验
|
||||||
|
*/
|
||||||
|
|
||||||
|
static boolean chineseNameTest(String name) {
|
||||||
|
if (!name.matches("[\u4e00-\u9fa5]{2,4}")) {
|
||||||
|
System.out.println("只能输入2到4个汉字");
|
||||||
|
return false;
|
||||||
|
}else return true;
|
||||||
|
}
|
||||||
private void nameAuthentication() {
|
private void nameAuthentication() {
|
||||||
if (etAttestationName.getText().toString() == null || etAttestationName.getText().toString().equals("")) {
|
if (etAttestationName.getText().toString() == null || etAttestationName.getText().toString().equals("")) {
|
||||||
Toast.makeText(getContext(), "姓名不能为空,请输入姓名", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "姓名不能为空,请输入姓名", Toast.LENGTH_SHORT).show();
|
||||||
@ -181,24 +219,23 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(Response<NameAuthenticationBean> response) {
|
public void onSuccess(Response<NameAuthenticationBean> response) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
|
|
||||||
|
|
||||||
Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
|
Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
|
||||||
if (response.body().equals("0")) {
|
if (response.code()==200) {
|
||||||
MessageDialog.show((AppCompatActivity) getActivity(), "提示", "不通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||||
|
MessageDialog.show((AppCompatActivity) getActivity(), "提示", "通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
// Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
|
// Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
|
||||||
//传值给持卡人
|
|
||||||
Constant.USER_ATTESTATION_NAME = attestationName;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
MessageDialog.show((AppCompatActivity) getActivity(), "提示", "通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||||
|
MessageDialog.show((AppCompatActivity) getActivity(), "提示", "不通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
Constant.USER_ATTESTATION_NAME = attestationName;
|
navInfoEditor.putString("attestationName",attestationName);
|
||||||
|
navInfoEditor.commit();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -221,74 +258,84 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
|||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
if (requestCode == 100 && resultCode == RESULT_OK) {
|
if (requestCode == 100 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
Bundle extras = data.getExtras();//从Intent中获取附加值
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
if (file == null || !file.exists()) {
|
||||||
int height = bitmap.getHeight();
|
Toast.makeText(getContext(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
|
||||||
int width = bitmap.getWidth();
|
return;
|
||||||
if (height > width) {
|
|
||||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
|
||||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
|
||||||
@Override
|
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
|
||||||
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
|
||||||
startActivityForResult(intentPanorama, 100);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
|
|
||||||
String takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a", "");
|
}else {
|
||||||
ivAttestation1.setTag(takePhotoPath1);
|
String s = PhotoUtils.showPhotoAndGetPath(file, ivAttestation1);
|
||||||
ivAttestation1.setImageBitmap(bitmap);//显示图像
|
ivAttestation1.setTag(s);
|
||||||
|
}
|
||||||
|
file=null;
|
||||||
ivHera1.setVisibility(View.GONE);
|
ivHera1.setVisibility(View.GONE);
|
||||||
tvCard1.setVisibility(View.GONE);
|
tvCard1.setVisibility(View.GONE);
|
||||||
}
|
// int height = bitmap.getHeight();
|
||||||
|
// int width = bitmap.getWidth();
|
||||||
|
// if (height > width) {
|
||||||
|
// DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||||
|
// MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
|
// @Override
|
||||||
|
// public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
|
// Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
// startActivityForResult(intentPanorama, 100);
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
if (requestCode == 200 && resultCode == RESULT_OK) {
|
if (requestCode == 200 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (file == null || !file.exists()) {
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Toast.makeText(getContext(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
|
||||||
int height = bitmap.getHeight();
|
return;
|
||||||
int width = bitmap.getWidth();
|
|
||||||
if (height > width) {
|
}else {
|
||||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
String s = PhotoUtils.showPhotoAndGetPath(file, ivAttestation2);
|
||||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
ivAttestation2.setTag(s);
|
||||||
@Override
|
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
|
||||||
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
|
||||||
startActivityForResult(intentPanorama, 200);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
});
|
file=null;
|
||||||
} else {
|
|
||||||
String takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "a", "");
|
|
||||||
ivAttestation2.setTag(takePhotoPath2);
|
|
||||||
ivAttestation2.setImageBitmap(bitmap);//显示图像
|
|
||||||
ivHera2.setVisibility(View.GONE);
|
ivHera2.setVisibility(View.GONE);
|
||||||
tvCard2.setVisibility(View.GONE);
|
tvCard2.setVisibility(View.GONE);
|
||||||
}
|
// int height = bitmap.getHeight();
|
||||||
|
// int width = bitmap.getWidth();
|
||||||
|
// if (height > width) {
|
||||||
|
// DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||||
|
// MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
|
// @Override
|
||||||
|
// public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
|
// Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
// startActivityForResult(intentPanorama, 200);
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
if (requestCode == 300 && resultCode == RESULT_OK) {
|
if (requestCode == 300 && resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();//从Intent中获取附加值
|
if (file == null || !file.exists()) {
|
||||||
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
|
Toast.makeText(getContext(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
|
||||||
int height = bitmap.getHeight();
|
return;
|
||||||
int width = bitmap.getWidth();
|
|
||||||
if (height > width) {
|
}else {
|
||||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
String s = PhotoUtils.showPhotoAndGetPath(file, ivAttestation3);
|
||||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
ivAttestation3.setTag(s);
|
||||||
@Override
|
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
|
||||||
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
|
||||||
startActivityForResult(intentPanorama, 300);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
});
|
file=null;
|
||||||
} else {
|
|
||||||
String takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "a", "");
|
|
||||||
ivAttestation3.setTag(takePhotoPath3);
|
|
||||||
ivAttestation3.setImageBitmap(bitmap);//显示图像
|
|
||||||
ivHera3.setVisibility(View.GONE);
|
ivHera3.setVisibility(View.GONE);
|
||||||
tvCard3.setVisibility(View.GONE);
|
tvCard3.setVisibility(View.GONE);
|
||||||
|
// int height = bitmap.getHeight();
|
||||||
|
// int width = bitmap.getWidth();
|
||||||
|
// if (height > width) {
|
||||||
|
// DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||||
|
// MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
|
// @Override
|
||||||
|
// public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
|
// Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
// startActivityForResult(intentPanorama, 300);
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
//
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,25 @@
|
|||||||
package com.navinfo.outdoor.fragment;
|
package com.navinfo.outdoor.fragment;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.CompoundButton;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
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.lzy.okgo.model.HttpParams;
|
||||||
import com.navinfo.outdoor.R;
|
import com.navinfo.outdoor.R;
|
||||||
import com.navinfo.outdoor.activity.FragmentManagement;
|
import com.navinfo.outdoor.activity.FragmentManagement;
|
||||||
@ -34,12 +44,17 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
|||||||
private EditText etAllPrice;
|
private EditText etAllPrice;
|
||||||
private TextView poiPushMoney;
|
private TextView poiPushMoney;
|
||||||
private TextView poiReportMoney;
|
private TextView poiReportMoney;
|
||||||
|
private TextView poiVideoPushMoney;
|
||||||
|
private TextView poiVideoReportMoney;
|
||||||
private TextView roadPushMoney;
|
private TextView roadPushMoney;
|
||||||
private TextView roadReportMoney;
|
private TextView roadReportMoney;
|
||||||
private TextView chargingPushMoney;
|
private TextView chargingPushMoney;
|
||||||
private TextView chargingReportMoney;
|
private TextView chargingReportMoney;
|
||||||
private TextView otherPushMoney;
|
private TextView otherPushMoney;
|
||||||
private TextView otherReportMoney;
|
private TextView otherReportMoney;
|
||||||
|
private SharedPreferences navInfo;
|
||||||
|
private CheckBox checkBox;
|
||||||
|
private String bankAccount;
|
||||||
|
|
||||||
public static WithdrawFragment newInstance(Bundle bundle) {
|
public static WithdrawFragment newInstance(Bundle bundle) {
|
||||||
WithdrawFragment fragment = new WithdrawFragment();
|
WithdrawFragment fragment = new WithdrawFragment();
|
||||||
@ -61,7 +76,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
|||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
tvUnit = findViewById(R.id.tv_unit);//可提现
|
tvUnit = findViewById(R.id.tv_unit);//可提现
|
||||||
tvAlready = findViewById(R.id.tv_already);//以提现
|
tvAlready = findViewById(R.id.tv_already);//已提现
|
||||||
tvTotal = findViewById(R.id.tv_total);//总资产
|
tvTotal = findViewById(R.id.tv_total);//总资产
|
||||||
tvAll = findViewById(R.id.tv_all);
|
tvAll = findViewById(R.id.tv_all);
|
||||||
tvAll.setOnClickListener(this::onClick);
|
tvAll.setOnClickListener(this::onClick);
|
||||||
@ -70,10 +85,37 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
|||||||
ivWithDraw.setOnClickListener(this);
|
ivWithDraw.setOnClickListener(this);
|
||||||
tvText = findViewById(R.id.tv_text);
|
tvText = findViewById(R.id.tv_text);
|
||||||
tvText.setOnClickListener(this::onClick);
|
tvText.setOnClickListener(this::onClick);
|
||||||
|
checkBox = findViewById(R.id.checkBox);
|
||||||
|
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
|
if (isChecked){
|
||||||
|
checkBox.setChecked(true);
|
||||||
|
navInfo = getActivity().getSharedPreferences("navInfo", Context.MODE_PRIVATE);
|
||||||
|
bankAccount = navInfo.getString("bankAccount", null);
|
||||||
|
if (bankAccount ==null|| bankAccount.equals("")){
|
||||||
|
String attestationName = navInfo.getString("attestationName", null);
|
||||||
|
if (attestationName == null || attestationName.equals("")) {
|
||||||
|
Intent attestationIntent = new Intent(getContext(), FragmentManagement.class);
|
||||||
|
attestationIntent.putExtra("tag", 25);
|
||||||
|
startActivity(attestationIntent);
|
||||||
|
Toast.makeText(getContext(), "未实名认证,不能绑定银行卡", Toast.LENGTH_SHORT).show();
|
||||||
|
}else {
|
||||||
|
Intent gatheringIntent = new Intent(getContext(), FragmentManagement.class);
|
||||||
|
gatheringIntent.putExtra("tag", 24);
|
||||||
|
startActivity(gatheringIntent);
|
||||||
|
Toast.makeText(getContext(), "以实名认证,请绑定银行卡", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
btWithdraw = findViewById(R.id.button);
|
btWithdraw = findViewById(R.id.button);
|
||||||
btWithdraw.setOnClickListener(this::onClick);
|
btWithdraw.setOnClickListener(this::onClick);
|
||||||
poiPushMoney = (TextView) findViewById(R.id.poi_push_money);
|
poiPushMoney = (TextView) findViewById(R.id.poi_push_money);
|
||||||
poiReportMoney = (TextView) findViewById(R.id.poi_report_money);
|
poiReportMoney = (TextView) findViewById(R.id.poi_report_money);
|
||||||
|
poiVideoPushMoney = (TextView) findViewById(R.id.poiVideo_push_money);
|
||||||
|
poiVideoReportMoney = (TextView) findViewById(R.id.poiVideo_report_money);
|
||||||
roadPushMoney = (TextView) findViewById(R.id.road_push_money);
|
roadPushMoney = (TextView) findViewById(R.id.road_push_money);
|
||||||
roadReportMoney = (TextView) findViewById(R.id.road_report_money);
|
roadReportMoney = (TextView) findViewById(R.id.road_report_money);
|
||||||
chargingPushMoney = (TextView) findViewById(R.id.charging_push_money);
|
chargingPushMoney = (TextView) findViewById(R.id.charging_push_money);
|
||||||
@ -105,6 +147,8 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
|||||||
tvAlready.setText(response.getBody().getHaveExchangePrice() + "");
|
tvAlready.setText(response.getBody().getHaveExchangePrice() + "");
|
||||||
poiPushMoney.setText(response.getBody().getPoiPushPrice() + "元");
|
poiPushMoney.setText(response.getBody().getPoiPushPrice() + "元");
|
||||||
poiReportMoney.setText(response.getBody().getPoiNonepushPrice() + "元");
|
poiReportMoney.setText(response.getBody().getPoiNonepushPrice() + "元");
|
||||||
|
poiVideoPushMoney.setText(response.getBody().getPoivideoPushPrice() + "元");
|
||||||
|
poiVideoReportMoney.setText(response.getBody().getPoivideoNonepushPrice() + "元");
|
||||||
roadPushMoney.setText(response.getBody().getRoadPushPrice() + "元");
|
roadPushMoney.setText(response.getBody().getRoadPushPrice() + "元");
|
||||||
roadReportMoney.setText(response.getBody().getRoadNonepushPrice() + "元");
|
roadReportMoney.setText(response.getBody().getRoadNonepushPrice() + "元");
|
||||||
chargingPushMoney.setText(response.getBody().getCsPushPrice() + "元");
|
chargingPushMoney.setText(response.getBody().getCsPushPrice() + "元");
|
||||||
@ -144,7 +188,30 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
|||||||
if (etAllPrice.getText().toString().equals("")) {
|
if (etAllPrice.getText().toString().equals("")) {
|
||||||
Toast.makeText(getContext(), "提现金额不能为空", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "提现金额不能为空", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
String price = etAllPrice.getText().toString().trim();
|
||||||
|
Integer integer = Integer.valueOf(price);
|
||||||
|
if (integer!=null&&integer<10){
|
||||||
|
Toast.makeText(getContext(), "提现金额不能低于10元", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!checkBox.isChecked()){
|
||||||
|
Toast.makeText(getContext(), "请勾选银行卡", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (bankAccount!=null){
|
||||||
|
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||||
|
MessageDialog.show((AppCompatActivity) getContext(), "提示", "是否提取到"+bankAccount.substring(bankAccount.length()-4)+"的银行卡", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
immediatelyPrice();
|
immediatelyPrice();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else {
|
||||||
|
Toast.makeText(getContext(), "请先绑定银行卡", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case R.id.tv_all:
|
case R.id.tv_all:
|
||||||
etAllPrice.setText(canExchangePrice + "");
|
etAllPrice.setText(canExchangePrice + "");
|
||||||
@ -155,6 +222,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
|||||||
private void immediatelyPrice() {
|
private void immediatelyPrice() {
|
||||||
showLoadingDialog();
|
showLoadingDialog();
|
||||||
HttpParams httpParams = new HttpParams();
|
HttpParams httpParams = new HttpParams();
|
||||||
|
|
||||||
httpParams.put("exchangeMoney", etAllPrice.getText().toString());
|
httpParams.put("exchangeMoney", etAllPrice.getText().toString());
|
||||||
httpParams.put("payType", "1");
|
httpParams.put("payType", "1");
|
||||||
OkGoBuilder.getInstance()
|
OkGoBuilder.getInstance()
|
||||||
@ -168,6 +236,15 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
|||||||
public void onSuccess(UserPriceExchangeBean response, int id) {
|
public void onSuccess(UserPriceExchangeBean response, int id) {
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
Toast.makeText(getContext(), response.getMessage(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), response.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
|
if (response.getCode()==200){
|
||||||
|
String unit = tvUnit.getText().toString();
|
||||||
|
String price = etAllPrice.getText().toString();
|
||||||
|
double v = Double.valueOf(unit) - Double.valueOf(price);
|
||||||
|
String s = String.format("%.2f", v).toString();
|
||||||
|
tvUnit.setText(s);
|
||||||
|
}
|
||||||
|
etAllPrice.getText().clear();
|
||||||
|
|
||||||
Log.d("TAG", "onSuccess: " + response.toString() + "tttttttt");
|
Log.d("TAG", "onSuccess: " + response.toString() + "tttttttt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,6 +53,15 @@ public class HttpInterface {
|
|||||||
*/
|
*/
|
||||||
//http://172.23.139.4:9999/m4/userlogin/oauth/token
|
//http://172.23.139.4:9999/m4/userlogin/oauth/token
|
||||||
public static final String USER_LOGIN_OAUTH_TOKEN = IP +USER_LOGIN_PATH+ "oauth/token"; //登录接口
|
public static final String USER_LOGIN_OAUTH_TOKEN = IP +USER_LOGIN_PATH+ "oauth/token"; //登录接口
|
||||||
|
///m4/user/m4/user/register
|
||||||
|
public static final String USER_REGISTER=IP+USER_PATH+"m4/user/register";//注册接口
|
||||||
|
///m4/user/ phone/message
|
||||||
|
public static final String USER_MESSAGE=IP+USER_PATH+"phone/message ";//获取验证码 type 1:注册获取 2:更新
|
||||||
|
///m4/user/m4/user/forgetPassword
|
||||||
|
public static final String USER_FORGET_PASSWORD=IP +USER_PATH+"m4/user/forgetPassword";//忘记密码
|
||||||
|
//Flat.:
|
||||||
|
//dtxbmaps.navinfo.com/dtxb/m4/user/phone/message?mobile=18811794839&type=2
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提现 金额
|
* 提现 金额
|
||||||
* Path=/m4/price/**
|
* Path=/m4/price/**
|
||||||
@ -106,14 +115,25 @@ public class HttpInterface {
|
|||||||
//172.23.139.4:8003/m4/task/1/taskName?geo=1rn7exd5uhxy&name=四维
|
//172.23.139.4:8003/m4/task/1/taskName?geo=1rn7exd5uhxy&name=四维
|
||||||
public static final String TASK_NAME = IP+TASK_PATH +"m4/task/"+USERID+"/taskName";//poi-查重
|
public static final String TASK_NAME = IP+TASK_PATH +"m4/task/"+USERID+"/taskName";//poi-查重
|
||||||
//172.23.139.4:8003/m4/task/1/getCommitList?type=2&pageSize=10&pageNum=1
|
//172.23.139.4:8003/m4/task/1/getCommitList?type=2&pageSize=10&pageNum=1
|
||||||
public static final String GET_COMMIT_LIST = IP+TASK_PATH +"m4/task/"+USERID+"/getCommitList";
|
public static final String GET_COMMIT_LIST = IP+TASK_PATH +"m4/task/"+USERID+"/getCommitList";//紀錄——已提交
|
||||||
public static final String RECEIVED_POLYGON_TASK = IP+TASK_PATH + "polygonTask/"+USERID+"/receivedPolygontask"; //面状任务任务领取
|
public static final String RECEIVED_POLYGON_TASK = IP+TASK_PATH + "polygonTask/"+USERID+"/receivedPolygontask"; //面状任务任务领取
|
||||||
//172.23.139.4:8003/m4/task/1/unReceivedTask?taskIds=&auditIds=214,278 取消领取的接口
|
//172.23.139.4:8003/m4/task/1/unReceivedTask?taskIds=&auditIds=214,278 取消领取的接口
|
||||||
public static final String UNRECEIVED_POLYGON_TASK = IP+TASK_PATH + "m4/task/"+USERID+"/unReceivedTask";//面状任务结束领取
|
public static final String UNRECEIVED_POLYGON_TASK = IP+TASK_PATH + "m4/task/"+USERID+"/unReceivedTask";//所有類型结束领取
|
||||||
public static final String COMPLETE = IP+TASK_PATH + "polygonTask/"+USERID+"/complete";//面状任务任务采集
|
public static final String COMPLETE = IP+TASK_PATH + "polygonTask/"+USERID+"/complete";//面状任务任务采集
|
||||||
public static final String SUBMIT_POLYGON_TASK = IP+TASK_PATH + "polygonTask/"+USERID+"/submitPolygontask";//面状任务结束采集
|
public static final String SUBMIT_POLYGON_TASK = IP+TASK_PATH + "polygonTask/"+USERID+"/submitPolygontask";//面状任务结束采集
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* public static final String IPm8 = "http://172.23.139.4:8003/m4/";
|
||||||
|
//http://172.23.139.4:8003/m4/task/1/unReceivedTask?taskIds=&auditIds=214,278
|
||||||
|
、、public static final String UN_RECEIVED_TASK = + "task/1/unReceivedTask";//所以类型的结束领取
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
//http://172.21.91.160:8000/api/user/list
|
//http://172.21.91.160:8000/api/user/list
|
||||||
@ -310,10 +330,11 @@ public class HttpInterface {
|
|||||||
public static final String COMPLETE = IPm6 + "polygonTask/1/complete";//任务采集
|
public static final String COMPLETE = IPm6 + "polygonTask/1/complete";//任务采集
|
||||||
public static final String SUBMIT_POLYGON_TASK = IPm6 + "polygonTask/1/submitPolygontask";//结束采集
|
public static final String SUBMIT_POLYGON_TASK = IPm6 + "polygonTask/1/submitPolygontask";//结束采集
|
||||||
public static final String RECEIVED_POLYGON_TASK = IPm6 + "polygonTask/1/receivedPolygontask"; //任务领取
|
public static final String RECEIVED_POLYGON_TASK = IPm6 + "polygonTask/1/receivedPolygontask"; //任务领取
|
||||||
public static final String UNRECEIVED_POLYGON_TASK = IPm6 + "polygonTask/1/unReceivedPolygontask";//结束领取
|
|
||||||
public static final String COMPLETE = IPm6 + "polygonTask/1/complete";//任务采集
|
public static final String COMPLETE = IPm6 + "polygonTask/1/complete";//任务采集
|
||||||
public static final String SUBMIT_POLYGON_TASK = IPm6 + "polygonTask/1/submitPolygontask";//结束采集
|
public static final String SUBMIT_POLYGON_TASK = IPm6 + "polygonTask/1/submitPolygontask";//结束采集
|
||||||
|
|
||||||
|
|
||||||
* */
|
* */
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,10 @@ package com.navinfo.outdoor.http;
|
|||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
|
||||||
|
import com.github.lazylibrary.util.DES;
|
||||||
|
import com.github.lazylibrary.util.MD5;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
import com.lzy.okgo.OkGo;
|
import com.lzy.okgo.OkGo;
|
||||||
import com.lzy.okgo.model.HttpHeaders;
|
import com.lzy.okgo.model.HttpHeaders;
|
||||||
import com.lzy.okgo.model.HttpParams;
|
import com.lzy.okgo.model.HttpParams;
|
||||||
|
@ -22,6 +22,9 @@ public interface PoiDao {
|
|||||||
@Query("SELECT * FROM poi")
|
@Query("SELECT * FROM poi")
|
||||||
List<PoiEntity> getAllPoi();
|
List<PoiEntity> getAllPoi();
|
||||||
|
|
||||||
|
@Query("SELECT * FROM poi where taskStatus > 1 and type!=6")
|
||||||
|
List<PoiEntity> getAllPoiByRecoder();
|
||||||
|
|
||||||
@Query("SELECT * FROM poi where type=:type")
|
@Query("SELECT * FROM poi where type=:type")
|
||||||
List<PoiEntity> getAllPoiType(int type);
|
List<PoiEntity> getAllPoiType(int type);
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ public class PoiEntity implements Serializable {
|
|||||||
private int isLocalData;//是否是本地数据 0,服务 1,本地
|
private int isLocalData;//是否是本地数据 0,服务 1,本地
|
||||||
private int isExclusive;//任务类型 0.普通任务,1.专属任务
|
private int isExclusive;//任务类型 0.普通任务,1.专属任务
|
||||||
private int bodyId;//保存本地的bodyId
|
private int bodyId;//保存本地的bodyId
|
||||||
private int work_type;//0."车行" 1."自行车" 2."步行" 3."手动"
|
private int work_type;//0."车行" 1."自行车" 2."步行"
|
||||||
|
|
||||||
public int getWork_type() {
|
public int getWork_type() {
|
||||||
return work_type;
|
return work_type;
|
||||||
@ -266,7 +266,6 @@ public class PoiEntity implements Serializable {
|
|||||||
this.detail = detail;
|
this.detail = detail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "PoiEntity{" +
|
return "PoiEntity{" +
|
||||||
|
@ -66,7 +66,12 @@ public class ContactView {
|
|||||||
// rootView.removeViewAt(i);
|
// rootView.removeViewAt(i);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (poiBean.getPhone()==null){
|
||||||
|
holder.editPhoneNumber.setText("");
|
||||||
|
}else {
|
||||||
holder.editPhoneNumber.setText(poiBean.getPhone()+"");
|
holder.editPhoneNumber.setText(poiBean.getPhone()+"");
|
||||||
|
}
|
||||||
|
|
||||||
holder.editPhoneNumber.addTextChangedListener(new TextWatcher() {
|
holder.editPhoneNumber.addTextChangedListener(new TextWatcher() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -14,17 +14,23 @@ import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
|
|||||||
import com.bumptech.glide.load.resource.bitmap.VideoDecoder;
|
import com.bumptech.glide.load.resource.bitmap.VideoDecoder;
|
||||||
import com.bumptech.glide.request.RequestOptions;
|
import com.bumptech.glide.request.RequestOptions;
|
||||||
import com.coremedia.iso.boxes.Container;
|
import com.coremedia.iso.boxes.Container;
|
||||||
|
import com.github.lazylibrary.util.FileUtils;
|
||||||
|
import com.github.lazylibrary.util.StringUtils;
|
||||||
import com.googlecode.mp4parser.authoring.Movie;
|
import com.googlecode.mp4parser.authoring.Movie;
|
||||||
import com.googlecode.mp4parser.authoring.Track;
|
import com.googlecode.mp4parser.authoring.Track;
|
||||||
import com.googlecode.mp4parser.authoring.builder.DefaultMp4Builder;
|
import com.googlecode.mp4parser.authoring.builder.DefaultMp4Builder;
|
||||||
import com.googlecode.mp4parser.authoring.container.mp4.MovieCreator;
|
import com.googlecode.mp4parser.authoring.container.mp4.MovieCreator;
|
||||||
import com.googlecode.mp4parser.authoring.tracks.AppendTrack;
|
import com.googlecode.mp4parser.authoring.tracks.AppendTrack;
|
||||||
|
import com.navinfo.outdoor.api.Constant;
|
||||||
|
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileFilter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.RandomAccessFile;
|
import java.io.RandomAccessFile;
|
||||||
import java.nio.channels.FileChannel;
|
import java.nio.channels.FileChannel;
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
@ -38,10 +44,12 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
public class AWMp4ParserHelper {
|
public class AWMp4ParserHelper {
|
||||||
private static AWMp4ParserHelper instance;
|
private static AWMp4ParserHelper instance;
|
||||||
|
private static SimpleDateFormat simpleDateFormat;
|
||||||
|
|
||||||
public static AWMp4ParserHelper getInstance() {
|
public static AWMp4ParserHelper getInstance() {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
instance = new AWMp4ParserHelper();
|
instance = new AWMp4ParserHelper();
|
||||||
|
simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||||
}
|
}
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
@ -182,4 +190,133 @@ public class AWMp4ParserHelper {
|
|||||||
}
|
}
|
||||||
return bitmap;
|
return bitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成mp4文件拍摄的生成路径
|
||||||
|
* */
|
||||||
|
public File obtainMp4FilePath(String uuid, Object tag) {
|
||||||
|
if (tag == null) {
|
||||||
|
return new File(Constant.PICTURE_FOLDER+"/"+uuid+"-0.mp4");
|
||||||
|
}
|
||||||
|
List<File> fileList = (List<File>) tag;
|
||||||
|
if (fileList == null || fileList.isEmpty()) {
|
||||||
|
return new File(Constant.PICTURE_FOLDER+"/"+uuid+"-0.mp4");
|
||||||
|
}
|
||||||
|
int maxIndex = 0;
|
||||||
|
for (int i = 0; i < fileList.size(); i++) {
|
||||||
|
File file = fileList.get(i);
|
||||||
|
if (file!=null) {
|
||||||
|
String[] fileSplite = file.getName().replace(".mp4", "").split("-");
|
||||||
|
if (fileSplite!=null&&fileSplite.length>0&&fileSplite[fileSplite.length-1]!=null) {
|
||||||
|
int index = Integer.parseInt(fileSplite[fileSplite.length-1]);
|
||||||
|
if (index>=maxIndex) {
|
||||||
|
maxIndex = index;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new File(Constant.PICTURE_FOLDER+"/"+uuid+"-"+(maxIndex+1)+".mp4");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据文件夹路径生成最新的视频文件路径
|
||||||
|
* */
|
||||||
|
public File obtainMp4FilePath(String folderPath) {
|
||||||
|
if (folderPath == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
File folderFile = new File(folderPath);
|
||||||
|
if (!folderFile.exists()) {
|
||||||
|
folderFile.mkdirs();
|
||||||
|
}
|
||||||
|
File[] fileList = folderFile.listFiles(new FileFilter() {
|
||||||
|
@Override
|
||||||
|
public boolean accept(File pathname) {
|
||||||
|
if (pathname.getName().endsWith(".mp4")){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (fileList == null || fileList.length==0) {
|
||||||
|
return new File(folderPath+"/0.mp4");
|
||||||
|
}
|
||||||
|
int maxIndex = 0;
|
||||||
|
for (int i = 0; i < fileList.length; i++) {
|
||||||
|
File file = fileList[i];
|
||||||
|
if (file!=null) {
|
||||||
|
int index = Integer.parseInt(file.getName().replace(".mp4", ""));
|
||||||
|
if (index>=maxIndex) {
|
||||||
|
maxIndex = index;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new File(folderPath+"/"+(maxIndex+1)+".mp4");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据提供的uuid,获取指定目录下所有的视频文件
|
||||||
|
* */
|
||||||
|
public List<File> getVideoFileListByUUID(String uuid) {
|
||||||
|
List<File> videoFileList = new ArrayList<>();
|
||||||
|
if (StringUtils.isEmpty(uuid)) {
|
||||||
|
return videoFileList;
|
||||||
|
}
|
||||||
|
File folderFile = new File(Constant.PICTURE_FOLDER+"/"+uuid+"/");
|
||||||
|
if (!folderFile.exists()) {
|
||||||
|
folderFile.mkdirs();
|
||||||
|
return videoFileList;
|
||||||
|
}
|
||||||
|
for (File videoFile: folderFile.listFiles()) {
|
||||||
|
videoFileList.add(videoFile);
|
||||||
|
}
|
||||||
|
return videoFileList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVideoFileListStr(List<File> videoFileList) {
|
||||||
|
StringBuilder resultStrBuilder = new StringBuilder("");
|
||||||
|
if (videoFileList == null || videoFileList.size()<=0){
|
||||||
|
return resultStrBuilder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < videoFileList.size(); i++) {
|
||||||
|
File f = videoFileList.get(i);
|
||||||
|
resultStrBuilder.append(f.getAbsolutePath());
|
||||||
|
if (i < videoFileList.size() -1) {
|
||||||
|
resultStrBuilder.append(",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return resultStrBuilder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据视频文件列表,获取到对应的轨迹数据
|
||||||
|
* */
|
||||||
|
public List<LatLng> getLineStringByVideoFileList(List<File> videoFileList) {
|
||||||
|
List<LatLng> latLngs = new ArrayList<>();
|
||||||
|
if (videoFileList == null || videoFileList.isEmpty()) {
|
||||||
|
return latLngs;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int m = 0; m < videoFileList.size(); m++) {
|
||||||
|
File videoFile = videoFileList.get(m);
|
||||||
|
|
||||||
|
String path = videoFile.getPath() + ".txt";
|
||||||
|
List<String> strings = FileUtils.readFileToList(path, "utf-8");
|
||||||
|
if (strings!=null) {
|
||||||
|
for (int i = 0; i < strings.size(); i++) {
|
||||||
|
String[] split = strings.get(i).split(",");
|
||||||
|
LatLng latLng = new LatLng();
|
||||||
|
latLng.setLatitude(Double.valueOf(split[2]));
|
||||||
|
latLng.setLongitude(Double.valueOf(split[3]));
|
||||||
|
latLngs.add(latLng);
|
||||||
|
}
|
||||||
|
if (strings.size() == 1) {
|
||||||
|
LatLng latLng = latLngs.get(0);
|
||||||
|
latLngs.add(latLng);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return latLngs;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -261,15 +261,15 @@ public class Base64 {
|
|||||||
cipher.init(Cipher.ENCRYPT_MODE, secretKey, iv);
|
cipher.init(Cipher.ENCRYPT_MODE, secretKey, iv);
|
||||||
return encode_(cipher.doFinal(message.getBytes("UTF-8")));
|
return encode_(cipher.doFinal(message.getBytes("UTF-8")));
|
||||||
}
|
}
|
||||||
public static String desEncrypt1(String message) throws Exception {
|
// public static String desEncrypt1(String message) throws Exception {
|
||||||
// SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
|
//// SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
|
||||||
// SecretKey secretKey = keyFactory.generateSecret(new DESKeySpec(keyValue.getBytes("UTF-8")));
|
//// SecretKey secretKey = keyFactory.generateSecret(new DESKeySpec(keyValue.getBytes("UTF-8")));
|
||||||
SecretKeySpec secretKey = new SecretKeySpec(keyValue.getBytes(), "DES");
|
// SecretKeySpec secretKey = new SecretKeySpec(keyValue.getBytes(), "DES");
|
||||||
IvParameterSpec iv = new IvParameterSpec(keyVector.getBytes("UTF-8"));
|
// IvParameterSpec iv = new IvParameterSpec(keyVector.getBytes("UTF-8"));
|
||||||
Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
|
// Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
|
||||||
cipher.init(Cipher.ENCRYPT_MODE, secretKey, iv);
|
// cipher.init(Cipher.ENCRYPT_MODE, secretKey, iv);
|
||||||
return encode_(cipher.doFinal(message.getBytes("UTF-8")));
|
// return encode_(cipher.doFinal(message.getBytes("UTF-8")));
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 解密
|
* 解密
|
||||||
|
@ -1,8 +1,19 @@
|
|||||||
package com.navinfo.outdoor.util;
|
package com.navinfo.outdoor.util;
|
||||||
|
|
||||||
|
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||||
|
import com.vividsolutions.jts.geom.Geometry;
|
||||||
|
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.security.InvalidAlgorithmParameterException;
|
||||||
|
import java.security.InvalidKeyException;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.util.BitSet;
|
import java.util.BitSet;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import javax.crypto.BadPaddingException;
|
||||||
|
import javax.crypto.IllegalBlockSizeException;
|
||||||
|
import javax.crypto.NoSuchPaddingException;
|
||||||
|
|
||||||
public class Geohash {
|
public class Geohash {
|
||||||
|
|
||||||
private Geohash(){}
|
private Geohash(){}
|
||||||
@ -33,62 +44,80 @@ public class Geohash {
|
|||||||
lookup.put(c, i++);
|
lookup.put(c, i++);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
// public static void main(String[] args) {
|
||||||
String s = "1rn7exd5uhxy";
|
// String s = "1rn7exd5uhxy";
|
||||||
System.out.println(s);
|
// System.out.println(s);
|
||||||
System.out.println(new Geohash().decode(s)[0]);
|
// System.out.println(new Geohash().decode(s)[0]);
|
||||||
System.out.println(new Geohash().decode(s)[1]);
|
// System.out.println(new Geohash().decode(s)[1]);
|
||||||
System.out.println(new Geohash().encode(40.073556024581194, 116.24643344432116));
|
// System.out.println(new Geohash().encode(40.073556024581194, 116.24643344432116));
|
||||||
}
|
// }
|
||||||
|
|
||||||
//数据解密
|
//数据解密
|
||||||
/**
|
/**
|
||||||
* @param geohash 需要被解密的字符串
|
* @param geohash 需要被解密的字符串
|
||||||
* @return double[] 经纬度double数组,纬度(latitude)在前,经度在后(longitude)
|
* @return double[] 经纬度double数组,纬度(latitude)在前,经度在后(longitude)
|
||||||
* */
|
* */
|
||||||
public double[] decode(String geohash) {
|
public String decode(String geohash) {
|
||||||
|
// try {
|
||||||
|
// StringBuilder buffer = new StringBuilder();
|
||||||
|
// for (char c : geohash.toCharArray()) {
|
||||||
|
//
|
||||||
|
// int i = lookup.get(c) + 32;
|
||||||
|
// buffer.append(Integer.toString(i, 2).substring(1));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// long a = Long.parseLong(buffer.toString(), 2);
|
||||||
|
// buffer.setLength(0);
|
||||||
|
// buffer.append(Long.toBinaryString(a));
|
||||||
|
//
|
||||||
|
// BitSet lonset = new BitSet();
|
||||||
|
// BitSet latset = new BitSet();
|
||||||
|
//
|
||||||
|
// // even bits
|
||||||
|
// int j = 0;
|
||||||
|
// for (int i = 0; i < numbits * 2; i += 2) {
|
||||||
|
// boolean isSet = false;
|
||||||
|
// if (i < buffer.length())
|
||||||
|
// isSet = buffer.charAt(i) == '1';
|
||||||
|
// lonset.set(j++, isSet);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // odd bits
|
||||||
|
// j = 0;
|
||||||
|
// for (int i = 1; i < numbits * 2; i += 2) {
|
||||||
|
// boolean isSet = false;
|
||||||
|
// if (i < buffer.length())
|
||||||
|
// isSet = buffer.charAt(i) == '1';
|
||||||
|
// latset.set(j++, isSet);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// double lon = decode(lonset, -180, 180);
|
||||||
|
// double lat = decode(latset, -90, 90);
|
||||||
|
//
|
||||||
|
// return new double[] { lat, lon };
|
||||||
|
// } catch (RuntimeException re) {
|
||||||
|
// re.printStackTrace();
|
||||||
|
// return null;
|
||||||
|
// }
|
||||||
try {
|
try {
|
||||||
StringBuilder buffer = new StringBuilder();
|
return Base64.desDecrypt(geohash);
|
||||||
for (char c : geohash.toCharArray()) {
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
int i = lookup.get(c) + 32;
|
} catch (NoSuchAlgorithmException e) {
|
||||||
buffer.append(Integer.toString(i, 2).substring(1));
|
e.printStackTrace();
|
||||||
|
} catch (NoSuchPaddingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (InvalidKeyException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (InvalidAlgorithmParameterException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (IllegalBlockSizeException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (BadPaddingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
long a = Long.parseLong(buffer.toString(), 2);
|
|
||||||
buffer.setLength(0);
|
|
||||||
buffer.append(Long.toBinaryString(a));
|
|
||||||
|
|
||||||
BitSet lonset = new BitSet();
|
|
||||||
BitSet latset = new BitSet();
|
|
||||||
|
|
||||||
// even bits
|
|
||||||
int j = 0;
|
|
||||||
for (int i = 0; i < numbits * 2; i += 2) {
|
|
||||||
boolean isSet = false;
|
|
||||||
if (i < buffer.length())
|
|
||||||
isSet = buffer.charAt(i) == '1';
|
|
||||||
lonset.set(j++, isSet);
|
|
||||||
}
|
|
||||||
|
|
||||||
// odd bits
|
|
||||||
j = 0;
|
|
||||||
for (int i = 1; i < numbits * 2; i += 2) {
|
|
||||||
boolean isSet = false;
|
|
||||||
if (i < buffer.length())
|
|
||||||
isSet = buffer.charAt(i) == '1';
|
|
||||||
latset.set(j++, isSet);
|
|
||||||
}
|
|
||||||
|
|
||||||
double lon = decode(lonset, -180, 180);
|
|
||||||
double lat = decode(latset, -90, 90);
|
|
||||||
|
|
||||||
return new double[] { lat, lon };
|
|
||||||
} catch (RuntimeException re) {
|
|
||||||
re.printStackTrace();
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private double decode(BitSet bs, double floor, double ceiling) {
|
private double decode(BitSet bs, double floor, double ceiling) {
|
||||||
double mid = 0;
|
double mid = 0;
|
||||||
@ -107,14 +136,20 @@ public class Geohash {
|
|||||||
* @param lat,lon 需要被加密的double 值
|
* @param lat,lon 需要被加密的double 值
|
||||||
* */
|
* */
|
||||||
public String encode(double lat, double lon) {
|
public String encode(double lat, double lon) {
|
||||||
BitSet latbits = getBits(lat, -90, 90);
|
// BitSet latbits = getBits(lat, -90, 90);
|
||||||
BitSet lonbits = getBits(lon, -180, 180);
|
// BitSet lonbits = getBits(lon, -180, 180);
|
||||||
StringBuilder buffer = new StringBuilder();
|
// StringBuilder buffer = new StringBuilder();
|
||||||
for (int i = 0; i < numbits; i++) {
|
// for (int i = 0; i < numbits; i++) {
|
||||||
buffer.append((lonbits.get(i)) ? '1' : '0');
|
// buffer.append((lonbits.get(i)) ? '1' : '0');
|
||||||
buffer.append((latbits.get(i)) ? '1' : '0');
|
// buffer.append((latbits.get(i)) ? '1' : '0');
|
||||||
|
// }
|
||||||
|
Geometry geometry = GeometryTools.createGeometry(new LatLng(lat, lon));
|
||||||
|
try {
|
||||||
|
return Base64.desEncrypt(geometry.toString());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return base32(Long.parseLong(buffer.toString(), 2));
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private BitSet getBits(double lat, double floor, double ceiling) {
|
private BitSet getBits(double lat, double floor, double ceiling) {
|
||||||
|
@ -54,7 +54,7 @@ public class PhotoPathUtil {
|
|||||||
if (angle==0){
|
if (angle==0){
|
||||||
angle=90;
|
angle=90;
|
||||||
}
|
}
|
||||||
File file = new File(Constant.PICTURE_FOLDER, d+time+"_p"+coord+"_a"+angle+".jpg");
|
File file = new File(Constant.PICTURE_FOLDER+d+time+"_p"+coord+"_a"+angle+".jpg");
|
||||||
/***打开文件输出流*/
|
/***打开文件输出流*/
|
||||||
fileOutputStream = new FileOutputStream(file);
|
fileOutputStream = new FileOutputStream(file);
|
||||||
// 生成图片文件
|
// 生成图片文件
|
||||||
|
116
app/src/main/java/com/navinfo/outdoor/util/PhotoUtils.java
Normal file
116
app/src/main/java/com/navinfo/outdoor/util/PhotoUtils.java
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
package com.navinfo.outdoor.util;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
|
||||||
|
import androidx.exifinterface.media.ExifInterface;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.navinfo.outdoor.api.Constant;
|
||||||
|
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.BitSet;
|
||||||
|
|
||||||
|
import static org.greenrobot.eventbus.EventBus.TAG;
|
||||||
|
|
||||||
|
public class PhotoUtils {
|
||||||
|
private static int numbits = 6 * 5;
|
||||||
|
// 为了加密,所以改了base32编码代码表
|
||||||
|
final static char[] digits = { 'd', 'f', 'g', 'y', 'n', 't', 'u', 'v', 'q',
|
||||||
|
'b', '9', 's', 'z', '7', 'i', '2', 'h', '5', '0', 'p', '4', 'm',
|
||||||
|
'8', 'x', 'c', 'j', '6', 'e', '1', 'r', '3', 'k' };
|
||||||
|
|
||||||
|
public static String showPhotoAndGetPath(File file, ImageView imageView) {
|
||||||
|
Glide.with(imageView.getContext()).load(file).into(imageView);
|
||||||
|
return file.getAbsolutePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static File showPhotoFile(String d, LatLng latLng) {
|
||||||
|
String lat="";
|
||||||
|
if (latLng!=null){
|
||||||
|
lat= initEncode(latLng);
|
||||||
|
}
|
||||||
|
long time = System.currentTimeMillis();
|
||||||
|
File file = new File(Constant.PICTURE_FOLDER, d + time + "_p" + lat + "_a" + 0 + ".jpg");
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String initEncode(LatLng latLng) {
|
||||||
|
BitSet latbits = getBits(latLng.latitude, -90, 90);
|
||||||
|
BitSet lonbits = getBits(latLng.longitude, -180, 180);
|
||||||
|
StringBuilder buffer = new StringBuilder();
|
||||||
|
for (int i = 0; i < numbits; i++) {
|
||||||
|
buffer.append((lonbits.get(i)) ? '1' : '0');
|
||||||
|
buffer.append((latbits.get(i)) ? '1' : '0');
|
||||||
|
}
|
||||||
|
return base32(Long.parseLong(buffer.toString(), 2));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static BitSet getBits(double lat, double floor, double ceiling) {
|
||||||
|
BitSet buffer = new BitSet(numbits);
|
||||||
|
for (int i = 0; i < numbits; i++) {
|
||||||
|
double mid = (floor + ceiling) / 2;
|
||||||
|
if (lat >= mid) {
|
||||||
|
buffer.set(i);
|
||||||
|
floor = mid;
|
||||||
|
} else {
|
||||||
|
ceiling = mid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String base32(long i) {
|
||||||
|
char[] buf = new char[65];
|
||||||
|
int charPos = 64;
|
||||||
|
boolean negative = (i < 0);
|
||||||
|
if (!negative)
|
||||||
|
i = -i;
|
||||||
|
while (i <= -32) {
|
||||||
|
buf[charPos--] = digits[(int) (-(i % 32))];
|
||||||
|
i /= 32;
|
||||||
|
}
|
||||||
|
buf[charPos] = digits[(int) (-i)];
|
||||||
|
|
||||||
|
if (negative)
|
||||||
|
buf[--charPos] = '-';
|
||||||
|
return new String(buf, charPos, (65 - charPos));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取图片旋转角度
|
||||||
|
*
|
||||||
|
* @param filepath
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static int getExifOrientation(String filepath) {
|
||||||
|
int degree = 0;
|
||||||
|
ExifInterface exif = null;
|
||||||
|
try {
|
||||||
|
exif = new ExifInterface(filepath);
|
||||||
|
} catch (IOException ex) {
|
||||||
|
Log.d(TAG, "cannot read exif" + ex);
|
||||||
|
}
|
||||||
|
if (exif != null) {
|
||||||
|
int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, -1);
|
||||||
|
if (orientation != -1) {
|
||||||
|
switch (orientation) {
|
||||||
|
case ExifInterface.ORIENTATION_ROTATE_90:
|
||||||
|
degree = 90;
|
||||||
|
break;
|
||||||
|
case ExifInterface.ORIENTATION_ROTATE_180:
|
||||||
|
degree = 180;
|
||||||
|
break;
|
||||||
|
case ExifInterface.ORIENTATION_ROTATE_270:
|
||||||
|
degree = 270;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return degree;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -38,7 +38,8 @@ public class PoiSaveUtils {
|
|||||||
private Activity mContext;
|
private Activity mContext;
|
||||||
private Gson gson;
|
private Gson gson;
|
||||||
private static PoiSaveUtils instance;
|
private static PoiSaveUtils instance;
|
||||||
private boolean isBoolean;
|
private int anInt=0;
|
||||||
|
private int bInt=0;
|
||||||
|
|
||||||
public static PoiSaveUtils getInstance(Activity mContext) {
|
public static PoiSaveUtils getInstance(Activity mContext) {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
@ -88,7 +89,7 @@ public class PoiSaveUtils {
|
|||||||
public void run() {
|
public void run() {
|
||||||
Message obtain = Message.obtain();
|
Message obtain = Message.obtain();
|
||||||
obtain.what = Constant.EVENT_STAY_REFRESH;
|
obtain.what = Constant.EVENT_STAY_REFRESH;
|
||||||
obtain.obj = isBoolean;
|
obtain.obj = "提交成功"+anInt+",提交失败"+bInt;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -287,10 +288,10 @@ public class PoiSaveUtils {
|
|||||||
if (otherUploadPicBean.getCode() == 200) {
|
if (otherUploadPicBean.getCode() == 200) {
|
||||||
PoiDatabase.getInstance(mContext).getPoiDao().deletePoiEntity(poiEntity);
|
PoiDatabase.getInstance(mContext).getPoiDao().deletePoiEntity(poiEntity);
|
||||||
Log.d("TAGss", "uploadPoiNet: 成功");
|
Log.d("TAGss", "uploadPoiNet: 成功");
|
||||||
isBoolean = true;
|
anInt++;
|
||||||
} else {
|
} else {
|
||||||
Log.d("TAGss", "uploadPoiNet: 失败");
|
Log.d("TAGss", "uploadPoiNet: 失败");
|
||||||
isBoolean = false;
|
bInt++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
5
app/src/main/res/drawable/ic_baseline.xml
Normal file
5
app/src/main/res/drawable/ic_baseline.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<vector android:alpha="0.91" android:height="16dp"
|
||||||
|
android:tint="#91230A" android:viewportHeight="24"
|
||||||
|
android:viewportWidth="24" android:width="16dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2z"/>
|
||||||
|
</vector>
|
@ -1,195 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/root"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="#FF444444">
|
|
||||||
<com.otaliastudios.cameraview.CameraView
|
|
||||||
android:id="@+id/camera"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:keepScreenOn="true"
|
|
||||||
app:cameraAudio="on"
|
|
||||||
app:cameraAutoFocusMarker="@string/cameraview_default_autofocus_marker"
|
|
||||||
app:cameraEngine="camera2"
|
|
||||||
app:cameraExperimental="true"
|
|
||||||
app:cameraFacing="back"
|
|
||||||
app:cameraFlash="auto"
|
|
||||||
app:cameraGestureLongTap="none"
|
|
||||||
app:cameraGesturePinch="zoom"
|
|
||||||
app:cameraGestureScrollHorizontal="filterControl1"
|
|
||||||
app:cameraGestureScrollVertical="exposureCorrection"
|
|
||||||
app:cameraGestureTap="autoFocus"
|
|
||||||
app:cameraGrid="off"
|
|
||||||
app:cameraMode="picture"
|
|
||||||
app:cameraPlaySounds="true"
|
|
||||||
app:cameraPreview="glSurface"
|
|
||||||
app:layout_constraintBottom_toTopOf="@id/ll_caiji"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintVertical_bias="0.0"
|
|
||||||
tools:layout_editor_absoluteX="-76dp">
|
|
||||||
|
|
||||||
</com.otaliastudios.cameraview.CameraView>
|
|
||||||
|
|
||||||
<com.tencent.tencentmap.mapsdk.maps.MapView
|
|
||||||
android:id="@+id/iv_map"
|
|
||||||
android:layout_width="300dp"
|
|
||||||
android:layout_height="183dp"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/btn_switch"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:layout_marginRight="20dp"
|
|
||||||
android:text="切换"
|
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
<Button
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/btn_switch"
|
|
||||||
app:layout_constraintRight_toRightOf="@id/btn_switch"
|
|
||||||
android:id="@+id/btn_video"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="停止" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/iv_pic"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@mipmap/take_pic_arrow"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
<!-- <LinearLayout-->
|
|
||||||
<!-- android:id="@+id/ll_iv"-->
|
|
||||||
<!-- android:layout_width="match_parent"-->
|
|
||||||
<!-- android:layout_height="wrap_content"-->
|
|
||||||
<!-- android:layout_gravity="bottom"-->
|
|
||||||
<!-- android:orientation="horizontal"-->
|
|
||||||
<!-- android:padding="16dp"-->
|
|
||||||
<!-- android:weightSum="4"-->
|
|
||||||
<!-- app:layout_constraintBottom_toBottomOf="parent">-->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <Space-->
|
|
||||||
<!-- android:layout_width="0dp"-->
|
|
||||||
<!-- android:layout_height="1dp"-->
|
|
||||||
<!-- android:layout_weight="1" />-->
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/ll_caiji"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center"
|
|
||||||
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_marginBottom="20dp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent">
|
|
||||||
<Button
|
|
||||||
android:id="@+id/capuretVideo"
|
|
||||||
android:layout_width="100dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="开始采集"
|
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
style="@style/user_data_style"/>
|
|
||||||
<Button
|
|
||||||
|
|
||||||
android:layout_width="100dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="结束采集"
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:background="@drawable/uploding_shape"
|
|
||||||
android:textColor="@color/colorBlue"/>
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/capturePicture"
|
|
||||||
android:layout_width="56dp"
|
|
||||||
android:layout_height="56dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
|
||||||
app:srcCompat="@drawable/ic_photo" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <Space-->
|
|
||||||
<!-- android:layout_width="0dp"-->
|
|
||||||
<!-- android:layout_height="1dp"-->
|
|
||||||
<!-- android:layout_weight="1" />-->
|
|
||||||
<!-- <Space-->
|
|
||||||
<!-- android:layout_width="0dp"-->
|
|
||||||
<!-- android:layout_height="1dp"-->
|
|
||||||
<!-- android:layout_weight="1" />-->
|
|
||||||
|
|
||||||
<!-- <Space-->
|
|
||||||
<!-- android:layout_width="0dp"-->
|
|
||||||
<!-- android:layout_height="1dp"-->
|
|
||||||
<!-- android:layout_weight="1" />-->
|
|
||||||
<!-- <Space-->
|
|
||||||
<!-- android:layout_width="0dp"-->
|
|
||||||
<!-- android:layout_height="1dp"-->
|
|
||||||
<!-- android:layout_weight="1" />-->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <LinearLayout-->
|
|
||||||
<!-- android:id="@+id/capturePictureSnapshot"-->
|
|
||||||
<!-- android:layout_width="56dp"-->
|
|
||||||
<!-- android:layout_height="56dp"-->
|
|
||||||
<!-- android:background="?attr/selectableItemBackgroundBorderless"-->
|
|
||||||
<!-- android:gravity="center"-->
|
|
||||||
<!-- android:orientation="vertical"-->
|
|
||||||
<!-- android:visibility="gone">-->
|
|
||||||
|
|
||||||
<!-- <ImageView-->
|
|
||||||
<!-- android:layout_width="wrap_content"-->
|
|
||||||
<!-- android:layout_height="wrap_content"-->
|
|
||||||
<!-- app:srcCompat="@drawable/ic_photo" />-->
|
|
||||||
|
|
||||||
<!-- <TextView-->
|
|
||||||
<!-- android:layout_width="wrap_content"-->
|
|
||||||
<!-- android:layout_height="wrap_content"-->
|
|
||||||
<!-- android:text="SNAP"-->
|
|
||||||
<!-- android:textColor="@android:color/white"-->
|
|
||||||
<!-- android:textSize="10sp"-->
|
|
||||||
<!-- android:textStyle="bold" />-->
|
|
||||||
|
|
||||||
<!-- </LinearLayout>-->
|
|
||||||
|
|
||||||
<!-- <ImageButton-->
|
|
||||||
<!-- android:id="@+id/capuretVideo"-->
|
|
||||||
<!-- android:layout_width="56dp"-->
|
|
||||||
<!-- android:layout_height="56dp"-->
|
|
||||||
<!-- android:background="?attr/selectableItemBackgroundBorderless"-->
|
|
||||||
<!-- app:srcCompat="@drawable/ic_video" />-->
|
|
||||||
<!-- <LinearLayout-->
|
|
||||||
<!-- android:id="@+id/captureVideoSnapshot"-->
|
|
||||||
<!-- android:layout_width="56dp"-->
|
|
||||||
<!-- android:layout_height="56dp"-->
|
|
||||||
<!-- android:orientation="vertical"-->
|
|
||||||
<!-- android:background="?attr/selectableItemBackgroundBorderless"-->
|
|
||||||
<!-- android:gravity="center" >-->
|
|
||||||
<!-- <ImageView-->
|
|
||||||
<!-- android:layout_width="wrap_content"-->
|
|
||||||
<!-- android:layout_height="wrap_content"-->
|
|
||||||
<!-- app:srcCompat="@drawable/ic_video"/>-->
|
|
||||||
<!-- <TextView-->
|
|
||||||
<!-- android:layout_width="wrap_content"-->
|
|
||||||
<!-- android:layout_height="wrap_content"-->
|
|
||||||
<!-- android:textColor="@android:color/white"-->
|
|
||||||
<!-- android:textStyle="bold"-->
|
|
||||||
<!-- android:textSize="10sp"-->
|
|
||||||
<!-- android:text="SNAP"/>-->
|
|
||||||
<!-- </LinearLayout>-->
|
|
||||||
|
|
||||||
<!-- </LinearLayout>-->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -40,15 +40,6 @@
|
|||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/btn_video"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="停止"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintRight_toRightOf="@id/btn_switch"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/btn_switch" />
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_pic"
|
android:id="@+id/iv_pic"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -85,5 +76,17 @@
|
|||||||
app:layout_constraintBottom_toBottomOf="@id/capuretVideo"
|
app:layout_constraintBottom_toBottomOf="@id/capuretVideo"
|
||||||
app:layout_constraintLeft_toRightOf="@id/capuretVideo"
|
app:layout_constraintLeft_toRightOf="@id/capuretVideo"
|
||||||
app:layout_constraintRight_toRightOf="parent" />
|
app:layout_constraintRight_toRightOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/video_chronometer"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:background="@color/whiteAlpha50"
|
||||||
|
android:padding="@dimen/default_widget_padding"
|
||||||
|
android:format="00:00:00"
|
||||||
|
android:layout_marginTop="@dimen/default_widget_padding"></TextView>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
@ -6,21 +6,30 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="#FF444444"
|
android:background="#FF444444"
|
||||||
tools:context=".activity.PicturesActivity">
|
tools:context=".activity.PicturesActivity">
|
||||||
|
<FrameLayout
|
||||||
<com.otaliastudios.cameraview.CameraView
|
android:id="@+id/layer_change"
|
||||||
android:id="@+id/cameraView"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="match_parent">
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
<com.otaliastudios.cameraview.CameraView
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
android:id="@+id/camera"
|
||||||
/>
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:keepScreenOn="true"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<com.tencent.tencentmap.mapsdk.maps.TextureMapView
|
||||||
|
android:id="@+id/iv_map"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="157dp"
|
||||||
|
app:layout_constraintHeight_default="percent"
|
||||||
|
app:layout_constraintHeight_percent="0.3"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintWidth_default="percent"
|
||||||
|
app:layout_constraintWidth_percent="0.3" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
<!-- <com.tencent.tencentmap.mapsdk.maps.MapView-->
|
|
||||||
<!-- android:id="@+id/iv_map"-->
|
|
||||||
<!-- android:layout_width="300dp"-->
|
|
||||||
<!-- android:layout_height="183dp"-->
|
|
||||||
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
|
|
||||||
<!-- app:layout_constraintTop_toTopOf="parent" />-->
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_switch"
|
android:id="@+id/btn_switch"
|
||||||
@ -32,23 +41,18 @@
|
|||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/iv_pic"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@mipmap/take_pic_arrow"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
|
|
||||||
<Button
|
<CheckBox
|
||||||
android:id="@+id/capuretVideo"
|
android:id="@+id/capuretVideo"
|
||||||
style="@style/user_data_style"
|
style="@style/user_data_style"
|
||||||
android:layout_width="100dp"
|
android:layout_width="100dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="20dp"
|
android:layout_marginBottom="20dp"
|
||||||
|
android:background="@drawable/user_style"
|
||||||
|
android:button="@null"
|
||||||
|
android:gravity="center"
|
||||||
|
android:padding="@dimen/fab_margin"
|
||||||
android:text="开始采集"
|
android:text="开始采集"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
@ -72,8 +72,8 @@
|
|||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_attestation"
|
android:id="@+id/btn_attestation"
|
||||||
style="@style/user_style"
|
style="@style/user_style"
|
||||||
android:layout_width="70dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="30dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_marginRight="10dp"
|
android:layout_marginRight="10dp"
|
||||||
android:text="去认证"
|
android:text="去认证"
|
||||||
@ -102,8 +102,8 @@
|
|||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_gathering"
|
android:id="@+id/btn_gathering"
|
||||||
android:layout_width="70dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="30dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_marginRight="10dp"
|
android:layout_marginRight="10dp"
|
||||||
android:text="去绑定"
|
android:text="去绑定"
|
||||||
@ -168,8 +168,10 @@
|
|||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/et_phone"
|
android:id="@+id/et_phone"
|
||||||
android:layout_toRightOf="@id/tv_number"
|
android:layout_toRightOf="@id/tv_number"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
style="@style/user_hint_style"
|
style="@style/user_hint_style"
|
||||||
|
android:digits="1234567890"
|
||||||
|
android:maxLength="11"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:hint="请输入手机号码"
|
android:hint="请输入手机号码"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -258,8 +260,8 @@
|
|||||||
style="@style/user_text_style"
|
style="@style/user_text_style"
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="70dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="30dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_marginRight="10dp"
|
android:layout_marginRight="10dp"
|
||||||
android:text="去绑定"
|
android:text="去绑定"
|
||||||
|
@ -335,6 +335,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_panorama"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
@ -370,6 +371,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_coding"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
@ -397,7 +399,7 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent">
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_scutcheon"
|
android:id="@+id/tv_scutcheon1"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:text="设备标牌"
|
android:text="设备标牌"
|
||||||
@ -415,10 +417,10 @@
|
|||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_marginLeft="18dp"
|
android:layout_marginLeft="18dp"
|
||||||
android:layout_toRightOf="@id/tv_scutcheon"
|
android:layout_toRightOf="@id/tv_scutcheon1"
|
||||||
android:background="@color/white"
|
android:background="@color/white"
|
||||||
android:layout_marginRight="10dp"
|
android:layout_marginRight="10dp"
|
||||||
android:layout_toEndOf="@id/tv_scutcheon"
|
android:layout_toEndOf="@id/tv_scutcheon1"
|
||||||
android:textSize="15sp"
|
android:textSize="15sp"
|
||||||
android:textColor="#333" />
|
android:textColor="#333" />
|
||||||
<ImageView
|
<ImageView
|
||||||
@ -451,6 +453,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_equipment"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
@ -486,6 +489,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_facility"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
@ -523,6 +527,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_scutcheon"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
@ -560,6 +565,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_device"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
@ -639,6 +645,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_usable"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
@ -670,6 +677,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_available"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
@ -702,6 +710,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_parking"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
@ -738,6 +747,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_number"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
|
@ -318,6 +318,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_panorama"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
@ -353,6 +354,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_name"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
@ -388,6 +390,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_internal"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
@ -429,6 +432,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_else"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
@ -464,6 +468,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_scutcheon"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
|
@ -201,8 +201,8 @@
|
|||||||
app:layout_constraintLeft_toLeftOf="@id/et_forgetPaw_confirm_paw"
|
app:layout_constraintLeft_toLeftOf="@id/et_forgetPaw_confirm_paw"
|
||||||
app:layout_constraintTop_toBottomOf="@id/et_forgetPaw_confirm_paw" />
|
app:layout_constraintTop_toBottomOf="@id/et_forgetPaw_confirm_paw" />
|
||||||
|
|
||||||
<TextView
|
<Button
|
||||||
android:id="@+id/tv_forgetPaw"
|
android:id="@+id/btn_forgetPaw"
|
||||||
style="@style/login_style"
|
style="@style/login_style"
|
||||||
android:layout_width="300dp"
|
android:layout_width="300dp"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
|
@ -134,7 +134,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginLeft="10dp"
|
||||||
android:text="POIVIDEO任务列表"
|
android:text="POI录像任务列表"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
app:layout_constraintLeft_toRightOf="@id/iv_poiVideo"
|
app:layout_constraintLeft_toRightOf="@id/iv_poiVideo"
|
||||||
app:layout_constraintTop_toTopOf="@id/iv_poiVideo" />
|
app:layout_constraintTop_toTopOf="@id/iv_poiVideo" />
|
||||||
|
@ -202,6 +202,7 @@
|
|||||||
android:background="@drawable/plus" />
|
android:background="@drawable/plus" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_picture"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/image_picture"
|
android:layout_below="@id/image_picture"
|
||||||
@ -236,6 +237,7 @@
|
|||||||
android:background="@drawable/plus" />
|
android:background="@drawable/plus" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_pictures"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/image_pictures"
|
android:layout_below="@id/image_pictures"
|
||||||
|
@ -102,15 +102,17 @@
|
|||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/et_register_note"
|
android:id="@+id/et_register_note"
|
||||||
|
style="@style/register_hint_style"
|
||||||
android:layout_width="200dp"
|
android:layout_width="200dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
android:hint="6为短信验证"
|
android:hint="6为短信验证"
|
||||||
style="@style/register_hint_style"
|
|
||||||
android:textColorHint="@color/colorTransparent"
|
android:textColorHint="@color/colorTransparent"
|
||||||
android:textCursorDrawable="@drawable/text_color"
|
android:textCursorDrawable="@drawable/text_color"
|
||||||
android:theme="@style/MyEditText"
|
android:theme="@style/MyEditText"
|
||||||
app:layout_constraintLeft_toLeftOf="@id/register_note"
|
app:layout_constraintLeft_toLeftOf="@id/register_note"
|
||||||
app:layout_constraintTop_toBottomOf="@id/register_note" />
|
app:layout_constraintTop_toBottomOf="@id/register_note" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/view3"
|
android:id="@+id/view3"
|
||||||
android:layout_width="300dp"
|
android:layout_width="300dp"
|
||||||
@ -239,8 +241,8 @@
|
|||||||
app:layout_constraintTop_toTopOf="@id/iv_register_check"
|
app:layout_constraintTop_toTopOf="@id/iv_register_check"
|
||||||
app:layout_constraintRight_toRightOf="@id/et_register_confirm_paw"
|
app:layout_constraintRight_toRightOf="@id/et_register_confirm_paw"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/iv_register_check"/>
|
app:layout_constraintBottom_toBottomOf="@id/iv_register_check"/>
|
||||||
<TextView
|
<Button
|
||||||
android:id="@+id/tv_register"
|
android:id="@+id/btn_register"
|
||||||
android:layout_width="300dp"
|
android:layout_width="300dp"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
|
@ -36,11 +36,11 @@
|
|||||||
android:id="@+id/ll_name"
|
android:id="@+id/ll_name"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
android:background="@drawable/road_shape"
|
android:background="@drawable/road_shape"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
app:layout_constraintStart_toStartOf="@+id/tv_message"
|
app:layout_constraintStart_toStartOf="@+id/tv_message"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/tv_message">
|
app:layout_constraintTop_toBottomOf="@+id/tv_message">
|
||||||
|
|
||||||
@ -56,12 +56,12 @@
|
|||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/et_road_name"
|
android:id="@+id/et_road_name"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:textSize="14sp"
|
android:background="@null"
|
||||||
|
android:gravity="center_vertical"
|
||||||
android:inputType="text"
|
android:inputType="text"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:background="@null" />
|
android:textSize="14sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -79,8 +79,8 @@
|
|||||||
android:id="@+id/ll_mode"
|
android:id="@+id/ll_mode"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="15dp"
|
|
||||||
android:layout_marginLeft="2dp"
|
android:layout_marginLeft="2dp"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tv_mode">
|
app:layout_constraintTop_toBottomOf="@id/tv_mode">
|
||||||
|
|
||||||
@ -96,32 +96,32 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:textColor="@color/test_color_selector"
|
android:text="车行"
|
||||||
android:text="车行" />
|
android:textColor="@color/test_color_selector" />
|
||||||
|
|
||||||
<RadioButton
|
<RadioButton
|
||||||
android:id="@+id/rb_bicycle"
|
android:id="@+id/rb_bicycle"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:textColor="@color/test_color_selector"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="自行车" />
|
android:text="自行车"
|
||||||
|
android:textColor="@color/test_color_selector" />
|
||||||
|
|
||||||
<RadioButton
|
<RadioButton
|
||||||
android:id="@+id/rb_walking"
|
android:id="@+id/rb_walking"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:textColor="@color/test_color_selector"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="步行" />
|
android:text="步行"
|
||||||
|
android:textColor="@color/test_color_selector" />
|
||||||
|
|
||||||
<RadioButton
|
<!-- <RadioButton-->
|
||||||
android:id="@+id/rb_manual"
|
<!-- android:id="@+id/rb_manual"-->
|
||||||
android:layout_width="0dp"
|
<!-- android:layout_width="0dp"-->
|
||||||
android:textColor="@color/test_color_selector"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_weight="1"-->
|
||||||
android:layout_weight="1"
|
<!-- android:text="手动"-->
|
||||||
android:text="手动" />
|
<!-- android:textColor="@color/test_color_selector" />-->
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@ -139,46 +139,61 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="03.拍照 "
|
android:text="03.录像 "
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="16sp" />
|
android:textSize="16sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_pictures"
|
android:id="@+id/tv_pictures"
|
||||||
style="@style/user_style"
|
style="@style/user_style"
|
||||||
android:layout_width="40dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="25dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="拍照"
|
android:text="录像"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="15sp" />
|
android:textSize="15sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/fm_road_picture"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
|
||||||
|
app:layout_constraintLeft_toLeftOf="@id/ll_pictures"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/ll_pictures">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_road_picture"
|
android:id="@+id/iv_road_picture"
|
||||||
android:layout_width="200dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="100dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:minWidth="140dp"
|
||||||
app:layout_constraintLeft_toLeftOf="@id/ll_pictures"
|
android:minHeight="70dp"
|
||||||
app:layout_constraintTop_toBottomOf="@id/ll_pictures" />
|
android:maxHeight="100dp"
|
||||||
|
android:maxWidth="200dp"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
/>
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_desc"
|
android:id="@+id/ll_desc"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintLeft_toLeftOf="@id/iv_road_picture"
|
app:layout_constraintLeft_toLeftOf="@id/fm_road_picture"
|
||||||
app:layout_constraintTop_toBottomOf="@id/iv_road_picture">
|
app:layout_constraintTop_toBottomOf="@id/fm_road_picture">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginLeft="10dp"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
android:text="03.描述"
|
android:text="04.描述"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="16sp" />
|
android:textSize="16sp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/linear_describe"
|
android:id="@+id/linear_describe"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -187,24 +202,25 @@
|
|||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@drawable/underline"
|
android:background="@drawable/underline"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tv_03"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent">
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_03">
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/et_desc"
|
android:id="@+id/et_desc"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:paddingBottom="30dp"
|
|
||||||
android:layout_margin="2dp"
|
android:layout_margin="2dp"
|
||||||
android:gravity="top"
|
android:background="@color/white"
|
||||||
android:paddingLeft="10dp"
|
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:focusableInTouchMode="true"
|
android:focusableInTouchMode="true"
|
||||||
android:background="@color/white"
|
android:gravity="top"
|
||||||
android:hint="任务描述"
|
android:hint="任务描述"
|
||||||
android:textSize="15sp"
|
android:paddingLeft="10dp"
|
||||||
|
android:paddingTop="10dp"
|
||||||
|
android:paddingBottom="30dp"
|
||||||
android:textColor="@color/test_color_selector"
|
android:textColor="@color/test_color_selector"
|
||||||
|
android:textSize="15sp"
|
||||||
|
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
@ -125,14 +125,17 @@
|
|||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/et_bank_num"
|
android:id="@+id/et_bank_num"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="200dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:hint="银行卡号 "
|
android:hint="银行卡号"
|
||||||
|
|
||||||
|
android:digits="1234567890"
|
||||||
|
android:maxLength="19"
|
||||||
android:textSize="16sp" />
|
android:textSize="16sp" />
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="100dp"
|
android:layout_width="60dp"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
@ -17,7 +17,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/progressBar_tx"
|
android:id="@+id/progressBar_tx"
|
||||||
android:layout_width="50dp"
|
android:layout_width="100dp"
|
||||||
|
android:gravity="center"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/progressBar1"
|
android:layout_below="@+id/progressBar1"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
|
@ -279,6 +279,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_panorama"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
@ -315,6 +316,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_name"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
@ -351,6 +353,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_internal"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
@ -393,6 +396,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_card"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
@ -429,6 +433,7 @@
|
|||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
/>
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_else"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -36,11 +36,11 @@
|
|||||||
android:id="@+id/ll_name"
|
android:id="@+id/ll_name"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
android:background="@drawable/road_shape"
|
android:background="@drawable/road_shape"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
app:layout_constraintStart_toStartOf="@+id/tv_message"
|
app:layout_constraintStart_toStartOf="@+id/tv_message"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/tv_message">
|
app:layout_constraintTop_toBottomOf="@+id/tv_message">
|
||||||
|
|
||||||
@ -56,114 +56,133 @@
|
|||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/et_poi_video_name"
|
android:id="@+id/et_poi_video_name"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:textSize="14sp"
|
|
||||||
android:inputType="text"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:background="@null" />
|
android:background="@null"
|
||||||
|
android:inputType="text"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textSize="14sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_mode"
|
android:id="@+id/tv_mode"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
android:text="02.拍照方式"
|
android:text="02.拍照方式"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/ll_name"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
|
android:textSize="16sp"
|
||||||
app:layout_constraintLeft_toLeftOf="@id/ll_name"
|
app:layout_constraintLeft_toLeftOf="@id/ll_name"
|
||||||
android:layout_marginTop="10dp"/>
|
app:layout_constraintTop_toBottomOf="@+id/ll_name" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_mode"
|
android:id="@+id/ll_mode"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_marginTop="15dp"
|
|
||||||
android:layout_marginLeft="2dp"
|
android:layout_marginLeft="2dp"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tv_mode">
|
app:layout_constraintTop_toBottomOf="@id/tv_mode">
|
||||||
|
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
android:id="@+id/rg_type"
|
android:id="@+id/rg_type"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:orientation="horizontal"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_height="wrap_content">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<RadioButton
|
<RadioButton
|
||||||
android:id="@+id/rb_car"
|
android:id="@+id/rb_car"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:textColor="@color/test_color_selector"
|
android:text="车行"
|
||||||
android:text="车行"/>
|
android:textColor="@color/test_color_selector" />
|
||||||
|
|
||||||
<RadioButton
|
<RadioButton
|
||||||
android:id="@+id/rb_bicycle"
|
android:id="@+id/rb_bicycle"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_weight="1"
|
|
||||||
android:textColor="@color/test_color_selector"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="自行车"/>
|
android:layout_weight="1"
|
||||||
|
android:text="骑行"
|
||||||
|
android:textColor="@color/test_color_selector" />
|
||||||
|
|
||||||
<RadioButton
|
<RadioButton
|
||||||
android:id="@+id/rb_walking"
|
android:id="@+id/rb_walking"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:textColor="@color/test_color_selector"
|
android:text="步行"
|
||||||
android:text="步行"/>
|
android:textColor="@color/test_color_selector" />
|
||||||
<RadioButton
|
<!-- <RadioButton-->
|
||||||
android:id="@+id/rb_manual"
|
<!-- android:id="@+id/rb_manual"-->
|
||||||
android:layout_width="0dp"
|
<!-- android:layout_width="0dp"-->
|
||||||
android:layout_weight="1"
|
<!-- android:layout_weight="1"-->
|
||||||
android:textColor="@color/test_color_selector"
|
<!-- android:textColor="@color/test_color_selector"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
android:text="手动"/>
|
<!-- android:text="手动"/>-->
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_pictures"
|
android:id="@+id/ll_pictures"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
app:layout_constraintLeft_toLeftOf="@id/ll_mode"
|
app:layout_constraintLeft_toLeftOf="@id/ll_mode"
|
||||||
app:layout_constraintTop_toBottomOf="@id/ll_mode">
|
app:layout_constraintTop_toBottomOf="@id/ll_mode">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="03.拍照 "
|
android:text="03.录像 "
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="16sp" />
|
android:textSize="16sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_pictures"
|
android:id="@+id/tv_pictures"
|
||||||
style="@style/user_style"
|
style="@style/user_style"
|
||||||
android:layout_width="40dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="25dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="拍照"
|
android:text="录像"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="15sp" />
|
android:textSize="15sp" />
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/fm_poi_video_picture"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
app:layout_constraintLeft_toLeftOf="@id/ll_pictures"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/ll_pictures">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_poi_video_picture"
|
android:id="@+id/iv_poi_video_picture"
|
||||||
android:layout_width="200dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="100dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:maxWidth="200dp"
|
||||||
|
android:maxHeight="100dp"
|
||||||
|
android:minWidth="140dp"
|
||||||
|
android:minHeight="70dp"
|
||||||
|
android:scaleType="fitXY" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
app:layout_constraintLeft_toLeftOf="@id/ll_pictures"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/ll_pictures" />
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_desc"
|
android:id="@+id/ll_desc"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintLeft_toLeftOf="@id/iv_poi_video_picture"
|
app:layout_constraintLeft_toLeftOf="@id/fm_poi_video_picture"
|
||||||
app:layout_constraintTop_toBottomOf="@id/iv_poi_video_picture">
|
app:layout_constraintTop_toBottomOf="@id/fm_poi_video_picture">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/linear_exist"
|
android:id="@+id/linear_exist"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -217,6 +236,7 @@
|
|||||||
android:text="04.描述"
|
android:text="04.描述"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="16sp" />
|
android:textSize="16sp" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/linear_describe"
|
android:id="@+id/linear_describe"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -225,29 +245,31 @@
|
|||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@drawable/underline"
|
android:background="@drawable/underline"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tv_03"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent">
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_03">
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/et_desc"
|
android:id="@+id/et_desc"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:paddingBottom="30dp"
|
|
||||||
android:layout_margin="2dp"
|
android:layout_margin="2dp"
|
||||||
android:gravity="top"
|
android:background="@color/white"
|
||||||
android:paddingLeft="10dp"
|
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:focusableInTouchMode="true"
|
android:focusableInTouchMode="true"
|
||||||
android:background="@color/white"
|
android:gravity="top"
|
||||||
android:hint="任务描述"
|
android:hint="任务描述"
|
||||||
android:textSize="15sp"
|
android:paddingLeft="10dp"
|
||||||
|
android:paddingTop="10dp"
|
||||||
|
android:paddingBottom="30dp"
|
||||||
android:textColor="@color/test_color_selector"
|
android:textColor="@color/test_color_selector"
|
||||||
|
android:textSize="15sp"
|
||||||
|
|
||||||
|
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -34,14 +34,6 @@
|
|||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/btn_video2"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="停止"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintRight_toRightOf="@id/btn_switch2"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/btn_switch2" />
|
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/capuretVideo2"
|
android:id="@+id/capuretVideo2"
|
||||||
|
@ -104,144 +104,134 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:background="#2196F3" />
|
android:background="#2196F3" />
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linear_photograph"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="140dp"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_02"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="150dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/iv_attestation1"
|
|
||||||
android:layout_width="100dp"
|
|
||||||
android:layout_height="100dp"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_margin="10dp"
|
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:scaleType="fitXY"
|
>
|
||||||
android:background="@color/colorPrimaryBlue"
|
<RelativeLayout
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
android:id="@+id/rl_panorama"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
android:layout_width="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
<LinearLayout
|
android:layout_height="match_parent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_marginTop="10dp"
|
||||||
android:layout_height="wrap_content"
|
android:background="@drawable/selector_red_bg"
|
||||||
android:orientation="vertical"
|
android:layout_marginRight="10dp"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/iv_attestation1"
|
android:layout_marginBottom="10dp">
|
||||||
app:layout_constraintLeft_toLeftOf="@id/iv_attestation1"
|
|
||||||
app:layout_constraintRight_toRightOf="@id/iv_attestation1"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/iv_attestation1">
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_hera1"
|
android:id="@+id/iv_hera1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="20dp"
|
||||||
android:layout_gravity="center"
|
android:layout_marginTop="20dp"
|
||||||
android:src="@drawable/card_zhengmian" />
|
android:background="@drawable/card_zhengmian"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_card1"
|
android:id="@+id/tv_card1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_centerHorizontal="true"
|
||||||
android:text="*身份证人像面"
|
|
||||||
android:textColor="@color/white" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/iv_attestation2"
|
|
||||||
android:layout_width="100dp"
|
|
||||||
android:layout_height="100dp"
|
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_margin="10dp"
|
android:text="*身份证人像面"
|
||||||
android:layout_weight="1"
|
android:textSize="12sp"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:layout_below="@id/iv_hera1"
|
||||||
|
/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_attestation1"
|
||||||
android:scaleType="fitXY"
|
android:scaleType="fitXY"
|
||||||
android:background="@color/colorPrimaryBlue"
|
android:layout_centerInParent="true"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
android:layout_width="match_parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
android:layout_height="match_parent"
|
||||||
|
/>
|
||||||
<LinearLayout
|
</RelativeLayout>
|
||||||
android:layout_width="wrap_content"
|
<RelativeLayout
|
||||||
android:layout_height="wrap_content"
|
android:id="@+id/rl_name"
|
||||||
android:orientation="vertical"
|
android:layout_width="0dp"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/iv_attestation2"
|
android:layout_weight="1"
|
||||||
app:layout_constraintLeft_toLeftOf="@id/iv_attestation2"
|
android:layout_height="match_parent"
|
||||||
app:layout_constraintRight_toRightOf="@id/iv_attestation2"
|
android:layout_marginTop="10dp"
|
||||||
app:layout_constraintTop_toTopOf="@id/iv_attestation2">
|
android:background="@drawable/selector_red_bg"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:layout_marginBottom="10dp">
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_hera2"
|
android:id="@+id/iv_hera2"
|
||||||
android:layout_width="wrap_content"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="20dp"
|
||||||
android:layout_gravity="center"
|
android:layout_marginTop="20dp"
|
||||||
android:src="@drawable/card_fanmian" />
|
android:background="@drawable/card_fanmian"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_card2"
|
android:id="@+id/tv_card2"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
android:text="*身份证国徽面"
|
android:text="*身份证国徽面"
|
||||||
android:textColor="@color/white" />
|
android:textSize="12sp"
|
||||||
</LinearLayout>
|
android:layout_margin="5dp"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:layout_below="@id/iv_hera2"
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
/>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<ImageView
|
||||||
|
android:id="@+id/iv_attestation2"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
/>
|
||||||
|
</RelativeLayout>
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_internal_photos"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
>
|
android:layout_marginTop="10dp"
|
||||||
<ImageView
|
android:background="@drawable/selector_red_bg"
|
||||||
android:id="@+id/iv_attestation3"
|
android:layout_marginRight="5dp"
|
||||||
android:layout_width="100dp"
|
android:layout_marginBottom="10dp">
|
||||||
android:layout_height="100dp"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_margin="10dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:scaleType="fitXY"
|
|
||||||
android:background="@color/colorPrimaryBlue"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
/>
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/iv_attestation3"
|
|
||||||
app:layout_constraintLeft_toLeftOf="@id/iv_attestation3"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@id/iv_attestation3"
|
|
||||||
app:layout_constraintRight_toRightOf="@id/iv_attestation3"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_hera3"
|
android:id="@+id/iv_hera3"
|
||||||
android:layout_width="wrap_content"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="20dp"
|
||||||
android:layout_gravity="center"
|
android:layout_marginTop="20dp"
|
||||||
android:src="@drawable/card_shouchi" />
|
android:background="@drawable/card_shouchi"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_card3"
|
android:id="@+id/tv_card3"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
android:text="*手持身份证"
|
android:text="*手持身份证"
|
||||||
android:layout_gravity="center_horizontal"
|
android:textSize="12sp"
|
||||||
android:textColor="@color/white"/>
|
android:layout_margin="5dp"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:layout_below="@id/iv_hera3"
|
||||||
|
/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_attestation3"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
/>
|
||||||
|
</RelativeLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
|
@ -85,7 +85,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:drawableRight="@drawable/ic_baseline_navigate"
|
android:drawableRight="@drawable/ic_baseline_navigate"
|
||||||
android:text="提现纪录"
|
android:text="提现记录"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/tv_unit"
|
app:layout_constraintBottom_toBottomOf="@+id/tv_unit"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@+id/tv_unit" />
|
app:layout_constraintTop_toTopOf="@+id/tv_unit" />
|
||||||
@ -312,6 +312,86 @@
|
|||||||
android:textColor="#333"
|
android:textColor="#333"
|
||||||
android:textSize="18sp" />
|
android:textSize="18sp" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#F1F0F0" />
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="65dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image_poiVideo"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_margin="2dp"
|
||||||
|
android:background="@drawable/poi_square" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="20dp"
|
||||||
|
android:layout_toRightOf="@id/image_poiVideo"
|
||||||
|
android:text="POIVIDEO推送积分"
|
||||||
|
android:textColor="#333"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/poiVideo_push_money"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="+¥0.0"
|
||||||
|
android:textColor="#333"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#F1F0F0" />
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="65dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image_poiVideo_report"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_margin="2dp"
|
||||||
|
android:background="@drawable/poi_square" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="20dp"
|
||||||
|
android:layout_toRightOf="@id/image_poiVideo_report"
|
||||||
|
android:text="POIVIDEO上报任务积分"
|
||||||
|
android:textColor="#333"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/poiVideo_report_money"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="+¥0.0"
|
||||||
|
android:textColor="#333"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
|
@ -2,4 +2,5 @@
|
|||||||
<!--状态栏-->
|
<!--状态栏-->
|
||||||
<dimen name="top_pind_sp">20dp</dimen>
|
<dimen name="top_pind_sp">20dp</dimen>
|
||||||
<dimen name="fab_margin">16dp</dimen>
|
<dimen name="fab_margin">16dp</dimen>
|
||||||
|
<dimen name="default_widget_padding">6dp</dimen>
|
||||||
</resources>
|
</resources>
|
@ -82,6 +82,7 @@
|
|||||||
<!-- ‘我的-用户资料’方框设置-->
|
<!-- ‘我的-用户资料’方框设置-->
|
||||||
<style name="user_style">
|
<style name="user_style">
|
||||||
<item name="android:background">@drawable/selector_red_bg</item>
|
<item name="android:background">@drawable/selector_red_bg</item>
|
||||||
|
<item name="android:padding">@dimen/default_widget_padding</item>
|
||||||
</style>
|
</style>
|
||||||
<!-- ‘我的-用户资料’字体设置-->
|
<!-- ‘我的-用户资料’字体设置-->
|
||||||
<style name="user_text_style">
|
<style name="user_text_style">
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<paths>
|
<paths xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<external-path path="Android/data/com.navinfo.outdoor/" name="files_root" />
|
<external-files-path
|
||||||
<external-path path="." name="external_storage_root" />
|
name="my_images"
|
||||||
|
path="Android/data/com.navinfo.outdoor/files/Pictures" />
|
||||||
</paths>
|
</paths>
|
Loading…
x
Reference in New Issue
Block a user