修改点位作业的拍照

This commit is contained in:
wangdongsheng 2021-09-10 18:17:41 +08:00
parent 30c374b2d9
commit 5ace14ca36
14 changed files with 419 additions and 513 deletions

View File

@ -58,8 +58,10 @@
android:name=".activity.PictureActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|navigation"
android:launchMode="singleTop" />
<activity android:name=".activity.PhotographActivity"
android:screenOrientation="portrait" />
<activity
android:name=".activity.PhotographActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|navigation"
android:launchMode="singleTop" />
<meta-data
android:name="TencentMapSDK"

View File

@ -74,9 +74,8 @@ import static com.tencent.tencentmap.mapsdk.maps.model.MyLocationStyle.LOCATION_
/**
* 照片对应
*/
public class PhotographActivity extends BaseActivity implements View.OnClickListener {
private static final CameraLogger LOG = CameraLogger.create("Picture");
private CameraView cameraView;
private String photo_path;
@ -105,6 +104,8 @@ public class PhotographActivity extends BaseActivity implements View.OnClickList
if (getIntent()!=null){
photo_path = getIntent().getStringExtra(Constant.INTENT_PHOTO_PATH);
}
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE);
cameraView = findViewById(R.id.camera);
cameraView.setOnClickListener(this);
Button btnCapturePicture = findViewById(R.id.capture_picture);
@ -152,5 +153,4 @@ public class PhotographActivity extends BaseActivity implements View.OnClickList
EventBus.getDefault().unregister(this);
}
}
}

View File

