Skip to content

Commit 8711ebe

Browse files
committed
see 12/16 log
1 parent 481f98c commit 8711ebe

File tree

7 files changed

+635
-577
lines changed

7 files changed

+635
-577
lines changed

README-CN.md

Lines changed: 365 additions & 362 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 47 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Directory is shown below:
66
```
77
isActivityExists
88
launchActivity
9-
getLauncherActivity
9+
getLauncherActivity: 获取入口activity
1010
```
1111

1212
> - **About App→[AppUtils.java][app.java][Demo][app.demo]**
@@ -20,7 +20,7 @@ isAppRoot
2020
launchApp
2121
closeApp
2222
getAppPackageName
23-
getAppDetailsSettings
23+
getAppDetailsSettings: 获取App具体设置
2424
getAppName
2525
getAppIcon
2626
getAppPath
@@ -39,7 +39,7 @@ cleanAppData
3939

4040
> - **About Bar→[BarUtils.java][bar.java]**
4141
```
42-
setTransparentStatusBar
42+
setTransparentStatusBar: 设置透明状态栏(api大于19方可使用)
4343
hideStatusBar
4444
getStatusBarHeight
4545
isStatusBarExists
@@ -53,7 +53,7 @@ hideNotificationBar
5353
cleanInternalCache
5454
cleanInternalFiles
5555
cleanInternalDbs
56-
cleanInternalDbByName
56+
cleanInternalDbByName: 根据名称清除数据库
5757
cleanInternalSP
5858
cleanExternalCache
5959
cleanCustomCache
@@ -65,19 +65,19 @@ copyText
6565
getText
6666
copyUri
6767
getUri
68-
copyIntent
68+
copyIntent: 复制意图到剪贴板
6969
getIntent
7070
```
7171

7272
> - **About Close→[CloseUtils.java][close.java]**
7373
```
7474
closeIO
75-
closeIOQuietly
75+
closeIOQuietly: 安静关闭IO
7676
```
7777

7878
> - **About Const→[ConstUtils.java][const.java]**
7979
```
80-
MemoryConst
80+
MemoryConst: 存储相关常量
8181
TimeConst
8282
RegexConst
8383
```
@@ -95,7 +95,7 @@ input2OutputStream, output2InputStream
9595
inputStream2Bytes, bytes2InputStream
9696
outputStream2Bytes, bytes2OutputStream
9797
inputStream2String, string2InputStream
98-
outputStream2String, string2OutputStream
98+
outputStream2String, string2OutputStream: outputStream与string按编码互转
9999
bitmap2Bytes, bytes2Bitmap
100100
drawable2Bitmap, bitmap2Drawable
101101
drawable2Bytes, bytes2Drawable
@@ -106,7 +106,7 @@ sp2px, px2sp
106106

107107
> - **About Crash→[CrashUtils.java][crash.java]**
108108
```
109-
getInstance
109+
getInstance: 获取单例
110110
init
111111
```
112112

@@ -121,20 +121,20 @@ getModel
121121
shutdown
122122
reboot
123123
reboot2Recovery
124-
reboot2Bootloader
124+
reboot2Bootloader: 重启到bootloader
125125
```
126126

127127
> - **About Empty→[EmptyUtils.java][empty.java][Test][empty.test]**
128128
```
129129
isEmpty
130-
isNotEmpty
130+
isNotEmpty: 判断对象是否非空
131131
```
132132

133133
> - **About Encode→[EncodeUtils.java][encode.java][Test][encode.test]**
134134
```
135135
urlEncode
136136
urlDecode
137-
base64Encode, base64Encode2String
137+
base64Encode, base64Encode2String: Base64编码
138138
base64Decode
139139
base64UrlSafeEncode
140140
htmlEncode
@@ -159,7 +159,7 @@ encryptHmacSHA384, encryptHmacSHA384ToString
159159
encryptHmacSHA512, encryptHmacSHA512ToString
160160
encryptDES, encryptDES2HexString, encryptDES2Base64
161161
decryptDES, decryptHexStringDES, decryptBase64DES
162-
encrypt3DES, encrypt3DES2HexString, encrypt3DES2Base64
162+
encrypt3DES, encrypt3DES2HexString, encrypt3DES2Base64: 3DES加密
163163
decrypt3DES, decryptHexString3DES, decryptBase64_3DES
164164
encryptAES, encryptAES2HexString, encryptAES2Base64
165165
decryptAES, decryptHexStringAES, decryptBase64AES
@@ -190,15 +190,17 @@ listFilesInDirWithFilter
190190
searchFileInDir
191191
writeFileFromIS
192192
writeFileFromString
193+
readFile2List
194+
readFile2String
195+
readFile2Bytes
196+
getFileLastModified
193197
getFileCharsetSimple
194198
getFileLines
195-
readFile2List
196-
readFile2SB
197199
getDirSize
198200
getFileSize
199201
getDirLength
200202
getFileLength
201-
getFileMD5, getFileMD5ToString
203+
getFileMD5, getFileMD5ToString: 获取文件的MD5校验码
202204
getDirName
203205
getFileName
204206
getFileNameNoExtension
@@ -207,13 +209,13 @@ getFileExtension
207209

