Bläddra i källkod

预加工报工界面增加输入框,增加蓝牙搜索展示筛选

ChengJH 7 månader sedan
förälder
incheckning
a9cbf0c71e

+ 15 - 12
app/src/main/java/com/uas/ruiziuasmes/adapter/BluetoothAdapter.java

@@ -109,19 +109,22 @@ public class BluetoothAdapter extends RecyclerView.Adapter<BluetoothAdapter.Blue
     public void onBindViewHolder(@NonNull BlueTootViewHolder holder, int position) {
         BluetoothDevice model = models.get(position);
         boolean isConnect = model.getBondState() == BluetoothDevice.BOND_BONDED;
-        holder.mNameTv.setText(TextUtils.isEmpty(model.getName()) ? "未知" : model.getName());
-        holder.mMacTv.setText(model.getAddress());
-        holder.mStatusTv.setText(isConnect ? "已连接" : "未连接");
-        holder.mDeviceIc.setImageResource(getTypeIcon(model));
-        holder.itemView.setTag(model);
-        holder.itemView.setOnClickListener(mOnClickListener);
-        if (isConnect) {
-            holder.mDoingTv.setTag(model);
-            holder.mDoingTv.setVisibility(View.VISIBLE);
-            holder.mDoingTv.setOnClickListener(mOnClickListener);
-        } else {
-            holder.mDoingTv.setVisibility(View.GONE);
+        if (model.getName().contains("HM")){
+            holder.mNameTv.setText(TextUtils.isEmpty(model.getName()) ? "未知" : model.getName());
+            holder.mMacTv.setText(model.getAddress());
+            holder.mStatusTv.setText(isConnect ? "已连接" : "未连接");
+            holder.mDeviceIc.setImageResource(getTypeIcon(model));
+            holder.itemView.setTag(model);
+            holder.itemView.setOnClickListener(mOnClickListener);
+            if (isConnect) {
+                holder.mDoingTv.setTag(model);
+                holder.mDoingTv.setVisibility(View.VISIBLE);
+                holder.mDoingTv.setOnClickListener(mOnClickListener);
+            } else {
+                holder.mDoingTv.setVisibility(View.GONE);
+            }
         }
+
     }
 
 

+ 3 - 1
app/src/main/java/com/uas/ruiziuasmes/fragment/BlueToothPrintFragment.java

@@ -342,7 +342,9 @@ public class BlueToothPrintFragment extends BaseFragment {
         if (!ListUtils.isEmpty(models)) {
             for (int i = 0; i < models.size(); i++) {
                 BluetoothDevice bluetoothDevice = models.get(i);
-                if (bluetoothDevice != null && bluetoothDevice.getBluetoothClass().getDeviceClass() == ConnectHelper.PRINT_TYPE) {
+                if (bluetoothDevice != null
+//                        && bluetoothDevice.getBluetoothClass().getDeviceClass() == ConnectHelper.PRINT_TYPE
+                ) {
                     printDevices.add(bluetoothDevice);
                 }
             }

+ 3 - 0
app/src/main/java/com/uas/ruiziuasmes/fragment/PreProcessingReportFragment.java

@@ -78,6 +78,7 @@ public class PreProcessingReportFragment extends BaseFragment implements View.On
     private int mPrintDpi = 203;
     private JSONArray dataArray;
     private Button btn_oneprint;
+    private ClearableEditText ol_remark_et;
 
     @Override
     protected int getLayout() {
@@ -93,6 +94,7 @@ public class PreProcessingReportFragment extends BaseFragment implements View.On
         ct_qty = root.findViewById(R.id.ct_qty);
         ct_sum = root.findViewById(R.id.ct_sum);
         btn_oneprint = root.findViewById(R.id.btn_oneprint);
+        ol_remark_et = root.findViewById(R.id.ol_remark_et);
         jlt_storage_in_barcode_save_btn = root.findViewById(R.id.jlt_storage_in_barcode_save_btn);
     }
 
@@ -229,6 +231,7 @@ public class PreProcessingReportFragment extends BaseFragment implements View.On
                         .addParam("prods",prods)
                         .addParam("decode",ct_qty.getText().toString().trim())
                         .addParam("reportqty",ct_sum.getText().toString().trim())
+                        .addParam("remark",ol_remark_et.getText().toString().trim())
                         .build(), new HttpCallback() {
                     @Override
                     public void onSuccess(int flag, Object o) throws Exception {

+ 1 - 1
app/src/main/java/com/uas/ruiziuasmes/util/PrintUtils.java

@@ -27,7 +27,7 @@ public class PrintUtils {
             int offset = 6,
                     h = 400,
                     v = 800,
-                    height = 300,
+                    height = 600,
                     qty = 1;
 //                    h = 200,
 //                    v = 200,

+ 29 - 3
app/src/main/res/layout/fragment_pre_processing_report.xml

@@ -18,7 +18,7 @@
         android:layout_height="wrap_content">
 
         <LinearLayout
-            android:padding="@dimen/sp_16"
+            android:padding="10dp"
             android:orientation="horizontal"
             android:layout_width="match_parent"
             android:layout_height="wrap_content">
@@ -44,7 +44,7 @@
         </LinearLayout>
 
         <LinearLayout
-            android:padding="@dimen/sp_16"
+            android:padding="10dp"
             android:orientation="horizontal"
             android:layout_width="match_parent"
             android:layout_height="wrap_content">
@@ -70,7 +70,7 @@
                 />
         </LinearLayout>
         <LinearLayout
-            android:padding="@dimen/sp_16"
+            android:padding="10dp"
             android:orientation="horizontal"
             android:layout_width="match_parent"
             android:layout_height="wrap_content">
@@ -95,6 +95,32 @@
                 android:textColor="@color/black"
                 />
         </LinearLayout>
+        <LinearLayout
+            android:padding="10dp"
+            android:orientation="horizontal"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+            <TextView
+                android:layout_gravity="center"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textColor="@color/red"
+                android:text="备注"
+                android:layout_marginRight="@dimen/dp_10"
+                android:gravity="right">
+            </TextView>
+            <com.uas.ruiziuasmes.view.ClearableEditText
+                android:id="@+id/ol_remark_et"
+                style="@style/EditTextStyle"
+                android:layout_weight="1"
+                android:background="@drawable/bg_line_edittext"
+                android:focusable="true"
+                android:focusableInTouchMode="true"
+                android:hint="请输入备注"
+                android:imeOptions="actionSend"
+                android:textColor="@color/black"
+                />
+        </LinearLayout>
         <android.support.v7.widget.RecyclerView
             android:layout_marginLeft="@dimen/dp_10"
             android:layout_marginRight="@dimen/dp_10"

+ 2 - 2
build.gradle

@@ -51,8 +51,8 @@ ext {
             targetSdkVersion : 28,
             compileSdkVersion: 28,
             buildToolsVersion: "28.0.3",
-            versionCode      : 12,
-            versionName      : "v1.0.2"
+            versionCode      : 15,
+            versionName      : "v1.0.5"
     ]
 
     depsVersion = [