Merge remote-tracking branch 'OutDoor/master'

This commit is contained in:
wds 2021-08-04 16:59:58 +08:00
commit 85335843ae
16 changed files with 357 additions and 246 deletions

View File

@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
android { android {
compileSdkVersion 29 compileSdkVersion 29
buildToolsVersion '29.0.2' buildToolsVersion '29.0.2'
// ndkVersion '23.0.7123448' ndkVersion '23.0.7123448'
defaultConfig { defaultConfig {
applicationId "com.navinfo.outdoor" applicationId "com.navinfo.outdoor"

View File

@ -22,9 +22,10 @@ import org.jetbrains.annotations.NotNull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Vector;
public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.ViewHolder> { public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.ViewHolder> {
private List<PoiEntity> allRoad = new ArrayList<>(); private Vector<PoiEntity> allRoad = new Vector<>();
private Context context; private Context context;
public StaySubmitAdapter(Context context) { public StaySubmitAdapter(Context context) {
@ -55,6 +56,7 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
synchronized (allRoad) {
Iterator iterator = allRoad.iterator(); Iterator iterator = allRoad.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
PoiEntity poiEntity = (PoiEntity) iterator.next(); PoiEntity poiEntity = (PoiEntity) iterator.next();
@ -64,6 +66,7 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
} }
} }
handler.sendEmptyMessage(0x105); handler.sendEmptyMessage(0x105);
}
} }
}).start(); }).start();
@ -84,10 +87,11 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
holder.tvDay.setText(poiEntity.getCreateTime()); holder.tvDay.setText(poiEntity.getCreateTime());
//获取checkBox点击的记录 //获取checkBox点击的记录
holder.cbUnSubmit.setChecked(allRoad.get(position).isChecked()); holder.cbUnSubmit.setChecked(allRoad.get(position).isChecked());
holder.cbUnSubmit.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { holder.cbUnSubmit.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { public void onClick(View v) {
allRoad.get(position).setChecked(isChecked); holder.cbUnSubmit.setChecked(!poiEntity.isChecked());
poiEntity.setChecked(!poiEntity.isChecked());
} }
}); });
if (poiEntity.getIsLocalData() == 1){ if (poiEntity.getIsLocalData() == 1){

View File

@ -1093,7 +1093,9 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
@Override @Override
public void onSuccess(ChargingStationBean chargingStationBean, int id) { public void onSuccess(ChargingStationBean chargingStationBean, int id) {
dismissLoadingDialog(); dismissLoadingDialog();
if (chargingStationBean.getCode() == 200) {
bodyId = chargingStationBean.getBody(); bodyId = chargingStationBean.getBody();
if (bodyId != null && bodyId != 0) {
poiEntity.setBodyId(bodyId); poiEntity.setBodyId(bodyId);
poiEntity.setTaskStatus(3); poiEntity.setTaskStatus(3);
new Thread(new Runnable() { new Thread(new Runnable() {
@ -1117,6 +1119,12 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
}); });
} }
}).start(); }).start();
} else {
Toast.makeText(getContext(), "" + chargingStationBean.getMessage(), Toast.LENGTH_SHORT).show();
}
} else {
Toast.makeText(getContext(), "" + chargingStationBean.getMessage(), Toast.LENGTH_SHORT).show();
}
} }
@Override @Override

View File