@ -588,7 +588,6 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
public void benSwitch() {
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
System.out.println("width-display :" + dm.widthPixels);
System.out.println("height-display :" + dm.heightPixels);
FrameLayout.LayoutParams layoutParamsMap = (FrameLayout.LayoutParams) ivMap.getLayoutParams();//地图的宽高
@ -630,7 +629,6 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
ivZoomDel.setVisibility(View.GONE);
ivLocation.setVisibility(View.GONE);
setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE);
}
//大图
@ -640,7 +638,6 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
ivZoomDel.setVisibility(View.VISIBLE);
ivLocation.setVisibility(View.VISIBLE);
setLocMarkerStyle(LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER);
}
@Override
@ -662,8 +659,6 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
super.onPause();
camera.close();
stopTakenVideo();
}
@Override
@ -738,7 +733,9 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
sb.append("\r\n");
LatLng latLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.circle);
Marker marker = tencentMap.addMarker(new MarkerOptions(latLng).icon(pileDescriptor).alpha(0.9f)
Marker marker = tencentMap.addMarker(new MarkerOptions(latLng)
.icon(pileDescriptor)
.alpha(0.9f)
.flat(true)
.clockwise(false));
removables.add(marker);

View File

@ -41,6 +41,7 @@ import com.kongzue.dialog.v3.MessageDialog;
import com.lzy.okgo.model.HttpParams;
import com.navinfo.outdoor.R;
import com.navinfo.outdoor.activity.FragmentManagement;
import com.navinfo.outdoor.activity.PhotographActivity;
import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.base.BaseDrawerFragment;
import com.navinfo.outdoor.bean.ChargingPileSaveBean;
@ -108,7 +109,6 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
private String pid;
private String station;
private LatLng latLng;
private File file;
private Marker markerPile;
private Point screenPilePositions;
private ChargingPileEntity chargingPileEntity;
@ -909,64 +909,64 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
});
break;
case R.id.rl_panorama:
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("a", latLng);
intentPanorama.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
Intent intentPanorama = new Intent(getActivity(), PhotographActivity.class);
File panoramaFile = PhotoUtils.showPhotoFile("a", latLng);
intentPanorama.putExtra(Constant.INTENT_PHOTO_PATH, panoramaFile.getPath());
startActivityForResult(intentPanorama, 101);
break;
case R.id.rl_coding:
Intent intentCoding = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("b", latLng);
intentCoding.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
Intent intentCoding = new Intent(getActivity(), PhotographActivity.class);
File codingFile = PhotoUtils.showPhotoFile("b", latLng);
intentCoding.putExtra(Constant.INTENT_PHOTO_PATH, codingFile.getPath());
startActivityForResult(intentCoding, 102);
break;
case R.id.rl_equipment:
Intent intentEquipment = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("c", latLng);
intentEquipment.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
Intent intentEquipment = new Intent(getActivity(), PhotographActivity.class);
File equipmentFile = PhotoUtils.showPhotoFile("c", latLng);
intentEquipment.putExtra(Constant.INTENT_PHOTO_PATH, equipmentFile.getPath());
startActivityForResult(intentEquipment, 103);
break;
case R.id.rl_facility:
Intent intentFacility = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("c", latLng);
intentFacility.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
Intent intentFacility = new Intent(getActivity(), PhotographActivity.class);
File facilityFile = PhotoUtils.showPhotoFile("c", latLng);
intentFacility.putExtra(Constant.INTENT_PHOTO_PATH, facilityFile.getPath());
startActivityForResult(intentFacility, 104);
break;
case R.id.rl_scutcheon:
Intent intentScutcheon = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("c", latLng);
intentScutcheon.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
Intent intentScutcheon = new Intent(getActivity(), PhotographActivity.class);
File scutcheonFile = PhotoUtils.showPhotoFile("c", latLng);
intentScutcheon.putExtra(Constant.INTENT_PHOTO_PATH, scutcheonFile.getPath());
startActivityForResult(intentScutcheon, 105);
break;
case R.id.rl_device:
Intent intentDevice = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("c", latLng);
intentDevice.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
Intent intentDevice = new Intent(getActivity(), PhotographActivity.class);
File deviceFile = PhotoUtils.showPhotoFile("c", latLng);
intentDevice.putExtra(Constant.INTENT_PHOTO_PATH, deviceFile.getPath());
startActivityForResult(intentDevice, 106);
break;
case R.id.rl_usable:
Intent intentUsable = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("d", latLng);
intentUsable.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
Intent intentUsable = new Intent(getActivity(), PhotographActivity.class);
File usableFile = PhotoUtils.showPhotoFile("d", latLng);
intentUsable.putExtra(Constant.INTENT_PHOTO_PATH, usableFile.getPath());
startActivityForResult(intentUsable, 107);
break;
case R.id.rl_available:
Intent intentAvailable = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("d", latLng);
intentAvailable.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
Intent intentAvailable = new Intent(getActivity(), PhotographActivity.class);
File availableFile = PhotoUtils.showPhotoFile("d", latLng);
intentAvailable.putExtra(Constant.INTENT_PHOTO_PATH, availableFile.getPath());
startActivityForResult(intentAvailable, 108);
break;
case R.id.rl_parking:
Intent intentParking = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("e", latLng);
intentParking.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
Intent intentParking = new Intent(getActivity(), PhotographActivity.class);
File parkingFile = PhotoUtils.showPhotoFile("e", latLng);
intentParking.putExtra(Constant.INTENT_PHOTO_PATH, parkingFile.getPath());
startActivityForResult(intentParking, 109);
break;
case R.id.rl_number:
Intent intentNumber = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("e", latLng);
intentNumber.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
Intent intentNumber = new Intent(getActivity(), PhotographActivity.class);
File numberFile = PhotoUtils.showPhotoFile("e", latLng);
intentNumber.putExtra(Constant.INTENT_PHOTO_PATH, numberFile.getPath());
startActivityForResult(intentNumber, 110);
break;
@ -1058,114 +1058,98 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 101 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getActivity(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
return;
} else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivPanorama);
tvPanorama.setTag(s);
}
file = null;
} else if (requestCode == 102 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getActivity(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
return;
} else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivCoding);
tvCoding.setTag(s);
}
file = null;
} else if (requestCode == 103 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getActivity(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
return;
} else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivEquipment);
tvEquipment.setTag(s);
}
file = null;
} else if (requestCode == 104 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getActivity(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
return;
} else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivFacility);
tvFacility.setTag(s);
}
file = null;
} else if (requestCode == 105 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getActivity(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
return;
} else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivScutcheon);
tvScutcheon.setTag(s);
}
file = null;
} else if (requestCode == 106 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getActivity(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
return;
} else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivDevice);
tvDevice.setTag(s);
}
file = null;
} else if (requestCode == 107 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getActivity(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
return;
} else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivUsable);
tvUsable.setTag(s);
}
file = null;
} else if (requestCode == 108 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getActivity(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
return;
} else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivAvailable);
tvAvailable.setTag(s);
}
file = null;
} else if (requestCode == 109 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getActivity(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
return;
} else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivParking);
tvParking.setTag(s);
}
file = null;
} else if (requestCode == 110 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getActivity(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
return;
} else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivNumber);
tvNumber.setTag(s);
}
file = null;
if (resultCode==0x104){
if (requestCode==101){
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivPanorama);
tvPanorama.setTag(andGetPath);
}
} else if (requestCode==102){
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivCoding);
tvCoding.setTag(andGetPath);
}
}else if (requestCode==103){
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivEquipment);
tvEquipment.setTag(andGetPath);
}
}else if (requestCode==104){
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivFacility);
tvFacility.setTag(andGetPath);
}
}else if (requestCode==105){
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivScutcheon);
tvScutcheon.setTag(andGetPath);
}
}else if (requestCode==106){
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivDevice);
tvDevice.setTag(andGetPath);
}
}else if (requestCode==107){
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivUsable);
tvUsable.setTag(andGetPath);
}
}else if (requestCode==108){
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivAvailable);
tvAvailable.setTag(andGetPath);
}
}else if (requestCode==109){
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivParking);
tvParking.setTag(andGetPath);
}
}else if (requestCode==110){
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivNumber);
tvNumber.setTag(andGetPath);
}
}
}
}