208210
> - **About Handler→[HandlerUtils.java][handler.java][Demo][handler.demo]**
209211
```
210-
HandlerHolder
212+
HandlerHolder: 使用必读
211213
```
212214

213215
> - **About Image→[ImageUtils.java][image.java][Demo][image.demo]**
214216
```
215217
bitmap2Bytes, bytes2Bitmap
216-
drawable2Bitmap, bitmap2Drawable
218+
drawable2Bitmap, bitmap2Drawable: drawable与bitmap互转
217219
drawable2Bytes, bytes2Drawable
218220
getBitmap
219221
scale
@@ -245,7 +247,7 @@ compressBySampleSize
245247
getInstallAppIntent
246248
getUninstallAppIntent
247249
getLaunchAppIntent
248-
getAppDetailsSettingsIntent
250+
getAppDetailsSettingsIntent: 获取App具体设置的意图
249251
getShareTextIntent
250252
getShareImageIntent
251253
getComponentIntent
@@ -256,15 +258,15 @@ getCaptureIntent
256258
> - **About Keyboard→[KeyboardUtils.java][keyboard.java][Demo][keyboard.demo]**
257259
```
258260
hideSoftInput
259-
clickBlankArea2HideSoftInput
261+
clickBlankArea2HideSoftInput: 点击屏幕空白区域隐藏软键盘
260262
showSoftInput
261263
toggleSoftInput
262264
```
263265

264266
> - **About Location→[LocationUtils.java][location.java][Demo][location.demo]**
265267
```
266268
isGpsEnabled
267-
isLocationEnabled
269+
isLocationEnabled: 判断定位是否可用
268270
openGpsSettings
269271
register
270272
unregister
@@ -277,7 +279,7 @@ getStreet
277279
> - **About Log→[LogUtils.java][log.java][Test][log.test]**
278280
```
279281
init
280-
getBuilder
282+
getBuilder: 获取LogUtils建造者
281283
v
282284
d
283285
i
@@ -297,7 +299,7 @@ getWifiEnabled
297299
setWifiEnabled
298300
isWifiConnected
299301
isWifiAvailable
300-
getNetworkOperatorName
302+
getNetworkOperatorName: 获取移动网络运营商名称
301303
getNetworkType
302304
getIPAddress
303305
getDomainAddress
@@ -310,7 +312,7 @@ getIMEI
310312
getIMSI
311313
getPhoneType
312314
isSimCardReady
313-
getSimOperatorName, getSimOperatorByMnc
315+
getSimOperatorName, getSimOperatorByMnc: 获取Sim卡运营商名称
314316
getPhoneStatus
315317
dial
316318
call
@@ -323,14 +325,17 @@ getAllSMS
323325

324326
> - **About Pinyin→[PinyinUtils.java][pinyin.java][Test][pinyin.test]**
325327
```
326-
getPinyinFirstLetter
327328
ccs2Pinyin
329+
ccs2Pinyin
330+
getPinyinFirstLetter
331+
getPinyinFirstLetters: 获取所有汉字的首字母
332+
surname2Pinyin
328333
```
329334

330335
> - **About Process→[ProcessUtils.java][process.java][Demo][process.demo]**
331336
```
332337
getForegroundProcessName
333-
cleanAllBackgroundProcesses, cleanBackgroundProcesses
338+
cleanAllBackgroundProcesses, cleanBackgroundProcesses: 清理后台服务进程
334339
```
335340

336341
> - **About Regex→[RegexUtils.java][regex.java][Test][regex.test]**
@@ -349,7 +354,7 @@ isIP
349354
isMatch
350355
getMatches
351356
getSplits
352-
getReplaceFirst
357+
getReplaceFirst: 替换正则匹配的第一部分
353358
getReplaceAll
354359
```
355360

