2017-03-10 14:53:19 +01:00
|
|
|
/* Copyright (C) 2015-2017 Andreas Shimokawa, Carsten Pfeiffer, Julien
|
|
|
|
Pivotto, Kevin Richter
|
|
|
|
|
|
|
|
This file is part of Gadgetbridge.
|
|
|
|
|
|
|
|
Gadgetbridge is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Affero General Public License as published
|
|
|
|
by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Gadgetbridge is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
2015-09-13 00:39:53 +02:00
|
|
|
package nodomain.freeyourgadget.gadgetbridge.model;
|
|
|
|
|
2016-12-09 17:54:19 +01:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.devices.pebble.PebbleColor;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.devices.pebble.PebbleIconID;
|
|
|
|
|
2015-09-24 14:45:21 +02:00
|
|
|
public enum NotificationType {
|
2015-09-13 00:39:53 +02:00
|
|
|
|
2017-03-02 00:27:54 +01:00
|
|
|
// TODO: this this pebbleism needs to be moved somewhere else
|
2016-12-09 17:54:19 +01:00
|
|
|
UNKNOWN(PebbleIconID.NOTIFICATION_GENERIC, PebbleColor.Red),
|
|
|
|
|
|
|
|
CONVERSATIONS(PebbleIconID.NOTIFICATION_HIPCHAT, PebbleColor.Inchworm),
|
|
|
|
GENERIC_EMAIL(PebbleIconID.GENERIC_EMAIL, PebbleColor.JaegerGreen),
|
|
|
|
GENERIC_NAVIGATION(PebbleIconID.LOCATION, PebbleColor.Orange),
|
|
|
|
GENERIC_SMS(PebbleIconID.GENERIC_SMS, PebbleColor.VividViolet),
|
|
|
|
FACEBOOK(PebbleIconID.NOTIFICATION_FACEBOOK, PebbleColor.Liberty),
|
|
|
|
FACEBOOK_MESSENGER(PebbleIconID.NOTIFICATION_FACEBOOK_MESSENGER, PebbleColor.VeryLightBlue),
|
2017-01-03 20:36:39 +01:00
|
|
|
RIOT(PebbleIconID.NOTIFICATION_HIPCHAT, PebbleColor.LavenderIndigo),
|
2016-12-09 17:54:19 +01:00
|
|
|
SIGNAL(PebbleIconID.NOTIFICATION_HIPCHAT, PebbleColor.BlueMoon),
|
|
|
|
TWITTER(PebbleIconID.NOTIFICATION_TWITTER, PebbleColor.BlueMoon),
|
|
|
|
TELEGRAM(PebbleIconID.NOTIFICATION_TELEGRAM, PebbleColor.PictonBlue),
|
2017-02-07 23:49:10 +01:00
|
|
|
WHATSAPP(PebbleIconID.NOTIFICATION_WHATSAPP, PebbleColor.MayGreen),
|
|
|
|
GENERIC_ALARM_CLOCK(PebbleIconID.ALARM_CLOCK, PebbleColor.Red);
|
2017-03-02 00:27:54 +01:00
|
|
|
// Note: if you add any more constants, update all clients as well
|
2015-09-13 00:39:53 +02:00
|
|
|
|
2016-12-09 17:54:19 +01:00
|
|
|
public int icon;
|
|
|
|
public byte color;
|
|
|
|
|
|
|
|
NotificationType(int icon, byte color) {
|
|
|
|
this.icon = icon;
|
|
|
|
this.color = color;
|
|
|
|
}
|
2016-10-10 22:39:20 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the enum constant as a fixed String value, e.g. to be used
|
|
|
|
* as preference key. In case the keys are ever changed, this method
|
|
|
|
* may be used to bring backward compatibility.
|
|
|
|
*/
|
|
|
|
public String getFixedValue() {
|
|
|
|
return name().toLowerCase();
|
|
|
|
}
|
2016-10-11 15:20:55 +02:00
|
|
|
|
|
|
|
public String getGenericType() {
|
|
|
|
switch (this) {
|
|
|
|
case GENERIC_EMAIL:
|
|
|
|
case GENERIC_NAVIGATION:
|
|
|
|
case GENERIC_SMS:
|
2017-02-07 23:49:10 +01:00
|
|
|
case GENERIC_ALARM_CLOCK:
|
2016-10-11 15:20:55 +02:00
|
|
|
return getFixedValue();
|
|
|
|
case FACEBOOK:
|
|
|
|
case TWITTER:
|
|
|
|
return "generic_social";
|
|
|
|
case CONVERSATIONS:
|
|
|
|
case FACEBOOK_MESSENGER:
|
2017-01-03 20:36:39 +01:00
|
|
|
case RIOT:
|
2016-10-11 15:20:55 +02:00
|
|
|
case SIGNAL:
|
|
|
|
case TELEGRAM:
|
2016-12-09 17:54:19 +01:00
|
|
|
case WHATSAPP:
|
2016-10-11 15:20:55 +02:00
|
|
|
return "generic_chat";
|
|
|
|
case UNKNOWN:
|
|
|
|
default:
|
|
|
|
return "generic";
|
|
|
|
}
|
|
|
|
}
|
2015-09-13 00:39:53 +02:00
|
|
|
}
|