View File

@ -42,6 +42,7 @@ import com.kongzue.dialog.v3.MessageDialog;
import com.lzy.okgo.model.HttpParams;
import com.navinfo.outdoor.R;
import com.navinfo.outdoor.activity.FragmentManagement;
import com.navinfo.outdoor.activity.PhotographActivity;
import com.navinfo.outdoor.adapter.ChargingPileAdapter;
import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.base.BaseDrawerFragment;
@ -126,7 +127,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
String str = "";
// private ArrayList<File> fileList;
private File photoFile; // 拍照保存的路径
private NestedScrollView nestedScrollView;
private Marker markerStation;
private Point screenStationPositions;
@ -844,33 +844,33 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
findingDuplicateByWork();
break;
case R.id.rl_panorama:
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
photoFile = PhotoUtils.showPhotoFile("a", latLng);
intentPanorama.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile));
Intent intentPanorama = new Intent(getActivity(), PhotographActivity.class);
File PanoramaFile = PhotoUtils.showPhotoFile("a", latLng);
intentPanorama.putExtra(Constant.INTENT_PHOTO_PATH, PanoramaFile.getPath());
startActivityForResult(intentPanorama, 101);
break;
case R.id.rl_name:
Intent intentName = new Intent("android.media.action.IMAGE_CAPTURE");
photoFile = PhotoUtils.showPhotoFile("b", latLng);
intentName.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile));
Intent intentName = new Intent(getActivity(), PhotographActivity.class);
File nameFile = PhotoUtils.showPhotoFile("b", latLng);
intentName.putExtra(Constant.INTENT_PHOTO_PATH, nameFile.getPath());
startActivityForResult(intentName, 102);
break;
case R.id.rl_internal_photos:
Intent intentInternal = new Intent("android.media.action.IMAGE_CAPTURE");
photoFile = PhotoUtils.showPhotoFile("c", latLng);
intentInternal.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile));
Intent intentInternal = new Intent(getActivity(), PhotographActivity.class);
File internalFile = PhotoUtils.showPhotoFile("c", latLng);
intentInternal.putExtra(Constant.INTENT_PHOTO_PATH, internalFile.getPath());
startActivityForResult(intentInternal, 103);
break;
case R.id.rl_else:
Intent intentElse = new Intent("android.media.action.IMAGE_CAPTURE");
photoFile = PhotoUtils.showPhotoFile("d", latLng);
intentElse.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile));
Intent intentElse = new Intent(getActivity(), PhotographActivity.class);
File elseFile = PhotoUtils.showPhotoFile("d", latLng);
intentElse.putExtra(Constant.INTENT_PHOTO_PATH, elseFile.getPath());
startActivityForResult(intentElse, 104);
break;
case R.id.rl_scutcheon:
Intent intentScutcheon = new Intent("android.media.action.IMAGE_CAPTURE");
photoFile = PhotoUtils.showPhotoFile("e", latLng);
intentScutcheon.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile));
Intent intentScutcheon = new Intent(getActivity(), PhotographActivity.class);
File scutcheonFile = PhotoUtils.showPhotoFile("e", latLng);
intentScutcheon.putExtra(Constant.INTENT_PHOTO_PATH, scutcheonFile.getPath());
startActivityForResult(intentScutcheon, 105);
break;
case R.id.linear_charging_pile:
@ -1313,46 +1313,53 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 101 && resultCode == RESULT_OK) {
if (photoFile == null || !photoFile.exists()) {
ToastUtil.showShort(getActivity(), "取消拍照");
return;
if (resultCode==0x104){
if (requestCode==101){
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivPanorama);
tvPanorama.setTag(andGetPath);
}
}else if (requestCode==102){
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivName);
tvNamePic.setTag(andGetPath);
}
}else if (requestCode==103){
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivInternal);
tvInternal.setTag(andGetPath);
}
}else if (requestCode==104){
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivElse);
tvElse.setTag(andGetPath);
}
}else if (requestCode==105){
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivScutcheon);
tvScutcheon.setTag(andGetPath);
}
}
String photoPath = PhotoUtils.showPhotoAndGetPath(photoFile, ivPanorama);
tvPanorama.setTag(photoPath);
photoFile = null;
} else if (requestCode == 102 && resultCode == RESULT_OK) {
if (photoFile == null || !photoFile.exists()) {
ToastUtil.showShort(getActivity(), "取消拍照");
return;
}
String photoPath = PhotoUtils.showPhotoAndGetPath(photoFile, ivName);
tvNamePic.setTag(photoPath);
photoFile = null;
} else if (requestCode == 103 && resultCode == RESULT_OK) {
if (photoFile == null || !photoFile.exists()) {
ToastUtil.showShort(getActivity(), "取消拍照");
return;
}
String photoPath = PhotoUtils.showPhotoAndGetPath(photoFile, ivInternal);
tvInternal.setTag(photoPath);
photoFile = null;
} else if (requestCode == 104 && resultCode == RESULT_OK) {
if (photoFile == null || !photoFile.exists()) {
ToastUtil.showShort(getActivity(), "取消拍照");
return;
}
String photoPath = PhotoUtils.showPhotoAndGetPath(photoFile, ivElse);
tvElse.setTag(photoPath);
photoFile = null;
} else if (requestCode == 105 && resultCode == RESULT_OK) {
if (photoFile == null || !photoFile.exists()) {
ToastUtil.showShort(getActivity(), "取消拍照");
return;
}
String photoPath = PhotoUtils.showPhotoAndGetPath(photoFile, ivScutcheon);
tvScutcheon.setTag(photoPath);
photoFile = null;
}
}

