Changeset View
Changeset View
Standalone View
Standalone View
src/org/kde/knotifications/KNotification.java
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | Copyright (C) 2018 Volker Krause <vkrause@kde.org> | ||||
3 | | ||||
4 | This program is free software; you can redistribute it and/or modify it | ||||
5 | under the terms of the GNU Library General Public License as published by | ||||
6 | the Free Software Foundation; either version 2 of the License, or (at your | ||||
7 | option) any later version. | ||||
8 | | ||||
9 | This program is distributed in the hope that it will be useful, but WITHOUT | ||||
10 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||||
11 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public | ||||
12 | License for more details. | ||||
13 | | ||||
14 | You should have received a copy of the GNU General Public License | ||||
15 | along with this program. If not, see <https://www.gnu.org/licenses/>. | ||||
16 | */ | ||||
17 | | ||||
18 | package org.kde.knotifications; | ||||
19 | | ||||
20 | import android.graphics.drawable.Icon; | ||||
21 | import java.util.ArrayList; | ||||
22 | | ||||
23 | /** Java side of KNotification. | ||||
24 | * Used to convey the relevant notification data to Java. | ||||
25 | */ | ||||
26 | public class KNotification | ||||
27 | { | ||||
28 | public int id; | ||||
29 | public String text; | ||||
30 | public String title; | ||||
31 | public Icon icon; | ||||
32 | public ArrayList<String> actions = new ArrayList<String>(); | ||||
33 | | ||||
34 | public void setIconFromData(byte[] data, int length) | ||||
35 | { | ||||
36 | icon = Icon.createWithData(data, 0, length); | ||||
37 | } | ||||
38 | | ||||
39 | public void addAction(String action) | ||||
40 | { | ||||
41 | actions.add(action); | ||||
42 | } | ||||
43 | } |