@ -680,9 +680,12 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
poiListEntity.setX(latPolygon.get(0).longitude + ""); poiListEntity.setX(latPolygon.get(0).longitude + "");
poiListEntity.setY(latPolygon.get(0).latitude + ""); poiListEntity.setY(latPolygon.get(0).latitude + "");
} }
if (poiListEntity.getTaskStatus()!=1){
// 通知地图界面显示当前编辑数据的marker // 通知地图界面显示当前编辑数据的marker
senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX()); senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX());
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity); InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
}
getActivity().runOnUiThread(new Runnable() { getActivity().runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -789,9 +792,12 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
poiListEntity.setX(latPolygon.get(0).longitude + ""); poiListEntity.setX(latPolygon.get(0).longitude + "");
poiListEntity.setY(latPolygon.get(0).latitude + ""); poiListEntity.setY(latPolygon.get(0).latitude + "");
} }
if (poiListEntity.getTaskStatus()!=1){
// 通知地图界面显示当前编辑数据的marker // 通知地图界面显示当前编辑数据的marker
senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX()); senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX());
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity); InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
}
getActivity().runOnUiThread(new Runnable() { getActivity().runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {

View File

@ -526,7 +526,9 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
@Override @Override
public void onSuccess(PoiSaveBean poiSaveBean, int id) { public void onSuccess(PoiSaveBean poiSaveBean, int id) {
dismissLoadingDialog(); dismissLoadingDialog();
if (poiSaveBean.getCode()==200){
Integer body = poiSaveBean.getBody(); Integer body = poiSaveBean.getBody();
if (body!=null&&body!=0){
poiEntity.setBodyId(body); poiEntity.setBodyId(body);
poiEntity.setTaskStatus(3); poiEntity.setTaskStatus(3);
new Thread(new Runnable() { new Thread(new Runnable() {
@ -546,6 +548,15 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
}); });
} }
}).start(); }).start();
}else {
Toast.makeText(getActivity(), ""+poiSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
}
}else {
Toast.makeText(getActivity(), ""+poiSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
}
} }
@Override @Override

View File

@ -799,7 +799,9 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
@Override @Override
public void onSuccess(PoiSaveBean poiSaveBean, int id) { public void onSuccess(PoiSaveBean poiSaveBean, int id) {
dismissLoadingDialog(); dismissLoadingDialog();
if (poiSaveBean.getCode()==200){
Integer body = poiSaveBean.getBody(); Integer body = poiSaveBean.getBody();
if (body!=null&&body!=0){
poiEntity.setBodyId(body); poiEntity.setBodyId(body);
poiEntity.setTaskStatus(3); poiEntity.setTaskStatus(3);
new Thread(new Runnable() { new Thread(new Runnable() {
@ -819,6 +821,14 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
}); });
} }
}).start(); }).start();
}else {
Toast.makeText(getActivity(), ""+poiSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
}
}else {
Toast.makeText(getActivity(), ""+poiSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
}
} }
@Override @Override

View File