View File

@ -28,6 +28,7 @@ import com.kongzue.dialog.util.BaseDialog;
import com.kongzue.dialog.v3.MessageDialog;
import com.lzy.okgo.model.HttpParams;
import com.navinfo.outdoor.R;
import com.navinfo.outdoor.activity.PhotographActivity;
import com.navinfo.outdoor.adapter.BankAdapter;
import com.navinfo.outdoor.api.BankCard;
import com.navinfo.outdoor.api.Constant;
@ -60,7 +61,6 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
private ArrayList<BankPathBean> jsonBean;
private String value;
private File file;
public static GatheringFragment newInstance(Bundle bundle) {
@ -152,9 +152,9 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
gatheringNetWork();
break;
case R.id.gathering_camera:
Intent gatheringNumberIntent = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("a", null);
gatheringNumberIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
Intent gatheringNumberIntent = new Intent(getActivity(), PhotographActivity.class);
File file = PhotoUtils.showPhotoFile("a", null);
gatheringNumberIntent.putExtra(Constant.INTENT_PHOTO_PATH, file.getPath());
startActivityForResult(gatheringNumberIntent, 131);
break;
}
@ -223,24 +223,28 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 131 && resultCode == RESULT_OK) {
if (file == null||!file.exists()) {
Toast.makeText(getActivity(), "请先拍照", Toast.LENGTH_SHORT).show();
return;
}
String absolutePath = file.getAbsolutePath();
Constant.FILE_PATH = absolutePath;
gatheringCamera.setTag(absolutePath);
//银行卡识别
BankCardBean bankCardBean = new Gson().fromJson(BankCard.bankCard(), BankCardBean.class);
if (bankCardBean==null){
Toast.makeText(getContext(), "请手动添加银行卡号", Toast.LENGTH_SHORT).show();
}else {
if (bankCardBean.getResult()!=null&&bankCardBean.getResult().getBank_card_number()!=null){
String bank_card_number = bankCardBean.getResult().getBank_card_number();
etBankNum.setText(bank_card_number);
}else {
Toast.makeText(getActivity(), "请拍银行卡照片", Toast.LENGTH_SHORT).show();
if (resultCode == 0x104) {
if (requestCode == 131) {
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String absolutePath = videoFile.getAbsolutePath();
Constant.FILE_PATH = absolutePath;
gatheringCamera.setTag(absolutePath);
//银行卡识别
BankCardBean bankCardBean = new Gson().fromJson(BankCard.bankCard(), BankCardBean.class);
if (bankCardBean==null){
Toast.makeText(getContext(), "请手动添加银行卡号", Toast.LENGTH_SHORT).show();
}else {
if (bankCardBean.getResult()!=null&&bankCardBean.getResult().getBank_card_number()!=null){
String bank_card_number = bankCardBean.getResult().getBank_card_number();
etBankNum.setText(bank_card_number);
}else {
Toast.makeText(getActivity(), "请拍银行卡照片", Toast.LENGTH_SHORT).show();
}
}
}
}
}

View File

@ -31,7 +31,7 @@ import java.util.Objects;
/**
* 寻宝-消息的Fragment
*/
public class MessageFragment extends BaseFragment implements View.OnClickListener {
public class MessageFragment extends BaseFragment implements View.OnClickListener {
private MessageAdapter messageAdapter;
private int messagePage = 1;
@ -108,8 +108,6 @@ public class MessageFragment extends BaseFragment implements View.OnClickListene
}else {
Toast.makeText(getActivity(), taskPrefectureBean.getMessage()+"", Toast.LENGTH_SHORT).show();
}
Log.d("TAG", "onSuccess: " + taskPrefectureBean.getMessage() + "");
//initTaskSpecification(taskSpecificationBean,start);
}

View File

@ -1,5 +1,6 @@
package com.navinfo.outdoor.fragment;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.os.Message;
@ -61,6 +62,7 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
return R.layout.mine_fragment;
}
@SuppressLint("SetTextI18n")
@Override
protected void initView() {
super.initView();
@ -96,7 +98,7 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
mainGrade = (TextView) findViewById(R.id.main_grade);
tvMainGrade = findViewById(R.id.tv_main_grade);
if (Constant.LEVEL != 0) {
tvMainGrade.setText(Constant.LEVEL);
tvMainGrade.setText(Constant.LEVEL+"");
}
initNetWork();
@ -171,21 +173,21 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
intentWithdraw.putExtra("tag", 15);
startActivity(intentWithdraw);
break;
// Intent intentGrade = new Intent(getActivity(), FragmentManagement.class);
// intentGrade.putExtra("tag", 17);
// startActivity(intentGrade);
// Intent intentPrivilege = new Intent(getActivity(), FragmentManagement.class);
// intentPrivilege.putExtra("tag", 18);
// startActivity(intentPrivilege);
// Intent intentMap = new Intent(getActivity(), FragmentManagement.class);
// intentMap.putExtra("tag", 19);
// startActivity(intentMap);
// Intent intentIssue = new Intent(getActivity(), FragmentManagement.class);
// intentIssue.putExtra("tag", 20);
// startActivity(intentIssue);
// Intent intentSet = new Intent(getActivity(), FragmentManagement.class);
// intentSet.putExtra("tag", 22);
// startActivity(intentSet);
// Intent intentGrade = new Intent(getActivity(), FragmentManagement.class);
// intentGrade.putExtra("tag", 17);
// startActivity(intentGrade);
// Intent intentPrivilege = new Intent(getActivity(), FragmentManagement.class);
// intentPrivilege.putExtra("tag", 18);
// startActivity(intentPrivilege);
// Intent intentMap = new Intent(getActivity(), FragmentManagement.class);
// intentMap.putExtra("tag", 19);
// startActivity(intentMap);
// Intent intentIssue = new Intent(getActivity(), FragmentManagement.class);
// intentIssue.putExtra("tag", 20);
// startActivity(intentIssue);
// Intent intentSet = new Intent(getActivity(), FragmentManagement.class);
// intentSet.putExtra("tag", 22);
// startActivity(intentSet);
case R.id.rl_contact://联系我们
Intent intentContact = new Intent(getActivity(), FragmentManagement.class);
intentContact.putExtra("tag", 21);

View File

@ -636,7 +636,6 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivPicture, 500);
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivPicture);
tvPicture.setTag(andGetPath);
}
@ -646,33 +645,11 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivPictures, 500);
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivPictures);
tvPictures.setTag(andGetPath);
}
}
}
/* if (requestCode == 101 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getActivity(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
return;
} else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivPicture);
tvPicture.setTag(s);
}
file = null;
} else if (requestCode == 102 && resultCode == RESULT_OK) {
//照片路径
if (file == null || !file.exists()) {
Toast.makeText(getActivity(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
return;
} else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivPictures);
tvPictures.setTag(s);
}
file = null;
}*/
}
@Override

