修改用户资料的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.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,15 +56,17 @@ public class StaySubmitAdapter extends RecyclerView.Adapter<StaySubmitAdapter.Vi
|
|||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Iterator iterator = allRoad.iterator();
|
synchronized (allRoad) {
|
||||||
while (iterator.hasNext()) {
|
Iterator iterator = allRoad.iterator();
|
||||||
PoiEntity poiEntity = (PoiEntity) iterator.next();
|
while (iterator.hasNext()) {
|
||||||
if (poiEntity.isChecked()) {
|
PoiEntity poiEntity = (PoiEntity) iterator.next();
|
||||||
PoiDatabase.getInstance(context).getPoiDao().deletePoiEntity(poiEntity);
|
if (poiEntity.isChecked()) {
|
||||||
iterator.remove();
|
PoiDatabase.getInstance(context).getPoiDao().deletePoiEntity(poiEntity);
|
||||||
|
iterator.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
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){
|
||||||
|
@ -358,8 +358,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
InsertAndUpdateUtils.getInstance().insertOrUpdateChargingPile(getActivity(), chargingPileEntityList);
|
InsertAndUpdateUtils.getInstance().insertOrUpdateChargingPile(getActivity(), chargingPileEntityList);
|
||||||
}
|
}
|
||||||
//获取当前位置的marker
|
//获取当前位置的marker
|
||||||
// senMessageMarker(chargingStationEntity.getType(), chargingStationEntity.getY(), chargingStationEntity.getX());
|
senMessageMarker(chargingStationEntity.getType(), chargingStationEntity.getY(), chargingStationEntity.getX());
|
||||||
// InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(),chargingStationEntity);
|
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(),chargingStationEntity);
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -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 + "");
|
||||||
}
|
}
|
||||||
// 通知地图界面显示当前编辑数据的marker
|
if (poiListEntity.getTaskStatus()!=1){
|
||||||
// senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX());
|
// 通知地图界面显示当前编辑数据的marker
|
||||||
// InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
|
senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX());
|
||||||
|
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 + "");
|
||||||
}
|
}
|
||||||
// 通知地图界面显示当前编辑数据的marker
|
if (poiListEntity.getTaskStatus()!=1){
|
||||||
// senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX());
|
// 通知地图界面显示当前编辑数据的marker
|
||||||
// InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
|
senMessageMarker(poiEntity.getType(), poiEntity.getY(), poiEntity.getX());
|
||||||
|
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiListEntity);
|
||||||
|
}
|
||||||
|
|
||||||
getActivity().runOnUiThread(new Runnable() {
|
getActivity().runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -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();
|
String takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a", "");
|
||||||
int width = bitmap.getWidth();
|
ivAttestation1.setTag(takePhotoPath1);
|
||||||
if (height > width) {
|
ivAttestation1.setImageBitmap(bitmap);//显示图像
|
||||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
ivHera1.setVisibility(View.GONE);
|
||||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
tvCard1.setVisibility(View.GONE);
|
||||||
@Override
|
// int height = bitmap.getHeight();
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
// int width = bitmap.getWidth();
|
||||||
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
// if (height > width) {
|
||||||
startActivityForResult(intentPanorama, 100);
|
// DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||||
return false;
|
// MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
}
|
// @Override
|
||||||
});
|
// public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
} else {
|
// Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
|
// startActivityForResult(intentPanorama, 100);
|
||||||
String takePhotoPath1 = PhotoPathUtil.getTakePhotoPath(data, "a", "");
|
// return false;
|
||||||
ivAttestation1.setTag(takePhotoPath1);
|
// }
|
||||||
ivAttestation1.setImageBitmap(bitmap);//显示图像
|
// });
|
||||||
ivHera1.setVisibility(View.GONE);
|
// }
|
||||||
tvCard1.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
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();
|
String takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "a", "");
|
||||||
int width = bitmap.getWidth();
|
ivAttestation2.setTag(takePhotoPath2);
|
||||||
if (height > width) {
|
ivAttestation2.setImageBitmap(bitmap);//显示图像
|
||||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
ivHera2.setVisibility(View.GONE);
|
||||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
tvCard2.setVisibility(View.GONE);
|
||||||
@Override
|
// int height = bitmap.getHeight();
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
// int width = bitmap.getWidth();
|
||||||
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
// if (height > width) {
|
||||||
startActivityForResult(intentPanorama, 200);
|
// DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||||
return false;
|
// MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
}
|
// @Override
|
||||||
});
|
// public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
} else {
|
// Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
String takePhotoPath2 = PhotoPathUtil.getTakePhotoPath(data, "a", "");
|
// startActivityForResult(intentPanorama, 200);
|
||||||
ivAttestation2.setTag(takePhotoPath2);
|
// return false;
|
||||||
ivAttestation2.setImageBitmap(bitmap);//显示图像
|
// }
|
||||||
ivHera2.setVisibility(View.GONE);
|
// });
|
||||||
tvCard2.setVisibility(View.GONE);
|
// }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
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();
|
String takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "a", "");
|
||||||
int width = bitmap.getWidth();
|
ivAttestation3.setTag(takePhotoPath3);
|
||||||
if (height > width) {
|
ivAttestation3.setImageBitmap(bitmap);//显示图像
|
||||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
ivHera3.setVisibility(View.GONE);
|
||||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
tvCard3.setVisibility(View.GONE);
|
||||||
@Override
|
// int height = bitmap.getHeight();
|
||||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
// int width = bitmap.getWidth();
|
||||||
Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
// if (height > width) {
|
||||||
startActivityForResult(intentPanorama, 300);
|
// DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||||
return false;
|
// MessageDialog.show((AppCompatActivity) getContext(), "提示", "请重新拍照,要求横屏拍照", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||||
}
|
// @Override
|
||||||
});
|
// public boolean onClick(BaseDialog baseDialog, View v) {
|
||||||
} else {
|
// Intent intentPanorama = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||||
String takePhotoPath3 = PhotoPathUtil.getTakePhotoPath(data, "a", "");
|
// startActivityForResult(intentPanorama, 300);
|
||||||
ivAttestation3.setTag(takePhotoPath3);
|
// return false;
|
||||||
ivAttestation3.setImageBitmap(bitmap);//显示图像
|
// }
|
||||||
ivHera3.setVisibility(View.GONE);
|
// });
|
||||||
tvCard3.setVisibility(View.GONE);
|
// } else {
|
||||||
}
|
//
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user