@ -14,6 +14,7 @@ import android.widget.AdapterView;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.RadioButton; import android.widget.RadioButton;
import android.widget.RadioGroup; import android.widget.RadioGroup;
@ -91,6 +92,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
private Button btnPoiVideoUpload; private Button btnPoiVideoUpload;
private String videoPath; private String videoPath;
private File fileZip; private File fileZip;
private FrameLayout fmPoiVideoPic;
public static PoiVideoFragment newInstance(Bundle bundle) { public static PoiVideoFragment newInstance(Bundle bundle) {
PoiVideoFragment fragment = new PoiVideoFragment(); PoiVideoFragment fragment = new PoiVideoFragment();
@ -151,12 +153,13 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
rbWalking = (RadioButton) findViewById(R.id.rb_walking); rbWalking = (RadioButton) findViewById(R.id.rb_walking);
rbManual = (RadioButton) findViewById(R.id.rb_manual); rbManual = (RadioButton) findViewById(R.id.rb_manual);
etDesc = (EditText) findViewById(R.id.et_desc); etDesc = (EditText) findViewById(R.id.et_desc);
fmPoiVideoPic = findViewById(R.id.fm_poi_video_picture);
btnRoadSave = (Button) findViewById(R.id.btn_poi_video_save); btnRoadSave = (Button) findViewById(R.id.btn_poi_video_save);
btnRoadSave.setOnClickListener(this::onClick); btnRoadSave.setOnClickListener(this::onClick);
btnPoiVideoUpload = findViewById(R.id.btn_poi_video_upload); btnPoiVideoUpload = findViewById(R.id.btn_poi_video_upload);
btnPoiVideoUpload.setOnClickListener(this::onClick); btnPoiVideoUpload.setOnClickListener(this::onClick);
rgType = (RadioGroup) findViewById(R.id.rg_type); rgType = (RadioGroup) findViewById(R.id.rg_type);
ivPoiVideoPicture.setOnClickListener(new View.OnClickListener() { fmPoiVideoPic.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (v.getTag() == null) { if (v.getTag() == null) {
@ -164,19 +167,19 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
return; return;
} }
File videoFile = (File) v.getTag(); File videoFile = (File) v.getTag();
Intent intent = new Intent(getContext(), PicturesActivity.class); Intent intent = new Intent(getContext(), PictureActivity.class);
intent.putExtra(Constant.INTENT_VIDEO_PATH, videoFile.getAbsolutePath()); intent.putExtra(Constant.INTENT_VIDEO_PATH, videoFile.getAbsolutePath());
startActivityForResult(intent, 0x101); startActivityForResult(intent, 0x101);
} }
}); });
ivPoiVideoPicture.setOnLongClickListener(new View.OnLongClickListener() { fmPoiVideoPic.setOnLongClickListener(new View.OnLongClickListener() {
@Override @Override
public boolean onLongClick(View v) { public boolean onLongClick(View v) {
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE; DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
MessageDialog.show((AppCompatActivity) getContext(), "提示", "对否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() { MessageDialog.show((AppCompatActivity) getContext(), "提示", "对否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
File videoFile = (File) ivPoiVideoPicture.getTag(); File videoFile = (File) fmPoiVideoPic.getTag();
if (videoFile != null) { if (videoFile != null) {
videoFile.delete(); videoFile.delete();
//获取文件名 //获取文件名
@ -215,7 +218,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
if (videoFile.exists()) { if (videoFile.exists()) {
// 使用glide加载视频的第一帧 // 使用glide加载视频的第一帧
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivPoiVideoPicture, 500); AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivPoiVideoPicture, 500);
ivPoiVideoPicture.setTag(videoFile); fmPoiVideoPic.setTag(videoFile);
} }
} }
} }
@ -271,7 +274,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
// 根据用户点击的时间为视频名称赋值 // 根据用户点击的时间为视频名称赋值
DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss"); DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
String videoFormatName = formatter.format(new Date()); String videoFormatName = formatter.format(new Date());
Intent intent = new Intent(getContext(), PicturesActivity.class); Intent intent = new Intent(getContext(), PictureActivity.class);
intent.putExtra(Constant.INTENT_VIDEO_PATH, Constant.PICTURE_FOLDER + "/" + videoFormatName + ".mp4"); intent.putExtra(Constant.INTENT_VIDEO_PATH, Constant.PICTURE_FOLDER + "/" + videoFormatName + ".mp4");
startActivityForResult(intent, 0x101); startActivityForResult(intent, 0x101);
@ -280,8 +283,8 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
case R.id.btn_poi_video_upload: case R.id.btn_poi_video_upload:
showLoadingDialog(); showLoadingDialog();
ArrayList<File> videoFileList = new ArrayList<>(); ArrayList<File> videoFileList = new ArrayList<>();
if (ivPoiVideoPicture.getTag() != null) { if (fmPoiVideoPic.getTag() != null) {
File videoFile = (File) ivPoiVideoPicture.getTag(); File videoFile = (File) fmPoiVideoPic.getTag();
videoFileList.add(videoFile); videoFileList.add(videoFile);
File file = new File(videoFile.getPath()+".txt"); File file = new File(videoFile.getPath()+".txt");
videoFileList.add(file); videoFileList.add(file);
@ -372,7 +375,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
poiEntity.setTaskId(showPoiEntity.getTaskId()); poiEntity.setTaskId(showPoiEntity.getTaskId());
} }
} }
File videoFile = (File) ivPoiVideoPicture.getTag(); File videoFile = (File) fmPoiVideoPic.getTag();
if (videoFile == null ) { if (videoFile == null ) {
Toast.makeText(getActivity(), "请录像", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), "请录像", Toast.LENGTH_SHORT).show();
return; return;
@ -505,6 +508,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
@Override @Override
public void onSuccess(PoiVideoBean poiVideoBean, int id) { public void onSuccess(PoiVideoBean poiVideoBean, int id) {
dismissLoadingDialog(); dismissLoadingDialog();
if (poiVideoBean.getCode()==200){
Integer poiVideoBody = poiVideoBean.getBody(); Integer poiVideoBody = poiVideoBean.getBody();
if (poiVideoBody != null && poiVideoBody != 0) { if (poiVideoBody != null && poiVideoBody != 0) {
poiEntity.setBodyId(poiVideoBody); poiEntity.setBodyId(poiVideoBody);
@ -529,6 +533,10 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
} else { } else {
Toast.makeText(getActivity(), ""+poiVideoBean.getMessage(), Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), ""+poiVideoBean.getMessage(), Toast.LENGTH_SHORT).show();
} }
}else {
Toast.makeText(getActivity(), ""+poiVideoBean.getMessage(), Toast.LENGTH_SHORT).show();
}
} }
@ -552,7 +560,7 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
File videoFile = new File(videoPath); File videoFile = new File(videoPath);
if (videoFile.exists()) { if (videoFile.exists()) {
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivPoiVideoPicture, 500); AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivPoiVideoPicture, 500);
ivPoiVideoPicture.setTag(videoFile); fmPoiVideoPic.setTag(videoFile);
} }
} }
} }

