mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-01-12 02:45:49 +01:00
Require initialized state for some more actions
This commit is contained in:
parent
66ed672ad6
commit
6d7428ad29
@ -193,12 +193,10 @@ public class ControlCenter extends Activity {
|
|||||||
getMenuInflater().inflate(R.menu.controlcenter_context, menu);
|
getMenuInflater().inflate(R.menu.controlcenter_context, menu);
|
||||||
|
|
||||||
DeviceCoordinator coordinator = DeviceHelper.getInstance().getCoordinator(selectedDevice);
|
DeviceCoordinator coordinator = DeviceHelper.getInstance().getCoordinator(selectedDevice);
|
||||||
if (!selectedDevice.isConnected() || !coordinator.supportsActivityDataFetching()) {
|
if (!coordinator.supportsActivityDataFetching()) {
|
||||||
menu.removeItem(R.id.controlcenter_fetch_activity_data);
|
menu.removeItem(R.id.controlcenter_fetch_activity_data);
|
||||||
menu.removeItem(R.id.controlcenter_configure_alarms);
|
|
||||||
}
|
}
|
||||||
|
if (!coordinator.supportsScreenshots()) {
|
||||||
if (!selectedDevice.isConnected() || !coordinator.supportsScreenshots()) {
|
|
||||||
menu.removeItem(R.id.controlcenter_take_screenshot);
|
menu.removeItem(R.id.controlcenter_take_screenshot);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -207,6 +205,9 @@ public class ControlCenter extends Activity {
|
|||||||
}
|
}
|
||||||
if (!selectedDevice.isInitialized()) {
|
if (!selectedDevice.isInitialized()) {
|
||||||
menu.removeItem(R.id.controlcenter_find_device);
|
menu.removeItem(R.id.controlcenter_find_device);
|
||||||
|
menu.removeItem(R.id.controlcenter_fetch_activity_data);
|
||||||
|
menu.removeItem(R.id.controlcenter_configure_alarms);
|
||||||
|
menu.removeItem(R.id.controlcenter_take_screenshot);
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.setHeaderTitle(selectedDevice.getName());
|
menu.setHeaderTitle(selectedDevice.getName());
|
||||||
|
Loading…
Reference in New Issue
Block a user