View File

@ -41,6 +41,7 @@ import com.kongzue.dialog.v3.MessageDialog;
import com.lzy.okgo.model.HttpParams;
import com.navinfo.outdoor.R;
import com.navinfo.outdoor.activity.FragmentManagement;
import com.navinfo.outdoor.activity.PhotographActivity;
import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.base.BaseDrawerFragment;
import com.navinfo.outdoor.bean.GetPhoneBean;
@ -111,7 +112,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
private LinearLayout linearContact;
private ContactView contactView;
private ArrayList<File> poiPicList;
private File file;
private Marker markerPoi;
private Point screenPoiPositions;
@ -648,33 +648,33 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
findingDuplicateByWork();
break;
case R.id.rl_panorama:
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("a", latLng);
intentPanorama.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
Intent intentPanorama = new Intent(getActivity(), PhotographActivity.class);
File filePanorama = PhotoUtils.showPhotoFile("a", latLng);
intentPanorama.putExtra(Constant.INTENT_PHOTO_PATH, filePanorama.getPath());
startActivityForResult(intentPanorama, 101);
break;
case R.id.rl_name:
Intent intentName = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("b", latLng);
intentName.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
Intent intentName = new Intent(getActivity(), PhotographActivity.class);
File fileName = PhotoUtils.showPhotoFile("b", latLng);
intentName.putExtra(Constant.INTENT_PHOTO_PATH, fileName.getPath());
startActivityForResult(intentName, 102);
break;
case R.id.rl_internal_photos:
Intent intentInternal = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("c", latLng);
intentInternal.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
Intent intentInternal = new Intent(getActivity(), PhotographActivity.class);
File fileInternal = PhotoUtils.showPhotoFile("c", latLng);
intentInternal.putExtra(Constant.INTENT_PHOTO_PATH, fileInternal.getPath());
startActivityForResult(intentInternal, 103);
break;
case R.id.rl_card:
Intent intentCard = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("d", latLng);
intentCard.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
Intent intentCard = new Intent(getActivity(), PhotographActivity.class);
File fileCard = PhotoUtils.showPhotoFile("d", latLng);
intentCard.putExtra(Constant.INTENT_PHOTO_PATH, fileCard.getPath());
startActivityForResult(intentCard, 104);
break;
case R.id.rl_else:
Intent intentElse = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("e", latLng);
intentElse.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
Intent intentElse = new Intent(getActivity(), PhotographActivity.class);
File fileElse = PhotoUtils.showPhotoFile("e", latLng);
intentElse.putExtra(Constant.INTENT_PHOTO_PATH, fileElse.getPath());
startActivityForResult(intentElse, 105);
break;
}
@ -925,128 +925,53 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 101 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getActivity(), "请先拍照", Toast.LENGTH_SHORT).show();
return;
} else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivPanorama);
tvPanorama.setTag(s);
if (resultCode==0x104){
if (requestCode==101){
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivPanorama);
tvPanorama.setTag(andGetPath);
}
}else if (requestCode==102){
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivName);
tvPoiNamePic.setTag(andGetPath);
}
}else if (requestCode==103){
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivInternal);
tvInternal.setTag(andGetPath);
}
}else if (requestCode==104){
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivCard);
tvCard.setTag(andGetPath);
}
}else if (requestCode==105){
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivElse);
tvElse.setTag(andGetPath);
}
}
file = null;
/* 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, 101);
return false;
}
});
} else {
}*/
} else if (requestCode == 102 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getActivity(), "请先拍照", Toast.LENGTH_SHORT).show();
return;
} else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivName);
tvPoiNamePic.setTag(s);
}
file = null;
/* 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, 102);
return false;
}
});
} else {
}*/
} else if (requestCode == 103 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getActivity(), "请先拍照", Toast.LENGTH_SHORT).show();
return;
} else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivInternal);
tvInternal.setTag(s);
}
file = null;
/*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, 103);
return false;
}
});
} else {
}*/
} else if (requestCode == 104 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getActivity(), "请先拍照", Toast.LENGTH_SHORT).show();
return;
} else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivCard);
tvCard.setTag(s);
}
file = null;
/* 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, 104);
return false;
}
});
} else {
}*/
} else if (requestCode == 105 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getActivity(), "请先拍照", Toast.LENGTH_SHORT).show();
return;
} else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivElse);
tvElse.setTag(s);
}
file = null;
/* 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, 105);
return false;
}
});
} else {}*/
}
}

