aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/ConversationsPlusColors.java
blob: db9c560fe2d141f2564147323d6158bc37ed89a3 (plain)
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
148
149
150
151
152
153
154
155
156
157
package de.thedevstack.conversationsplus;

/**
 * Helper class for accessing colors.
 */
public final class ConversationsPlusColors {
    /**
     * Returns the primary background color.
     * @return the primary background color
     */
    public static int primaryBackground() {
        return byId(R.color.primaryBackground);
    }

    /**
     * Returns the secondary background color.
     * @return the secondary background color
     */
    public static int secondaryBackground() {
        return byId(R.color.secondaryBackground);
    }

    /**
     * Returns the primary text color.
     * @return the primary text color
     */
    public static int primaryText() {
        return byId(R.color.primaryText);
    }

    /**
     * Returns the secondary text color.
     * @return the secondary text color
     */
    public static int secondaryText() {
        return byId(R.color.secondaryText);
    }

    /**
     * Returns the tertiary text color.
     * @return the tertiary text color
     */
    public static int tertiaryText() {
        return byId(R.color.tertiaryText);
    }

    /**
     * Returns the primary text color on dark background.
     * @return the primary text color on dark background
     */
    public static int primaryTextOnDark() {
        return byId(R.color.primaryTextOnDark);
    }

    /**
     * Returns the secondary text color on dark background.
     * @return the secondary text color on dark background
     */
    public static int secondaryTextOnDark() {
        return byId(R.color.secondaryTextOnDark);
    }

    /**
     * Returns the online color.
     * @return the online color
     */
    public static int online() {
        return byId(R.color.online);
    }

    /**
     * Returns the color for the presence status 'chat'.
     * @return the color for the presence status 'chat'
     */
    public static int chat() {
        return byId(R.color.chat);
    }

    /**
     * Returns the color for the presence status 'away'.
     * @return the color for the presence status 'away'
     */
    public static int away() {
        return byId(R.color.away);
    }

    /**
     * Returns the color for the presence status 'dnd'.
     * @return the color for the presence status 'dnd'
     */
    public static int dnd() {
        return byId(R.color.dnd);
    }

    /**
     * Returns the color for the presence status 'xa'.
     * @return the color for the presence status 'xa'
     */
    public static int xa() {
        return byId(R.color.xa);
    }

    /**
     * Returns the color for the presence status 'offline'.
     * @return the color for the presence status 'offline'
     */
    public static int offline() {
        return byId(R.color.offline);
    }

    /**
     * Returns the error color.
     * @return the error color
     */
    public static int error() {
        return byId(R.color.error);
    }

    /**
     * Returns the warning color.
     * @return the warning color
     */
    public static int warning() {
        return byId(R.color.warning);
    }

    /**
     * Returns the notification color.
     * @return the notification color
     */
    public static int notification() {
        return byId(R.color.notification);
    }

    /**
     * Returns the accent color.
     * @return the accent color
     */
    public static int accent() {
        return byId(R.color.accent);
    }

    /**
     * Returns the color identified by id.
     * Delegates to android.content.res.Resources.getColor(int)
     * @param id the id of the color
     * @see {@link android.content.res.Resources#getColor(int)}
     * @return the color identified by id
     */
    public static int byId(int id) {
        return ConversationsPlusApplication.getAppContext().getResources().getColor(id);
    }

    private ConversationsPlusColors() {
        // avoid instantiation - helper class
    }
}