修改 小料判断

master
wangh 1 year ago
parent 8ec5d0a9f2
commit 92705cbd38

@ -17,12 +17,12 @@ public class HomeActivity extends AppCompatActivity {
}
public void startAc1(View view) {
intent.putExtra("type",false);
intent.putExtra("type",true);
startActivity(intent);
}
public void startAc2(View view) {
intent.putExtra("type",true);
intent.putExtra("type",false);
startActivity(intent);
}

@ -6,6 +6,7 @@ import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Toast;
@ -56,12 +57,14 @@ public class MainActivity extends BaseActivity {
@Override
public void onClick(DialogInterface dialog, int which) {
ingredientInfo.setIsOpen(1);
submitRequest();
}
})
.setNeutralButton("保存数据", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
ingredientInfo.setIsOpen(2);
submitRequest();
}
}).create();
}
@ -113,7 +116,10 @@ public class MainActivity extends BaseActivity {
return;
}
alertDialog.show();
}
private void submitRequest(){
var type = mainVm.isType();
Log.e("TAG", "submitRequest:" + type);
if (type) {
ingredientInfo.setRemainder(mainVm.isResidueYes());
var residueNum = mainVm.getResidueNum();
@ -127,7 +133,7 @@ public class MainActivity extends BaseActivity {
}
OkGo.<MyResult>post(url + "/api/IngCheck/" + (type ? "BigMaterial" : "SmallMaterial"))
OkGo.<MyResult>post(url + "/api/IngCheck/" + (type ?"SmallMaterial": "BigMaterial" ))
.tag(this)
.upRequestBody(RequestBody.create(JSON, gson.toJson(ingredientInfo)))
.execute(new MyRecultCall(dialog, this) {
@ -143,8 +149,6 @@ public class MainActivity extends BaseActivity {
}
});
}
public void backAc(View view) {

@ -31,7 +31,7 @@
android:layout_height="match_parent"
android:gravity="center"
android:letterSpacing="0.2"
android:text='@{vm.type?"大料料罐投料":"小料料罐投料"}'
android:text='@{vm.type?"小料料罐投料":"大料料罐投料"}'
android:textColor="@color/white"
android:textSize="18sp" />

Loading…
Cancel
Save