View File

@ -14,6 +14,7 @@ import android.widget.AdapterView;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.RadioButton; import android.widget.RadioButton;
import android.widget.RadioGroup; import android.widget.RadioGroup;
@ -86,6 +87,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
private Button roadUpload; private Button roadUpload;
private String videoPath; private String videoPath;
private File fileZip; private File fileZip;
private FrameLayout fmRoadPic;
public static RoadFragment newInstance(Bundle bundle) { public static RoadFragment newInstance(Bundle bundle) {
RoadFragment fragment = new RoadFragment(); RoadFragment fragment = new RoadFragment();
@ -147,12 +149,13 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
rbWalking = (RadioButton) findViewById(R.id.rb_walking); rbWalking = (RadioButton) findViewById(R.id.rb_walking);
rbManual = (RadioButton) findViewById(R.id.rb_manual); rbManual = (RadioButton) findViewById(R.id.rb_manual);
etDesc = (EditText) findViewById(R.id.et_desc); etDesc = (EditText) findViewById(R.id.et_desc);
fmRoadPic = findViewById(R.id.fm_road_picture);
btnRoadSave = (Button) findViewById(R.id.btn_road_save); btnRoadSave = (Button) findViewById(R.id.btn_road_save);
btnRoadSave.setOnClickListener(this::onClick); btnRoadSave.setOnClickListener(this::onClick);
rgType = (RadioGroup) findViewById(R.id.rg_type); rgType = (RadioGroup) findViewById(R.id.rg_type);
roadUpload = findViewById(R.id.road_upload); roadUpload = findViewById(R.id.road_upload);
roadUpload.setOnClickListener(this::onClick); roadUpload.setOnClickListener(this::onClick);
ivRoadPicture.setOnClickListener(new View.OnClickListener() { fmRoadPic.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (v.getTag() == null) { if (v.getTag() == null) {
@ -192,7 +195,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
if (videoFile.exists()) { if (videoFile.exists()) {
// 使用glide加载视频的第一帧 // 使用glide加载视频的第一帧
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivRoadPicture, 500); AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivRoadPicture, 500);
ivRoadPicture.setTag(videoFile); fmRoadPic.setTag(videoFile);
} }
} }
} }
@ -263,9 +266,9 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
case R.id.road_upload: case R.id.road_upload:
showLoadingDialog(); showLoadingDialog();
ArrayList<File> videoFileList = new ArrayList<>(); ArrayList<File> videoFileList = new ArrayList<>();
if (ivRoadPicture.getTag() != null) { if (fmRoadPic.getTag() != null) {
File videoFile = (File) ivRoadPicture.getTag(); File videoFile = (File) fmRoadPic.getTag();
videoFileList.add(videoFile); videoFileList.add(videoFile);
File file = new File(videoFile.getPath() + ".txt"); File file = new File(videoFile.getPath() + ".txt");
videoFileList.add(file); videoFileList.add(file);
@ -346,11 +349,11 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
poiEntity.setTaskId(showPoiEntity.getTaskId()); poiEntity.setTaskId(showPoiEntity.getTaskId());
} }
} }
if (ivRoadPicture.getTag() == null) { if (fmRoadPic.getTag() == null) {
Toast.makeText(getActivity(), "请录像", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), "请录像", Toast.LENGTH_SHORT).show();
return; return;
} else { } else {
File videoFile = (File) ivRoadPicture.getTag(); File videoFile = (File) fmRoadPic.getTag();
String path = videoFile.getPath() + ".txt"; String path = videoFile.getPath() + ".txt";
poiEntity.setPhoto(videoFile.getAbsolutePath()); poiEntity.setPhoto(videoFile.getAbsolutePath());
List<String> strings = FileUtils.readFileToList(path, "utf-8"); List<String> strings = FileUtils.readFileToList(path, "utf-8");
@ -482,6 +485,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
@Override @Override
public void onSuccess(RoadSaveBean roadSaveBean, int id) { public void onSuccess(RoadSaveBean roadSaveBean, int id) {
dismissLoadingDialog(); dismissLoadingDialog();
if (roadSaveBean.getCode()==200){
Integer roadBody = roadSaveBean.getBody(); Integer roadBody = roadSaveBean.getBody();
if (roadBody!=null&&roadBody!=0){ if (roadBody!=null&&roadBody!=0){
poiEntity.setBodyId(roadBody); poiEntity.setBodyId(roadBody);
@ -506,6 +510,10 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
}else { }else {
Toast.makeText(getContext(), ""+roadSaveBean.getMessage(), Toast.LENGTH_SHORT).show(); Toast.makeText(getContext(), ""+roadSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
} }
}else {
Toast.makeText(getContext(), ""+roadSaveBean.getMessage(), Toast.LENGTH_SHORT).show();
}
} }
@ -530,7 +538,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
File videoFile = new File(videoPath); File videoFile = new File(videoPath);
if (videoFile.exists()) { if (videoFile.exists()) {
AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivRoadPicture, 500); AWMp4ParserHelper.getInstance().loadFirstWithGlide(getActivity(), Uri.fromFile(videoFile).toString(), ivRoadPicture, 500);
ivRoadPicture.setTag(videoFile); fmRoadPic.setTag(videoFile);
} }
} }
} }

