In CCv2 allow to disconnect with long press in any state expect "not connected"

master
Andreas Shimokawa 2017-03-13 22:27:59 +01:00
parent 5008f08272
commit a6bba1b094
1 changed files with 1 additions and 1 deletions

View File

@ -79,7 +79,7 @@ public class GBDeviceAdapterv2 extends RecyclerView.Adapter<GBDeviceAdapterv2.Vi
holder.container.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
if (device.isInitialized() || device.isConnected()) {
if (device.getState() != GBDevice.State.NOT_CONNECTED) {
showTransientSnackbar(R.string.controlcenter_snackbar_disconnecting);
GBApplication.deviceService().disconnect();
}