View File

@ -23,6 +23,7 @@ import com.kongzue.dialog.util.DialogSettings;
import com.kongzue.dialog.v3.MessageDialog;
import com.lzy.okgo.model.HttpParams;
import com.navinfo.outdoor.R;
import com.navinfo.outdoor.activity.PhotographActivity;
import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.api.IdCard;
import com.navinfo.outdoor.base.BaseFragment;
@ -57,11 +58,10 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
private TextView tvCard2;
private ImageView ivHera3;
private TextView tvCard3;
private File file;
private LinearLayout linearHint;
private TextView tvTitle;
private LinearLayout linearLayout;
private View userAttestView;
/* private LinearLayout linearHint;
private TextView tvTitle;
private LinearLayout linearLayout;
private View userAttestView;*/
private ImageView useCamera;
@ -112,8 +112,8 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
LinearLayout linearLayout = findViewById(R.id.ll_pic);//身份证照片
useCamera = findViewById(R.id.user_attestation_camera);
useCamera.setOnClickListener(this);
if (Constant.AUDIOTAPES ==-1){//审核中
if (Constant.NAME!=null&&Constant.ID_NUM!=null){
if (Constant.AUDIOTAPES == -1) {//审核中
if (Constant.NAME != null && Constant.ID_NUM != null) {
tvTitle.setText("1.审核中");
linearHint.setVisibility(View.VISIBLE);
etAttestationName.setText(Constant.NAME);
@ -121,20 +121,20 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
etAttestationName.setEnabled(false);
etNamePhone.setEnabled(false);
btnAttestation.setEnabled(false);
}else {
} else {
linearHint.setVisibility(View.GONE);
etAttestationName.setEnabled(true);
etNamePhone.setEnabled(true);
btnAttestation.setEnabled(true);
}
}else if (Constant.AUDIOTAPES ==0){//不通过
} else if (Constant.AUDIOTAPES == 0) {//不通过
linearHint.setVisibility(View.GONE);
etAttestationName.setText(Constant.NAME);
etNamePhone.setText(Constant.ID_NUM);
etAttestationName.setEnabled(true);
etNamePhone.setEnabled(true);
btnAttestation.setEnabled(true);
}else if (Constant.AUDIOTAPES ==1){//通过
} else if (Constant.AUDIOTAPES == 1) {//通过
tvTitle.setText("1.审核通过");
linearHint.setVisibility(View.VISIBLE);
etAttestationName.setText(Constant.NAME);
@ -157,21 +157,21 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
Objects.requireNonNull(getActivity()).finish();
break;
case R.id.iv_attestation1:
Intent ivAttestationIntent1 = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("a", null);
ivAttestationIntent1.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
Intent ivAttestationIntent1 = new Intent(getActivity(), PhotographActivity.class);
File attestationFile1 = PhotoUtils.showPhotoFile("a", null);
ivAttestationIntent1.putExtra(Constant.INTENT_PHOTO_PATH, attestationFile1.getPath());
startActivityForResult(ivAttestationIntent1, 121);
break;
case R.id.iv_attestation2:
Intent ivAttestationIntent2 = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("b", null);
ivAttestationIntent2.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
Intent ivAttestationIntent2 = new Intent(getActivity(), PhotographActivity.class);
File attestationFile2 = PhotoUtils.showPhotoFile("b", null);
ivAttestationIntent2.putExtra(Constant.INTENT_PHOTO_PATH, attestationFile2.getPath());
startActivityForResult(ivAttestationIntent2, 122);
break;
case R.id.iv_attestation3:
Intent ivAttestationIntent3 = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("c", null);
ivAttestationIntent3.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
Intent ivAttestationIntent3 = new Intent(getActivity(), PhotographActivity.class);
File attestationFile3 = PhotoUtils.showPhotoFile("c", null);
ivAttestationIntent3.putExtra(Constant.INTENT_PHOTO_PATH, attestationFile3.getPath());
startActivityForResult(ivAttestationIntent3, 123);
break;
case R.id.btn_attestation:
@ -190,9 +190,9 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
nameAuthentication();
break;
case R.id.user_attestation_camera:
Intent userCameraIntent = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("d", null);
userCameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
Intent userCameraIntent = new Intent(getActivity(), PhotographActivity.class);
File file = PhotoUtils.showPhotoFile("d", null);
userCameraIntent.putExtra(Constant.INTENT_PHOTO_PATH, file.getPath());
startActivityForResult(userCameraIntent, 124);
break;
}
@ -270,24 +270,24 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
@Override
public void onSuccess(NameAuthenticationBean response, int id) {
dismissLoadingDialog();
if (response.getCode()==200){
if (response.getCode() == 200) {
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "提交成功", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
Constant.NAME=attestationName;
Constant.ID_NUM=namePhone;
Constant.AUDIOTAPES =-1;
getActivity().finish();
Constant.NAME = attestationName;
Constant.ID_NUM = namePhone;
Constant.AUDIOTAPES = -1;
getActivity().finish();
return false;
}
});
}else {
} else {
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
MessageDialog.show((AppCompatActivity) Objects.requireNonNull(getActivity()), "提示", "提交失败", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
Toast.makeText(getActivity(), response.getMessage()+"", Toast.LENGTH_SHORT).show();
Toast.makeText(getActivity(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
return false;
}
});
@ -297,7 +297,7 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();
Log.d("TAG", "onSuccess: sss********sssssssssssss 失败" + e.getMessage() + "");
Log.d("TAG", "onSuccess: 失败" + e.getMessage() + "");
}
});
}
@ -305,70 +305,72 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 121 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getActivity(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
return;
} else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivAttestation1);
tvCard1.setTag(s);
}
file = null;
ivHera1.setVisibility(View.GONE);
tvCard1.setVisibility(View.GONE);
} else if (requestCode == 122 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getActivity(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
return;
} else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivAttestation2);
tvCard2.setTag(s);
}
file = null;
ivHera2.setVisibility(View.GONE);
tvCard2.setVisibility(View.GONE);
} else if (requestCode == 123 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getActivity(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
return;
} else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivAttestation3);
tvCard3.setTag(s);
}
file = null;
ivHera3.setVisibility(View.GONE);
tvCard3.setVisibility(View.GONE);
}else if (requestCode == 124 && resultCode == RESULT_OK){
if (file == null || !file.exists()) {
Toast.makeText(getActivity(), "请先拍照", Toast.LENGTH_SHORT).show();
return;
}
String absolutePath = file.getAbsolutePath();
Constant.FILE_PATH = absolutePath;
useCamera.setTag(absolutePath);
//身份证识别
String idcard = IdCard.icarus();
if (idcard!=null){
IdCardNumberBean idCardNumberBean = new Gson().fromJson(idcard, IdCardNumberBean.class);
if (idCardNumberBean ==null){
Toast.makeText(getActivity(), "请手动添加身份证号", Toast.LENGTH_SHORT).show();
}else {
if (idCardNumberBean.getWords_result().get公民身份号码()!=null){
String words = idCardNumberBean.getWords_result().get公民身份号码().getWords();
etNamePhone.setText(words);
}else {
Toast.makeText(getActivity(), "请拍身份证照片", Toast.LENGTH_SHORT).show();
}
if (resultCode == 0x104) {
if (requestCode == 121) {
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivAttestation1);
tvCard1.setTag(andGetPath);
}
}else {
Toast.makeText(getActivity(), "请手动添加身份证号", Toast.LENGTH_SHORT).show();
}
ivHera1.setVisibility(View.GONE);
tvCard1.setVisibility(View.GONE);
} else if (requestCode == 122) {
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivAttestation2);
tvCard2.setTag(andGetPath);
}
ivHera2.setVisibility(View.GONE);
tvCard2.setVisibility(View.GONE);
} else if (requestCode == 123) {
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String andGetPath = PhotoUtils.showPhotoAndGetPath(videoFile, ivAttestation3);
tvCard3.setTag(andGetPath);
}
ivHera3.setVisibility(View.GONE);
tvCard3.setVisibility(View.GONE);
} else if (requestCode == 124) {
assert data != null;
String file = data.getStringExtra("file");
assert file != null;
File videoFile = new File(file);
if (videoFile.exists()) {
String absolutePath = videoFile.getAbsolutePath();
Constant.FILE_PATH = absolutePath;
useCamera.setTag(absolutePath);
//身份证识别
String inward = IdCard.icarus();
if (inward != null) {
IdCardNumberBean idCardNumberBean = new Gson().fromJson(inward, IdCardNumberBean.class);
if (idCardNumberBean == null) {
Toast.makeText(getActivity(), "请手动添加身份证号", Toast.LENGTH_SHORT).show();
} else {
if (idCardNumberBean.getWords_result().get公民身份号码() != null) {
String words = idCardNumberBean.getWords_result().get公民身份号码().getWords();
etNamePhone.setText(words);
} else {
Toast.makeText(getActivity(), "请拍身份证照片", Toast.LENGTH_SHORT).show();
}
}
} else {
Toast.makeText(getActivity(), "请手动添加身份证号", Toast.LENGTH_SHORT).show();
}
}
} else {
Toast.makeText(getContext(), "请先拍照", Toast.LENGTH_SHORT).show();
}
}
}
}

