修改用户资料的bug
This commit is contained in:
parent
771fce9b79
commit
3cc02873b7
@ -22,9 +22,10 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
|
||||
public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.ViewHolder> {
|
||||
private List<PoiEntity> allRoad = new ArrayList<>();
|
||||
private Vector<PoiEntity> allRoad = new Vector<>();
|
||||
private Context context;
|
||||
|
||||
public StaySubmitAdapter(Context context) {
|
||||
@ -55,15 +56,17 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Iterator iterator = allRoad.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
PoiEntity poiEntity = (PoiEntity) iterator.next();
|
||||
if (poiEntity.isChecked()) {
|
||||
PoiDatabase.getInstance(context).getPoiDao().deletePoiEntity(poiEntity);
|
||||
iterator.remove();
|
||||
synchronized (allRoad) {
|
||||
Iterator iterator = allRoad.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
PoiEntity poiEntity = (PoiEntity) iterator.next();
|
||||
if (poiEntity.isChecked()) {
|
||||
PoiDatabase.getInstance(context).getPoiDao().deletePoiEntity(poiEntity);
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
handler.sendEmptyMessage(0x105);
|
||||
}
|
||||
handler.sendEmptyMessage(0x105);
|
||||
|
||||
}
|
||||
}).start();
|
||||
@ -84,10 +87,11 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
|
||||
holder.tvDay.setText(poiEntity.getCreateTime());
|
||||
//获取checkBox点击的记录
|
||||
holder.cbUnSubmit.setChecked(allRoad.get(position).isChecked());
|
||||
holder.cbUnSubmit.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
holder.cbUnSubmit.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
allRoad.get(position).setChecked(isChecked);
|
||||
public void onClick(View v) {
|
||||
holder.cbUnSubmit.setChecked(!poiEntity.isChecked());
|
||||
poiEntity.setChecked(!poiEntity.isChecked());
|
||||
}
|
||||
});
|
||||
if (poiEntity.getIsLocalData() == 1){
|
||||
|
@ -358,8 +358,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdateChargingPile(getActivity(), chargingPileEntityList);
|
||||
}
|
||||
//获取当前位置的marker
|
||||
// senMessageMarker(chargingStationEntity.getType(), chargingStationEntity.getY(), chargingStationEntity.getX());
|
||||
// InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(),chargingStationEntity);
|
||||
senMessageMarker(chargingStationEntity.getType(), chargingStationEntity.getY(), chargingStationEntity.getX());
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(),chargingStationEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -680,9 +680,12 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
poiListEntity.setX(latPolygon.get(0).longitude + "");
|
||||
poiListEntity.setY(latPolygon.get(0).latitude + "");
|
||||
}
|
||||
// 通知地图界面显示当前编辑数据的marker
|
||||
// senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX());
|
||||
// InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
|
||||
if (poiListEntity.getTaskStatus()!=1){
|
||||
// 通知地图界面显示当前编辑数据的marker
|
||||
senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX());
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
|
||||
}
|
||||
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -789,9 +792,12 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
poiListEntity.setX(latPolygon.get(0).longitude + "");
|
||||
poiListEntity.setY(latPolygon.get(0).latitude + "");
|
||||
}
|
||||
// 通知地图界面显示当前编辑数据的marker
|
||||
// senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX());
|
||||
// InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
|
||||
if (poiListEntity.getTaskStatus()!=1){
|
||||
// 通知地图界面显示当前编辑数据的marker
|
||||
senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX());
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
|
||||
}
|
||||
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -118,11 +118,33 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
startActivityForResult(ivAttestation3, 300);
|
||||
break;
|
||||
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();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
*
|
||||
*/
|
||||
public boolean checkNum(String text) {
|
||||
Pattern patternSfzhm1 = Pattern
|
||||
.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;
|
||||
|
||||
}
|
||||
/**
|
||||
* 中文效验
|
||||
*/
|
||||
|
||||
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();
|
||||
@ -222,73 +253,70 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
if (requestCode == 100 && 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");
|
||||
startActivityForResult(intentPanorama, 100);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
String takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a", "");
|
||||
ivAttestation1.setTag(takePhotoPath1);
|
||||
ivAttestation1.setImageBitmap(bitmap);//显示图像
|
||||
ivHera1.setVisibility(View.GONE);
|
||||
tvCard1.setVisibility(View.GONE);
|
||||
}
|
||||
String takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a", "");
|
||||
ivAttestation1.setTag(takePhotoPath1);
|
||||
ivAttestation1.setImageBitmap(bitmap);//显示图像
|
||||
ivHera1.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) {
|
||||
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");
|
||||
startActivityForResult(intentPanorama, 200);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "a", "");
|
||||
ivAttestation2.setTag(takePhotoPath2);
|
||||
ivAttestation2.setImageBitmap(bitmap);//显示图像
|
||||
ivHera2.setVisibility(View.GONE);
|
||||
tvCard2.setVisibility(View.GONE);
|
||||
}
|
||||
String takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "a", "");
|
||||
ivAttestation2.setTag(takePhotoPath2);
|
||||
ivAttestation2.setImageBitmap(bitmap);//显示图像
|
||||
ivHera2.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) {
|
||||
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");
|
||||
startActivityForResult(intentPanorama, 300);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "a", "");
|
||||
ivAttestation3.setTag(takePhotoPath3);
|
||||
ivAttestation3.setImageBitmap(bitmap);//显示图像
|
||||
ivHera3.setVisibility(View.GONE);
|
||||
tvCard3.setVisibility(View.GONE);
|
||||
}
|
||||
String takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "a", "");
|
||||
ivAttestation3.setTag(takePhotoPath3);
|
||||
ivAttestation3.setImageBitmap(bitmap);//显示图像
|
||||
ivHera3.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 {
|
||||
//
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -85,7 +85,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableRight="@drawable/ic_baseline_navigate"
|
||||
android:text="提现纪录"
|
||||
android:text="提现记录"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_unit"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_unit" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user