Skip to content

Commit 82d08c4

Browse files
committed
[commit] 删除中文注释,将代码发布到jcenter中
1 parent 13dcbcf commit 82d08c4

File tree

13 files changed

+79
-543
lines changed

13 files changed

+79
-543
lines changed

library/build.gradle

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
apply plugin: 'com.android.library'
2-
apply plugin: 'com.github.dcendents.android-maven'
3-
apply plugin: 'com.jfrog.bintray'
2+
apply plugin: 'com.github.dcendents.android-maven' //插件
3+
apply plugin: 'com.jfrog.bintray' //插件
44

5-
version = "0.0.1"
5+
version = "0.0.1" //版本号,更新代码后修改这个值
66
android {
7-
resourcePrefix "h4de5ing_"
87
compileSdkVersion 23
98
buildToolsVersion "23.0.3"
109

@@ -33,7 +32,6 @@ def gitUrl = 'https://github.com/h4de5ing/AndroidCommon.git' // Git仓库的ur
3332
group = "com.code19.library"
3433
install{
3534
repositories.mavenInstaller {
36-
// This generates POM.xml with proper parameters
3735
pom {
3836
project {
3937
packaging 'aar'
@@ -49,9 +47,9 @@ install{
4947
}
5048
developers {
5149
developer {
52-
id 'h4de5ing'
53-
name 'h4de5ing'
54-
email 'android@19code.com'
50+
id 'h4de5ing' //开发者id
51+
name 'h4de5ing' //开发者名称
52+
email 'android@19code.com' //开发者邮箱
5553
}
5654
}
5755
scm {
@@ -87,7 +85,7 @@ bintray {
8785
configurations = ['archives']
8886
pkg {
8987
repo = "maven"
90-
name = "h4de5ing-commonr" //发布到JCenter上的项目名字
88+
name = "h4de5ing-common" //发布到JCenter上的项目名字
9189
websiteUrl = siteUrl
9290
vcsUrl = gitUrl
9391
licenses = ["Apache-2.0"]

library/src/main/java/com/code19/library/AppUtils.java

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,7 @@
2828
* Create by h4de5ing 2016/5/18 018
2929
*/
3030
public class AppUtils {
31-
/**
32-
* 获取应用名称
33-
*
34-
* @param packageName 应用程序包名
35-
* @param context 包管理器
36-
* @return 返回获取到的应用程序名称
37-
*/
31+
3832
public static String getAppName(String packageName, Context context) {
3933
PackageManager pm = context.getPackageManager();
4034
String appName = null;
@@ -47,13 +41,6 @@ public static String getAppName(String packageName, Context context) {
4741
return appName;
4842
}
4943

50-
/**
51-
* 获取应用图标
52-
*
53-
* @param packageName 应用程序包名
54-
* @param context 包管理器
55-
* @return 返回获取到的应用程序图标
56-
*/
5744

5845
public static Drawable getAppIcon(String packageName, Context context) {
5946
PackageManager pm = context.getPackageManager();
@@ -67,13 +54,7 @@ public static Drawable getAppIcon(String packageName, Context context) {
6754
return appIcon;
6855
}
6956

70-
/**
71-
* 获取应用程序最后更新的时间
72-
*
73-
* @param packageName 应用程序包名
74-
* @param pm 包管理器
75-
* @return 返回获取到的应用程序更新时间
76-
*/
57+
7758
public static long getAppDate(String packageName, PackageManager pm) {
7859
long lastUpdateTime = 0;
7960
try {
@@ -85,13 +66,7 @@ public static long getAppDate(String packageName, PackageManager pm) {
8566
return lastUpdateTime;
8667
}
8768

88-
/**
89-
* 获取应用的大小
90-
*
91-
* @param packageName 应用程序包名
92-
* @param pm 包管理器
93-
* @return 返回获取到的应用程序大小
94-
*/
69+
9570
public static long getAppSize(String packageName, PackageManager pm) {
9671
long appSize = 0;
9772
try {
@@ -103,13 +78,6 @@ public static long getAppSize(String packageName, PackageManager pm) {
10378
return appSize;
10479
}
10580

106-
/**
107-
* 获取应用成apk
108-
*
109-
* @param packageName 应用程序包名
110-
* @param pm 包管理器
111-
* @return 返回获取到的应用程序apk
112-
*/
11381
public static String getAppApk(String packageName, PackageManager pm) {
11482
String sourceDir = null;
11583
try {

library/src/main/java/com/code19/library/CipherUtils.java

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,7 @@
2626
* Create by h4de5ing 2016/5/7 007
2727
*/
2828
public class CipherUtils {
29-
/**
30-
* 对流进行MD5加密
31-
*
32-
* @param in 输入流
33-
* @return 返回流的md5值
34-
*/
29+
3530
public static String md5Encode(InputStream in) {
3631
try {
3732
MessageDigest digester = MessageDigest.getInstance("MD5");
@@ -57,10 +52,7 @@ public static String md5Encode(InputStream in) {
5752
return null;
5853
}
5954

60-
/**
61-
* @param pwd 加密的字符串
62-
* @return 返回加密的md5值
63-
*/
55+
6456
public static String md5Encode(String pwd) {
6557
try {
6658
MessageDigest instance = MessageDigest.getInstance("md5");
@@ -81,34 +73,18 @@ public static String md5Encode(String pwd) {
8173
return null;
8274
}
8375

84-
/**
85-
* Base64加密
86-
*
87-
* @param str 明文
88-
* @return 密文
89-
*/
76+
9077
public static String base64Encode(String str) {
9178
return Base64.encodeToString(str.getBytes(), Base64.DEFAULT);
9279
}
9380

94-
/**
95-
* Base64解密
96-
*
97-
* @param str 密文
98-
* @return 明文
99-
*/
81+
10082
public static String base64Decode(String str) {
10183
byte[] decode = Base64.decode(str, Base64.DEFAULT);
10284
return String.valueOf(decode);
10385
}
10486

105-
/**
106-
* 异或加密
107-
*
108-
* @param pwd 需要加密的密文
109-
* @param key key值
110-
* @return 加密后的字符串
111-
*/
87+
11288
public static String XorEncode(String pwd, int key) {
11389
key = key % 128;
11490
byte[] bytes = pwd.getBytes();

library/src/main/java/com/code19/library/DateUitl.java

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -27,62 +27,26 @@ public class DateUitl {
2727
private static final SimpleDateFormat DATE_FORMAT_DATE = new SimpleDateFormat("yyyy-MM-dd");
2828
private static final SimpleDateFormat DATE_FORMAT_TIME = new SimpleDateFormat("HH:mm:ss");
2929

30-
/**
31-
* unix时间戳转换为dateFormat
32-
*
33-
* @param beginDate 时间字符串
34-
* @return 格式化后的时间字符串
35-
*/
3630
public static String formatDate(String beginDate) {
3731
return DATE_FORMAT_DATETIME.format(new Date(Long.parseLong(beginDate)));
3832
}
3933

40-
/**
41-
* 自定义格式时间戳转换
42-
*
43-
* @param beginDate 时间字符串
44-
* @param format 格式
45-
* @return 格式化后的时间字符串
46-
*/
47-
4834
public static String customFormatDate(String beginDate, String format) {
4935
return new SimpleDateFormat(format).format(new Date(Long.parseLong(beginDate)));
5036
}
5137

52-
53-
/**
54-
* 格式化日期时间
55-
*
56-
* @param date long型时间
57-
* @return 格式化后的时间字符串
58-
*/
5938
public static String formatDataTime(long date) {
6039
return DATE_FORMAT_DATETIME.format(new Date(date));
6140
}
6241

63-
/**
64-
* 格式化日期
65-
*
66-
* @param date long型时间
67-
* @return 格式化后的日期字符串
68-
*/
6942
public static String formatDate(long date) {
7043
return DATE_FORMAT_DATE.format(new Date(date));
7144
}
7245

73-
/**
74-
* 格式化时间
75-
*
76-
* @param date long型时间
77-
* @return 格式化后的时间字符串
78-
*/
7946
public static String formatTime(long date) {
8047
return DATE_FORMAT_TIME.format(new Date(date));
8148
}
8249

83-
/**
84-
* 返回当前系统时间(格式以HH:mm:ss形式)
85-
*/
8650
public static String getDataTime() {
8751
return new SimpleDateFormat("HH:mm:ss").format(new Date());
8852
}

library/src/main/java/com/code19/library/DensityUtil.java

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,41 +23,29 @@
2323
* Create by h4de5ing 2016/5/7 007
2424
*/
2525
public class DensityUtil {
26-
/**
27-
* dip 转 px(像素)
28-
*/
26+
2927
public static int dip2px(Context context, float dpValue) {
3028
final float scale = context.getResources().getDisplayMetrics().density;
3129
return (int) (dpValue * scale + 0.5f);
3230
}
3331

34-
/**
35-
* px(像素) 转 dp
36-
*/
3732
public static int px2dip(Context context, float pxValue) {
3833
final float scale = context.getResources().getDisplayMetrics().density;
3934
return (int) (pxValue / scale + 0.5f);
4035
}
4136

42-
/**
43-
* 根据手机的分辨率从 px(像素) 的单位 转成为 sp
44-
*/
37+
4538
public static int px2sp(Context context, float pxValue) {
4639
float fontScale = context.getResources().getDisplayMetrics().scaledDensity;
4740
return (int) (pxValue / fontScale + 0.5f);
4841
}
4942

50-
/**
51-
* 根据手机的分辨率从 sp 的单位 转成为 px
52-
*/
43+
5344
public static int sp2px(Context context, float spValue) {
5445
float fontScale = context.getResources().getDisplayMetrics().scaledDensity;
5546
return (int) (spValue * fontScale + 0.5f);
5647
}
5748

58-
/**
59-
* 获取dialog宽度
60-
*/
6149
public static int getDialogW(Context aty) {
6250
DisplayMetrics dm = new DisplayMetrics();
6351
dm = aty.getResources().getDisplayMetrics();
@@ -66,17 +54,12 @@ public static int getDialogW(Context aty) {
6654
return w;
6755
}
6856

69-
/**
70-
* 获取屏幕宽度
71-
*/
57+
7258
public static int getScreenW(Context aty) {
7359
DisplayMetrics dm = aty.getResources().getDisplayMetrics();
7460
return dm.widthPixels;
7561
}
7662

77-
/**
78-
* 获取屏幕高度
79-
*/
8063
public static int getScreenH(Context aty) {
8164
DisplayMetrics dm = aty.getResources().getDisplayMetrics();
8265
return dm.heightPixels;

0 commit comments

Comments
 (0)