diff --git a/app/src/main/java/com/mirkowu/mvm/ble/BleActivity.kt b/app/src/main/java/com/mirkowu/mvm/ble/BleActivity.kt index 70cf2b1..5dfe738 100644 --- a/app/src/main/java/com/mirkowu/mvm/ble/BleActivity.kt +++ b/app/src/main/java/com/mirkowu/mvm/ble/BleActivity.kt @@ -65,7 +65,7 @@ class BleActivity : BaseActivity() { } mAdapter.setOnItemClickListener { view, item, position -> val device = mAdapter.getItem(position); - // bleManager.connect(device.address, true) + bleManager.connect(device.address, true) }; bleManager = BLEManager.getInstance() diff --git a/app/src/main/java/com/mirkowu/mvm/ble/DeviceAdapter.java b/app/src/main/java/com/mirkowu/mvm/ble/DeviceAdapter.java index 762733c..17a7adc 100644 --- a/app/src/main/java/com/mirkowu/mvm/ble/DeviceAdapter.java +++ b/app/src/main/java/com/mirkowu/mvm/ble/DeviceAdapter.java @@ -9,12 +9,12 @@ import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; -import com.mirkowu.lib_base.adapter.BaseAdapter; +import com.mirkowu.lib_widget.adapter.BaseRVAdapter; import com.mirkowu.mvm.R; import org.jetbrains.annotations.NotNull; -public class DeviceAdapter extends BaseAdapter { +public class DeviceAdapter extends BaseRVAdapter { @Override public void onBindHolder(@NonNull @NotNull ViewHolder holder, BluetoothDevice item, int position) { diff --git a/app/src/main/java/com/mirkowu/mvm/ble/SearchBleActivity.kt b/app/src/main/java/com/mirkowu/mvm/ble/SearchBleActivity.kt index 1680603..df3e3a9 100644 --- a/app/src/main/java/com/mirkowu/mvm/ble/SearchBleActivity.kt +++ b/app/src/main/java/com/mirkowu/mvm/ble/SearchBleActivity.kt @@ -1,7 +1,6 @@ package com.mirkowu.mvm.ble import android.bluetooth.BluetoothAdapter.LeScanCallback -import android.bluetooth.BluetoothDevice import android.content.BroadcastReceiver import android.content.Context import android.content.Intent @@ -17,6 +16,7 @@ import com.mirkowu.lib_util.utilcode.util.ConvertUtils import com.mirkowu.lib_util.utilcode.util.ToastUtils import com.mirkowu.mvm.R import com.mirkowu.mvm.base.BaseActivity +import com.mirkowu.mvm.databinding.ActivitySearchBleBinding class SearchBleActivity : BaseActivity() { @@ -64,8 +64,8 @@ class SearchBleActivity : BaseActivity() { rvSearch.setAdapter(mAdapter); mAdapter.setOnItemClickListener { view, item, position -> val device = mAdapter.getItem(position); -// client.connect(device.getAddress(), true); -// client.startMonitor(getContext(), bleReceiver, BLEClient.makeGattUpdateIntentFilter()); + client.connect(device.getAddress(), true); + client.startMonitor(getContext(), bleReceiver, BLEClient.makeGattUpdateIntentFilter()); }; client = BLEClient.getInstance() startLeScan(); diff --git a/build.gradle b/build.gradle index c0a2e76..7b50e0c 100644 --- a/build.gradle +++ b/build.gradle @@ -35,7 +35,7 @@ ext { targetSdkVersion = 29 compileSdkVersion = 29 - mvm_version = '1.0.15' + mvm_version = '1.0.19' appcompat_version = '1.3.0' core_ktx_version = '1.5.0' lifecycle_version = '2.3.1'