View File

@ -198,7 +198,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
@Override @Override
public boolean onClick(BaseDialog baseDialog, View v) { public boolean onClick(BaseDialog baseDialog, View v) {
staySubmitAdapter.setAllCheckedDelete(); staySubmitAdapter.setAllCheckedDelete();
refreshData(); // refreshData();
return false; return false;
} }
}); });

View File

@ -118,11 +118,33 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
startActivityForResult(ivAttestation3, 300); startActivityForResult(ivAttestation3, 300);
break; break;
case R.id.btn_attestation: case R.id.btn_attestation:
/**
* static boolean ChineseNameTest(String name) {
* if (!name.matches("[\u4e00-\u9fa5]{2,4}")) {
* System.out.println("只能输入2到4个汉字");
* return false;
* }else return true;
* }
*/
if (etAttestationName.getText().toString() == null || etAttestationName.getText().toString().equals("")) {
Toast.makeText(getContext(), "姓名不能为空,请输入姓名", Toast.LENGTH_SHORT).show();
return;
}
if (!chineseNameTest(etAttestationName.getText().toString())){
Toast.makeText(getActivity(), "请输入中文名字", Toast.LENGTH_SHORT).show();
return;
}
if (!checkNum(etNamePhone.getText().toString().trim())) {
Toast.makeText(getContext(), "身份证号错误,请重新输入", Toast.LENGTH_SHORT).show();
return;
}
nameAuthentication(); nameAuthentication();
break; break;
} }
} }
/***
*
*/
public boolean checkNum(String text) { public boolean checkNum(String text) {
Pattern patternSfzhm1 = Pattern Pattern patternSfzhm1 = Pattern
.compile("^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$"); .compile("^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$");
@ -135,7 +157,16 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
else return true; else return true;
} }
/**
* 中文效验
*/
static boolean chineseNameTest(String name) {
if (!name.matches("[\u4e00-\u9fa5]{2,4}")) {
System.out.println("只能输入2到4个汉字");
return false;
}else return true;
}
private void nameAuthentication() { private void nameAuthentication() {
if (etAttestationName.getText().toString() == null || etAttestationName.getText().toString().equals("")) { if (etAttestationName.getText().toString() == null || etAttestationName.getText().toString().equals("")) {
Toast.makeText(getContext(), "姓名不能为空,请输入姓名", Toast.LENGTH_SHORT).show(); Toast.makeText(getContext(), "姓名不能为空,请输入姓名", Toast.LENGTH_SHORT).show();
@ -222,73 +253,70 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
if (requestCode == 100 && resultCode == RESULT_OK) { if (requestCode == 100 && resultCode == RESULT_OK) {
Bundle extras = data.getExtras();//从Intent中获取附加值 Bundle extras = data.getExtras();//从Intent中获取附加值
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像 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");
startActivityForResult(intentPanorama, 100);
return false;
}
});
} else {
String takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a", ""); String takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a", "");
ivAttestation1.setTag(takePhotoPath1); ivAttestation1.setTag(takePhotoPath1);
ivAttestation1.setImageBitmap(bitmap);//显示图像 ivAttestation1.setImageBitmap(bitmap);//显示图像
ivHera1.setVisibility(View.GONE); ivHera1.setVisibility(View.GONE);
tvCard1.setVisibility(View.GONE); tvCard1.setVisibility(View.GONE);
} // int height = bitmap.getHeight();
// int width = bitmap.getWidth();
// if (height > width) {
// DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
// MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
// @Override
// public boolean onClick(BaseDialog baseDialog, View v) {
// Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
// startActivityForResult(intentPanorama, 100);
// return false;
// }
// });
// }
} }
if (requestCode == 200 && resultCode == RESULT_OK) { if (requestCode == 200 && resultCode == RESULT_OK) {
Bundle extras = data.getExtras();//从Intent中获取附加值 Bundle extras = data.getExtras();//从Intent中获取附加值
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像 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");
startActivityForResult(intentPanorama, 200);
return false;
}
});
} else {
String takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "a", ""); String takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "a", "");
ivAttestation2.setTag(takePhotoPath2); ivAttestation2.setTag(takePhotoPath2);
ivAttestation2.setImageBitmap(bitmap);//显示图像 ivAttestation2.setImageBitmap(bitmap);//显示图像
ivHera2.setVisibility(View.GONE); ivHera2.setVisibility(View.GONE);
tvCard2.setVisibility(View.GONE); tvCard2.setVisibility(View.GONE);
} // int height = bitmap.getHeight();
// int width = bitmap.getWidth();
// if (height > width) {
// DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
// MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
// @Override
// public boolean onClick(BaseDialog baseDialog, View v) {
// Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
// startActivityForResult(intentPanorama, 200);
// return false;
// }
// });
// }
} }
if (requestCode == 300 && resultCode == RESULT_OK) { if (requestCode == 300 && resultCode == RESULT_OK) {
Bundle extras = data.getExtras();//从Intent中获取附加值 Bundle extras = data.getExtras();//从Intent中获取附加值
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像 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");
startActivityForResult(intentPanorama, 300);
return false;
}
});
} else {
String takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "a", ""); String takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "a", "");
ivAttestation3.setTag(takePhotoPath3); ivAttestation3.setTag(takePhotoPath3);
ivAttestation3.setImageBitmap(bitmap);//显示图像 ivAttestation3.setImageBitmap(bitmap);//显示图像
ivHera3.setVisibility(View.GONE); ivHera3.setVisibility(View.GONE);
tvCard3.setVisibility(View.GONE); tvCard3.setVisibility(View.GONE);
// int height = bitmap.getHeight();
// int width = bitmap.getWidth();
// if (height > width) {
// DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
// MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
// @Override
// public boolean onClick(BaseDialog baseDialog, View v) {
// Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
// startActivityForResult(intentPanorama, 300);
// return false;
// }
// });
// } else {
//
// }
} }
} }
} }
}

