Skip to content

Commit 4c9c6a9

Browse files
committed
see 04/27 log
1 parent 23e42d9 commit 4c9c6a9

File tree

17 files changed

+196
-162
lines changed

17 files changed

+196
-162
lines changed

app/build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ android {
1212
versionName "1.4.1"
1313
}
1414

15-
lintOptions {
16-
abortOnError false
17-
}
1815

1916
buildTypes {
2017
debug {
@@ -26,6 +23,10 @@ android {
2623
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2724
}
2825
}
26+
27+
lintOptions {
28+
abortOnError false
29+
}
2930
}
3031

3132
dependencies {

app/src/main/java/com/blankj/androidutilcode/activity/HandlerActivity.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import android.app.Activity;
44
import android.os.Bundle;
5-
import android.os.Handler;
65
import android.os.Handler.Callback;
76
import android.os.Message;
87
import android.view.View;

app/src/main/java/com/blankj/androidutilcode/activity/LocationActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
*/
2323
public class LocationActivity extends Activity {
2424

25-
private TextView tvAboutLocation;
26-
private LocationService mLocationService;
25+
TextView tvAboutLocation;
26+
LocationService mLocationService;
2727

2828
@Override
2929
protected void onCreate(Bundle savedInstanceState) {

app/src/main/java/com/blankj/androidutilcode/activity/LogActivity.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,25 @@ public class LogActivity extends Activity
3434
private boolean border = true;
3535
private int filter = LogUtils.V;
3636

37-
private static final int UPDATE_TAG = 0x01 << 0;
37+
private static final int UPDATE_TAG = 0x01;
3838
private static final int UPDATE_HEAD = 0x01 << 1;
3939
private static final int UPDATE_FILE = 0x01 << 2;
4040
private static final int UPDATE_BORDER = 0x01 << 3;
4141
private static final int UPDATE_FILTER = 0x01 << 4;
4242

43+
String json = "{\"tools\": [{ \"name\":\"css format\" , \"site\":\"http://tools.w3cschool.cn/code/css\" },{ \"name\":\"json format\" , \"site\":\"http://tools.w3cschool.cn/code/json\" },{ \"name\":\"pwd check\" , \"site\":\"http://tools.w3cschool.cn/password/my_password_safe\" }]}";
44+
String xml = "<books><book><author>Jack Herrington</author><title>PHP Hacks</title><publisher>O'Reilly</publisher></book><book><author>Jack Herrington</author><title>Podcasting Hacks</title><publisher>O'Reilly</publisher></book></books>";
45+
46+
static {
47+
StringBuilder sb = new StringBuilder();
48+
sb.append("len = 10400\ncontent = \"");
49+
for (int i = 0; i < 800; ++i) {
50+
sb.append("Hello world. ");
51+
}
52+
sb.append("\"");
53+
longStr = sb.toString();
54+
}
55+
4356
private Runnable mRunnable = new Runnable() {
4457
@Override
4558
public void run() {
@@ -54,19 +67,6 @@ public void run() {
5467

5568
private static final String longStr;
5669

57-
private String json = "{\"tools\": [{ \"name\":\"css format\" , \"site\":\"http://tools.w3cschool.cn/code/css\" },{ \"name\":\"json format\" , \"site\":\"http://tools.w3cschool.cn/code/json\" },{ \"name\":\"pwd check\" , \"site\":\"http://tools.w3cschool.cn/password/my_password_safe\" }]}";
58-
private String xml = "<books><book><author>Jack Herrington</author><title>PHP Hacks</title><publisher>O'Reilly</publisher></book><book><author>Jack Herrington</author><title>Podcasting Hacks</title><publisher>O'Reilly</publisher></book></books>";
59-
60-
static {
61-
StringBuilder sb = new StringBuilder();
62-
sb.append("len = 10400\ncontent = \"");
63-
for (int i = 0; i < 800; ++i) {
64-
sb.append("Hello world. ");
65-
}
66-
sb.append("\"");
67-
longStr = sb.toString();
68-
}
69-
7070
@Override
7171
protected void onCreate(Bundle savedInstanceState) {
7272
super.onCreate(savedInstanceState);

app/src/main/java/com/blankj/androidutilcode/activity/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void cleanClick(View view) {
4646
}
4747

4848
public void crashClick(View view) {
49-
int err = 1 / 0;
49+
throw new NullPointerException("crash test");
5050
}
5151

5252
public void deviceClick(View view) {

app/src/main/java/com/blankj/androidutilcode/activity/PinyinActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818
public class PinyinActivity extends Activity {
1919

20-
private TextView tvAboutPinyin;
20+
TextView tvAboutPinyin;
2121

2222
@Override
2323
protected void onCreate(Bundle savedInstanceState) {

app/src/main/java/com/blankj/androidutilcode/fragment/Demo0Fragment.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ public class Demo0Fragment extends Fragment
3434

3535
private Demo0Fragment demo0Fragment;
3636
private FragmentUtils.SharedElement sharedElement;
37+
Button btnShowAboutFragment;
38+
ImageView ivSharedElement;
39+
TextView tvAboutFragment;
3740

3841
public static Demo0Fragment newInstance() {
3942

@@ -44,10 +47,6 @@ public static Demo0Fragment newInstance() {
4447
return fragment;
4548
}
4649

47-
private Button btnShowAboutFragment;
48-
private ImageView ivSharedElement;
49-
private TextView tvAboutFragment;
50-
5150
@Override
5251
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
5352
return inflater.inflate(R.layout.fragment_demo0, container, false);

utilcode/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ android {
2020
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2121
}
2222
}
23+
24+
lintOptions {
25+
abortOnError false
26+
}
2327
}
2428

2529
dependencies {

utilcode/src/main/java/com/blankj/utilcode/constant/RegexConstants.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ public final class RegexConstants {
6060
*/
6161
public static final String REGEX_IP = "((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)";
6262

63-
/************** 以下摘自http://tool.oschina.net/regex **************/
63+
///////////////////////////////////////////////////////////////////////////
64+
// 以下摘自http://tool.oschina.net/regex
65+
///////////////////////////////////////////////////////////////////////////
66+
6467
/**
6568
* 正则:双字节字符(包括汉字在内)
6669
*/
@@ -106,5 +109,7 @@ public final class RegexConstants {
106109
*/
107110
public static final String REGEX_NEGATIVE_FLOAT = "^-[1-9]\\d*\\.\\d*|-0\\.\\d*[1-9]\\d*$";
108111

109-
/************** If u want more please visit http://toutiao.com/i6231678548520731137/ **************/
112+
///////////////////////////////////////////////////////////////////////////
113+
// If u want more please visit http://toutiao.com/i6231678548520731137
114+
///////////////////////////////////////////////////////////////////////////
110115
}

utilcode/src/main/java/com/blankj/utilcode/util/EncryptUtils.java

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ private EncryptUtils() {
2929
throw new UnsupportedOperationException("u can't instantiate me...");
3030
}
3131

32-
/*********************** 哈希加密相关 ***********************/
32+
///////////////////////////////////////////////////////////////////////////
33+
// 哈希加密相关
34+
///////////////////////////////////////////////////////////////////////////
35+
3336
/**
3437
* MD2加密
3538
*
@@ -562,15 +565,18 @@ private static byte[] hmacTemplate(byte[] data, byte[] key, String algorithm) {
562565
}
563566
}
564567

565-
/************************ DES加密相关 ***********************/
568+
///////////////////////////////////////////////////////////////////////////
569+
// DES加密相关
570+
///////////////////////////////////////////////////////////////////////////
571+
566572
/**
567573
* DES转变
568574
* <p>法算法名称/加密模式/填充方式</p>
569575
* <p>加密模式有:电子密码本模式ECB、加密块链模式CBC、加密反馈模式CFB、输出反馈模式OFB</p>
570576
* <p>填充方式有:NoPadding、ZerosPadding、PKCS5Padding</p>
571577
*/
572-
public static String DES_Transformation = "DES/ECB/NoPadding";
573-
private static final String DES_Algorithm = "DES";
578+
public static String DES_Transformation = "DES/ECB/NoPadding";
579+
private static final String DES_Algorithm = "DES";
574580

575581
/**
576582
* DES加密后转为Base64编码
@@ -638,15 +644,18 @@ public static byte[] decryptDES(byte[] data, byte[] key) {
638644
return desTemplate(data, key, DES_Algorithm, DES_Transformation, false);
639645
}
640646

641-
/************************ 3DES加密相关 ***********************/
647+
///////////////////////////////////////////////////////////////////////////
648+
// 3DES加密相关
649+
///////////////////////////////////////////////////////////////////////////
650+
642651
/**
643652
* 3DES转变
644653
* <p>法算法名称/加密模式/填充方式</p>
645654
* <p>加密模式有:电子密码本模式ECB、加密块链模式CBC、加密反馈模式CFB、输出反馈模式OFB</p>
646655
* <p>填充方式有:NoPadding、ZerosPadding、PKCS5Padding</p>
647656
*/
648-
public static String TripleDES_Transformation = "DESede/ECB/NoPadding";
649-
private static final String TripleDES_Algorithm = "DESede";
657+
public static String TripleDES_Transformation = "DESede/ECB/NoPadding";
658+
private static final String TripleDES_Algorithm = "DESede";
650659

651660

652661
/**
@@ -715,15 +724,18 @@ public static byte[] decrypt3DES(byte[] data, byte[] key) {
715724
return desTemplate(data, key, TripleDES_Algorithm, TripleDES_Transformation, false);
716725
}
717726

718-
/************************ AES加密相关 ***********************/
727+
///////////////////////////////////////////////////////////////////////////
728+
// AES加密相关
729+
///////////////////////////////////////////////////////////////////////////
730+
719731
/**
720732
* AES转变
721733
* <p>法算法名称/加密模式/填充方式</p>
722734
* <p>加密模式有:电子密码本模式ECB、加密块链模式CBC、加密反馈模式CFB、输出反馈模式OFB</p>
723735
* <p>填充方式有:NoPadding、ZerosPadding、PKCS5Padding</p>
724736
*/
725-
public static String AES_Transformation = "AES/ECB/NoPadding";
726-
private static final String AES_Algorithm = "AES";
737+
public static String AES_Transformation = "AES/ECB/NoPadding";
738+
private static final String AES_Algorithm = "AES";
727739

728740

729741
/**

utilcode/src/main/java/com/blankj/utilcode/util/FileUtils.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,9 @@ public static String getFileExtension(String filePath) {
12941294
return filePath.substring(lastPoi + 1);
12951295
}
12961296

1297-
/** copy from ConvertUtils **/
1297+
///////////////////////////////////////////////////////////////////////////
1298+
// copy from ConvertUtils
1299+
///////////////////////////////////////////////////////////////////////////
12981300

12991301
/**
13001302
* inputStream转byteArr

utilcode/src/main/java/com/blankj/utilcode/util/FragmentUtils.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ private FragmentUtils() {
3030
throw new UnsupportedOperationException("u can't instantiate me...");
3131
}
3232

33-
private static final int TYPE_ADD_FRAGMENT = 0x01 << 0;
34-
private static final int TYPE_REMOVE_FRAGMENT = 0x01 << 1;
33+
private static final int TYPE_ADD_FRAGMENT = 0x01;
34+
private static final int TYPE_REMOVE_FRAGMENT = 0x01 << 1;
3535
private static final int TYPE_REMOVE_TO_FRAGMENT = 0x01 << 2;
36-
private static final int TYPE_REPLACE_FRAGMENT = 0x01 << 3;
37-
private static final int TYPE_POP_ADD_FRAGMENT = 0x01 << 4;
38-
private static final int TYPE_HIDE_FRAGMENT = 0x01 << 5;
39-
private static final int TYPE_SHOW_FRAGMENT = 0x01 << 6;
36+
private static final int TYPE_REPLACE_FRAGMENT = 0x01 << 3;
37+
private static final int TYPE_POP_ADD_FRAGMENT = 0x01 << 4;
38+
private static final int TYPE_HIDE_FRAGMENT = 0x01 << 5;
39+
private static final int TYPE_SHOW_FRAGMENT = 0x01 << 6;
4040
private static final int TYPE_HIDE_SHOW_FRAGMENT = 0x01 << 7;
4141

42-
private static final String ARGS_ID = "args_id";
43-
private static final String ARGS_IS_HIDE = "args_is_hide";
42+
private static final String ARGS_ID = "args_id";
43+
private static final String ARGS_IS_HIDE = "args_is_hide";
4444
private static final String ARGS_IS_ADD_STACK = "args_is_add_stack";
4545

4646
/**
@@ -163,6 +163,7 @@ public static Fragment addFragments(@NonNull FragmentManager fragmentManager,
163163
* @param fragments fragments
164164
* @param containerId 布局Id
165165
* @param showIndex 要显示的fragment索引
166+
* @param lists 共享元素链表
166167
* @return 要显示的fragment
167168
*/
168169
public static Fragment addFragments(@NonNull FragmentManager fragmentManager,
@@ -871,7 +872,7 @@ public static void setBackground(@NonNull Fragment fragment, Drawable background
871872
}
872873

873874
static class Args {
874-
int id;
875+
int id;
875876
boolean isHide;
876877
boolean isAddStack;
877878

@@ -883,7 +884,7 @@ static class Args {
883884
}
884885

885886
public static class SharedElement {
886-
View sharedElement;
887+
View sharedElement;
887888
String name;
888889

889890
public SharedElement(View sharedElement, String name) {
@@ -893,7 +894,7 @@ public SharedElement(View sharedElement, String name) {
893894
}
894895

895896
static class FragmentNode {
896-
Fragment fragment;
897+
Fragment fragment;
897898
List<FragmentNode> next;
898899

899900
public FragmentNode(Fragment fragment, List<FragmentNode> next) {

utilcode/src/main/java/com/blankj/utilcode/util/ImageUtils.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,9 @@ private static boolean isEmptyBitmap(Bitmap src) {
13621362
return src == null || src.getWidth() == 0 || src.getHeight() == 0;
13631363
}
13641364

1365-
/******************************~~~~~~~~~ 下方和压缩有关 ~~~~~~~~~******************************/
1365+
///////////////////////////////////////////////////////////////////////////
1366+
// 下方和压缩有关
1367+
///////////////////////////////////////////////////////////////////////////
13661368

13671369
/**
13681370
* 按缩放压缩

0 commit comments

Comments
 (0)