Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/czy1121/notificationdemo
通知demo
https://github.com/czy1121/notificationdemo
demo notification notify util
Last synced: about 2 months ago
JSON representation
通知demo
- Host: GitHub
- URL: https://github.com/czy1121/notificationdemo
- Owner: czy1121
- License: apache-2.0
- Created: 2016-12-27T10:30:25.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-27T10:59:37.000Z (about 8 years ago)
- Last Synced: 2023-10-08T12:29:49.869Z (over 1 year ago)
- Topics: demo, notification, notify, util
- Language: Java
- Size: 1.5 MB
- Stars: 88
- Watchers: 5
- Forks: 20
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Notification
通知demo与工具类
![notify](screenshots/screenshot.png)
api 19 (android 4.4)![api19_big_text](screenshots/api19_big_text.png) ![api19_big_picture](screenshots/api19_big_picture.png)
api 21 (android 5.0)![api21_big_text](screenshots/api21_big_text.png) ![api19_big_picture](screenshots/api21_big_picture.png)
![api21_progress_bar](screenshots/api21_progress_bar.png) ![api21_heads_up](screenshots/api21_heads_up.png)
api 24 (android 7.0)![api24_basic](screenshots/api24_basic.png) ![api24_progress_bar](screenshots/api24_progress_bar.png)
![api24_heads_up](screenshots/api24_heads_up.png)``` java
// 创建通知
NotifyUtil.create(context)
NotifyUtil.create(context, smallIcon, title, content)
NotifyUtil.create(context, largeIcon, smallIcon, title, content)
NotifyUtil.create(context, largeIcon, smallIcon, title, content, contentIntent)// 发送通知
NotifyUtil.notify(context, notifyId, notification)// 取消通知
NotifyUtil.cancel(context, notifyId)
NotifyUtil.cancelAll(context)// 创建 Action
NotifyUtil.makeAction(icon, title, pendingIntent)// 创建多行文本样式
NotifyUtil.makeBigText(content)
// 创建大图样式
NotifyUtil.makeBigPicture(bitmap)
// 创建收件箱样式
NotifyUtil.makeInbox(messages)
```
## License
```
Copyright 2016 czy1121Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```