haijiang
2018-04-20 8e9d0834e4f5328efca969156af81a41fa99dce9
app/src/main/java/com/moral/yunfushao/adapter/BleDeviceAdapter.java
@@ -7,6 +7,7 @@
import com.clj.fastble.data.ScanResult;
import com.moral.andbrickslib.baseadapter.recyclerview.CommonAdapter;
import com.moral.andbrickslib.baseadapter.recyclerview.base.ViewHolder;
import com.moral.andbrickslib.utils.StringUtils;
import com.moral.yunfushao.R;
import java.util.List;
@@ -24,6 +25,14 @@
    protected void convert(ViewHolder holder, ScanResult scanResult, int position) {
        TextView tv_name = holder.getView(R.id.tv_name);
        BluetoothDevice device = scanResult.getDevice();
        tv_name.setText(device.getName()+"\n"+device.getAddress());
        if(!StringUtils.isEmpty(device.getName())){
            if(device.getName().contains("7drlb")){
                tv_name.setText("孕妇哨"+"\n"+device.getAddress());
            }else{
                tv_name.setText(device.getName()+"\n"+device.getAddress());
            }
        }else{
            tv_name.setText("未知设备"+"\n"+device.getAddress());
        }
    }
}