|
|
@ -3,6 +3,9 @@ package com.example.pulit;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.util.Log;
|
|
|
|
import android.util.Log;
|
|
|
|
import android.view.View;
|
|
|
|
import android.view.View;
|
|
|
|
|
|
|
|
import android.widget.ArrayAdapter;
|
|
|
|
|
|
|
|
import android.widget.LinearLayout;
|
|
|
|
|
|
|
|
import android.widget.ListPopupWindow;
|
|
|
|
import android.widget.TextView;
|
|
|
|
import android.widget.TextView;
|
|
|
|
import android.widget.Toast;
|
|
|
|
import android.widget.Toast;
|
|
|
|
|
|
|
|
|
|
|
@ -20,6 +23,7 @@ import com.example.pulit.util.SharedPreferencesUtils;
|
|
|
|
import com.lzy.okgo.OkGo;
|
|
|
|
import com.lzy.okgo.OkGo;
|
|
|
|
import com.lzy.okgo.model.Response;
|
|
|
|
import com.lzy.okgo.model.Response;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
import butterknife.BindView;
|
|
|
|
import butterknife.BindView;
|
|
|
@ -42,13 +46,15 @@ public class X1Activity extends BaseActivity {
|
|
|
|
TextView x1GoodsCode;
|
|
|
|
TextView x1GoodsCode;
|
|
|
|
@BindView(R.id.x1_goods_Weight)
|
|
|
|
@BindView(R.id.x1_goods_Weight)
|
|
|
|
TextView x1GoodsWeight;
|
|
|
|
TextView x1GoodsWeight;
|
|
|
|
|
|
|
|
@BindView(R.id.x1_code1)
|
|
|
|
|
|
|
|
LinearLayout x1Code1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean scanStates;
|
|
|
|
private boolean scanStates;
|
|
|
|
private List<Item> items;
|
|
|
|
private List<Item> items;
|
|
|
|
private ItemAdapter adapter;
|
|
|
|
private ItemAdapter adapter;
|
|
|
|
private X1Submit entrySubmit;
|
|
|
|
private X1Submit entrySubmit;
|
|
|
|
|
|
|
|
private ListPopupWindow lpw;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
@ -58,6 +64,10 @@ public class X1Activity extends BaseActivity {
|
|
|
|
scanStates = true;
|
|
|
|
scanStates = true;
|
|
|
|
x1RecyclerView.setLayoutManager(new LinearLayoutManager(this));
|
|
|
|
x1RecyclerView.setLayoutManager(new LinearLayoutManager(this));
|
|
|
|
adapter = new ItemAdapter(this);
|
|
|
|
adapter = new ItemAdapter(this);
|
|
|
|
|
|
|
|
lpw = new ListPopupWindow(this);
|
|
|
|
|
|
|
|
lpw.setAnchorView(x1Code1);
|
|
|
|
|
|
|
|
lpw.setAdapter(new ArrayAdapter(this, R.layout.support_simple_spinner_dropdown_item, Arrays.asList("B20230011", "B20230300", "B20230221", "B20230192", "B20230223")));
|
|
|
|
|
|
|
|
lpw.setOnItemClickListener((adapterView, view, i, l) -> lpw.dismiss());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -68,7 +78,6 @@ public class X1Activity extends BaseActivity {
|
|
|
|
dialog.show();
|
|
|
|
dialog.show();
|
|
|
|
//反应釜查询
|
|
|
|
//反应釜查询
|
|
|
|
getF(info);
|
|
|
|
getF(info);
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
x1Tong.setText(info);
|
|
|
|
x1Tong.setText(info);
|
|
|
|
if (info.contains("kg")) {
|
|
|
|
if (info.contains("kg")) {
|
|
|
@ -148,6 +157,7 @@ public class X1Activity extends BaseActivity {
|
|
|
|
adapter.setList(items);
|
|
|
|
adapter.setList(items);
|
|
|
|
x1RecyclerView.setAdapter(adapter);
|
|
|
|
x1RecyclerView.setAdapter(adapter);
|
|
|
|
scanStates = false;//扫描
|
|
|
|
scanStates = false;//扫描
|
|
|
|
|
|
|
|
lpw.show();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Toast.makeText(X1Activity.this, "请求失败,条码不正确", Toast.LENGTH_SHORT).show();
|
|
|
|
Toast.makeText(X1Activity.this, "请求失败,条码不正确", Toast.LENGTH_SHORT).show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|