View File

@ -72,8 +72,8 @@
<Button <Button
android:id="@+id/btn_attestation" android:id="@+id/btn_attestation"
style="@style/user_style" style="@style/user_style"
android:layout_width="70dp" android:layout_width="wrap_content"
android:layout_height="30dp" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:text="去认证" android:text="去认证"
@ -102,8 +102,8 @@
/> />
<Button <Button
android:id="@+id/btn_gathering" android:id="@+id/btn_gathering"
android:layout_width="70dp" android:layout_width="wrap_content"
android:layout_height="30dp" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:text="去绑定" android:text="去绑定"
@ -258,8 +258,8 @@
style="@style/user_text_style" style="@style/user_text_style"
/> />
<Button <Button
android:layout_width="70dp" android:layout_width="wrap_content"
android:layout_height="30dp" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:text="去绑定" android:text="去绑定"

View File

@ -36,11 +36,11 @@
android:id="@+id/ll_name" android:id="@+id/ll_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:background="@drawable/road_shape" android:background="@drawable/road_shape"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
app:layout_constraintStart_toStartOf="@+id/tv_message" app:layout_constraintStart_toStartOf="@+id/tv_message"
app:layout_constraintTop_toBottomOf="@+id/tv_message"> app:layout_constraintTop_toBottomOf="@+id/tv_message">
@ -56,12 +56,12 @@
<EditText <EditText
android:id="@+id/et_road_name" android:id="@+id/et_road_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:gravity="center_vertical"
android:layout_height="match_parent" android:layout_height="match_parent"
android:textSize="14sp" android:background="@null"
android:gravity="center_vertical"
android:inputType="text" android:inputType="text"
android:maxLines="1" android:maxLines="1"
android:background="@null" /> android:textSize="14sp" />
</LinearLayout> </LinearLayout>
<TextView <TextView
@ -79,8 +79,8 @@
android:id="@+id/ll_mode" android:id="@+id/ll_mode"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginLeft="2dp" android:layout_marginLeft="2dp"
android:layout_marginTop="15dp"
android:orientation="horizontal" android:orientation="horizontal"
app:layout_constraintTop_toBottomOf="@id/tv_mode"> app:layout_constraintTop_toBottomOf="@id/tv_mode">
@ -96,32 +96,32 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:textColor="@color/test_color_selector" android:text="车行"
android:text="车行" /> android:textColor="@color/test_color_selector" />
<RadioButton <RadioButton
android:id="@+id/rb_bicycle" android:id="@+id/rb_bicycle"
android:layout_width="0dp" android:layout_width="0dp"
android:textColor="@color/test_color_selector"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text="自行车" /> android:text="自行车"
android:textColor="@color/test_color_selector" />
<RadioButton <RadioButton
android:id="@+id/rb_walking" android:id="@+id/rb_walking"
android:layout_width="0dp" android:layout_width="0dp"
android:textColor="@color/test_color_selector"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text="步行" /> android:text="步行"
android:textColor="@color/test_color_selector" />
<RadioButton <RadioButton
android:id="@+id/rb_manual" android:id="@+id/rb_manual"
android:layout_width="0dp" android:layout_width="0dp"
android:textColor="@color/test_color_selector"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text="手动" /> android:text="手动"
android:textColor="@color/test_color_selector" />
</RadioGroup> </RadioGroup>
</LinearLayout> </LinearLayout>
@ -146,8 +146,8 @@
<TextView <TextView
android:id="@+id/tv_pictures" android:id="@+id/tv_pictures"
style="@style/user_style" style="@style/user_style"
android:layout_width="40dp" android:layout_width="wrap_content"
android:layout_height="25dp" android:layout_height="wrap_content"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:gravity="center" android:gravity="center"
android:text="拍照" android:text="拍照"
@ -155,21 +155,35 @@
android:textSize="15sp" /> android:textSize="15sp" />
</LinearLayout> </LinearLayout>
<FrameLayout
android:id="@+id/fm_road_picture"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
app:layout_constraintLeft_toLeftOf="@id/ll_pictures"
app:layout_constraintTop_toBottomOf="@id/ll_pictures">
<ImageView <ImageView
android:id="@+id/iv_road_picture" android:id="@+id/iv_road_picture"
android:layout_width="200dp" android:layout_width="wrap_content"
android:layout_height="100dp" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:minWidth="140dp"
app:layout_constraintLeft_toLeftOf="@id/ll_pictures" android:minHeight="70dp"
app:layout_constraintTop_toBottomOf="@id/ll_pictures" /> android:maxHeight="100dp"
android:maxWidth="200dp"
android:scaleType="fitXY"
/>
</FrameLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_desc" android:id="@+id/ll_desc"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintLeft_toLeftOf="@id/iv_road_picture" app:layout_constraintLeft_toLeftOf="@id/fm_road_picture"
app:layout_constraintTop_toBottomOf="@id/iv_road_picture"> app:layout_constraintTop_toBottomOf="@id/fm_road_picture">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -179,6 +193,7 @@
android:text="03.描述" android:text="03.描述"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="16sp" /> android:textSize="16sp" />
<LinearLayout <LinearLayout
android:id="@+id/linear_describe" android:id="@+id/linear_describe"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -187,24 +202,25 @@
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_marginEnd="10dp" android:layout_marginEnd="10dp"
android:background="@drawable/underline" android:background="@drawable/underline"
app:layout_constraintTop_toBottomOf="@id/tv_03"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"> app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_03">
<EditText <EditText
android:id="@+id/et_desc" android:id="@+id/et_desc"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingBottom="30dp"
android:layout_margin="2dp" android:layout_margin="2dp"
android:gravity="top" android:background="@color/white"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:focusable="true" android:focusable="true"
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
android:background="@color/white" android:gravity="top"
android:hint="任务描述" android:hint="任务描述"
android:textSize="15sp" android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingBottom="30dp"
android:textColor="@color/test_color_selector" android:textColor="@color/test_color_selector"
android:textSize="15sp"
/> />

