1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-25 10:05:49 +01:00

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

This commit is contained in:
Andreas Shimokawa 2017-03-13 22:27:59 +01:00
parent 5008f08272
commit a6bba1b094

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();
}