diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDevice.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDevice.java index 459cb19af..91dc04257 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDevice.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDevice.java @@ -82,6 +82,10 @@ public class GBDevice implements Parcelable { private List mDeviceInfos; private HashMap mExtraInfos; + private int mNotificationIconConnected = R.drawable.ic_notification; + private int mNotificationIconDisconnected = R.drawable.ic_notification_disconnected; + private int mNotificationIconLowBattery = R.drawable.ic_notification_low_battery; + public GBDevice(String address, String name, DeviceType deviceType) { this(address, null, name, deviceType); } @@ -110,6 +114,9 @@ public class GBDevice implements Parcelable { mBusyTask = in.readString(); mDeviceInfos = in.readArrayList(getClass().getClassLoader()); mExtraInfos = (HashMap) in.readSerializable(); + mNotificationIconConnected = in.readInt(); + mNotificationIconDisconnected = in.readInt(); + mNotificationIconLowBattery = in.readInt(); validate(); } @@ -131,6 +138,9 @@ public class GBDevice implements Parcelable { dest.writeString(mBusyTask); dest.writeList(mDeviceInfos); dest.writeSerializable(mExtraInfos); + dest.writeInt(mNotificationIconConnected); + dest.writeInt(mNotificationIconDisconnected); + dest.writeInt(mNotificationIconLowBattery); } private void validate() { @@ -221,6 +231,30 @@ public class GBDevice implements Parcelable { return mBusyTask; } + public int getNotificationIconConnected() { + return mNotificationIconConnected; + } + + public void setNotificationIconConnected(int mNotificationIconConnected) { + this.mNotificationIconConnected = mNotificationIconConnected; + } + + public int getNotificationIconDisconnected() { + return mNotificationIconDisconnected; + } + + public void setNotificationIconDisconnected(int notificationIconDisconnected) { + this.mNotificationIconDisconnected = notificationIconDisconnected; + } + + public int getNotificationIconLowBattery() { + return mNotificationIconLowBattery; + } + + public void setNotificationIconLowBattery(int mNotificationIconLowBattery) { + this.mNotificationIconLowBattery = mNotificationIconLowBattery; + } + /** * Marks the device as busy, performing a certain task. While busy, no other operations will * be performed on the device. diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/GB.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/GB.java index cef13fa3d..f61d97da7 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/GB.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/GB.java @@ -98,7 +98,7 @@ public class GB { builder.setContentTitle(deviceName) .setTicker(deviceName + " - " + text) .setContentText(text) - .setSmallIcon(connected ? R.drawable.ic_notification : R.drawable.ic_notification_disconnected) + .setSmallIcon(connected ? device.getNotificationIconConnected() : device.getNotificationIconDisconnected()) .setContentIntent(getContentIntent(context)) .setColor(context.getResources().getColor(R.color.accent)) .setOngoing(true);