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