|
|
@ -48,6 +48,7 @@ public class WriteUserActivity extends BaseActivity implements DataReturnCall, P
|
|
|
|
private List<ReadTyreNoResult> list;
|
|
|
|
private List<ReadTyreNoResult> list;
|
|
|
|
private PopupMenu popupMenu;
|
|
|
|
private PopupMenu popupMenu;
|
|
|
|
private MyAlertDialog myAlertDialog;
|
|
|
|
private MyAlertDialog myAlertDialog;
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressLint("UnspecifiedRegisterReceiverFlag")
|
|
|
|
@SuppressLint("UnspecifiedRegisterReceiverFlag")
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
@ -72,7 +73,7 @@ public class WriteUserActivity extends BaseActivity implements DataReturnCall, P
|
|
|
|
myAlertDialog.setDialogCall(this);
|
|
|
|
myAlertDialog.setDialogCall(this);
|
|
|
|
var power = SharedPreferencesUtils.getInt("power", 30);
|
|
|
|
var power = SharedPreferencesUtils.getInt("power", 30);
|
|
|
|
Log.e("TAG", "记忆功率:" + power);
|
|
|
|
Log.e("TAG", "记忆功率:" + power);
|
|
|
|
if (power!=30){
|
|
|
|
if (power != 30) {
|
|
|
|
rfidModel.setPower(power);
|
|
|
|
rfidModel.setPower(power);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -131,14 +132,19 @@ public class WriteUserActivity extends BaseActivity implements DataReturnCall, P
|
|
|
|
public void onSuccess(Response<MyResult> response) {
|
|
|
|
public void onSuccess(Response<MyResult> response) {
|
|
|
|
super.onSuccess(response);
|
|
|
|
super.onSuccess(response);
|
|
|
|
var body = response.body();
|
|
|
|
var body = response.body();
|
|
|
|
|
|
|
|
// 如果=1 直接是成功
|
|
|
|
if (body.getSaveFlag().equals("1")) {
|
|
|
|
if (body.getSaveFlag().equals("1")) {
|
|
|
|
Toast.makeText(WriteUserActivity.this, getString(R.string.binding_success), Toast.LENGTH_SHORT).show();
|
|
|
|
// Toast.makeText(WriteUserActivity.this, getString(R.string.binding_success), Toast.LENGTH_SHORT).show();
|
|
|
|
writeUserState = true;
|
|
|
|
writeUserState = true;
|
|
|
|
writeUser(user, epcStr);
|
|
|
|
writeUser(user, epcStr);
|
|
|
|
return;
|
|
|
|
} else if (body.getSaveFlagCF().equals("0")) {// 等于0的情况属于绑定后写入失败,可重新写入
|
|
|
|
}
|
|
|
|
writeUserState = true;
|
|
|
|
|
|
|
|
writeUser(user, epcStr);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
tipDialog.shouDialog(false, body.getSaveMessage());
|
|
|
|
tipDialog.shouDialog(false, body.getSaveMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -230,7 +236,7 @@ public class WriteUserActivity extends BaseActivity implements DataReturnCall, P
|
|
|
|
} else if (itemId == R.id.menu_configuration) {
|
|
|
|
} else if (itemId == R.id.menu_configuration) {
|
|
|
|
startActivity(intent2);
|
|
|
|
startActivity(intent2);
|
|
|
|
} else if (itemId == R.id.menu_setPower) {
|
|
|
|
} else if (itemId == R.id.menu_setPower) {
|
|
|
|
myAlertDialog.show(SharedPreferencesUtils.getInt("power",30));
|
|
|
|
myAlertDialog.show(SharedPreferencesUtils.getInt("power", 30));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -240,9 +246,9 @@ public class WriteUserActivity extends BaseActivity implements DataReturnCall, P
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void returnData(int power) {
|
|
|
|
public void returnData(int power) {
|
|
|
|
if (rfidModel.setPower(power)){
|
|
|
|
if (rfidModel.setPower(power)) {
|
|
|
|
Toast.makeText(context, getString(R.string.tip_set_success), Toast.LENGTH_SHORT).show();
|
|
|
|
Toast.makeText(context, getString(R.string.tip_set_success), Toast.LENGTH_SHORT).show();
|
|
|
|
SharedPreferencesUtils.putInt("power",power);
|
|
|
|
SharedPreferencesUtils.putInt("power", power);
|
|
|
|
myAlertDialog.dismiss();
|
|
|
|
myAlertDialog.dismiss();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|