1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-24 02:46:50 +01:00

Fossil: Allow swiching off the device specific "Q" notification icon

This commit is contained in:
Andreas Shimokawa 2020-03-12 13:48:25 +01:00
parent d2647b2b65
commit 1ccb7ab785
5 changed files with 20 additions and 4 deletions

View File

@ -24,4 +24,5 @@ public class DeviceSettingsPreferenceConst {
public static final String PREF_RESERVER_ALARMS_CALENDAR = "reserve_alarms_calendar";
public static final String PREF_ALLOW_HIGH_MTU = "allow_high_mtu";
public static final String PREF_SYNC_CALENDAR = "sync_calendar";
public static final String PREF_USE_CUSTOM_DEVICEICON = "use_custom_deviceicon";
}

View File

@ -183,11 +183,13 @@ public class QHybridCoordinator extends AbstractDeviceCoordinator {
if (isHybridHR()) {
return new int[]{
R.xml.devicesettings_fossilhybridhr,
R.xml.devicesettings_pairingkey
R.xml.devicesettings_pairingkey,
R.xml.devicesettings_custom_deviceicon
};
}
return new int[]{
R.xml.devicesettings_pairingkey
R.xml.devicesettings_pairingkey,
R.xml.devicesettings_custom_deviceicon
};
}

View File

@ -48,6 +48,7 @@ import java.util.UUID;
import nodomain.freeyourgadget.gadgetbridge.BuildConfig;
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventBatteryInfo;
import nodomain.freeyourgadget.gadgetbridge.devices.qhybrid.NotificationConfiguration;
import nodomain.freeyourgadget.gadgetbridge.devices.qhybrid.PackageConfigHelper;
@ -350,8 +351,10 @@ public class QHybridSupport extends QHybridBaseSupport {
this.useActivityHand = GBApplication.getPrefs().getBoolean("QHYBRID_USE_ACTIVITY_HAND", false);
getDevice().addDeviceInfo(new GenericItem(ITEM_USE_ACTIVITY_HAND, String.valueOf(this.useActivityHand)));
getDevice().setNotificationIconConnected(R.drawable.ic_notification_qhybrid);
getDevice().setNotificationIconDisconnected(R.drawable.ic_notification_disconnected_qhybrid);
if (GBApplication.getDeviceSpecificSharedPrefs(gbDevice.getAddress()).getBoolean(DeviceSettingsPreferenceConst.PREF_USE_CUSTOM_DEVICEICON, true)) {
getDevice().setNotificationIconConnected(R.drawable.ic_notification_qhybrid);
getDevice().setNotificationIconDisconnected(R.drawable.ic_notification_disconnected_qhybrid);
}
for (int i = 2; i <= 7; i++)
builder.notify(getCharacteristic(UUID.fromString("3dda000" + i + "-957f-7d4a-34a6-74696673696d")), true);

View File

@ -145,6 +145,8 @@
<string name="pref_summary_sunrise_sunset">Send sunrise and sunset times based on the location to the Pebble timeline</string>
<string name="pref_title_enable_calendar_sync">Sync calendar</string>
<string name="pref_summary_enable_calendar_sync">Send calendar events to the timeline</string>
<string name="pref_title_custom_deviceicon">Show device specific notification icon</string>
<string name="pref_summary_custom_deviceicon">Show a device specific Android notification icon instead the Gadgetbridge icon when connected</string>
<string name="pref_title_autoremove_notifications">Autoremove dismissed notifications</string>
<string name="pref_summary_autoremove_notifications">Notifications are automatically removed from the Pebble when dismissed from the Android device</string>
<string name="pref_title_pebble_privacy_mode">Privacy mode</string>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<SwitchPreference
android:defaultValue="true"
android:key="use_custom_deviceicon"
android:summary="@string/pref_summary_custom_deviceicon"
android:title="@string/pref_title_custom_deviceicon" />
</androidx.preference.PreferenceScreen>