mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-28 04:46:51 +01:00
Do not show "your activity" if activity tracking is not supported
This commit is contained in:
parent
1f8cfa5a68
commit
696611d392
@ -197,6 +197,9 @@ public class ControlCenter extends GBActivity {
|
||||
if (!coordinator.supportsAlarmConfiguration()) {
|
||||
menu.removeItem(R.id.controlcenter_configure_alarms);
|
||||
}
|
||||
if (!coordinator.supportsActivityTracking()) {
|
||||
menu.removeItem(R.id.controlcenter_start_sleepmonitor);
|
||||
}
|
||||
|
||||
if (selectedDevice.getState() == GBDevice.State.NOT_CONNECTED) {
|
||||
menu.removeItem(R.id.controlcenter_disconnect);
|
||||
|
@ -71,6 +71,14 @@ public interface DeviceCoordinator {
|
||||
*/
|
||||
boolean supportsActivityDataFetching();
|
||||
|
||||
/**
|
||||
* Returns true if activity tracking is supported by the device
|
||||
* (with this coordinator).
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean supportsActivityTracking();
|
||||
|
||||
/**
|
||||
* Returns true if activity data fetching is supported AND possible at this
|
||||
* very moment. This will consider the device state (being connected/disconnected/busy...)
|
||||
|
@ -106,6 +106,11 @@ public class UnknownDeviceCoordinator extends AbstractDeviceCoordinator {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracking() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsScreenshots() {
|
||||
return false;
|
||||
|
@ -93,6 +93,11 @@ public class MiBandCoordinator extends AbstractDeviceCoordinator {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracking() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTapString() {
|
||||
return R.string.tap_connected_device_for_activity;
|
||||
|
@ -68,6 +68,11 @@ public class PebbleCoordinator extends AbstractDeviceCoordinator {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracking() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsScreenshots() {
|
||||
return true;
|
||||
|
@ -47,6 +47,11 @@ public class VibratissimoCoordinator extends AbstractDeviceCoordinator {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsActivityTracking() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SampleProvider<? extends ActivitySample> getSampleProvider(GBDevice device, DaoSession session) {
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user