修改定位上的bug

This commit is contained in:
wds 2021-08-15 21:46:51 +08:00
parent 23c6ff16b7
commit c2ffd60060
5 changed files with 47 additions and 30 deletions

View File

@ -194,12 +194,10 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
chargingPileDao = poiDatabase.getChargingPileDao(); chargingPileDao = poiDatabase.getChargingPileDao();
checkBoxLife = findViewById(R.id.check_pot_life); checkBoxLife = findViewById(R.id.check_pot_life);
checkBoxRight = findViewById(R.id.check_pot_right); checkBoxRight = findViewById(R.id.check_pot_right);
checkBoxLife.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { checkBoxLife.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { public void onClick(View v) {
if (isChecked) { if(checkBoxLife.isChecked()){
checkBoxLife.setText("保存");
checkBoxLife.setTextColor(Color.WHITE);
moveLatlng(latLng, new TencentMap.CancelableCallback() { moveLatlng(latLng, new TencentMap.CancelableCallback() {
@Override @Override
public void onFinish() { public void onFinish() {
@ -208,19 +206,25 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
if (markerPile != null) { if (markerPile != null) {
markerPile.setFixingPoint(screenPilePositions.x, screenPilePositions.y); markerPile.setFixingPoint(screenPilePositions.x, screenPilePositions.y);
} }
checkBoxLife.setText("保存");
checkBoxLife.setTextColor(Color.WHITE);
checkBoxLife.setChecked(true);
} }
@Override @Override
public void onCancel() { public void onCancel() {
checkBoxLife.setText("编辑");
checkBoxLife.setTextColor(Color.BLACK);
checkBoxLife.setChecked(false);
} }
}); });
} else { }else {
checkBoxLife.setText("编辑"); checkBoxLife.setText("编辑");
checkBoxLife.setTextColor(Color.BLACK); checkBoxLife.setTextColor(Color.BLACK);
latLng = tencentMap.getProjection().fromScreenLocation(screenPilePositions); latLng = tencentMap.getProjection().fromScreenLocation(screenPilePositions);
markerPile.setPosition(latLng); markerPile.setPosition(latLng);
markerPile.setFixingPointEnable(false); markerPile.setFixingPointEnable(false);
checkBoxLife.setChecked(false);
} }
} }
}); });

View File

@ -277,13 +277,10 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
EventBus.getDefault().post(obtain); EventBus.getDefault().post(obtain);
} }
}); });
checkBoxLife.setOnClickListener(new View.OnClickListener() {
checkBoxLife.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { public void onClick(View v) {
if (isChecked) { if(checkBoxLife.isChecked()){
checkBoxLife.setText("保存");
checkBoxLife.setTextColor(Color.WHITE);
moveLatlng(latLng, new TencentMap.CancelableCallback() { moveLatlng(latLng, new TencentMap.CancelableCallback() {
@Override @Override
public void onFinish() { public void onFinish() {
@ -292,20 +289,26 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
if (markerStation != null) { if (markerStation != null) {
markerStation.setFixingPoint(screenStationPositions.x, screenStationPositions.y); markerStation.setFixingPoint(screenStationPositions.x, screenStationPositions.y);
} }
checkBoxLife.setText("保存");
checkBoxLife.setTextColor(Color.WHITE);
checkBoxLife.setChecked(true);
} }
@Override @Override
public void onCancel() { public void onCancel() {
checkBoxLife.setText("编辑");
checkBoxLife.setTextColor(Color.BLACK);
checkBoxLife.setChecked(false);
} }
}); });
} else { }else {
checkBoxLife.setText("编辑"); checkBoxLife.setText("编辑");
checkBoxLife.setTextColor(Color.BLACK); checkBoxLife.setTextColor(Color.BLACK);
latLng = tencentMap.getProjection().fromScreenLocation(screenStationPositions); latLng = tencentMap.getProjection().fromScreenLocation(screenStationPositions);
markerStation.setPosition(latLng); markerStation.setPosition(latLng);
markerStation.setFixingPointEnable(false); markerStation.setFixingPointEnable(false);
checkBoxLife.setChecked(false);
} }
} }
}); });
checkBoxRight.setVisibility(View.GONE); checkBoxRight.setVisibility(View.GONE);

View File