View File

@ -3,9 +3,9 @@ package com.navinfo.outdoor.http;
import com.navinfo.outdoor.api.Constant;
public class HttpInterface {
public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
public static final String IP_ = "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
public static final String DATA_IP = "http://172.23.139.4:9999/m4";//接口
public static final String IP_TASK = "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口
public static final String IP = "http://dtxbmaps.navinfo.com/dtxb_test/m4";//测试接口
public static final String TEST_GUIDANCE_IP = "http://172.21.98.90:9999/m4";//引导页完成接口
public static final String APKIP = "http://172.23.139.4:8001/";

View File

@ -9,14 +9,18 @@
android:id="@+id/camera"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
app:cameraPictureSizeMaxArea="3686400"
app:cameraPictureSizeMinArea="1166400"
app:cameraPictureSizeMaxHeight="1920"
app:cameraPictureSizeMinHeight="1080"
app:cameraPictureSizeMaxWidth="1920"
app:cameraPictureSizeMinWidth="1080"
app:cameraPictureSizeAspectRatio="1920:1080"
app:cameraVideoSizeMaxArea="3686400"
app:cameraVideoSizeMaxHeight="1920"
app:cameraVideoSizeMaxWidth="1920"
app:cameraVideoSizeMinArea="1166400"
app:cameraVideoSizeMinHeight="1080"
app:cameraVideoSizeMinWidth="1080"
app:cameraPictureFormat="jpeg"
app:cameraPictureSizeBiggest="true"
app:cameraPictureSizeSmallest="true"
app:cameraPictureMetering="true"
android:keepScreenOn="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -16,13 +16,17 @@
android:id="@+id/camera"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cameraVideoSizeMaxArea="3686400"
app:cameraVideoSizeMinArea="1166400"
app:cameraVideoSizeMaxHeight="1920"
app:cameraVideoSizeMinHeight="1080"
app:cameraVideoSizeMaxWidth="1920"
app:cameraVideoSizeMinWidth="1080"
app:cameraPictureSizeMaxArea="3686400"
app:cameraPictureSizeMinArea="1166400"
app:cameraPictureSizeMaxHeight="1920"
app:cameraPictureSizeMinHeight="1080"
app:cameraPictureSizeMaxWidth="1920"
app:cameraPictureSizeMinWidth="1080"
app:cameraPictureSizeAspectRatio="1920:1080"
app:cameraPictureFormat="jpeg"
app:cameraPictureSizeBiggest="true"
app:cameraPictureSizeSmallest="true"
app:cameraPictureMetering="true"
android:keepScreenOn="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent" />