Skip to content

Commit

Permalink
see 09/10 log
Browse files Browse the repository at this point in the history
  • Loading branch information
Blankj committed Sep 10, 2017
1 parent 37211ad commit 495539e
Show file tree
Hide file tree
Showing 25 changed files with 765 additions and 931 deletions.
3 changes: 0 additions & 3 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -586,14 +586,11 @@ cancel : 取消吐司显示

* ### 压缩相关→[ZipUtils.java][zip.java][Test][zip.test]
```
zipFiles : 批量压缩文件
zipFile : 压缩文件
unzipFiles : 批量解压文件
unzipFile : 解压文件
unzipFileByKeyword: 解压带有关键字的文件
getFilesPath : 获取压缩文件中的文件路径链表
getComments : 获取压缩文件中的注释链表
getEntries : 获取压缩文件中的文件对象
```

* ### 更新Log→[update_log.md][update_log.md]
Expand Down
26 changes: 26 additions & 0 deletions subutil/src/test/java/com/blankj/subutil/util/TestConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.blankj.subutil.util;

/**
* <pre>
* author: Blankj
* blog : http://blankj.com
* time : 2017/09/10
* desc :
* </pre>
*/
public class TestConfig {

static final String FILE_SEP = System.getProperty("file.separator");

static final String LINE_SEP = System.getProperty("line.separator");

static final String TEST_PATH;

static {
String projectPath = System.getProperty("user.dir");
if (!projectPath.contains("subutil")) {
projectPath += FILE_SEP + "subutil";
}
TEST_PATH = projectPath + FILE_SEP + "src" + FILE_SEP + "test" + FILE_SEP + "res";
}
}
14 changes: 0 additions & 14 deletions subutil/src/test/java/com/blankj/subutil/util/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,6 @@
@Config(manifest = Config.NONE)
public class TestUtils {

static final String FILE_SEP = System.getProperty("file.separator");

static final String LINE_SEP = System.getProperty("line.separator");

static final String TEST_PATH;

static {
String projectPath = System.getProperty("user.dir");
if (!projectPath.contains("utilcode")) {
projectPath += FILE_SEP + "subutil";
}
TEST_PATH = projectPath + FILE_SEP + "src" + FILE_SEP + "test" + FILE_SEP + "res";
}

public static void init() {
Utils.init(RuntimeEnvironment.application);
}
Expand Down
2 changes: 2 additions & 0 deletions update_log.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* 17/09/10 完善单元测试
* 17/09/08 完善单元测试
* 17/09/06 完善SDCardUtils获取SD卡路径,完善SPUtils新增commit
* 17/09/05 完善LogUtils,发布版本1.9.0
* 17/09/04 完善ToastUtils,去除相关safe函数,都改为safe实现,新增CustomToast的Demo
Expand Down
1 change: 0 additions & 1 deletion utilcode/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ dependencies {

testCompile "junit:junit:$rootProject.ext.junitVersion"
testCompile "org.robolectric:robolectric:$rootProject.ext.robolectricVersion"
testCompile "com.google.truth:truth:0.31"
}
//apply from: "https://raw.githubusercontent.com/xiaopansky/android-library-publish-to-jcenter/master/bintrayUpload.gradle"
//gradle bintrayUpload
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,13 @@ public static String byte2FitMemorySize(final long byteNum) {
if (byteNum < 0) {
return "shouldn't be less than zero!";
} else if (byteNum < MemoryConstants.KB) {
return String.format("%.3fB", (double) byteNum + 0.0005);
return String.format("%.3fB", (double) byteNum);
} else if (byteNum < MemoryConstants.MB) {
return String.format("%.3fKB", (double) byteNum / MemoryConstants.KB + 0.0005);
return String.format("%.3fKB", (double) byteNum / MemoryConstants.KB);
} else if (byteNum < MemoryConstants.GB) {
return String.format("%.3fMB", (double) byteNum / MemoryConstants.MB + 0.0005);
return String.format("%.3fMB", (double) byteNum / MemoryConstants.MB);
} else {
return String.format("%.3fGB", (double) byteNum / MemoryConstants.GB + 0.0005);
return String.format("%.3fGB", (double) byteNum / MemoryConstants.GB);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1077,13 +1077,13 @@ private static String byte2FitMemorySize(final long byteNum) {
if (byteNum < 0) {
return "shouldn't be less than zero!";
} else if (byteNum < 1024) {
return String.format("%.3fB", (double) byteNum + 0.0005);
return String.format("%.3fB", (double) byteNum);
} else if (byteNum < 1048576) {
return String.format("%.3fKB", (double) byteNum / 1024 + 0.0005);
return String.format("%.3fKB", (double) byteNum / 1024);
} else if (byteNum < 1073741824) {
return String.format("%.3fMB", (double) byteNum / 1048576 + 0.0005);
return String.format("%.3fMB", (double) byteNum / 1048576);
} else {
return String.format("%.3fGB", (double) byteNum / 1073741824 + 0.0005);
return String.format("%.3fGB", (double) byteNum / 1073741824);
}
}

Expand Down
Loading

0 comments on commit 495539e

Please sign in to comment.