解决冲突

This commit is contained in:
wds 2021-08-10 14:50:29 +08:00
commit c03b3cb597
18 changed files with 248 additions and 162 deletions

View File

@ -105,7 +105,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
private Button btnVideo, stopVideo;
private String finalVideoPath; // 摄像后最终保存的文件名
// private File tmpFile; // 合并文件的临时文件路径
// private File tmpFile; // 合并文件的临时文件路径
private Timer timer;
private CsvTimerTask timerTask; // 执行定时写入csv文件的task
private DateFormat formatter;
@ -232,13 +232,13 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
// }
// });
removables = new ArrayList<>();//存储轨迹的marker
if (uuId!=null){
if (uuId != null) {
List<File> videoFileListByUUID = AWMp4ParserHelper.getInstance().getVideoFileListByUUID(uuId);
if (videoFileListByUUID!=null){
if (videoFileListByUUID != null) {
List<LatLng> lineStringByVideoFileList = AWMp4ParserHelper.getInstance().getLineStringByVideoFileList(videoFileListByUUID);
for (int i = 0; i < lineStringByVideoFileList.size(); i++) {
LatLng latLng = lineStringByVideoFileList.get(i);
if (latLng!=null){
if (latLng != null) {
BitmapDescriptor pileDescriptor = BitmapDescriptorFactory.fromResource(ic_baseline);
Marker marker = tencentMap.addMarker(new MarkerOptions(latLng).icon(pileDescriptor).alpha(0.9f)
.flat(true)
@ -276,12 +276,17 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
@Override
public void onVideoTaken(@NonNull @NotNull VideoResult result) {
super.onVideoTaken(result);
Toast.makeText(PictureActivity.this, "暂停摄像", Toast.LENGTH_SHORT).show();
showLoadingDialog();
dismissLoadingDialog();
if (isFinishActivity) {
PictureActivity.this.finish();
return;
}
if (captureVideo.isChecked()&&!isFinishActivity){
startTakenVideo();
return;
}
Toast.makeText(PictureActivity.this, "暂停摄像", Toast.LENGTH_SHORT).show();
// new Thread(new Runnable() {
// @Override
// public void run() {
@ -529,7 +534,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
layerChange.removeAllViews();
if (widthMap > widthCamera) {
ivPic.setVisibility(View.VISIBLE);
layoutParamsCamera.width = dm.widthPixels;
layoutParamsCamera.height = dm.heightPixels;
layoutParamsMap.height = heightCamera;
@ -539,7 +544,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
layerChange.addView(camera);
layerChange.addView(ivMap);
} else {
ivPic.setVisibility(View.GONE);
layoutParamsMap.height = dm.heightPixels;
layoutParamsMap.width = dm.widthPixels;
layoutParamsCamera.height = heightMap;
@ -550,6 +555,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
layerChange.addView(camera);
}
}
@Override
protected void onResume() {
super.onResume();
@ -581,10 +587,10 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
public void onEventMessageMainThread(Message msg) {
switch (msg.what) {
case Constant.EVENT_WHAT_LOCATION_CHANGE: // 用户位置更新
if (tencentMap!=null) {
if (tencentMap != null) {
CameraUpdate cameraSigma =
CameraUpdateFactory.newCameraPosition(new CameraPosition(
new LatLng(Constant.currentLocation.getLatitude(),Constant.currentLocation.getLongitude()), //中心点坐标地图目标经纬度
new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude()), //中心点坐标地图目标经纬度
16, //目标缩放级别
0, //目标倾斜角
0)); //目标旋转角 0~360° (正北方为0)
@ -596,7 +602,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
/**
* 记录视频拍摄的时间及经纬度
*/
*/
private class CsvTimerTask extends TimerTask {
private File csvFile;
private long currentVideoTime; // 记录当前的视频时间
@ -618,13 +624,13 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
StringBuffer sb = new StringBuffer();
sb.append(formatter.format(new Date())); // 记录当前时间
sb.append(",");
sb.append(currentVideoTime) ;// 记录视频时间
sb.append(currentVideoTime);// 记录视频时间
sb.append(",");
sb.append(Constant.currentLocation.getLatitude());
sb.append(",");
sb.append(Constant.currentLocation.getLongitude());
sb.append(",");
if (Constant.currentLocation.getBearing()!=0) {
if (Constant.currentLocation.getBearing() != 0) {
sb.append(Constant.currentLocation.getBearing());
} else {
sb.append(Constant.currentLocation.getDirection());

View File

@ -66,6 +66,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
private SharedPreferences navInfo;
@Override
protected int getLayout() {
return R.layout.activity_user;
@ -133,6 +134,16 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
break;
case R.id.btn_save:
String attestationNames = navInfo.getString("attestationName", null);
if (attestationNames == null || attestationNames.equals("")) {
Toast.makeText(this, "请先实名认证", Toast.LENGTH_SHORT).show();
return;
}
String bankAccount = navInfo.getString("bankAccount", null);
if (bankAccount == null||bankAccount.equals("")){
Toast.makeText(this, "请先绑定银行卡", Toast.LENGTH_SHORT).show();
return;
}
userphone = etPhone.getText().toString().trim();
userqq = etQq.getText().toString().trim();
usermailbox = etMailbox.getText().toString().trim();

View File

@ -95,7 +95,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
private RelativeLayout rlPanorama, rlName, rlInternalPhotos, rlElse, rlScutcheon, rlNull;
private ImageView ivPanorama, ivName, ivInternal, ivElse, ivScutcheon;
private TextView tvExamine;
private TextView tvPanorama, tvName, tvInternal, tvElse, tvScutcheon;
private TextView tvPanorama, tvNamePic, tvInternal, tvElse, tvScutcheon;
private EditText editNameContent, editSiteContent;
private ArrayList<PhoneBean> poiBeans;
private Button btnSaveLocal;
@ -227,7 +227,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
tvPanorama = findViewById(R.id.tv_panorama);
tvElse = findViewById(R.id.tv_else);
tvInternal = findViewById(R.id.tv_internal);
tvName = findViewById(R.id.tv_name);
tvNamePic = findViewById(R.id.tv_name_pic);
tvScutcheon = findViewById(R.id.tv_scutcheon);
/* recyclerPhone = findViewById(R.id.recycler_phone);
recyclerPhone.setLayoutManager(new LinearLayoutManager(getContext()));
@ -523,7 +523,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
tvPanorama.setTag(photo);
} else if (split[split.length - 1].startsWith("b")) {
Glide.with(getActivity()).load(photo).into(ivName);
tvName.setTag(photo);
tvNamePic.setTag(photo);
} else if (split[split.length - 1].startsWith("c")) {
Glide.with(getActivity()).load(photo).into(ivInternal);
tvInternal.setTag(photo);
@ -704,7 +704,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
} else {
chargingStationList.add(new File(tagPanorama));
}
String tagName = (String) tvName.getTag();
String tagName = (String) tvNamePic.getTag();
if (tagName == null) {
Toast.makeText(getContext(), "请拍照", Toast.LENGTH_SHORT).show();
return;
@ -921,6 +921,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
private void stationUploadByNetWork(PoiEntity poiEntity, ArrayList<File> chargingStationList) {
showFileLoadingDialog();
setLoadingDialogText("上传中...");
if (poiEntity == null || poiEntity.getBodyId() == 0) {
Toast.makeText(getActivity(), "没有保存本地", Toast.LENGTH_SHORT).show();
Log.e("TAG", "poiUploadByNetWork: " + poiEntity.getBodyId() + chargingStationList);
@ -1174,7 +1175,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
return;
}
String photoPath = PhotoUtils.showPhotoAndGetPath(photoFile, ivName);
tvName.setTag(photoPath);
tvNamePic.setTag(photoPath);
photoFile = null;
/*int height = bitmap.getHeight();
int width = bitmap.getWidth();
@ -1372,7 +1373,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
if (tagPanorama != null && !tagPanorama.equals("")) {
infoPhoto.add(new Info(tagPanorama));
}
String tagName = (String) tvName.getTag();
String tagName = (String) tvNamePic.getTag();
if (tagName != null && !tagName.equals("")) {
infoPhoto.add(new Info(tagName));
}
@ -1415,7 +1416,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
poiCheckResult.setMsg("请拍照 全景图");
return poiCheckResult;
}
if (tvName.getTag()==null){
if (tvNamePic.getTag()==null){
poiCheckResult.setCode(1);
poiCheckResult.setMsg("请拍照 名称照片");
return poiCheckResult;

View File

@ -38,6 +38,8 @@ import com.vividsolutions.jts.geom.Geometry;
import org.greenrobot.eventbus.EventBus;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
@ -117,7 +119,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
if (poiEntity.getPrecision() == null) {
tvMoney.setText("" + 0);
} else {
tvMoney.setText("" + poiEntity.getPrecision());
tvMoney.setText("" + format2(Double.valueOf(poiEntity.getPrecision())));
}
if (poiEntity != null) {
if (poiEntity.getDescribe() != null && !"".equals(poiEntity.getDescribe())) {
@ -137,7 +139,18 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
initViewByTaskStatus(taskStatus);
}
}
/**
* 保存小数点后两位
*
* @param value
* @return
*/
public static String format2(double value) {
DecimalFormat df = new DecimalFormat("0.00");
df.setRoundingMode(RoundingMode.HALF_UP);
return df.format(value);
}
private void initViewByTaskStatus(int taskStatus) {
switch (taskStatus) {

View File

@ -69,8 +69,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
private String value;
private SharedPreferences navInfo;
private SharedPreferences.Editor navInfoEditor;
private File gatherFile;
private String file;
private File file;
public static GatheringFragment newInstance(Bundle bundle) {
@ -100,7 +99,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
btnBank.setOnClickListener(this::onClick);
tvName = (TextView) findViewById(R.id.tv_name);
String attestationName = navInfo.getString("attestationName", null);
if (attestationName!= null&&!attestationName.equals("")) {
if (attestationName != null && !attestationName.equals("")) {
tvName.setText(attestationName);
}
etBankNum = (EditText) findViewById(R.id.et_bank_num);
@ -156,28 +155,39 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
dialog.show();
break;
case R.id.btn_bank:
if (etBankNum.getText().toString() == null && etBankNum.getText().toString().equals("")) {
Toast.makeText(getContext(), "银行卡号不能为空", Toast.LENGTH_SHORT).show();
return;
}
gatheringNetWork();
break;
case R.id.gathering_camera:
Intent gatheringNumber = new Intent("android.media.action.IMAGE_CAPTURE");
startActivityForResult(gatheringNumber, 400);
Intent gatheringNumberIntent = new Intent("android.media.action.IMAGE_CAPTURE");
file =PhotoUtils.showPhotoFile("a", null);
gatheringNumberIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
startActivityForResult(gatheringNumberIntent, 131);
break;
}
}
private void gatheringNetWork() {
gatheringList = new ArrayList<>();
File gatheringFile = new File(gatheringPath);
if (!gatheringFile.exists()) {
Toast.makeText(getContext(), "身份证照片不能为空", Toast.LENGTH_SHORT).show();
return;
}
gatheringList.add(gatheringFile);
if (gatheringCamera.getTag() == null){
Toast.makeText(getContext(), "请先拍银行卡", Toast.LENGTH_SHORT).show();
return;
}
// if (!gatheringFile.exists()) {
// Toast.makeText(getContext(), "身份证照片不能为空", Toast.LENGTH_SHORT).show();
// return;
// }
String gatheringCameraTag = (String) gatheringCamera.getTag();
gatheringList.add(new File(gatheringCameraTag));
String etBankAccount = etBankNum.getText().toString().trim();
if (etBankAccount == null || etBankAccount.equals("")) {
Toast.makeText(getContext(), "银行卡号不能为空", Toast.LENGTH_SHORT).show();
return;
if (!etBankAccount.matches("^\\\\d{19}$\"")) {
Toast.makeText(getContext(), "银行卡号不能为空", Toast.LENGTH_SHORT).show();
return;
}
}
showLoadingDialog();
OkGo
@ -198,7 +208,7 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
MessageDialog.show((AppCompatActivity) getActivity(), "绑定成功", "确定", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
navInfoEditor.putString("bankAccount",value);
navInfoEditor.putString("bankAccount", value);
navInfoEditor.commit();
return false;
}
@ -228,28 +238,13 @@ 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 == 400 && resultCode == RESULT_OK) {
Bundle extras = data.getExtras();//从Intent中获取附加值
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
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");
gatherFile = new File(Constant.PICTURE_FOLDER+"/aaaaaa.jpg");
PhotoUtils.showPhotoFile("a", null);
intentPanorama.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(gatherFile));
startActivityForResult(intentPanorama, 400);
return false;
}
});
} else {
file = PhotoPathUtil.getTakePhotoPath(data, "", "");
if (requestCode == 131 && resultCode == RESULT_OK) {
if (file ==null&&!file.exists()){
Toast.makeText(getContext(), "请先拍照", Toast.LENGTH_SHORT).show();
return;
}
gatheringCamera.setTag(file.getAbsolutePath());
// gatheringPath = PhotoPathUtil.getTakePhotoPath(data, "", "");
}
}

View File

@ -345,7 +345,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
Toast.makeText(getActivity(), "请确定点位", Toast.LENGTH_SHORT).show();
return;
}
String tagPicture = (String) ivPicture.getTag();
String tagPicture = (String) tvPicture.getTag();
if (tagPicture == null) {
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
return;
@ -471,6 +471,7 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
private void otherSaveByNetWork(PoiEntity poiEntity,boolean isLocal) {
showLoadingDialog();
setLoadingDialogText("保存中...");
HttpParams httpParams = new HttpParams();
httpParams.put("type", poiEntity.getStation_type());
httpParams.put("taskId", poiEntity.getTaskId());

View File

@ -2,7 +2,6 @@ package com.navinfo.outdoor.fragment;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
@ -60,8 +59,6 @@ import com.navinfo.outdoor.room.PoiDatabase;
import com.navinfo.outdoor.room.PoiEntity;
import com.navinfo.outdoor.ui.view.ContactView;
import com.navinfo.outdoor.util.Geohash;
import com.navinfo.outdoor.util.NetWorkUtils;
import com.navinfo.outdoor.util.PhotoPathUtil;
import com.navinfo.outdoor.util.PhotoUtils;
import com.tencent.tencentmap.mapsdk.maps.model.LatLng;
@ -86,7 +83,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
private EditText editDescribe;
private RelativeLayout rlPanorama, rlName, rlInternalPhotos, rlCard, rlElse;
private ImageView ivPanorama, ivName, ivInternal, ivCard, ivElse;
private TextView tvPanorama, tvName, tvInternal, tvCard, tvElse;
private TextView tvPanorama, tvPoiNamePic, tvInternal, tvCard, tvElse;
public TextView tvExamine;
private EditText editNameContent, editSiteContent;
private ArrayList<PhoneBean> poiBeans;
@ -198,7 +195,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
ivPanorama = findViewById(R.id.iv_panorama);
tvPanorama = findViewById(R.id.tv_panorama);
ivName = findViewById(R.id.iv_name);
tvName = findViewById(R.id.tv_name);
tvPoiNamePic = findViewById(R.id.tv_poi_name_pic);
ivInternal = findViewById(R.id.iv_internal);
tvInternal = findViewById(R.id.tv_internal);
@ -419,7 +416,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
tvPanorama.setTag(photo);
} else if (split[split.length - 1].startsWith("b")) {
Glide.with(getActivity()).load(photo).into(ivName);
tvName.setTag(photo);
tvPoiNamePic.setTag(photo);
} else if (split[split.length - 1].startsWith("c")) {
Glide.with(getActivity()).load(photo).into(ivInternal);
tvInternal.setTag(photo);
@ -539,7 +536,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
} else {
poiPicList.add(new File(tagPanorama));
}
String tagName = (String)tvName.getTag();
String tagName = (String) tvPoiNamePic.getTag();
if (tagName == null) {
Toast.makeText(getActivity(), "请拍照", Toast.LENGTH_SHORT).show();
return;
@ -849,7 +846,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
return;
}else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivName);
tvName.setTag(s);
tvPoiNamePic.setTag(s);
}
file=null;
@ -999,7 +996,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
if (tagPanorama != null && !tagPanorama.equals("")) {
infoPhoto.add(new Info(tagPanorama));
}
String tagName = (String) tvName.getTag();
String tagName = (String) tvPoiNamePic.getTag();
if (tagName != null && !tagName.equals("")) {
infoPhoto.add(new Info(tagName));
}
@ -1041,7 +1038,7 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
poiCheckResult.setMsg("请 拍照");
return poiCheckResult;
}
if (tvName.getTag()==null){
if (tvPoiNamePic.getTag()==null){
poiCheckResult.setCode(1);
poiCheckResult.setMsg("请 拍照");
return poiCheckResult;

View File

@ -2,6 +2,7 @@ package com.navinfo.outdoor.fragment;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
@ -14,11 +15,15 @@ import com.navinfo.outdoor.R;
import com.navinfo.outdoor.activity.LoginActivity;
import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.base.BaseFragment;
import com.navinfo.outdoor.bean.UserBean;
import com.navinfo.outdoor.http.Callback;
import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.navinfo.outdoor.util.RegexUtil;
/**
* 注册页面
*/
@ -30,6 +35,7 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
private TextView haveGoLogin, registerGetNote;
private Button btnRegister;
private String sessionId;
private CountDownTimer timer;
public static RegisterFragment newInstance(Bundle bundle) {
RegisterFragment fragment = new RegisterFragment();
@ -81,6 +87,7 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
case R.id.btn_register:
initRegister();
case R.id.register_get_note:
registerNote();
initGetNote();
break;
}
@ -187,4 +194,26 @@ public class RegisterFragment extends BaseFragment implements View.OnClickListen
}
private void registerNote() {
if (timer!=null){
timer.cancel();
timer= null;
}
registerGetNote.setEnabled(false);
timer = new CountDownTimer(60 * 1000, 1000) {
@Override
public void onTick(long millisUntilFinished) {
registerGetNote.setText(millisUntilFinished / 1000 + "秒后重新获取验证码");
}
@Override
public void onFinish() {
registerGetNote.setEnabled(true);
registerGetNote.setText("重新发送");
}
};
timer.start();
}
}

View File

@ -221,6 +221,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
}
if (poiEntities.size() > 0) {
showFileLoadingDialog();
setLoadingDialogText("提交中...");
PoiSaveUtils.getInstance(getActivity()).uploadPoiEntityBatch(poiEntities);
} else {
Toast.makeText(getContext(), "请选择要删除的条目数据", Toast.LENGTH_SHORT).show();

View File

@ -1378,6 +1378,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
EventBus.getDefault().unregister(this);
}
@Override
public void onClick (View v){
switch (v.getId()) {
@ -1445,6 +1446,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
break;
case 1: // POI录像
showPoiMarkerByType(2, newPoiLatLng);
poiEntity.setWork_type(1);
bundle.putSerializable("poiEntity", poiEntity);
PoiVideoFragment poiVideoFragment = PoiVideoFragment.newInstance(bundle);
showSlidingFragment(poiVideoFragment);
break;

View File

@ -115,22 +115,22 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
getActivity().finish();
break;
case R.id.iv_attestation1:
Intent ivAttestation1 = new Intent("android.media.action.IMAGE_CAPTURE");
Intent ivAttestationIntent1 = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("a", null);
ivAttestation1.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
startActivityForResult(ivAttestation1, 100);
ivAttestationIntent1.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
startActivityForResult(ivAttestationIntent1, 121);
break;
case R.id.iv_attestation2:
Intent ivAttestation2 = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("a", null);
ivAttestation2.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
startActivityForResult(ivAttestation2, 200);
Intent ivAttestationIntent2 = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("b", null);
ivAttestationIntent2.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
startActivityForResult(ivAttestationIntent2, 122);
break;
case R.id.iv_attestation3:
Intent ivAttestation3 = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("a", null);
ivAttestation3.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
startActivityForResult(ivAttestation3, 300);
Intent ivAttestationIntent3 = new Intent("android.media.action.IMAGE_CAPTURE");
file = PhotoUtils.showPhotoFile("c", null);
ivAttestationIntent3.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
startActivityForResult(ivAttestationIntent3, 123);
break;
case R.id.btn_attestation:
if (etAttestationName.getText().toString() == null || etAttestationName.getText().toString().equals("")) {
@ -165,15 +165,15 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
}
/**
* 中文效验
* 中文姓名效验
*/
static boolean chineseNameTest(String name) {
if (!name.matches("[\u4e00-\u9fa5]{2,4}")) {
System.out.println("只能输入2到4个汉字");
return false;
}else return true;
}
private void nameAuthentication() {
if (etAttestationName.getText().toString() == null || etAttestationName.getText().toString().equals("")) {
Toast.makeText(getContext(), "姓名不能为空,请输入姓名", Toast.LENGTH_SHORT).show();
@ -183,29 +183,30 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
Toast.makeText(getContext(), "身份证错误,请重新输入", Toast.LENGTH_SHORT).show();
return;
}
if (ivAttestation1.getTag() == null) {
if (tvCard1.getTag() == null) {
Toast.makeText(getContext(), "请拍照 身份证人像面", Toast.LENGTH_SHORT).show();
return;
}
if (ivAttestation2.getTag() == null) {
if (tvCard2.getTag() == null) {
Toast.makeText(getContext(), "请拍照 身份证国徽面", Toast.LENGTH_SHORT).show();
return;
}
if (ivAttestation3.getTag() == null) {
if (tvCard3.getTag() == null) {
Toast.makeText(getContext(), "请拍照 手持身份证", Toast.LENGTH_SHORT).show();
return;
}
ArrayList<File> takePhoneList = new ArrayList<>();
String takePhotoPath1 = (String) ivAttestation1.getTag();
String takePhotoPath1 = (String) tvCard1.getTag();
takePhoneList.add(new File(takePhotoPath1));
String takePhotoPath2 = (String) ivAttestation2.getTag();
String takePhotoPath2 = (String) tvCard2.getTag();
takePhoneList.add(new File(takePhotoPath2));
String takePhotoPath3 = (String) ivAttestation3.getTag();
String takePhotoPath3 = (String) tvCard3.getTag();
takePhoneList.add(new File(takePhotoPath3));
String attestationName = etAttestationName.getText().toString().trim();
String namePhone = etNamePhone.getText().toString().trim();
showLoadingDialog();
setLoadingDialogText("实名认证中...");
OkGo
// 请求方式和请求url
.<NameAuthenticationBean>post(HttpInterface.USER_AUTH_ADD)
@ -225,7 +226,8 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
MessageDialog.show((AppCompatActivity) getActivity(), "提示", "通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
// Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
navInfoEditor.putString("attestationName",attestationName);
navInfoEditor.commit();
return false;
}
});
@ -234,8 +236,7 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
MessageDialog.show((AppCompatActivity) getActivity(), "提示", "不通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
navInfoEditor.putString("attestationName",attestationName);
navInfoEditor.commit();
return false;
}
});
@ -256,15 +257,14 @@ 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 == 100 && resultCode == RESULT_OK) {
Bundle extras = data.getExtras();//从Intent中获取附加值
if (requestCode == 121 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getContext(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
return;
}else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivAttestation1);
ivAttestation1.setTag(s);
tvCard1.setTag(s);
}
file=null;
ivHera1.setVisibility(View.GONE);
@ -282,15 +282,14 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
// }
// });
// }
}
if (requestCode == 200 && resultCode == RESULT_OK) {
}else if (requestCode == 122 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getContext(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
return;
}else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivAttestation2);
ivAttestation2.setTag(s);
tvCard2.setTag(s);
}
file=null;
ivHera2.setVisibility(View.GONE);
@ -308,15 +307,14 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
// }
// });
// }
}
if (requestCode == 300 && resultCode == RESULT_OK) {
}else if (requestCode == 123 && resultCode == RESULT_OK) {
if (file == null || !file.exists()) {
Toast.makeText(getContext(), "没有拍摄照片", Toast.LENGTH_SHORT).show();
return;
}else {
String s = PhotoUtils.showPhotoAndGetPath(file, ivAttestation3);
ivAttestation3.setTag(s);
tvCard3.setTag(s);
}
file=null;
ivHera3.setVisibility(View.GONE);

View File

@ -89,18 +89,18 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked){
if (isChecked) {
checkBox.setChecked(true);
navInfo = getActivity().getSharedPreferences("navInfo", Context.MODE_PRIVATE);
bankAccount = navInfo.getString("bankAccount", null);
if (bankAccount ==null|| bankAccount.equals("")){
if (bankAccount == null || bankAccount.equals("")) {
String attestationName = navInfo.getString("attestationName", null);
if (attestationName == null || attestationName.equals("")) {
Intent attestationIntent = new Intent(getContext(), FragmentManagement.class);
attestationIntent.putExtra("tag", 25);
startActivity(attestationIntent);
Toast.makeText(getContext(), "未实名认证,不能绑定银行卡", Toast.LENGTH_SHORT).show();
}else {
} else {
Intent gatheringIntent = new Intent(getContext(), FragmentManagement.class);
gatheringIntent.putExtra("tag", 24);
startActivity(gatheringIntent);
@ -188,26 +188,26 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
if (etAllPrice.getText().toString().equals("")) {
Toast.makeText(getContext(), "提现金额不能为空", Toast.LENGTH_SHORT).show();
}
String price = etAllPrice.getText().toString().trim();
Integer integer = Integer.valueOf(price);
if (integer!=null&&integer<10){
String price = etAllPrice.getText().toString();
double prices = Double.valueOf(price);
if (prices != 0 && prices < 10) {
Toast.makeText(getContext(), "提现金额不能低于10元", Toast.LENGTH_SHORT).show();
return;
}
if (!checkBox.isChecked()){
if (!checkBox.isChecked()) {
Toast.makeText(getContext(), "请勾选银行卡", Toast.LENGTH_SHORT).show();
return;
}
if (bankAccount!=null){
if (bankAccount != null) {
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
MessageDialog.show((AppCompatActivity) getContext(), "提示", "是否提取到"+bankAccount.substring(bankAccount.length()-4)+"的银行卡", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
MessageDialog.show((AppCompatActivity) getContext(), "提示", "是否提取到" + bankAccount.substring(bankAccount.length() - 4) + "的银行卡", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
immediatelyPrice();
return false;
}
});
}else {
} else {
Toast.makeText(getContext(), "请先绑定银行卡", Toast.LENGTH_SHORT).show();
}
@ -236,7 +236,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
public void onSuccess(UserPriceExchangeBean response, int id) {
dismissLoadingDialog();
Toast.makeText(getContext(), response.getMessage(), Toast.LENGTH_SHORT).show();
if (response.getCode()==200){
if (response.getCode() == 200) {
String unit = tvUnit.getText().toString();
String price = etAllPrice.getText().toString();
double v = Double.valueOf(unit) - Double.valueOf(price);

View File

@ -83,7 +83,7 @@
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintTop_toTopOf="@+id/btn_switch"
android:background="@color/whiteAlpha50"
android:padding="@dimen/default_widget_padding"
android:format="00:00:00"

View File

@ -90,7 +90,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:id="@+id/tv_name"
android:id="@+id/tv_name_pic"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="名称*"
@ -108,11 +108,11 @@
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="18dp"
android:layout_toRightOf="@id/tv_name"
android:layout_toRightOf="@id/tv_name_pic"
android:background="@color/white"
android:hint="名称"
android:singleLine="true"
android:layout_toEndOf="@id/tv_name"
android:layout_toEndOf="@id/tv_name_pic"
android:layout_toStartOf="@id/tv_examine"
android:textSize="15sp"
android:textColor="@color/test_color_selector" />

View File

@ -62,10 +62,13 @@
<EditText
android:id="@+id/et_forgetPaw_phone"
android:layout_width="300dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:background="@null"
android:digits="1234567890"
android:hint="11为手机号码"
android:maxLength="11"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:textColorHint="@color/colorTransparent"
@ -76,11 +79,13 @@
app:layout_constraintTop_toBottomOf="@id/forgetPaw_phone" />
<View
android:layout_width="300dp"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/colorHui"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
app:layout_constraintLeft_toLeftOf="@id/et_forgetPaw_phone"
app:layout_constraintTop_toBottomOf="@id/et_forgetPaw_phone" />
app:layout_constraintTop_toBottomOf="@id/et_forgetPaw_phone"/>
<TextView
android:id="@+id/forgetPaw_note"
@ -95,42 +100,36 @@
<EditText
android:id="@+id/et_forgetPaw_note"
android:layout_width="200dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:hint="6为短信验证"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:layout_marginLeft="20dp"
android:textColorHint="@color/colorTransparent"
android:textCursorDrawable="@drawable/text_color"
android:textSize="15sp"
android:theme="@style/MyEditText"
app:layout_constraintLeft_toLeftOf="@id/forgetPaw_note"
app:layout_constraintRight_toLeftOf="@+id/forgetPaw_get_note"
app:layout_constraintTop_toBottomOf="@id/forgetPaw_note" />
<View
android:layout_width="300dp"
android:layout_height="1dp"
android:background="@color/colorHui"
app:layout_constraintLeft_toLeftOf="@id/et_forgetPaw_note"
app:layout_constraintTop_toBottomOf="@id/et_forgetPaw_note" />
<TextView
android:id="@+id/forgetPaw_get_note"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="40dp"
android:text="获取短信验证码"
android:textColor="@color/colorWhite"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="@id/et_forgetPaw_note"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintRight_toRightOf="@+id/tv_view"
app:layout_constraintTop_toTopOf="@id/et_forgetPaw_note" />
<TextView
android:layout_width="300dp"
<View
android:id="@+id/tv_view"
android:layout_width="match_parent"
android:layout_height="1dp"
android:textColor="@color/colorWhite"
android:layout_marginRight="20dp"
android:layout_marginLeft="20dp"
android:background="@color/colorHui"
app:layout_constraintLeft_toLeftOf="@id/et_forgetPaw_note"
app:layout_constraintTop_toBottomOf="@id/et_forgetPaw_note" />
@ -143,16 +142,17 @@
android:text="密码"
android:textColor="@color/colorWhite"
android:textSize="14sp"
app:layout_constraintLeft_toLeftOf="@id/et_forgetPaw_note"
app:layout_constraintLeft_toLeftOf="@id/forgetPaw_note"
app:layout_constraintTop_toBottomOf="@id/et_forgetPaw_note" />
<EditText
android:id="@+id/et_forgetPaw_paw"
android:layout_width="300dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:hint="6-20位密码"
android:paddingTop="10dp"
android:layout_marginLeft="20dp"
android:paddingBottom="10dp"
android:textColorHint="@color/colorTransparent"
android:textCursorDrawable="@drawable/text_color"
@ -162,9 +162,11 @@
app:layout_constraintTop_toBottomOf="@id/forgetPaw_paw" />
<View
android:layout_width="300dp"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/colorHui"
android:layout_marginRight="20dp"
android:layout_marginLeft="20dp"
app:layout_constraintLeft_toLeftOf="@id/et_forgetPaw_paw"
app:layout_constraintTop_toBottomOf="@id/et_forgetPaw_paw" />
@ -181,7 +183,7 @@
<EditText
android:id="@+id/et_forgetPaw_confirm_paw"
android:layout_width="300dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:hint="请再次输入一遍密码"
@ -189,14 +191,17 @@
android:paddingBottom="10dp"
android:textColorHint="@color/colorTransparent"
android:textCursorDrawable="@drawable/text_color"
android:layout_marginLeft="20dp"
android:textSize="15sp"
android:theme="@style/MyEditText"
app:layout_constraintLeft_toLeftOf="@id/forgetPaw_confirm_paw"
app:layout_constraintTop_toBottomOf="@id/forgetPaw_confirm_paw" />
<View
android:layout_width="300dp"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginRight="20dp"
android:layout_marginLeft="20dp"
android:background="@color/colorHui"
app:layout_constraintLeft_toLeftOf="@id/et_forgetPaw_confirm_paw"
app:layout_constraintTop_toBottomOf="@id/et_forgetPaw_confirm_paw" />
@ -204,9 +209,11 @@
<Button
android:id="@+id/btn_forgetPaw"
style="@style/login_style"
android:layout_width="300dp"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="50dp"
android:gravity="center"
android:text="提交"
app:layout_constraintLeft_toLeftOf="parent"

View File

@ -74,18 +74,23 @@
<EditText
android:id="@+id/et_register_phone"
android:layout_width="300dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="11为手机号码"
android:layout_marginLeft="35dp"
style="@style/register_hint_style"
android:digits="1234567890"
android:maxLength="11"
android:textColorHint="@color/colorTransparent"
android:textCursorDrawable="@drawable/text_color"
android:theme="@style/MyEditText"
app:layout_constraintLeft_toLeftOf="@id/register_phone"
app:layout_constraintTop_toBottomOf="@id/register_phone" />
<View
android:layout_width="300dp"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="35dp"
android:layout_marginRight="50dp"
android:background="@color/colorHui"
app:layout_constraintTop_toBottomOf="@id/et_register_phone"
app:layout_constraintLeft_toLeftOf="@id/et_register_phone"/>
@ -102,11 +107,10 @@
<EditText
android:id="@+id/et_register_note"
style="@style/register_hint_style"
android:layout_width="200dp"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:hint="6为短信验证"
android:hint="6位短信验证"
style="@style/register_hint_style"
android:textColorHint="@color/colorTransparent"
android:textCursorDrawable="@drawable/text_color"
android:theme="@style/MyEditText"
@ -115,8 +119,10 @@
<View
android:id="@+id/view3"
android:layout_width="300dp"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="35dp"
android:layout_marginRight="50dp"
android:background="@color/colorHui"
app:layout_constraintTop_toBottomOf="@id/et_register_note"
app:layout_constraintLeft_toLeftOf="@id/et_register_note"/>
@ -129,7 +135,7 @@
android:textColor="@color/colorWhite"
app:layout_constraintTop_toTopOf="@id/et_register_note"
app:layout_constraintBottom_toBottomOf="@id/et_register_note"
app:layout_constraintRight_toRightOf="@id/et_register_phone"
app:layout_constraintRight_toRightOf="@id/view3"
/>
<TextView
android:id="@+id/register_referrer"
@ -154,9 +160,11 @@
app:layout_constraintLeft_toLeftOf="@id/register_referrer"
app:layout_constraintTop_toBottomOf="@id/register_referrer"/>
<View
android:layout_width="300dp"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/colorHui"
android:layout_marginLeft="35dp"
android:layout_marginRight="50dp"
app:layout_constraintTop_toBottomOf="@id/et_register_referrer"
app:layout_constraintLeft_toLeftOf="@id/et_register_referrer"/>
<TextView
@ -176,15 +184,18 @@
android:layout_height="wrap_content"
android:hint="6-20位密码"
style="@style/register_hint_style"
android:maxLength="20"
android:textColorHint="@color/colorTransparent"
android:textCursorDrawable="@drawable/text_color"
android:theme="@style/MyEditText"
app:layout_constraintLeft_toLeftOf="@id/register_paw"
app:layout_constraintTop_toBottomOf="@id/register_paw"/>
<View
android:layout_width="300dp"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/colorHui"
android:layout_marginLeft="35dp"
android:layout_marginRight="50dp"
app:layout_constraintTop_toBottomOf="@id/et_register_paw"
app:layout_constraintLeft_toLeftOf="@id/et_register_paw"/>
<TextView
@ -203,6 +214,7 @@
android:layout_width="300dp"
android:layout_height="wrap_content"
android:hint="请再次输入一遍密码"
android:maxLength="20"
style="@style/register_hint_style"
android:textColorHint="@color/colorTransparent"
android:textCursorDrawable="@drawable/text_color"
@ -210,9 +222,12 @@
app:layout_constraintLeft_toLeftOf="@id/register_confirm_paw"
app:layout_constraintTop_toBottomOf="@id/register_confirm_paw"/>
<View
android:layout_width="300dp"
android:id="@+id/view_paw"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/colorHui"
android:layout_marginLeft="35dp"
android:layout_marginRight="50dp"
app:layout_constraintTop_toBottomOf="@id/et_register_confirm_paw"
app:layout_constraintLeft_toLeftOf="@id/et_register_confirm_paw"/>
<ImageView
@ -239,16 +254,19 @@
android:text="已有账号,去登录"
android:textColor="@color/colorWhite"
app:layout_constraintTop_toTopOf="@id/iv_register_check"
app:layout_constraintRight_toRightOf="@id/et_register_confirm_paw"
app:layout_constraintRight_toRightOf="@id/view_paw"
app:layout_constraintBottom_toBottomOf="@id/iv_register_check"/>
<Button
android:id="@+id/btn_register"
android:layout_width="300dp"
android:layout_height="50dp"
android:layout_marginTop="20dp"
android:gravity="center"
style="@style/login_style"
android:text="注册"
android:layout_marginLeft="35dp"
android:layout_marginRight="35dp"
app:layout_constraintLeft_toLeftOf="@id/iv_register_check"
app:layout_constraintTop_toBottomOf="@id/iv_register_check"/>

View File

@ -109,15 +109,19 @@
android:layout_height="1dp"
android:background="#2196F3" />
<LinearLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_creditNumbers"
android:layout_width="100dp"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:gravity="center"
android:text="银行卡号:"
android:textColor="#333"
@ -125,18 +129,18 @@
<EditText
android:id="@+id/et_bank_num"
android:layout_width="200dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="100dp"
android:layout_marginRight="50dp"
android:background="@null"
android:hint="银行卡号"
android:digits="1234567890"
android:maxLength="19"
android:textSize="16sp" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="60dp"
android:layout_height="match_parent">
android:textSize="16sp"
app:layout_constraintTop_toTopOf="@+id/tv_creditNumbers"
app:layout_constraintLeft_toRightOf="@+id/tv_creditNumbers"
/>
<ImageView
android:id="@+id/gathering_camera"
@ -145,11 +149,13 @@
android:layout_marginBottom="10dp"
android:src="@drawable/ic_baseline_camera"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
app:layout_constraintLeft_toRightOf="@+id/et_bank_num"
app:layout_constraintTop_toTopOf="parent"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:layout_width="match_parent"

View File

@ -316,7 +316,7 @@
android:layout_height="20dp"
/>
<TextView
android:id="@+id/tv_name"
android:id="@+id/tv_poi_name_pic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"