mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-28 12:56:49 +01:00
Bangle.js: Add screenshot support
This commit is contained in:
parent
705651e5f6
commit
1e2a561dfd
@ -443,7 +443,7 @@ public class GBDeviceAdapterv2 extends ListAdapter<GBDevice, GBDeviceAdapterv2.V
|
|||||||
|
|
||||||
|
|
||||||
//take screenshot
|
//take screenshot
|
||||||
holder.takeScreenshotView.setVisibility((device.isInitialized() && coordinator.supportsScreenshots()) ? View.VISIBLE : View.GONE);
|
holder.takeScreenshotView.setVisibility((device.isInitialized() && coordinator.supportsScreenshots(device)) ? View.VISIBLE : View.GONE);
|
||||||
holder.takeScreenshotView.setOnClickListener(new View.OnClickListener()
|
holder.takeScreenshotView.setOnClickListener(new View.OnClickListener()
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -310,7 +310,7 @@ public abstract class AbstractDeviceCoordinator implements DeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -332,7 +332,7 @@ public interface DeviceCoordinator {
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean supportsScreenshots();
|
boolean supportsScreenshots(GBDevice device);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of alarms this device/coordinator supports
|
* Returns the number of alarms this device/coordinator supports
|
||||||
|
@ -142,7 +142,7 @@ public class UnknownDeviceCoordinator extends AbstractDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ public class AsteroidOSDeviceCoordinator extends AbstractDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,8 +113,8 @@ public class BangleJSCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return device.getModel() != null && device.getModel().equals("2");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -109,7 +109,7 @@ public class BinarySensorCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ public class CasioGB6900DeviceCoordinator extends CasioDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ public class CasioGBX100DeviceCoordinator extends CasioDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ public class CasioGWB5600DeviceCoordinator extends CasioDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ public class DomyosT540Coordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ public class FitProDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ public class FlipperZeroCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ public abstract class GalaxyBudsGenericCoordinator extends AbstractBLClassicDevi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ public class HPlusCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -526,7 +526,7 @@ public abstract class HuamiCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ public class MiBand7Coordinator extends ZeppOsCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ public abstract class ZeppOsCoordinator extends HuamiCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ public abstract class HuaweiBRCoordinator extends AbstractBLClassicDeviceCoordin
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ public abstract class HuaweiLECoordinator extends AbstractBLEDeviceCoordinator i
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ public class ID115Coordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ public class ITagCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ public class BFH16DeviceCoordinator extends AbstractBLEDeviceCoordinator
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ public class TeclastH30Coordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ public class Y5Coordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ public class LefunDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ public class WatchXPlusDeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ public class LiveviewCoordinator extends AbstractBLClassicDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ public class MakibesHR3Coordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ public class MiBandCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ public class MiScale2DeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ public class No1F1Coordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ public class NutCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ public class PebbleCoordinator extends AbstractBLClassicDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ public class PineTimeJFCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ public class QC35Coordinator extends AbstractBLClassicDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ public class QHybridCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
public boolean supportsFlashing() { return false; }
|
public boolean supportsFlashing() { return false; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ public abstract class RoidmiCoordinator extends AbstractBLClassicDeviceCoordinat
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ public class SMAQ2OSSCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ public class SoFlowCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ public abstract class SonyHeadphonesCoordinator extends AbstractBLClassicDeviceC
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ public class SonyWena3Coordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ public class SonySWR12DeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ public class SuperCarsCoordinator extends AbstractDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ public class TestDeviceCoordinator extends AbstractDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return supports(getTestDevice(), TestFeature.SCREENSHOTS);
|
return supports(getTestDevice(), TestFeature.SCREENSHOTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ public class TLW64Coordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ public class UM25Coordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ public class VescCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ public class VibratissimoCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ public class VivomoveHrCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ public class WaspOSCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ public class Watch9DeviceCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ public class WithingsSteelHRDeviceCoordinator extends AbstractDeviceCoordinator
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ public class XWatchCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ public class ZeTimeCoordinator extends AbstractBLEDeviceCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsScreenshots() {
|
public boolean supportsScreenshots(final GBDevice device) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,6 +109,7 @@ import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventMusicContr
|
|||||||
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventNotificationControl;
|
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventNotificationControl;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventUpdatePreferences;
|
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventUpdatePreferences;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventVersionInfo;
|
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventVersionInfo;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventScreenshot;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.banglejs.BangleJSConstants;
|
import nodomain.freeyourgadget.gadgetbridge.devices.banglejs.BangleJSConstants;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.devices.banglejs.BangleJSSampleProvider;
|
import nodomain.freeyourgadget.gadgetbridge.devices.banglejs.BangleJSSampleProvider;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.entities.BangleJSActivitySample;
|
import nodomain.freeyourgadget.gadgetbridge.entities.BangleJSActivitySample;
|
||||||
@ -509,7 +510,11 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
|
|||||||
LOG.error("UART RX JSON parse failure: "+ e.getLocalizedMessage());
|
LOG.error("UART RX JSON parse failure: "+ e.getLocalizedMessage());
|
||||||
GB.toast(getContext(), "Malformed JSON from Bangle.js: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
GB.toast(getContext(), "Malformed JSON from Bangle.js: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||||
}
|
}
|
||||||
|
} else if (line.startsWith("data:image/bmp;base64,")) {
|
||||||
|
LOG.debug("Got screenshot bmp");
|
||||||
|
final byte[] screenshotBytes = Base64.decode(line.substring(21), Base64.DEFAULT);
|
||||||
|
final GBDeviceEventScreenshot gbDeviceEventScreenshot = new GBDeviceEventScreenshot(screenshotBytes);
|
||||||
|
evaluateGBDeviceEvent(gbDeviceEventScreenshot);
|
||||||
} else {
|
} else {
|
||||||
LOG.info("UART RX line started with "+(int)line.charAt(0)+" - ignoring");
|
LOG.info("UART RX line started with "+(int)line.charAt(0)+" - ignoring");
|
||||||
}
|
}
|
||||||
@ -1520,6 +1525,17 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onScreenshotReq() {
|
||||||
|
try {
|
||||||
|
final TransactionBuilder builder = performInitialized("screenshot");
|
||||||
|
uartTx(builder, "\u0010g.dump()\n");
|
||||||
|
builder.queue(getQueue());
|
||||||
|
} catch (final IOException e) {
|
||||||
|
GB.toast(getContext(), "Failed to get screenshot: " + e.getLocalizedMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSetHeartRateMeasurementInterval(int seconds) {
|
public void onSetHeartRateMeasurementInterval(int seconds) {
|
||||||
realtimeHRMInterval = seconds;
|
realtimeHRMInterval = seconds;
|
||||||
|
Loading…
Reference in New Issue
Block a user