修改 拍照功能(存在错误)添加‘其他’ 上传接口
This commit is contained in:
parent
aa777a3371
commit
d25b3e1e30
@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion '29.0.2'
|
||||
//ndkVersion '23.0.7123448'
|
||||
ndkVersion '23.0.7123448'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.navinfo.outdoor"
|
||||
|
@ -1,10 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.navinfo.outdoor">
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
|
||||
<uses-permission android:name="android.permission.READ_CALENDAR"/>
|
||||
<uses-permission android:name="android.permission.WRITE_CALENDAR"/>
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
|
||||
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<uses-permission android:name="android.permission.READ_CALENDAR" />
|
||||
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
@ -26,10 +27,6 @@
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <!-- 支持A-GPS辅助定位 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> <!-- 用于 log 日志 -->
|
||||
|
||||
|
||||
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="true" />
|
||||
@ -38,20 +35,23 @@
|
||||
android:name=".api.UserApplication"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.WhiteScreen">
|
||||
|
||||
<activity android:name=".activity.PictureActivity"
|
||||
<activity android:name=".activity.PicturesActivity"
|
||||
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|navigation"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
>
|
||||
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.PictureActivity"
|
||||
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|navigation"
|
||||
android:launchMode="singleTop"></activity>
|
||||
|
||||
<meta-data
|
||||
android:name="TencentMapSDK"
|
||||
android:value="EWWBZ-2PB62-6JXUL-CEX7G-N7UE6-XRB4V" />
|
||||
@ -62,21 +62,28 @@
|
||||
android:name="design_height_in_dp"
|
||||
android:value="800" />
|
||||
|
||||
<activity android:name=".activity.MainActivity">
|
||||
<activity android:name=".activity.MainActivity"
|
||||
android:screenOrientation="portrait">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".activity.LoginActivity" />
|
||||
<activity android:name=".activity.HomeActivity" />
|
||||
<activity android:name=".activity.WebActivity" />
|
||||
<activity android:name=".activity.LoginActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity android:name=".activity.HomeActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity android:name=".activity.WebActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name=".activity.FragmentManagement"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity android:name=".activity.ImageShowActivity" />
|
||||
<activity android:name=".activity.UserActivity" />
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity android:name=".activity.ImageShowActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity android:name=".activity.UserActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -0,0 +1,120 @@
|
||||
package com.navinfo.outdoor.activity;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseActivity;
|
||||
import com.otaliastudios.cameraview.CameraListener;
|
||||
import com.otaliastudios.cameraview.CameraLogger;
|
||||
import com.otaliastudios.cameraview.CameraView;
|
||||
import com.otaliastudios.cameraview.VideoResult;
|
||||
import com.otaliastudios.cameraview.controls.Engine;
|
||||
import com.otaliastudios.cameraview.controls.Mode;
|
||||
import com.tencent.tencentmap.mapsdk.maps.MapView;
|
||||
import com.tencent.tencentmap.mapsdk.maps.TencentMap;
|
||||
import com.tencent.tencentmap.mapsdk.maps.UiSettings;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
|
||||
public class PicturesActivity extends BaseActivity implements View.OnClickListener {
|
||||
private static final CameraLogger LOG = CameraLogger.create("Picture");
|
||||
private com.otaliastudios.cameraview.CameraView cameraView;
|
||||
private android.widget.Button capuretVideo;
|
||||
private android.widget.Button btnStopVideo;
|
||||
// private MapView ivMap;
|
||||
// private TencentMap tencentMap;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.activity_pictures;
|
||||
}
|
||||
//
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
cameraView = (CameraView) findViewById(R.id.cameraView);
|
||||
capuretVideo = (Button) findViewById(R.id.capuretVideo);
|
||||
capuretVideo.setOnClickListener(this::onClick);
|
||||
btnStopVideo = (Button) findViewById(R.id.btn_stop_video);
|
||||
btnStopVideo.setOnClickListener(this::onClick);
|
||||
// ivMap = findViewById(R.id.iv_map);
|
||||
cameraView.setLifecycleOwner(this);
|
||||
cameraView.setEngine(Engine.CAMERA1);
|
||||
cameraView.setMode(Mode.VIDEO);
|
||||
cameraView.addCameraListener(new CameraListener() {
|
||||
@Override
|
||||
public void onVideoTaken(@NonNull @NotNull VideoResult result) {
|
||||
super.onVideoTaken(result);
|
||||
Toast.makeText(PicturesActivity.this, "停止摄像", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
});
|
||||
// tencentMap = ivMap.getMap();
|
||||
//获取地图UI 设置对象
|
||||
// UiSettings uiSettings = tencentMap.getUiSettings();
|
||||
// //设置logo的大小
|
||||
// uiSettings.setLogoScale(0.7f);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.capuretVideo:
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
String format = formatter.format(calendar.getTime());
|
||||
//文件
|
||||
File file = new File(Constant.PICTURE_FOLDER, format + ".mp4");
|
||||
cameraView.takeVideo(file, 15000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
cameraView.open();
|
||||
// ivMap.onResume();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
cameraView.close();
|
||||
// ivMap.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
cameraView.destroy();
|
||||
// ivMap.onDestroy();
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@ import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.bean.JobSearchBean;
|
||||
import com.navinfo.outdoor.util.SdkFolderCreate;
|
||||
import com.tencent.map.geolocation.TencentLocation;
|
||||
import com.tencent.tencentmap.mapsdk.maps.MapView;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptor;
|
||||
import com.tencent.tencentmap.mapsdk.maps.model.BitmapDescriptorFactory;
|
||||
|
||||
@ -90,6 +91,7 @@ public class Constant {
|
||||
|
||||
|
||||
public static JobSearchBean jobSearchBean;//数据
|
||||
public static MapView treasureMap;
|
||||
|
||||
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setScreenRoate(true);
|
||||
// setScreenRoate(true);
|
||||
//初始化,默认透明状态栏和黑色导航栏
|
||||
ImmersionBar.with(this).init();
|
||||
Collector.addActivity(this);
|
||||
|
@ -86,12 +86,12 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
private PoiDao poiDao;
|
||||
private PoiEntity showPoiEntity;
|
||||
private LatLng latLng;
|
||||
private int station_type=0;
|
||||
String[] spinner = new String[]{"存在","不存在","无法验证"};
|
||||
private int station_type = 0;
|
||||
String[] spinner = new String[]{"存在", "不存在", "无法验证"};
|
||||
private RelativeLayout linearExist;
|
||||
private Spinner spinnerExist;
|
||||
|
||||
private ArrayList<Object> otheruploadList;
|
||||
private ArrayList<File> otheruploadList;
|
||||
private String takePhotoPath;
|
||||
private String takePhotoPath2;
|
||||
|
||||
@ -162,13 +162,13 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
switch (position) {
|
||||
case 0:
|
||||
station_type=6;
|
||||
station_type = 6;
|
||||
break;
|
||||
case 1:
|
||||
station_type=7;
|
||||
station_type = 7;
|
||||
break;
|
||||
case 2:
|
||||
station_type=8;
|
||||
station_type = 8;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -244,7 +244,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
showPoiEntity = (PoiEntity) getArguments().getSerializable("poiEntity");
|
||||
if (showPoiEntity != null) {
|
||||
String name = showPoiEntity.getName();//名称
|
||||
if (name != null&&!name.equals("")) {
|
||||
if (name != null && !name.equals("")) {
|
||||
editTaskName.setText(name + "");
|
||||
}
|
||||
String x = showPoiEntity.getX();
|
||||
@ -255,12 +255,12 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
latLng.setLatitude(Double.parseDouble(y));
|
||||
}
|
||||
String describe = showPoiEntity.getDescribe();//任务描述
|
||||
if (describe != null &&!describe.equals("")) {
|
||||
if (describe != null && !describe.equals("")) {
|
||||
editOtherDescribe.setText(describe);
|
||||
}
|
||||
linearExist.setVisibility(View.VISIBLE);
|
||||
int station_type = showPoiEntity.getStation_type();
|
||||
spinnerOther.setSelection(station_type,true);
|
||||
spinnerOther.setSelection(station_type, true);
|
||||
if (showPoiEntity.getPhotoInfo() != null) {
|
||||
for (int i = 0; i < showPoiEntity.getPhotoInfo().size(); i++) {
|
||||
String photo = showPoiEntity.getPhotoInfo().get(i).getPhoto();
|
||||
@ -338,8 +338,8 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
} else {
|
||||
infoList.add(new Info(tagPictures));
|
||||
}
|
||||
if (showPoiEntity!=null){
|
||||
if (showPoiEntity.getTaskId()!=0){
|
||||
if (showPoiEntity != null) {
|
||||
if (showPoiEntity.getTaskId() != 0) {
|
||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
||||
}
|
||||
}
|
||||
@ -388,20 +388,42 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
otheruploadList = new ArrayList<>();
|
||||
File otherUploadFile = new File(takePhotoPath);
|
||||
File otherUploadFile2 = new File(takePhotoPath2);
|
||||
if (!otherUploadFile.exists() || !otherUploadFile2.exists()){
|
||||
if (!otherUploadFile.exists() || !otherUploadFile2.exists()) {
|
||||
Toast.makeText(getContext(), "照片不能为空", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
otheruploadList.add(otherUploadFile);
|
||||
otheruploadList.add(otherUploadFile2);
|
||||
OkGo
|
||||
// 请求方式和请求url
|
||||
.<NameAuthenticationBean>post(HttpInterface.USER_AUTH_ADD)
|
||||
// 请求的 tag, 主要用于取消对应的请求
|
||||
.params("userid", "1")
|
||||
.addFileParams("file", otheruploadList)
|
||||
.tag(this)
|
||||
.execute(new DialogCallback<NameAuthenticationBean>(NameAuthenticationBean.class) {
|
||||
@Override
|
||||
public void onSuccess(Response<NameAuthenticationBean> response) {
|
||||
dismissLoadingDialog();
|
||||
Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Response<NameAuthenticationBean> response) {
|
||||
super.onError(response);
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(getActivity(), response.message(), Toast.LENGTH_SHORT).show();
|
||||
Log.d("TAG", "onError: " + response.message());
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void otherSaveByNetWork(PoiEntity poiEntity) {
|
||||
showLoadingDialog();
|
||||
HttpParams httpParams = new HttpParams();
|
||||
httpParams.put("type",poiEntity.getStation_type());
|
||||
httpParams.put("type", poiEntity.getStation_type());
|
||||
httpParams.put("taskId", poiEntity.getTaskId());
|
||||
httpParams.put("name", poiEntity.getName());
|
||||
httpParams.put("existence", "1");
|
||||
@ -459,15 +481,15 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
poiEntity.setDescribe(describe);
|
||||
}
|
||||
String tagPicture = (String) ivPicture.getTag();
|
||||
if (tagPicture != null &&!tagPicture.equals("")) {
|
||||
if (tagPicture != null && !tagPicture.equals("")) {
|
||||
arrayList.add(new Info(tagPicture));
|
||||
}
|
||||
String tagPictures = (String) ivPictures.getTag();
|
||||
if (tagPictures != null&&!tagPictures.equals("")) {
|
||||
if (tagPictures != null && !tagPictures.equals("")) {
|
||||
arrayList.add(new Info(tagPictures));
|
||||
}
|
||||
if (showPoiEntity!=null){
|
||||
if (showPoiEntity.getTaskId()!=0){
|
||||
if (showPoiEntity != null) {
|
||||
if (showPoiEntity.getTaskId() != 0) {
|
||||
poiEntity.setTaskId(showPoiEntity.getTaskId());
|
||||
}
|
||||
}
|
||||
|
@ -40,15 +40,19 @@ import com.kongzue.dialog.util.BaseDialog;
|
||||
import com.kongzue.dialog.util.DialogSettings;
|
||||
import com.kongzue.dialog.v3.MessageDialog;
|
||||
import com.kongzue.dialog.v3.ShareDialog;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.lzy.okgo.model.Response;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.adapter.PoiRecycleAdapter;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
import com.navinfo.outdoor.bean.Info;
|
||||
import com.navinfo.outdoor.bean.NameAuthenticationBean;
|
||||
import com.navinfo.outdoor.bean.PoiBean;
|
||||
import com.navinfo.outdoor.bean.PoiSaveBean;
|
||||
import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.DialogCallback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||
import com.navinfo.outdoor.room.PoiDao;
|
||||
@ -62,6 +66,7 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
@ -96,6 +101,13 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
String[] spinner = new String[]{"存在","不存在","无法验证"};
|
||||
private RelativeLayout linearExist;
|
||||
private Spinner spinnerExist;
|
||||
private ArrayList<File> poiUploadList;
|
||||
//获取的拍照图片
|
||||
private String takePhotoPath2;
|
||||
private String takePhotoPath5;
|
||||
private String takePhotoPath4;
|
||||
private String takePhotoPath3;
|
||||
private String takePhotoPath1;
|
||||
|
||||
public static PoiFragment newInstance(Bundle bundle) {
|
||||
PoiFragment fragment = new PoiFragment();
|
||||
@ -464,6 +476,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
obtain.what = Constant.TREASURE_FRAGMENT;
|
||||
obtain.obj = false;
|
||||
EventBus.getDefault().post(obtain);
|
||||
poiUploadByNetWork();
|
||||
break;
|
||||
case R.id.tv_examine:
|
||||
Toast.makeText(getContext(), editNameContent.getText().toString(), Toast.LENGTH_SHORT).show();
|
||||
@ -492,6 +505,47 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
}
|
||||
|
||||
private void poiUploadByNetWork() {
|
||||
poiUploadList = new ArrayList<>();
|
||||
File poiUploadFile1 = new File(takePhotoPath1);
|
||||
File poiUploadFile2 = new File(takePhotoPath2);
|
||||
File poiUploadFile3 = new File(takePhotoPath3);
|
||||
File poiUploadFile4 = new File(takePhotoPath4);
|
||||
File poiUploadFile5 = new File(takePhotoPath5);
|
||||
if (!poiUploadFile1.exists()||!poiUploadFile2.exists()||!poiUploadFile3.exists()||!poiUploadFile4.exists()||!poiUploadFile5.exists()){
|
||||
Toast.makeText(getActivity(), "照片不能为空", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
poiUploadList.add(poiUploadFile1);
|
||||
poiUploadList.add(poiUploadFile2);
|
||||
poiUploadList.add(poiUploadFile3);
|
||||
poiUploadList.add(poiUploadFile4);
|
||||
poiUploadList.add(poiUploadFile5);
|
||||
OkGo
|
||||
// 请求方式和请求url
|
||||
.<NameAuthenticationBean>post(HttpInterface.USER_AUTH_ADD)
|
||||
// 请求的 tag, 主要用于取消对应的请求
|
||||
.params("auditId", "1")
|
||||
.addFileParams("file",poiUploadList)
|
||||
.tag(this)
|
||||
.execute(new DialogCallback<NameAuthenticationBean>(NameAuthenticationBean.class) {
|
||||
@Override
|
||||
public void onSuccess(Response<NameAuthenticationBean> response) {
|
||||
dismissLoadingDialog();
|
||||
Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Response<NameAuthenticationBean> response) {
|
||||
super.onError(response);
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(getActivity(), response.message(), Toast.LENGTH_SHORT).show();
|
||||
Log.d("TAG", "onError: " + response.message());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void poiSaveByNet(PoiEntity poiEntity) {
|
||||
showLoadingDialog();
|
||||
HttpParams httpParams = new HttpParams();
|
||||
@ -631,8 +685,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "a");
|
||||
ivPanorama.setTag(takePhotoPath);
|
||||
takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a");
|
||||
ivPanorama.setTag(takePhotoPath1);
|
||||
ivPanorama.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
||||
@ -652,8 +706,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "b");
|
||||
ivName.setTag(takePhotoPath);
|
||||
takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "b");
|
||||
ivName.setTag(takePhotoPath2);
|
||||
ivName.setImageBitmap(bitmap);//显示图像
|
||||
|
||||
}
|
||||
@ -674,8 +728,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "c");
|
||||
ivInternal.setTag(takePhotoPath);
|
||||
takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "c");
|
||||
ivInternal.setTag(takePhotoPath3);
|
||||
ivInternal.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
} else if (requestCode == 104 && resultCode == RESULT_OK) {
|
||||
@ -694,8 +748,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "d");
|
||||
ivCard.setTag(takePhotoPath);
|
||||
takePhotoPath4 = PhotoPathUtil.getTakePhotoPath(data, "d");
|
||||
ivCard.setTag(takePhotoPath4);
|
||||
ivCard.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
} else if (requestCode == 105 && resultCode == RESULT_OK) {
|
||||
@ -714,8 +768,8 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath = PhotoPathUtil.getTakePhotoPath(data, "e");
|
||||
ivElse.setTag(takePhotoPath);
|
||||
takePhotoPath5 = PhotoPathUtil.getTakePhotoPath(data, "e");
|
||||
ivElse.setTag(takePhotoPath5);
|
||||
ivElse.setImageBitmap(bitmap);//显示图像
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,7 @@ import com.hjq.permissions.Permission;
|
||||
import com.hjq.permissions.XXPermissions;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.PictureActivity;
|
||||
import com.navinfo.outdoor.activity.PicturesActivity;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
import com.navinfo.outdoor.bean.RoadExtend;
|
||||
@ -286,7 +287,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
break;
|
||||
|
||||
case R.id.tv_pictures:
|
||||
Intent intent = new Intent(getContext(), PictureActivity.class);
|
||||
Intent intent = new Intent(getContext(), PicturesActivity.class);
|
||||
startActivity(intent);
|
||||
break;
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ import com.hjq.permissions.Permission;
|
||||
import com.hjq.permissions.XXPermissions;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.PictureActivity;
|
||||
import com.navinfo.outdoor.activity.PicturesActivity;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
import com.navinfo.outdoor.bean.PoiBean;
|
||||
@ -293,7 +294,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
break;
|
||||
|
||||
case R.id.tv_pictures:
|
||||
Intent intent = new Intent(getContext(), PictureActivity.class);
|
||||
Intent intent = new Intent(getContext(), PicturesActivity.class);
|
||||
startActivity(intent);
|
||||
break;
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
android:id="@+id/camera"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:keepScreenOn="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
67
app/src/main/res/layout/activity_pictures.xml
Normal file
67
app/src/main/res/layout/activity_pictures.xml
Normal file
@ -0,0 +1,67 @@
|
||||
<?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:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#FF444444"
|
||||
tools:context=".activity.PicturesActivity">
|
||||
|
||||
<com.otaliastudios.cameraview.CameraView
|
||||
android:id="@+id/cameraView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
/>
|
||||
|
||||
<!-- <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" />
|
||||
|
||||
<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
|
||||
android:id="@+id/capuretVideo"
|
||||
style="@style/user_data_style"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:text="开始采集"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/btn_stop_video" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_stop_video"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/uploding_shape"
|
||||
android:text="结束采集"
|
||||
android:textColor="@color/colorBlue"
|
||||
app:layout_constraintBottom_toBottomOf="@id/capuretVideo"
|
||||
app:layout_constraintLeft_toRightOf="@id/capuretVideo"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
x
Reference in New Issue
Block a user