@@ -363,13 +368,13 @@ isLandscape
363368
isPortrait
364369
getScreenRotation
365370
captureWithStatusBar
366-
captureWithoutStatusBar
371+
captureWithoutStatusBar: 获取当前屏幕截图,不包含状态栏
367372
isScreenLock
368373
```
369374

370375
> - **About SDCard→[SDCardUtils.java][sdcard.java][Demo][sdcard.demo]**
371376
```
372-
isSDCardEnable
377+
isSDCardEnable: 判断SD卡是否可用
373378
getSDCardPath
374379
getDataPath
375380
getFreeSpace
@@ -378,7 +383,7 @@ getSDCardInfo
378383

379384
> - **About Service→[ServiceUtils.java][service.java]**
380385
```
381-
getAllRunningService
386+
getAllRunningService: 获取所有运行的服务
382387
startService
383388
stopService
384389
bindService
@@ -388,7 +393,7 @@ isServiceRunning
388393

389394
> - **About Shell→[ShellUtils.java][shell.java]**
390395
```
391-
execCmd
396+
execCmd: 是否是在root下执行命令
392397
```
393398

394399
> - **About Size→[SizeUtils.java][size.java]**
@@ -399,14 +404,14 @@ applyDimension
399404
forceGetViewSize
400405
measureView
401406
getMeasuredWidth
402-
getMeasuredHeight
407+
getMeasuredHeight: 获取测量视图高度
403408
```
404409

405410
> - **About Snackbar→[SnackbarUtils.java][snackbar.java][Demo][snackbar.demo]**
406411
```
407412
showShortSnackbar
408413
showLongSnackbar
409-
showIndefiniteSnackbar
414+
showIndefiniteSnackbar: 显示自定义时长snackbar
410415
addView
411416
dismissSnackbar
412417
```
@@ -422,8 +427,8 @@ putLong
422427
getLong
423428
putFloat
424429
getFloat
425-
putBoolean
426-
getBoolean
430+
putBoolean: SP中写入boolean类型value
431+
getBoolean: SP中读取boolean
427432
getAll
428433
remove
429434
contains
@@ -435,11 +440,11 @@ clear
435440
isEmpty
436441
isSpace
437442
equals
438-
equalsIgnoreCase
443+
equalsIgnoreCase: 判断两字符串忽略大小写是否相等
439444
null2Length0
440445
length
441-
upperFirstLetter
442-
lowerFirstLetter
446+
upperFirstLetter: 首字母大写
447+
lowerFirstLetter: 首字母小写
443448
reverse
444449
toDBC
445450
toSBC
@@ -461,7 +466,7 @@ invokeAll, invokeAny
461466
schedule
462467
schedule
463468
scheduleWithFixedRate
464-
scheduleWithFixedDelay
469+
scheduleWithFixedDelay: 延迟并以固定休息时间循环执行命令
465470
```
466471

467472
> - **About Time→[TimeUtils.java][time.java][Test][time.test]**
@@ -479,7 +484,7 @@ getNowTimeString
479484
getNowTimeDate
480485
getTimeSpanByNow
481486
getFitTimeSpanByNow
482-
getFriendlyTimeSpanByNow
487+
getFriendlyTimeSpanByNow: 获取友好型与当前时间的差
483488
isSameDay
484489
isLeapYear
485490
getWeek, getWeekIndex
@@ -492,7 +497,7 @@ getZodiac
492497
> - **About Toast→[ToastUtils.java][toast.java][Demo][toast.demo]**
493498
```
494499
init
495-
showShortToastSafe
500+
showShortToastSafe: 安全地显示短时吐司
496501
showLongToastSafe
497502
showShortToast
498503
showLongToast
@@ -505,7 +510,7 @@ zipFiles
505510
zipFile
506511
unzipFiles
507512
unzipFile
508-
unzipFileByKeyword
513+
unzipFileByKeyword: 解压带有关键字的文件
509514
getFilesPath
510515
getComments
511516
getEntries

update_log.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* 16/12/16 拼音工具类完善结束
2+
* 16/12/15 完善拼音工具类中
3+
* 16/12/14 新增不低于7.0的Html解码
4+
* 16/12/13 新增获取文件最后修改时间
15
* 16/12/12 新增Utils来做初始化context
26
* 16/12/10 完善权限中
37
* 16/12/09 新增6.0以上权限判断

utilcode/src/main/java/com/blankj/utilcode/utils/EncodeUtils.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,12 @@ public static String htmlEncode(String input) {
188188
* @param input 待解码的字符串
189189
* @return Html解码后的字符串
190190
*/
191+
@SuppressWarnings("deprecation")
191192
public static String htmlDecode(String input) {
192-
return Html.fromHtml(input).toString();
193+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
194+
return Html.fromHtml(input, Html.FROM_HTML_MODE_LEGACY).toString();
195+
} else {
196+
return Html.fromHtml(input).toString();
197+
}
193198
}
194199
}

0 commit comments

Comments
 (0)