Skip to content

Commit 7631a27

Browse files
author
Ttt
committed
1.完善部分工具类代码注释、以及部分返回值等。
2.更新新的 api MarkDown 文档 Former-commit-id: 54856b1
1 parent 7a1dda4 commit 7631a27

24 files changed

+65
-63
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
188350dfe58874ffa018c8c0b5df3df71b25a66d
1+
818f8b9669c5b84ce9097dfdecfd5cb2dcf1f3af

DevLibUtils/src/main/java/dev/utils/app/ActivityUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public static void startHomeActivity() {
7171
}
7272

7373
/**
74-
* 获取 launcher activity
74+
* 获取 Launcher activity
7575
* @return
7676
*/
7777
public static String getLauncherActivity() {

DevLibUtils/src/main/java/dev/utils/app/AppUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,11 +375,11 @@ public static int getAppVersionCode(final String packageName) {
375375
*/
376376
public static void setLanguage(Locale locale) {
377377
try {
378-
// 获得res资源对象
378+
// 获取res资源对象
379379
Resources resources = DevUtils.getContext().getResources();
380-
// 获得设置对象
380+
// 获取设置对象
381381
Configuration config = resources.getConfiguration();
382-
// 获得屏幕参数:主要是分辨率,像素等。
382+
// 获取屏幕参数:主要是分辨率,像素等。
383383
DisplayMetrics dm = resources.getDisplayMetrics();
384384
// 语言
385385
config.locale = locale;

DevLibUtils/src/main/java/dev/utils/app/EncodeUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ private EncodeUtils() {
2222
private static final String TAG = EncodeUtils.class.getSimpleName();
2323

2424
/**
25-
* url编码 - UTF-8
25+
* url 编码 - UTF-8
2626
* @param input The input.
2727
* @return the urlencoded string
2828
*/
@@ -31,7 +31,7 @@ public static String urlEncode(final String input) {
3131
}
3232

3333
/**
34-
* url编码
34+
* url 编码
3535
* @param input The input.
3636
* @param charsetName The name of charset.
3737
* @return the urlencoded string
@@ -139,7 +139,7 @@ public static String base64DecodeToString(final byte[] input) {
139139
}
140140

141141
/**
142-
* html编码
142+
* html 编码
143143
* @param input The input.
144144
* @return html-encode string
145145
*/
@@ -177,7 +177,7 @@ public static String htmlEncode(final CharSequence input) {
177177
}
178178

179179
/**
180-
* html解码
180+
* html 解码
181181
* @param input The input.
182182
* @return the string of decode html-encode string
183183
*/

DevLibUtils/src/main/java/dev/utils/app/KeyBoardUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,9 @@ public void onGlobalLayout() {
490490
decorView.getWindowVisibleDisplayFrame(rect);
491491
// 计算出可见屏幕的高度
492492
int displayHight = rect.bottom - rect.top;
493-
// 获得屏幕整体的高度
493+
// 获取屏幕整体的高度
494494
int hight = decorView.getHeight();
495-
// 获得键盘高度
495+
// 获取键盘高度
496496
int keyboardHeight = hight - displayHight;
497497
// 计算一定比例
498498
boolean visible = (double) displayHight / hight < 0.8;

DevLibUtils/src/main/java/dev/utils/app/LocationUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public static boolean register(long minTime, long minDistance, OnLocationChangeL
143143
}
144144

145145
/**
146-
* 注销
146+
* 注销监听
147147
*/
148148
@SuppressLint("MissingPermission")
149149
public static void unregister() {

DevLibUtils/src/main/java/dev/utils/app/MemoryUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public static String getMemInfoIype(String type) {
171171
/* \\s表示 空格,回车,换行等空白符,
172172
+号表示一个或多个的意思 */
173173
String[] array = str.split("\\s+");
174-
// 获得系统总内存,单位是KB,乘以1024转换为Byte
174+
// 获取系统总内存,单位是KB,乘以1024转换为Byte
175175
long length = Long.valueOf(array[1]).longValue() * 1024;
176176
return android.text.format.Formatter.formatFileSize(DevUtils.getContext(), length);
177177
} catch (Exception e) {

DevLibUtils/src/main/java/dev/utils/app/NotificationUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ public static LightPattern obtain(int argb, int startOffMS, int durationMS) {
264264
*/
265265
public static class VibratePattern {
266266
/**
267-
* vibrate 属性是一个长整型的数组,用于设置手机静止和振动的时长,以毫秒为单位。
268-
* 参数中下标为0的值表示手机静止的时长,下标为1的值表示手机振动的时长, 下标为2的值又表示手机静止的时长,以此类推。
267+
* vibrate 属性是一个长整型的数组,用于设置手机静止和震动的时长,以毫秒为单位。
268+
* 参数中下标为0的值表示手机静止的时长,下标为1的值表示手机震动的时长, 下标为2的值又表示手机静止的时长,以此类推。
269269
*/
270270
// long[] vibrates = { 0, 1000, 1000, 1000 };
271271
private long[] vibrates = null;

DevLibUtils/src/main/java/dev/utils/app/ProcessUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public static String getProcessName(int pid) {
6464
}
6565

6666
/**
67-
* 获得当前进程的名字
67+
* 获取当前进程的名字
6868
* hit: 获取当前进程 DevUtils.getContext().getApplicationInfo().packageName
6969
* @return 进程号
7070
*/

DevLibUtils/src/main/java/dev/utils/app/ResourceUtils.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ private ResourceUtils() {
4848
public static final String ATTR = "attr";
4949

5050
/**
51-
* 获得字符串
51+
* 获取字符串
5252
* @param strId 字符串id
5353
* @return 字符串
5454
*/
@@ -62,7 +62,7 @@ public static String getString(int strId) {
6262
}
6363

6464
/**
65-
* 获得颜色
65+
* 获取 Color
6666
* @param colorId 颜色id
6767
* @return 颜色
6868
*/
@@ -76,7 +76,7 @@ public static int getColor(int colorId) {
7676
}
7777

7878
/**
79-
* 获得Drawable
79+
* 获取 Drawable
8080
* @param drawableId Drawable的id
8181
* @return Drawable
8282
*/
@@ -90,7 +90,7 @@ public static Drawable getDrawable(int drawableId) {
9090
}
9191

9292
/**
93-
* 根据资源名获得资源id
93+
* 根据资源名获取资源id
9494
* @param name 资源名
9595
* @param type 资源类型
9696
* @return 资源id,找不到返回0
@@ -107,7 +107,7 @@ public static int getResourceId(String name, String type) {
107107
}
108108

109109
/**
110-
* 获取资源id
110+
* 获取 drawable id
111111
* @param imageName
112112
* @return
113113
*/
@@ -129,7 +129,7 @@ public static int getDrawableId2(String imageName){
129129
// ==
130130

131131
/**
132-
* 获取 layout 布局文件
132+
* 获取 layout 布局文件 id
133133
* @param resName layout xml 的文件名
134134
* @return layout
135135
*/
@@ -143,7 +143,7 @@ public static int getLayoutId(String resName) {
143143
}
144144

145145
/**
146-
* 获取 string
146+
* 获取 string id
147147
* @param resName string name的名称
148148
* @return string
149149
*/
@@ -157,7 +157,7 @@ public static int getStringId(String resName) {
157157
}
158158

159159
/**
160-
* 获取 drawable
160+
* 获取 drawable id
161161
* @param resName drawable 的名称
162162
* @return drawable
163163
*/
@@ -171,7 +171,7 @@ public static int getDrawableId(String resName) {
171171
}
172172

173173
/**
174-
* 获取 mipmap
174+
* 获取 mipmap id
175175
* @param resName
176176
* @return
177177
*/
@@ -186,7 +186,7 @@ public static int getMipmapId(String resName) {
186186

187187

188188
/**
189-
* 获取 style
189+
* 获取 style id
190190
* @param resName style的名称
191191
* @return style
192192
*/
@@ -200,7 +200,7 @@ public static int getStyleId(String resName) {
200200
}
201201

202202
/**
203-
* 获取 styleable
203+
* 获取 styleable id
204204
* @param resName styleable 的名称
205205
* @return styleable
206206
*/
@@ -215,7 +215,7 @@ public static Object getStyleableId(String resName){
215215

216216

217217
/**
218-
* 获取 anim
218+
* 获取 anim id
219219
* @param resName anim xml 文件名称
220220
* @return anim
221221
*/
@@ -243,7 +243,7 @@ public static int getId(String resName) {
243243
}
244244

245245
/**
246-
* 获取 Color id
246+
* 获取 color id
247247
* @param resName color 名称
248248
* @return
249249
*/

0 commit comments

Comments
 (0)