wangzhibo
4 天以前 ae6f40460dcd56af6c5f60ba52c883854c3bac55
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*  Copyright (C) 2017-2024 Andreas Shimokawa, Daniele Gobbetti, Lukas
    Veneziano, Maxim Baz, musover
 
    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 <https://www.gnu.org/licenses/>. */
 
package nodomain.freeyourgadget.gadgetbridge.service.devices.huami;
 
 
import nodomain.freeyourgadget.gadgetbridge.model.NotificationType;
 
public class HuamiIcon {
    // icons which are unsure which app they are for are suffixed with _NN
    public static final byte WECHAT = 0;
    public static final byte PENGUIN_1 = 1;
    public static final byte MI_CHAT_2 = 2;
    public static final byte FACEBOOK = 3;
    public static final byte TWITTER = 4;
    public static final byte MI_APP_5 = 5;
    public static final byte SNAPCHAT = 6;
    public static final byte WHATSAPP = 7;
    public static final byte RED_WHITE_FIRE_8 = 8;
    public static final byte CHINESE_9 = 9;
    public static final byte ALARM_CLOCK = 10;
    public static final byte APP_11 = 11;
    public static final byte INSTAGRAM = 12;
    public static final byte CHAT_BLUE_13 = 13;
    public static final byte COW_14 = 14;
    public static final byte CHINESE_15 = 15;
    public static final byte CHINESE_16 = 16;
    public static final byte STAR_17 = 17;
    public static final byte APP_18 = 18;
    public static final byte CHINESE_19 = 19;
    public static final byte CHINESE_20 = 20;
    public static final byte CALENDAR = 21;
    public static final byte FACEBOOK_MESSENGER = 22;
    public static final byte VIBER = 23;
    public static final byte LINE = 24;
    public static final byte TELEGRAM = 25;
    public static final byte KAKAOTALK = 26;
    public static final byte SKYPE = 27;
    public static final byte VKONTAKTE = 28;
    public static final byte POKEMONGO = 29;
    public static final byte HANGOUTS = 30;
    public static final byte MI_31 = 31;
    public static final byte CHINESE_32 = 32;
    public static final byte CHINESE_33 = 33;
    public static final byte EMAIL = 34;
    public static final byte WEATHER = 35;
    public static final byte HR_WARNING_36 = 36;
 
    public static byte mapToIconId(NotificationType type) {
        switch (type) {
            case UNKNOWN:
            case GENERIC_NAVIGATION:
                return APP_11;
            case CONVERSATIONS:
            case RIOT:
            case HIPCHAT:
            case KONTALK:
            case ANTOX:
            case GENERIC_SMS:
            case WECHAT:
                return WECHAT;
            case GENERIC_EMAIL:
            case GMAIL:
            case YAHOO_MAIL:
            case OUTLOOK:
                return EMAIL;
            case GENERIC_CALENDAR:
            case BUSINESS_CALENDAR:
                return CALENDAR;
            case FACEBOOK:
                return FACEBOOK;
            case FACEBOOK_MESSENGER:
            case SIGNAL:
                return FACEBOOK_MESSENGER;
            case GOOGLE_HANGOUTS:
            case GOOGLE_MESSENGER:
                return HANGOUTS;
            case INSTAGRAM:
            case GOOGLE_PHOTOS:
                return INSTAGRAM;
            case KAKAO_TALK:
                return KAKAOTALK;
            case LINE:
                return LINE;
            case WIRE:
            case THREEMA:
                return CHAT_BLUE_13;
            case TWITTER:
                return TWITTER;
            case SKYPE:
                return SKYPE;
            case SNAPCHAT:
                return SNAPCHAT;
            case TELEGRAM:
                return TELEGRAM;
            case VIBER:
            case DISCORD:
                return VIBER;
            case WHATSAPP:
                return WHATSAPP;
            case GENERIC_ALARM_CLOCK:
                return ALARM_CLOCK;
        }
        return APP_11;
    }
 
    //amazfit workaround
    public static boolean acceptsSender(byte iconId){
        switch(iconId){
            case WECHAT:
            case PENGUIN_1:
            case MI_CHAT_2:
            case SNAPCHAT:
            case WHATSAPP:
            case RED_WHITE_FIRE_8:
            case INSTAGRAM:
            case CHAT_BLUE_13:
            case COW_14:
            case CHINESE_20:
            case FACEBOOK_MESSENGER:
            case VIBER:
            case LINE:
            case TELEGRAM:
            case VKONTAKTE:
            case CHINESE_32:
            case EMAIL:
                return true;
        }
 
        return false;
    }
}