View File

@ -134,8 +134,8 @@
<TextView <TextView
android:id="@+id/tv_pictures" android:id="@+id/tv_pictures"
style="@style/user_style" style="@style/user_style"
android:layout_width="40dp" android:layout_width="wrap_content"
android:layout_height="25dp" android:layout_height="wrap_content"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:gravity="center" android:gravity="center"
android:text="拍照" android:text="拍照"
@ -144,21 +144,31 @@
</LinearLayout> </LinearLayout>
<FrameLayout
<ImageView android:id="@+id/fm_poi_video_picture"
android:id="@+id/iv_poi_video_picture" android:layout_width="wrap_content"
android:layout_width="100dp" android:layout_height="wrap_content"
android:layout_height="100dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
app:layout_constraintLeft_toLeftOf="@id/ll_pictures" app:layout_constraintLeft_toLeftOf="@id/ll_pictures"
app:layout_constraintTop_toBottomOf="@id/ll_pictures" /> app:layout_constraintTop_toBottomOf="@id/ll_pictures">
<ImageView
android:id="@+id/iv_poi_video_picture"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="140dp"
android:minHeight="70dp"
android:maxHeight="100dp"
android:maxWidth="200dp"
android:scaleType="fitXY"/>
</FrameLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_desc" android:id="@+id/ll_desc"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintLeft_toLeftOf="@id/iv_poi_video_picture" app:layout_constraintLeft_toLeftOf="@id/fm_poi_video_picture"
app:layout_constraintTop_toBottomOf="@id/iv_poi_video_picture"> app:layout_constraintTop_toBottomOf="@id/fm_poi_video_picture">
<RelativeLayout <RelativeLayout
android:id="@+id/linear_exist" android:id="@+id/linear_exist"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -85,7 +85,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableRight="@drawable/ic_baseline_navigate" android:drawableRight="@drawable/ic_baseline_navigate"
android:text="提现录" android:text="提现录"
app:layout_constraintBottom_toBottomOf="@+id/tv_unit" app:layout_constraintBottom_toBottomOf="@+id/tv_unit"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/tv_unit" /> app:layout_constraintTop_toTopOf="@+id/tv_unit" />

View File

@ -2,4 +2,5 @@
<!--状态栏--> <!--状态栏-->
<dimen name="top_pind_sp">20dp</dimen> <dimen name="top_pind_sp">20dp</dimen>
<dimen name="fab_margin">16dp</dimen> <dimen name="fab_margin">16dp</dimen>
<dimen name="default_widget_padding">6dp</dimen>
</resources> </resources>

View File

@ -82,6 +82,7 @@
<!-- ‘我的-用户资料’方框设置--> <!-- ‘我的-用户资料’方框设置-->
<style name="user_style"> <style name="user_style">
<item name="android:background">@drawable/selector_red_bg</item> <item name="android:background">@drawable/selector_red_bg</item>
<item name="android:padding">@dimen/default_widget_padding</item>
</style> </style>
<!-- ‘我的-用户资料’字体设置--> <!-- ‘我的-用户资料’字体设置-->
<style name="user_text_style"> <style name="user_text_style">