Skip to content

Commit a4e411e

Browse files
committed
update
1 parent df8cf79 commit a4e411e

File tree

8 files changed

+85
-16
lines changed

8 files changed

+85
-16
lines changed
File renamed without changes.
File renamed without changes.

TODO/notification.md

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,62 @@
1-
http://reezy.me/2016/12/28/android-notification/
1+
http://www.jianshu.com/p/22e27a639787
2+
3+
http://reezy.me/2016-12-28/android-notification/
4+
5+
https://developer.android.google.cn/training/notify-user/display-progress.html
6+
7+
https://mp.weixin.qq.com/s/1ai6Kyg0lURQzjk5QPLrxw
8+
9+
https://blog.dreamtobe.cn/2016/01/09/notification_best_practise/
10+
11+
12+
13+
```java
14+
/**
15+
* 展示下载成功通知
16+
*
17+
* @param context 上下文
18+
* @param file 下载的apk文件
19+
* @param notificationIconResId 通知图标资源id
20+
* @param notificationTitle 通知标题
21+
* @param notificationContent 通知内容
22+
* @param isCanClear 通知是否可被清除
23+
*/
24+
public static Notification downloadSuccessNotification(Context context, File file, int notificationIconResId, String notificationTitle, String notificationContent, boolean isCanClear) {
25+
26+
// install Intent,下载完成后点击安装
27+
Intent intent = new Intent();
28+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
29+
intent.setAction(Intent.ACTION_VIEW);
30+
Uri uri;
31+
// Android 7.0
32+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
33+
uri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".bsdiffupdate",
34+
file);
35+
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
36+
} else {
37+
uri = Uri.fromFile(file);
38+
}
39+
intent.setDataAndType(uri, "application/vnd.android.package-archive");
40+
41+
NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
42+
builder.setAutoCancel(true) // 点击自动消失
43+
.setShowWhen(true) // 显示时间
44+
.setSmallIcon(notificationIconResId) // 小图标
45+
.setContentTitle(notificationTitle) // 标题
46+
.setContentText(notificationContent) // 内容
47+
.setOnlyAlertOnce(true) // 只显示一次
48+
.setDefaults(Notification.DEFAULT_SOUND); // 默认声音
49+
50+
PendingIntent pendingIntent = getActivity(context, 0, intent,
51+
PendingIntent.FLAG_UPDATE_CURRENT); // 延迟意图
52+
builder.setContentIntent(pendingIntent);
53+
54+
Notification notification = builder.build(); // 获取 Notification
55+
56+
notification.flags = isCanClear
57+
? notification.flags
58+
: notification.flags | Notification.FLAG_NO_CLEAR;
59+
return notification;
60+
}
61+
```
62+

