修改拍照界面,
This commit is contained in:
parent
482eaf31a1
commit
f7e8289b90
@ -40,6 +40,8 @@ import com.otaliastudios.cameraview.CameraView;
|
|||||||
import com.otaliastudios.cameraview.FileCallback;
|
import com.otaliastudios.cameraview.FileCallback;
|
||||||
import com.otaliastudios.cameraview.PictureResult;
|
import com.otaliastudios.cameraview.PictureResult;
|
||||||
import com.otaliastudios.cameraview.controls.Mode;
|
import com.otaliastudios.cameraview.controls.Mode;
|
||||||
|
import com.otaliastudios.cameraview.size.Size;
|
||||||
|
import com.otaliastudios.cameraview.size.SizeSelector;
|
||||||
import com.tencent.map.geolocation.TencentLocation;
|
import com.tencent.map.geolocation.TencentLocation;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.CameraUpdate;
|
import com.tencent.tencentmap.mapsdk.maps.CameraUpdate;
|
||||||
import com.tencent.tencentmap.mapsdk.maps.CameraUpdateFactory;
|
import com.tencent.tencentmap.mapsdk.maps.CameraUpdateFactory;
|
||||||
@ -110,20 +112,20 @@ public class PhotographActivity extends BaseActivity implements View.OnClickList
|
|||||||
DateFormat formatter = new SimpleDateFormat("yyyyMMdd");
|
DateFormat formatter = new SimpleDateFormat("yyyyMMdd");
|
||||||
String newFormat = formatter.format(new Date(System.currentTimeMillis()));
|
String newFormat = formatter.format(new Date(System.currentTimeMillis()));
|
||||||
String pictures_time = sharedPreferences.getString("pictures_time", null);
|
String pictures_time = sharedPreferences.getString("pictures_time", null);
|
||||||
if (pictures_time==null){
|
if (pictures_time == null) {
|
||||||
sharedEdit.putString("pictures_time",newFormat);
|
sharedEdit.putString("pictures_time", newFormat);
|
||||||
sharedEdit.apply();
|
sharedEdit.apply();
|
||||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||||
}else {
|
} else {
|
||||||
if (pictures_time.equals(newFormat)){
|
if (pictures_time.equals(newFormat)) {
|
||||||
logFile = new File(Constant.LOG_FOLDER + "/" + pictures_time + ".txt");
|
logFile = new File(Constant.LOG_FOLDER + "/" + pictures_time + ".txt");
|
||||||
}else {
|
} else {
|
||||||
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
logFile = new File(Constant.LOG_FOLDER + "/" + newFormat + ".txt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
photographBuilder = new StringBuilder();
|
photographBuilder = new StringBuilder();
|
||||||
photographBuilder.append("PhotographActivity-onCreate-initData ,");
|
photographBuilder.append("PhotographActivity-onCreate-initData ,");
|
||||||
if (Constant.USHERED!=null){
|
if (Constant.USHERED != null) {
|
||||||
photographBuilder.append("userId:").append(Constant.USHERED).append(",");
|
photographBuilder.append("userId:").append(Constant.USHERED).append(",");
|
||||||
}
|
}
|
||||||
cameraView.setMode(Mode.PICTURE);
|
cameraView.setMode(Mode.PICTURE);
|
||||||
@ -132,35 +134,36 @@ public class PhotographActivity extends BaseActivity implements View.OnClickList
|
|||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
if (getIntent()!=null){
|
if (getIntent() != null) {
|
||||||
photo_path = getIntent().getStringExtra(Constant.INTENT_PHOTO_PATH);
|
photo_path = getIntent().getStringExtra(Constant.INTENT_PHOTO_PATH);
|
||||||
oration = getIntent().getIntExtra(Constant.INTENT_VIDEO_OBLATION,-1);
|
oration = getIntent().getIntExtra(Constant.INTENT_VIDEO_OBLATION, -1);
|
||||||
}
|
}
|
||||||
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||||
CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE);
|
CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE);
|
||||||
cameraView = findViewById(R.id.camera);
|
cameraView = findViewById(R.id.camera);
|
||||||
cameraView.setOnClickListener(this);
|
cameraView.setOnClickListener(this);
|
||||||
Button btnCapturePicture = findViewById(R.id.capture_picture);
|
ImageView ivCapturePicture = findViewById(R.id.capture_picture);
|
||||||
btnCapturePicture.setOnClickListener(this);
|
ivCapturePicture.setOnClickListener(this);
|
||||||
cameraView.addCameraListener(new CameraListener() {
|
cameraView.addCameraListener(new CameraListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onPictureTaken(@NonNull PictureResult result) {
|
public void onPictureTaken(@NonNull PictureResult result) {
|
||||||
super.onPictureTaken(result);
|
super.onPictureTaken(result);
|
||||||
if (oration!=1){
|
if (oration == 1) {
|
||||||
if (Objects.requireNonNull(cameraView.getPictureSize()).getWidth() < cameraView.getPictureSize().getHeight()) {
|
if (Objects.requireNonNull(cameraView.getPictureSize()).getWidth() < cameraView.getPictureSize().getHeight()) {
|
||||||
Toast.makeText(PhotographActivity.this, "不允许竖向拍摄...", Toast.LENGTH_SHORT).show();
|
photographBuilder.append("cameraView 用户竖向拍摄 ,");
|
||||||
|
}else {
|
||||||
photographBuilder.append("cameraView 用户横屏拍摄 ,");
|
photographBuilder.append("cameraView 用户横屏拍摄 ,");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
File file = new File(photo_path);
|
File file = new File(photo_path);
|
||||||
result.toFile(file, new FileCallback() {
|
result.toFile(file, new FileCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onFileReady(@Nullable File file) {
|
public void onFileReady(@Nullable File file) {
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
assert file != null;
|
assert file != null;
|
||||||
intent.putExtra("file",file.getPath());
|
intent.putExtra("file", file.getPath());
|
||||||
setResult(0x104,intent);
|
setResult(0x104, intent);
|
||||||
SystemTTS.getInstance(PhotographActivity.this).stopSpeak();
|
SystemTTS.getInstance(PhotographActivity.this).stopSpeak();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
@ -169,6 +172,7 @@ public class PhotographActivity extends BaseActivity implements View.OnClickList
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
@ -177,8 +181,10 @@ public class PhotographActivity extends BaseActivity implements View.OnClickList
|
|||||||
obtain.obj = true;
|
obtain.obj = true;
|
||||||
EventBus.getDefault().post(obtain);
|
EventBus.getDefault().post(obtain);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onEvent(Message data) { }
|
public void onEvent(Message data) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
|
@ -207,7 +207,7 @@ public class Constant {
|
|||||||
|
|
||||||
public static TencentMap.OnMarkerClickListener markerClickListener=null;
|
public static TencentMap.OnMarkerClickListener markerClickListener=null;
|
||||||
|
|
||||||
public static final String NAVIN_FO="10.08";//版本日期
|
public static final String NAVIN_FO="10.11";//版本日期
|
||||||
/*联系我们的QQ群名称和QQ群号
|
/*联系我们的QQ群名称和QQ群号
|
||||||
*/
|
*/
|
||||||
public static String REGION_JIG_NAME = "京津冀晋蒙-地图寻宝群";
|
public static String REGION_JIG_NAME = "京津冀晋蒙-地图寻宝群";
|
||||||
|
@ -913,18 +913,21 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
case R.id.rl_panorama:
|
case R.id.rl_panorama:
|
||||||
Intent intentPanorama = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentPanorama = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File panoramaFile = PhotoUtils.showPhotoFile("a", latLng);
|
File panoramaFile = PhotoUtils.showPhotoFile("a", latLng);
|
||||||
|
intentPanorama.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
intentPanorama.putExtra(Constant.INTENT_PHOTO_PATH, panoramaFile.getPath());
|
intentPanorama.putExtra(Constant.INTENT_PHOTO_PATH, panoramaFile.getPath());
|
||||||
startActivityForResult(intentPanorama, 101);
|
startActivityForResult(intentPanorama, 101);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_coding:
|
case R.id.rl_coding:
|
||||||
Intent intentCoding = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentCoding = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File codingFile = PhotoUtils.showPhotoFile("b", latLng);
|
File codingFile = PhotoUtils.showPhotoFile("b", latLng);
|
||||||
|
intentCoding.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
intentCoding.putExtra(Constant.INTENT_PHOTO_PATH, codingFile.getPath());
|
intentCoding.putExtra(Constant.INTENT_PHOTO_PATH, codingFile.getPath());
|
||||||
startActivityForResult(intentCoding, 102);
|
startActivityForResult(intentCoding, 102);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_equipment:
|
case R.id.rl_equipment:
|
||||||
Intent intentEquipment = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentEquipment = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File equipmentFile = PhotoUtils.showPhotoFile("c", latLng);
|
File equipmentFile = PhotoUtils.showPhotoFile("c", latLng);
|
||||||
|
intentEquipment.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
intentEquipment.putExtra(Constant.INTENT_PHOTO_PATH, equipmentFile.getPath());
|
intentEquipment.putExtra(Constant.INTENT_PHOTO_PATH, equipmentFile.getPath());
|
||||||
startActivityForResult(intentEquipment, 103);
|
startActivityForResult(intentEquipment, 103);
|
||||||
|
|
||||||
@ -932,42 +935,49 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
|
|||||||
case R.id.rl_facility:
|
case R.id.rl_facility:
|
||||||
Intent intentFacility = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentFacility = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File facilityFile = PhotoUtils.showPhotoFile("c", latLng);
|
File facilityFile = PhotoUtils.showPhotoFile("c", latLng);
|
||||||
|
intentFacility.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
intentFacility.putExtra(Constant.INTENT_PHOTO_PATH, facilityFile.getPath());
|
intentFacility.putExtra(Constant.INTENT_PHOTO_PATH, facilityFile.getPath());
|
||||||
startActivityForResult(intentFacility, 104);
|
startActivityForResult(intentFacility, 104);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_scutcheon:
|
case R.id.rl_scutcheon:
|
||||||
Intent intentScutcheon = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentScutcheon = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File scutcheonFile = PhotoUtils.showPhotoFile("c", latLng);
|
File scutcheonFile = PhotoUtils.showPhotoFile("c", latLng);
|
||||||
|
intentScutcheon.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
intentScutcheon.putExtra(Constant.INTENT_PHOTO_PATH, scutcheonFile.getPath());
|
intentScutcheon.putExtra(Constant.INTENT_PHOTO_PATH, scutcheonFile.getPath());
|
||||||
startActivityForResult(intentScutcheon, 105);
|
startActivityForResult(intentScutcheon, 105);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_device:
|
case R.id.rl_device:
|
||||||
Intent intentDevice = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentDevice = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File deviceFile = PhotoUtils.showPhotoFile("c", latLng);
|
File deviceFile = PhotoUtils.showPhotoFile("c", latLng);
|
||||||
|
intentDevice.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
intentDevice.putExtra(Constant.INTENT_PHOTO_PATH, deviceFile.getPath());
|
intentDevice.putExtra(Constant.INTENT_PHOTO_PATH, deviceFile.getPath());
|
||||||
startActivityForResult(intentDevice, 106);
|
startActivityForResult(intentDevice, 106);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_usable:
|
case R.id.rl_usable:
|
||||||
Intent intentUsable = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentUsable = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File usableFile = PhotoUtils.showPhotoFile("d", latLng);
|
File usableFile = PhotoUtils.showPhotoFile("d", latLng);
|
||||||
|
intentUsable.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
intentUsable.putExtra(Constant.INTENT_PHOTO_PATH, usableFile.getPath());
|
intentUsable.putExtra(Constant.INTENT_PHOTO_PATH, usableFile.getPath());
|
||||||
startActivityForResult(intentUsable, 107);
|
startActivityForResult(intentUsable, 107);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_available:
|
case R.id.rl_available:
|
||||||
Intent intentAvailable = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentAvailable = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File availableFile = PhotoUtils.showPhotoFile("d", latLng);
|
File availableFile = PhotoUtils.showPhotoFile("d", latLng);
|
||||||
|
intentAvailable.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
intentAvailable.putExtra(Constant.INTENT_PHOTO_PATH, availableFile.getPath());
|
intentAvailable.putExtra(Constant.INTENT_PHOTO_PATH, availableFile.getPath());
|
||||||
startActivityForResult(intentAvailable, 108);
|
startActivityForResult(intentAvailable, 108);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_parking:
|
case R.id.rl_parking:
|
||||||
Intent intentParking = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentParking = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File parkingFile = PhotoUtils.showPhotoFile("e", latLng);
|
File parkingFile = PhotoUtils.showPhotoFile("e", latLng);
|
||||||
|
intentParking.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
intentParking.putExtra(Constant.INTENT_PHOTO_PATH, parkingFile.getPath());
|
intentParking.putExtra(Constant.INTENT_PHOTO_PATH, parkingFile.getPath());
|
||||||
startActivityForResult(intentParking, 109);
|
startActivityForResult(intentParking, 109);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_number:
|
case R.id.rl_number:
|
||||||
Intent intentNumber = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentNumber = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File numberFile = PhotoUtils.showPhotoFile("e", latLng);
|
File numberFile = PhotoUtils.showPhotoFile("e", latLng);
|
||||||
|
intentNumber.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
intentNumber.putExtra(Constant.INTENT_PHOTO_PATH, numberFile.getPath());
|
intentNumber.putExtra(Constant.INTENT_PHOTO_PATH, numberFile.getPath());
|
||||||
startActivityForResult(intentNumber, 110);
|
startActivityForResult(intentNumber, 110);
|
||||||
break;
|
break;
|
||||||
|
@ -97,7 +97,6 @@ import okhttp3.Response;
|
|||||||
* 2021-5-25
|
* 2021-5-25
|
||||||
*/
|
*/
|
||||||
public class ChargingStationFragment extends BaseDrawerFragment implements View.OnClickListener {
|
public class ChargingStationFragment extends BaseDrawerFragment implements View.OnClickListener {
|
||||||
|
|
||||||
private EditText editDescribe;
|
private EditText editDescribe;
|
||||||
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;
|
||||||
@ -245,11 +244,13 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
tvInternal = findViewById(R.id.tv_internal);
|
tvInternal = findViewById(R.id.tv_internal);
|
||||||
tvNamePic = findViewById(R.id.tv_name_pic);
|
tvNamePic = findViewById(R.id.tv_name_pic);
|
||||||
tvScutcheon = findViewById(R.id.tv_scutcheon);
|
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));
|
||||||
poiRecycleAdapter = new PoiRecycleAdapter(getContext());
|
poiRecycleAdapter = new PoiRecycleAdapter(getContext());
|
||||||
recyclerPhone.setAdapter(poiRecycleAdapter);*/
|
recyclerPhone.setAdapter(poiRecycleAdapter);*/
|
||||||
|
|
||||||
RecyclerView recyclerStation = findViewById(R.id.recycler_station);
|
RecyclerView recyclerStation = findViewById(R.id.recycler_station);
|
||||||
recyclerStation.setLayoutManager(new GridLayoutManager(getContext(), 3));
|
recyclerStation.setLayoutManager(new GridLayoutManager(getContext(), 3));
|
||||||
chargingPileAdapter = new ChargingPileAdapter(getContext());
|
chargingPileAdapter = new ChargingPileAdapter(getContext());
|
||||||
@ -880,30 +881,35 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
case R.id.rl_panorama:
|
case R.id.rl_panorama:
|
||||||
Intent intentPanorama = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentPanorama = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File PanoramaFile = PhotoUtils.showPhotoFile("a", latLng);
|
File PanoramaFile = PhotoUtils.showPhotoFile("a", latLng);
|
||||||
|
intentPanorama.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
intentPanorama.putExtra(Constant.INTENT_PHOTO_PATH, PanoramaFile.getPath());
|
intentPanorama.putExtra(Constant.INTENT_PHOTO_PATH, PanoramaFile.getPath());
|
||||||
startActivityForResult(intentPanorama, 101);
|
startActivityForResult(intentPanorama, 101);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_name:
|
case R.id.rl_name:
|
||||||
Intent intentName = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentName = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File nameFile = PhotoUtils.showPhotoFile("b", latLng);
|
File nameFile = PhotoUtils.showPhotoFile("b", latLng);
|
||||||
|
intentName.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
intentName.putExtra(Constant.INTENT_PHOTO_PATH, nameFile.getPath());
|
intentName.putExtra(Constant.INTENT_PHOTO_PATH, nameFile.getPath());
|
||||||
startActivityForResult(intentName, 102);
|
startActivityForResult(intentName, 102);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_internal_photos:
|
case R.id.rl_internal_photos:
|
||||||
Intent intentInternal = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentInternal = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File internalFile = PhotoUtils.showPhotoFile("c", latLng);
|
File internalFile = PhotoUtils.showPhotoFile("c", latLng);
|
||||||
|
intentInternal.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
intentInternal.putExtra(Constant.INTENT_PHOTO_PATH, internalFile.getPath());
|
intentInternal.putExtra(Constant.INTENT_PHOTO_PATH, internalFile.getPath());
|
||||||
startActivityForResult(intentInternal, 103);
|
startActivityForResult(intentInternal, 103);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_else:
|
case R.id.rl_else:
|
||||||
Intent intentElse = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentElse = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File elseFile = PhotoUtils.showPhotoFile("d", latLng);
|
File elseFile = PhotoUtils.showPhotoFile("d", latLng);
|
||||||
|
intentElse.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
intentElse.putExtra(Constant.INTENT_PHOTO_PATH, elseFile.getPath());
|
intentElse.putExtra(Constant.INTENT_PHOTO_PATH, elseFile.getPath());
|
||||||
startActivityForResult(intentElse, 104);
|
startActivityForResult(intentElse, 104);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_scutcheon:
|
case R.id.rl_scutcheon:
|
||||||
Intent intentScutcheon = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentScutcheon = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File scutcheonFile = PhotoUtils.showPhotoFile("e", latLng);
|
File scutcheonFile = PhotoUtils.showPhotoFile("e", latLng);
|
||||||
|
intentScutcheon.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
intentScutcheon.putExtra(Constant.INTENT_PHOTO_PATH, scutcheonFile.getPath());
|
intentScutcheon.putExtra(Constant.INTENT_PHOTO_PATH, scutcheonFile.getPath());
|
||||||
startActivityForResult(intentScutcheon, 105);
|
startActivityForResult(intentScutcheon, 105);
|
||||||
break;
|
break;
|
||||||
@ -1366,22 +1372,24 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
|||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
List<ChargingPileEntity> chargingPileEntityList = PoiDatabase.getInstance(getActivity()).getChargingPileDao().getChargingPileByStationId(showPoiEntity.getId());
|
if (showPoiEntity.getId()!=null){
|
||||||
if (chargingPileEntityList != null && !chargingPileEntityList.isEmpty()) {
|
List<ChargingPileEntity> chargingPileEntityList = PoiDatabase.getInstance(getActivity()).getChargingPileDao().getChargingPileByStationId(showPoiEntity.getId());
|
||||||
for (ChargingPileEntity chargingPileEntity : chargingPileEntityList) {
|
if (chargingPileEntityList != null && !chargingPileEntityList.isEmpty()) {
|
||||||
List<File> chargingPileFileList = new ArrayList<>();
|
for (ChargingPileEntity chargingPileEntity : chargingPileEntityList) {
|
||||||
if (chargingPileEntity.getPhotos() != null && !chargingPileEntity.getPhotos().isEmpty()) {
|
List<File> chargingPileFileList = new ArrayList<>();
|
||||||
for (String photoPath : chargingPileEntity.getPhotos()) {
|
if (chargingPileEntity.getPhotos() != null && !chargingPileEntity.getPhotos().isEmpty()) {
|
||||||
chargingPileFileList.add(new File(photoPath));
|
for (String photoPath : chargingPileEntity.getPhotos()) {
|
||||||
|
chargingPileFileList.add(new File(photoPath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
PoiDatabase.getInstance(getActivity()).getChargingPileDao().deleteChargingPileEntity(chargingPileEntity);
|
||||||
|
for (int i = 0; i < chargingPileFileList.size(); i++) {
|
||||||
|
chargingPileFileList.get(i).delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PoiDatabase.getInstance(getActivity()).getChargingPileDao().deleteChargingPileEntity(chargingPileEntity);
|
|
||||||
for (int i = 0; i < chargingPileFileList.size(); i++) {
|
|
||||||
chargingPileFileList.get(i).delete();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
chargingPileDao.deleteChargingFidPileEntity(showPoiEntity.getId());
|
||||||
}
|
}
|
||||||
chargingPileDao.deleteChargingFidPileEntity(showPoiEntity.getId());
|
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
|
@ -417,12 +417,14 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
|||||||
Intent intentPicture = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentPicture = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File file = PhotoUtils.showPhotoFile("a", latLng);
|
File file = PhotoUtils.showPhotoFile("a", latLng);
|
||||||
intentPicture.putExtra(Constant.INTENT_PHOTO_PATH, file.getPath());
|
intentPicture.putExtra(Constant.INTENT_PHOTO_PATH, file.getPath());
|
||||||
|
intentPicture.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
startActivityForResult(intentPicture, 101);
|
startActivityForResult(intentPicture, 101);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_pictures:
|
case R.id.rl_pictures:
|
||||||
Intent intentPictures = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentPictures = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File files = PhotoUtils.showPhotoFile("b", latLng);
|
File files = PhotoUtils.showPhotoFile("b", latLng);
|
||||||
intentPictures.putExtra(Constant.INTENT_PHOTO_PATH, files.getPath());
|
intentPictures.putExtra(Constant.INTENT_PHOTO_PATH, files.getPath());
|
||||||
|
intentPictures.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
startActivityForResult(intentPictures, 102);
|
startActivityForResult(intentPictures, 102);
|
||||||
break;
|
break;
|
||||||
case R.id.btn_other_local:
|
case R.id.btn_other_local:
|
||||||
|
@ -656,30 +656,35 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
|||||||
case R.id.rl_panorama:
|
case R.id.rl_panorama:
|
||||||
Intent intentPanorama = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentPanorama = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File filePanorama = PhotoUtils.showPhotoFile("a", latLng);
|
File filePanorama = PhotoUtils.showPhotoFile("a", latLng);
|
||||||
|
intentPanorama.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
intentPanorama.putExtra(Constant.INTENT_PHOTO_PATH, filePanorama.getPath());
|
intentPanorama.putExtra(Constant.INTENT_PHOTO_PATH, filePanorama.getPath());
|
||||||
startActivityForResult(intentPanorama, 101);
|
startActivityForResult(intentPanorama, 101);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_name:
|
case R.id.rl_name:
|
||||||
Intent intentName = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentName = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File fileName = PhotoUtils.showPhotoFile("b", latLng);
|
File fileName = PhotoUtils.showPhotoFile("b", latLng);
|
||||||
|
intentName.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
intentName.putExtra(Constant.INTENT_PHOTO_PATH, fileName.getPath());
|
intentName.putExtra(Constant.INTENT_PHOTO_PATH, fileName.getPath());
|
||||||
startActivityForResult(intentName, 102);
|
startActivityForResult(intentName, 102);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_internal_photos:
|
case R.id.rl_internal_photos:
|
||||||
Intent intentInternal = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentInternal = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File fileInternal = PhotoUtils.showPhotoFile("c", latLng);
|
File fileInternal = PhotoUtils.showPhotoFile("c", latLng);
|
||||||
|
intentInternal.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
intentInternal.putExtra(Constant.INTENT_PHOTO_PATH, fileInternal.getPath());
|
intentInternal.putExtra(Constant.INTENT_PHOTO_PATH, fileInternal.getPath());
|
||||||
startActivityForResult(intentInternal, 103);
|
startActivityForResult(intentInternal, 103);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_card:
|
case R.id.rl_card:
|
||||||
Intent intentCard = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentCard = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File fileCard = PhotoUtils.showPhotoFile("d", latLng);
|
File fileCard = PhotoUtils.showPhotoFile("d", latLng);
|
||||||
|
intentCard.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
intentCard.putExtra(Constant.INTENT_PHOTO_PATH, fileCard.getPath());
|
intentCard.putExtra(Constant.INTENT_PHOTO_PATH, fileCard.getPath());
|
||||||
startActivityForResult(intentCard, 104);
|
startActivityForResult(intentCard, 104);
|
||||||
break;
|
break;
|
||||||
case R.id.rl_else:
|
case R.id.rl_else:
|
||||||
Intent intentElse = new Intent(getActivity(), PhotographActivity.class);
|
Intent intentElse = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File fileElse = PhotoUtils.showPhotoFile("e", latLng);
|
File fileElse = PhotoUtils.showPhotoFile("e", latLng);
|
||||||
|
intentElse.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
intentElse.putExtra(Constant.INTENT_PHOTO_PATH, fileElse.getPath());
|
intentElse.putExtra(Constant.INTENT_PHOTO_PATH, fileElse.getPath());
|
||||||
startActivityForResult(intentElse, 105);
|
startActivityForResult(intentElse, 105);
|
||||||
break;
|
break;
|
||||||
|
@ -159,18 +159,21 @@ public class UserAttestationFragment extends BaseFragment implements View.OnC
|
|||||||
case R.id.iv_attestation1:
|
case R.id.iv_attestation1:
|
||||||
Intent ivAttestationIntent1 = new Intent(getActivity(), PhotographActivity.class);
|
Intent ivAttestationIntent1 = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File attestationFile1 = PhotoUtils.showPhotoFile("a", null);
|
File attestationFile1 = PhotoUtils.showPhotoFile("a", null);
|
||||||
|
ivAttestationIntent1.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
ivAttestationIntent1.putExtra(Constant.INTENT_PHOTO_PATH, attestationFile1.getPath());
|
ivAttestationIntent1.putExtra(Constant.INTENT_PHOTO_PATH, attestationFile1.getPath());
|
||||||
startActivityForResult(ivAttestationIntent1, 121);
|
startActivityForResult(ivAttestationIntent1, 121);
|
||||||
break;
|
break;
|
||||||
case R.id.iv_attestation2:
|
case R.id.iv_attestation2:
|
||||||
Intent ivAttestationIntent2 = new Intent(getActivity(), PhotographActivity.class);
|
Intent ivAttestationIntent2 = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File attestationFile2 = PhotoUtils.showPhotoFile("b", null);
|
File attestationFile2 = PhotoUtils.showPhotoFile("b", null);
|
||||||
|
ivAttestationIntent2.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
ivAttestationIntent2.putExtra(Constant.INTENT_PHOTO_PATH, attestationFile2.getPath());
|
ivAttestationIntent2.putExtra(Constant.INTENT_PHOTO_PATH, attestationFile2.getPath());
|
||||||
startActivityForResult(ivAttestationIntent2, 122);
|
startActivityForResult(ivAttestationIntent2, 122);
|
||||||
break;
|
break;
|
||||||
case R.id.iv_attestation3:
|
case R.id.iv_attestation3:
|
||||||
Intent ivAttestationIntent3 = new Intent(getActivity(), PhotographActivity.class);
|
Intent ivAttestationIntent3 = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File attestationFile3 = PhotoUtils.showPhotoFile("c", null);
|
File attestationFile3 = PhotoUtils.showPhotoFile("c", null);
|
||||||
|
ivAttestationIntent3.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
ivAttestationIntent3.putExtra(Constant.INTENT_PHOTO_PATH, attestationFile3.getPath());
|
ivAttestationIntent3.putExtra(Constant.INTENT_PHOTO_PATH, attestationFile3.getPath());
|
||||||
startActivityForResult(ivAttestationIntent3, 123);
|
startActivityForResult(ivAttestationIntent3, 123);
|
||||||
break;
|
break;
|
||||||
@ -192,6 +195,7 @@ public class UserAttestationFragment extends BaseFragment implements View.OnC
|
|||||||
case R.id.user_attestation_camera:
|
case R.id.user_attestation_camera:
|
||||||
Intent userCameraIntent = new Intent(getActivity(), PhotographActivity.class);
|
Intent userCameraIntent = new Intent(getActivity(), PhotographActivity.class);
|
||||||
File file = PhotoUtils.showPhotoFile("d", null);
|
File file = PhotoUtils.showPhotoFile("d", null);
|
||||||
|
userCameraIntent.putExtra(Constant.INTENT_VIDEO_OBLATION, 1);
|
||||||
userCameraIntent.putExtra(Constant.INTENT_PHOTO_PATH, file.getPath());
|
userCameraIntent.putExtra(Constant.INTENT_PHOTO_PATH, file.getPath());
|
||||||
startActivityForResult(userCameraIntent, 124);
|
startActivityForResult(userCameraIntent, 124);
|
||||||
break;
|
break;
|
||||||
|
BIN
app/src/main/res/drawable/icon_camera.png
Normal file
BIN
app/src/main/res/drawable/icon_camera.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
BIN
app/src/main/res/drawable/icon_photograph.png
Normal file
BIN
app/src/main/res/drawable/icon_photograph.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
@ -26,17 +26,14 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<Button
|
<ImageView
|
||||||
android:id="@+id/capture_picture"
|
android:id="@+id/capture_picture"
|
||||||
style="@style/user_data_style"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="100dp"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="20dp"
|
android:layout_marginEnd="24dp"
|
||||||
android:background="@drawable/user_style"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:padding="@dimen/fab_margin"
|
android:src="@drawable/icon_camera"
|
||||||
android:text="拍照"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
x
Reference in New Issue
Block a user