@ -191,12 +191,10 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
} }
}); });
checkPot = findViewById(R.id.check_pot); checkPot = findViewById(R.id.check_pot);
checkPot.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { checkPot.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { public void onClick(View v) {
if (isChecked) { if(checkPot.isChecked()){
checkPot.setText("保存");
checkPot.setTextColor(Color.WHITE);
moveLatlng(latLng, new TencentMap.CancelableCallback() { moveLatlng(latLng, new TencentMap.CancelableCallback() {
@Override @Override
public void onFinish() { public void onFinish() {
@ -205,18 +203,25 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
if (markerOther != null) { if (markerOther != null) {
markerOther.setFixingPoint(screenOtherPositions.x, screenOtherPositions.y); markerOther.setFixingPoint(screenOtherPositions.x, screenOtherPositions.y);
} }
checkPot.setText("保存");
checkPot.setTextColor(Color.WHITE);
checkPot.setChecked(true);
} }
@Override @Override
public void onCancel() { public void onCancel() {
checkPot.setText("编辑");
checkPot.setTextColor(Color.BLACK);
checkPot.setChecked(false);
} }
}); });
} else { }else {
checkPot.setText("编辑"); checkPot.setText("编辑");
checkPot.setTextColor(Color.BLACK); checkPot.setTextColor(Color.BLACK);
latLng = tencentMap.getProjection().fromScreenLocation(screenOtherPositions); latLng = tencentMap.getProjection().fromScreenLocation(screenOtherPositions);
markerOther.setPosition(latLng); markerOther.setPosition(latLng);
markerOther.setFixingPointEnable(false); markerOther.setFixingPointEnable(false);
checkPot.setChecked(false);
} }
} }
}); });

View File

@ -177,12 +177,10 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
poiDao = poiDatabase.getPoiDao(); poiDao = poiDatabase.getPoiDao();
checkBoxLife = findViewById(R.id.check_pot_life); checkBoxLife = findViewById(R.id.check_pot_life);
checkBoxRight = findViewById(R.id.check_pot_right); checkBoxRight = findViewById(R.id.check_pot_right);
checkBoxLife.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { checkBoxLife.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { public void onClick(View v) {
if (isChecked) { if(checkBoxLife.isChecked()){
checkBoxLife.setText("保存");
checkBoxLife.setTextColor(Color.WHITE);
moveLatlng(latLng, new TencentMap.CancelableCallback() { moveLatlng(latLng, new TencentMap.CancelableCallback() {
@Override @Override
public void onFinish() { public void onFinish() {
@ -191,22 +189,29 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
if (markerPoi != null) { if (markerPoi != null) {
markerPoi.setFixingPoint(screenPoiPositions.x, screenPoiPositions.y); markerPoi.setFixingPoint(screenPoiPositions.x, screenPoiPositions.y);
} }
checkBoxLife.setText("保存");
checkBoxLife.setTextColor(Color.WHITE);
checkBoxLife.setChecked(true);
} }
@Override @Override
public void onCancel() { public void onCancel() {
checkBoxLife.setText("编辑");
checkBoxLife.setTextColor(Color.BLACK);
checkBoxLife.setChecked(false);
} }
}); });
} else { }else {
checkBoxLife.setText("编辑"); checkBoxLife.setText("编辑");
checkBoxLife.setTextColor(Color.BLACK); checkBoxLife.setTextColor(Color.BLACK);
latLng = tencentMap.getProjection().fromScreenLocation(screenPoiPositions); latLng = tencentMap.getProjection().fromScreenLocation(screenPoiPositions);
markerPoi.setPosition(latLng); markerPoi.setPosition(latLng);
markerPoi.setFixingPointEnable(false); markerPoi.setFixingPointEnable(false);
checkBoxLife.setChecked(false);
} }
} }
}); });
setSlidingUpPanelLayout(Constant.SLIDING_LAYOUT); setSlidingUpPanelLayout(Constant.SLIDING_LAYOUT);
nestedScrollView = findViewById(R.id.nested_scroll_view); nestedScrollView = findViewById(R.id.nested_scroll_view);
if (slidingPaneLayout != null) { if (slidingPaneLayout != null) {

View File

@ -175,8 +175,8 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
case R.id.button: case R.id.button:
String price = etAllPrice.getText().toString().trim(); String price = etAllPrice.getText().toString().trim();
if (price!=null&&!price.equals("")){ if (price!=null&&!price.equals("")){
Integer integer = Integer.valueOf(price); double aDouble = Double.valueOf(price);
if (integer!=null&&integer<10){ if (aDouble<10){
Toast.makeText(getActivity(), "提现金额不能低于10元", Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), "提现金额不能低于10元", Toast.LENGTH_SHORT).show();
return; return;
} }