From 619a17425f59b99543f3ab92e4333eeff87e4ce6 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Wed, 4 May 2016 12:31:29 +0200 Subject: [PATCH] Mi Band: Display hint about starting Activity Activity instead of App Manager TODO: Fix the string, I have no idea how to properly name the Activity Activity --- .../gadgetbridge/activities/ControlCenter.java | 3 ++- .../gadgetbridge/devices/DeviceCoordinator.java | 2 ++ .../gadgetbridge/devices/UnknownDeviceCoordinator.java | 5 +++++ .../gadgetbridge/devices/miband/MiBandCoordinator.java | 6 ++++++ .../gadgetbridge/devices/pebble/PebbleCoordinator.java | 6 ++++++ app/src/main/res/values/strings.xml | 1 + 6 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ControlCenter.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ControlCenter.java index 7ddb5a884..702aa1346 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ControlCenter.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ControlCenter.java @@ -390,7 +390,8 @@ public class ControlCenter extends GBActivity { } if (connected) { - hintTextView.setText(R.string.tap_connected_device_for_app_mananger); + DeviceCoordinator coordinator = DeviceHelper.getInstance().getCoordinator(selectedDevice); + hintTextView.setText(coordinator.getTapString()); } else if (!deviceList.isEmpty()) { hintTextView.setText(R.string.tap_a_device_to_connect); } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/DeviceCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/DeviceCoordinator.java index e1bfe8225..7ecc3e8d1 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/DeviceCoordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/DeviceCoordinator.java @@ -107,4 +107,6 @@ public interface DeviceCoordinator { * @return */ boolean supportsAlarmConfiguration(); + + int getTapString(); } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/UnknownDeviceCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/UnknownDeviceCoordinator.java index 7d9b88d8d..1af8da27e 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/UnknownDeviceCoordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/UnknownDeviceCoordinator.java @@ -88,4 +88,9 @@ public class UnknownDeviceCoordinator extends AbstractDeviceCoordinator { public boolean supportsAlarmConfiguration() { return false; } + + @Override + public int getTapString() { + return 0; + } } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandCoordinator.java index a669412eb..c4e8e83c0 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandCoordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/miband/MiBandCoordinator.java @@ -8,6 +8,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import nodomain.freeyourgadget.gadgetbridge.GBApplication; +import nodomain.freeyourgadget.gadgetbridge.R; import nodomain.freeyourgadget.gadgetbridge.activities.charts.ChartsActivity; import nodomain.freeyourgadget.gadgetbridge.devices.AbstractDeviceCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler; @@ -78,6 +79,11 @@ public class MiBandCoordinator extends AbstractDeviceCoordinator { return true; } + @Override + public int getTapString() { + return R.string.tap_connected_device_for_activity; + } + public static boolean hasValidUserInfo() { String dummyMacAddress = MiBandService.MAC_ADDRESS_FILTER_1_1A + ":00:00:00"; try { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pebble/PebbleCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pebble/PebbleCoordinator.java index d76e71269..c74db0541 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pebble/PebbleCoordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pebble/PebbleCoordinator.java @@ -5,6 +5,7 @@ import android.content.Context; import android.net.Uri; import nodomain.freeyourgadget.gadgetbridge.GBApplication; +import nodomain.freeyourgadget.gadgetbridge.R; import nodomain.freeyourgadget.gadgetbridge.activities.AppManagerActivity; import nodomain.freeyourgadget.gadgetbridge.devices.AbstractDeviceCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler; @@ -80,4 +81,9 @@ public class PebbleCoordinator extends AbstractDeviceCoordinator { public boolean supportsAlarmConfiguration() { return false; } + + @Override + public int getTapString() { + return R.string.tap_connected_device_for_app_mananger; + } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1ec538ecd..a3392096a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -87,6 +87,7 @@ Bluetooth is not supported. Bluetooth is disabled. Tap connected device for App Manager + Tap connected device for Activiy Tap a device to connect Cannot connect. BT address invalid? Gadgetbridge running