mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-29 05:16:51 +01:00
Prevent disconnection if device is not connected.
This commit is contained in:
parent
46824b7235
commit
a45f76d3bf
@ -80,8 +80,10 @@ public class GBDeviceAdapterv2 extends RecyclerView.Adapter<GBDeviceAdapterv2.Vi
|
|||||||
holder.container.setOnLongClickListener(new View.OnLongClickListener() {
|
holder.container.setOnLongClickListener(new View.OnLongClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onLongClick(View v) {
|
public boolean onLongClick(View v) {
|
||||||
|
if (device.isInitialized() || device.isConnected()) {
|
||||||
showTransientSnackbar(R.string.controlcenter_snackbar_disconnecting);
|
showTransientSnackbar(R.string.controlcenter_snackbar_disconnecting);
|
||||||
GBApplication.deviceService().disconnect();
|
GBApplication.deviceService().disconnect();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user