소스 검색

更改蓝牙打印高度

ChengJH 7 달 전
부모
커밋
b15a3a9dd5

+ 17 - 13
app/src/main/java/com/uas/ruiziuasmes/adapter/BluetoothAdapter.java

@@ -15,6 +15,7 @@ import android.widget.TextView;
 import com.uas.bluetooth.ConnectHelper;
 import com.uas.ruiziuasmes.R;
 import com.uas.ruiziuasmes.util.ListUtils;
+import com.uas.ruiziuasmes.util.StringUtil;
 
 import java.util.Collections;
 import java.util.Comparator;
@@ -109,22 +110,25 @@ 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;
-        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);
+        if (!StringUtil.isEmpty(model.getName())){
+            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);
+                }
             }
         }
 
+
     }
 
 

+ 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 = 600,
+                    height = 700,
                     qty = 1;
 //                    h = 200,
 //                    v = 200,

+ 1 - 1
app/src/main/res/layout/fragment_pre_processing_report.xml

@@ -135,7 +135,7 @@
             android:layout_marginRight="@dimen/dp_10"
             android:id="@+id/feeded_rv"
             android:layout_width="match_parent"
-            android:layout_height="300dp"
+            android:layout_height="match_parent"
             />
     </LinearLayout>
     <Button

+ 2 - 2
build.gradle

@@ -51,8 +51,8 @@ ext {
             targetSdkVersion : 28,
             compileSdkVersion: 28,
             buildToolsVersion: "28.0.3",
-            versionCode      : 16,
-            versionName      : "v1.0.6"
+            versionCode      : 18,
+            versionName      : "v1.0.8"
     ]
 
     depsVersion = [