总结这些并没有什么用.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#总结这些并没有什么用
1+
# 总结这些并没有什么用
22
本文来自:[书生依旧](https://github.com/ssyijiu)[Android阅读笔记](https://github.com/ssyijiu/Android-ReadingNotes),这不是博客,只是笔记,最纯粹的干货,转载请注明出处。
33
完成时间:2016/10/14
44
> 总结一下现在 Android 的流行技术,本文不包括 RxJava 系列。
55
6-
###common
6+
### common
77
- 架构:[MVP](https://github.com/googlesamples/android-architecture) | [Data Binding](https://developer.android.com/topic/libraries/data-binding/index.html)
88
- 网络请求:[retrofit](https://github.com/square/retrofit) | [okhttp](https://github.com/square/okhttp)
99
- 图片加载:[picasso](https://github.com/square/picasso) | [glide](https://github.com/bumptech/glide) | [fresco](https://github.com/facebook/fresco)
@@ -22,9 +22,9 @@
2222
- 图片选择器:[Matisse](https://github.com/zhihu/Matisse)
2323
- 优质的第三方库集合:[UltimateAndroidReference](https://github.com/aritraroy/UltimateAndroidReference)
2424

25-
###special
25+
### special
2626
- 二维码:[barcodescanner](https://github.com/dm77/barcodescanner) | [zxing-android-embedded](https://github.com/journeyapps/zxing-android-embedded)
27-
- 视频播放:[ijkplayer](https://github.com/Bilibili/ijkplayer) | [Vitamio](https://github.com/yixia/VitamioBundle)
27+
- 视频播放:[ijkplayer](https://github.com/Bilibili/ijkplayer) | [Vitamio](https://github.com/yixia/VitamioBundle) | [ExoPlayer](https://github.com/google/ExoPlayer) | [mp4parser](https://github.com/sannies/mp4parser)
2828
- 图表绘制:[MPAndroidChart](https://github.com/PhilJay/MPAndroidChart)
2929
- HTML 解析:[jsoup](https://github.com/jhy/jsoup)
3030
- 混合开发:[rexxar](https://github.com/douban/rexxar-android)
@@ -59,8 +59,10 @@
5959
- 指纹识别:[FingerprintManager](https://github.com/JesusM/FingerprintManager)
6060
- SQlite 转 Excel:[SQLiteToExcel](https://github.com/li-yu/SQLiteToExcel)
6161
- 美团 lint:[MeituanLintDemo](https://github.com/GavinCT/MeituanLintDemo)
62+
- Activity 路由:[ARouter](https://github.com/alibaba/ARouter) | [Ferryman](https://github.com/Jude95/Ferryman) | [ActivityRouter](https://github.com/mzule/ActivityRouter) | [AndRouter](https://github.com/campusappcn/AndRouter) | [Router](https://github.com/yjfnypeu/Router)
63+
-下载框架: [FileDownloader](https://github.com/lingochamp/FileDownloader) | [Aria](https://github.com/AriaLyy/Aria) | [xUtils3](https://github.com/wyouflf/xUtils3)
6264

63-
###UI
65+
### UI
6466
- [Material Design](https://material.google.com/)
6567
- Material Design 兼容:[material](https://github.com/rey5137/material)
6668
- Material Design 颜色:[materialette](https://github.com/mike-schultz/materialette)
@@ -94,7 +96,7 @@
9496
- 点击扩散动画:[ActSwitchAnimTool](https://github.com/Yellow5A5/ActSwitchAnimTool) | [TapTargetView](https://github.com/KeepSafe/TapTargetView)
9597
- Loading 动画:[AVLoadingIndicatorView](https://github.com/81813780/AVLoadingIndicatorView) | [Android-SpinKit](https://github.com/ybq/Android-SpinKit) |
9698
- Loading Dialog: [spots-dialog](https://github.com/d-max/spots-dialog)
97-
- Material Design 进度条:[materialish-progress](https://github.com/pnikosis/materialish-progress) | [SmoothProgressBar](https://github.com/castorflex/SmoothProgressBar)
99+
- Material Design 进度条:[materialish-progress](https://github.com/pnikosis/materialish-progress) | [SmoothProgressBar](https://github.com/castorflex/SmoothProgressBar) | [ProgressView](https://github.com/WhiteDG/ProgressView)
98100
- 数字进度条:[NumberProgressBar](https://github.com/daimajia/NumberProgressBar)
99101
- Splash 引导:[AppIntro](https://github.com/PaoloRotolo/AppIntro) | [material-intro-screen](https://github.com/TangoAgency/material-intro-screen) | [ProductTour](https://github.com/matrixxun/ProductTour) | [SlidingTutorial-Android](https://github.com/Cleveroad/SlidingTutorial-Android)
100102
- MIUI 爆炸:[ExplosionField](https://github.com/tyrantgit/ExplosionField)
@@ -126,7 +128,7 @@
126128
- 标签控件:[FlycoLabelView](https://github.com/H07000223/FlycoLabelView) | [cornerlabelview](https://github.com/czy1121/cornerlabelview) | [AvatarLabelView](https://github.com/yanbober/AvatarLabelView)
127129
- ToolBar 搜索:[MaterialSearchView](https://github.com/MiguelCatalan/MaterialSearchView) | [JellyToolbar](https://github.com/Yalantis/JellyToolbar)
128130
- Markdown View:[MarkdownView-Android](https://github.com/mukeshsolanki/MarkdownView-Android)
129-
- 沉浸式状态栏:[StatusBarUtil](https://github.com/laobie/StatusBarUtil)
131+
- 沉浸式状态栏:[StatusBarUtil](https://github.com/laobie/StatusBarUtil) | [ImmersionBar](https://github.com/gyf-dev/ImmersionBar)
130132
- IOS OverScroll 效果:[overscroll-decor](https://github.com/EverythingMe/overscroll-decor)
131133
- 手势解锁:[PinLockView](https://github.com/aritraroy/PinLockView) | [LolliPin](https://github.com/OrangeGangsters/LolliPin)
132134
- 日期选择器:[MaterialDateTimePicker](https://github.com/wdullaer/MaterialDateTimePicker) | [ndroid-times-square](https://github.com/square/android-times-square) | [MaterialDateRangePicker](https://github.com/borax12/MaterialDateRangePicker) | [material-calendarview](https://github.com/prolificinteractive/material-calendarview)
@@ -157,7 +159,7 @@
157159
- 选中圆形的底部导航:[SpaceTabLayout](https://github.com/thelong1EU/SpaceTabLayout)
158160
- 芝麻信用分:[CreditSesameRingView](https://github.com/HotBitmapGG/CreditSesameRingView)
159161
- 贝塞尔曲线:[BezierMaker](https://github.com/venshine/BezierMaker)
160-
- 跑马灯:[MarqueeViewLibrary](https://github.com/gongwen/MarqueeViewLibrary)
162+
- 跑马灯:[MarqueeViewLibrary](https://github.com/gongwen/MarqueeViewLibrary) | [RotatingText](https://github.com/sdsmdg/RotatingText)
161163
- HTML 语法构建 TextView:[html-builder](https://github.com/jrummyapps/html-builder)
162164
- 聊天群组多个头像组合:[MultiImageView](https://github.com/stfalcon-studio/MultiImageView)
163165
- 下雪效果:[android-snowfall](https://github.com/JetradarMobile/android-snowfall) | [SnowingView](https://github.com/HelloVass/SnowingView)
@@ -166,7 +168,7 @@
166168
- 上下箭头动态效果:[Android-ExpandIcon](https://github.com/zagum/Android-ExpandIcon)
167169
- 根据手腕移动的ImageView:[PanoramaImageView](https://github.com/gjiazhe/PanoramaImageView)
168170
- 不规则多变形:[Vorolay](https://github.com/Quatja/Vorolay)
169-
- 加载时白光闪过:[ShimmerRecyclerView](https://github.com/sharish/ShimmerRecyclerView)
171+
- 加载时白光闪过:[ShimmerRecyclerView](https://github.com/sharish/ShimmerRecyclerView) | [ShimmerLayout](https://github.com/team-supercharge/ShimmerLayout)
170172
- 不依赖任何View 侧滑:[SlideLayout](https://github.com/yanbober/SlideLayout) | [SwipeDelMenuLayout](https://github.com/mcxtzhang/SwipeDelMenuLayout) | [BGASwipeItemLayout-Android](https://github.com/bingoogolapple/BGASwipeItemLayout-Android)
171173
- 可以翻转的 View:[EasyFlipView](https://github.com/wajahatkarim3/EasyFlipView)
172174
- 地图雷达扫描:[GoogleMapsAnimations](https://github.com/aarsy/GoogleMapsAnimations)
@@ -235,25 +237,28 @@
235237
- 生成漂亮的二维码:[AwesomeQRCode](https://github.com/SumiMakito/AwesomeQRCode)
236238
- 电影院选座、商场购物地图、展位摊位在线预定、办公场地租赁工位等需要操作不规则区域的功能:[InDoorSurfaceView](https://github.com/karonl/InDoorSurfaceView)
237239
- 极光推送开发 IM UI 组件库[aurora-imui](https://github.com/jpush/aurora-imui)
240+
- Emoji 表情:[android-EmojiCompat](https://github.com/googlesamples/android-EmojiCompat)
241+
- 视频实时渲染:[ExoPlayerFilter](https://github.com/MasayukiSuda/ExoPlayerFilter)
242+
- Web 简易图文展示:[Web 简易图文展示](https://yedaxia.github.io/Android-RichEditor-And-NativeHtml/)
238243

239-
###那些炫酷的UI组织:
244+
### 那些炫酷的UI组织:
240245
- [Yalantis](https://github.com/Yalantis)
241246
- [DevLight-Mobile-Agency](https://github.com/DevLight-Mobile-Agency)
242247
- [Cleveroad](https://github.com/Cleveroad)
243248

244-
###那些炫酷的App
249+
### 那些炫酷的App
245250
- [android-topeka](https://github.com/googlesamples/android-topeka)
246251
- [plaid](https://github.com/nickbutcher/plaid)
247252
- [MaterializeYourApp](https://github.com/antoniolg/MaterializeYourApp)
248253
- [Onboarding](https://github.com/eoinfogarty/Onboarding)
249254
- [from_design_to_android_part1](https://github.com/saulmm/from_design_to_android_part1)
250255

251256

252-
###那些炫酷动画
257+
### 那些炫酷动画
253258
- 沙漠风情:[desertplaceholder](https://github.com/JetradarMobile/desertplaceholder)
254259
- [Depth-LIB-Android-](https://github.com/danielzeller/Depth-LIB-Android-)
255260

256-
###Three party service
261+
### Three party service
257262
- 数据分析:[友盟](http://www.umeng.com/) | [腾讯移动分析](http://mta.qq.com/)
258263
- 推送服务:[小米推送](http://dev.xiaomi.com/console/?page=appservice&mod=push)
259264
- 即时通信:[融云](http://www.rongcloud.cn/)
@@ -262,7 +267,7 @@
262267
- 后台:[Bmob](http://www.bmob.cn/)
263268

264269

265-
###Other
270+
### Other
266271
- [AndroidTDDBootStrap](https://github.com/Piasy/AndroidTDDBootStrap)
267272
- [Meizhi](https://github.com/drakeet/Meizhi)
268273
- [Dribbbler](https://github.com/81813780/Dribbbler)
@@ -283,10 +288,13 @@
283288
- [一个快递查询 App ,Rxjava2 + Retrofit + Relam + Zxing](https://github.com/TonnyL/Espresso)
284289
- [diycode 客户端,app 和 sdk 代码很不错](https://github.com/GcsSloop/diycode)
285290
- [rebase-android 代码质量非常高](https://github.com/drakeet/rebase-android)
291+
- [android-architecture-components](https://github.com/googlesamples/android-architecture-components)
292+
- 非常棒的 IM 项目[wire-android](https://github.com/wireapp/wire-android)
293+
- 直播:[SmarterStreaming](https://github.com/daniulive/SmarterStreaming)
286294

287295

288296

289-
## 联系作者
297+
## 联系作者
290298
- Github : [ssyijiu](https://github.com/ssyijiu)
291299
- E-mail : lxmyijiu@163.com
292300
- WeChat : [ssyijiu11](http://obe5pxv6t.bkt.clouddn.com/weixin.jpg)

0 commit comments

Comments
 (0)