提交 4a465afb 编写于 作者: B blankj

see 08/16 log

上级 87eb898b
......@@ -188,7 +188,7 @@
***
Gradle:
``` groovy
compile 'com.blankj:utilcode:1.0'
compile 'com.blankj:utilcode:1.1.0'
```
### Proguard
......
......@@ -60,6 +60,9 @@ public class NetworkUtils {
/**
* 判断网络是否可用
* <p>需添加权限 android.permission.ACCESS_NETWORK_STATE</p>
*
* @param context 上下文
* @return true: 可用<br>false: 不可用
*/
public static boolean isAvailable(Context context) {
NetworkInfo info = getActiveNetworkInfo(context);
......
......@@ -27,6 +27,7 @@ public class ShellUtils {
/**
* 判断设备是否root
* @return true: root<br>false: 没root
*/
public static boolean isRoot() {
return execCmd("echo root", true, false).result == 0;
......
......@@ -102,7 +102,7 @@ public class SizeUtils {
* <pre>
* SizeUtils.forceGetViewSize(view);
* SizeUtils.setListener(new SizeUtils.onGetSizeListener() {
* <br>@Override
* <span></span>@Override
* public void onGetSize(View view) {
* Log.d("tag", view.getWidth() + " " + view.getHeight());
* }
......
......@@ -3,6 +3,9 @@
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import static com.blankj.utilcode.utils.ConstUtils.*;
/**
* <pre>
......@@ -27,7 +30,7 @@ public class TimeUtils {
* </p>
* 定义了以下模式字母(所有其他字符 'A' 到 'Z' 和 'a' 到 'z' 都被保留): <br>
* <table border="1" cellspacing="1" cellpadding="1" summary="Chart shows pattern letters, date/time component, presentation, and examples.">
* <tr bgcolor="#ccccff">
* <tr>
* <th align="left">字母</th>
* <th align="left">日期或时间元素</th>
* <th align="left">表示</th>
......@@ -39,7 +42,7 @@ public class TimeUtils {
* <td>Text</td>
* <td><code>AD</code></td>
* </tr>
* <tr bgcolor="#eeeeff">
* <tr>
* <td><code>y</code> </td>
* <td>年 </td>
* <td>Year </td>
......@@ -51,7 +54,7 @@ public class TimeUtils {
* <td>Month </td>
* <td><code>July</code>; <code>Jul</code>; <code>07</code> </td>
* </tr>
* <tr bgcolor="#eeeeff">
* <tr>
* <td><code>w</code> </td>
* <td>年中的周数 </td>
* <td>Number </td>
......@@ -63,7 +66,7 @@ public class TimeUtils {
* <td>Number </td>
* <td><code>2</code> </td>
* </tr>
* <tr bgcolor="#eeeeff">
* <tr>
* <td><code>D</code> </td>
* <td>年中的天数 </td>
* <td>Number </td>
......@@ -75,7 +78,7 @@ public class TimeUtils {
* <td>Number </td>
* <td><code>10</code> </td>
* </tr>
* <tr bgcolor="#eeeeff">
* <tr>
* <td><code>F</code> </td>
* <td>月份中的星期 </td>
* <td>Number </td>
......@@ -87,7 +90,7 @@ public class TimeUtils {
* <td>Text </td>
* <td><code>Tuesday</code>; <code>Tue</code> </td>
* </tr>
* <tr bgcolor="#eeeeff">
* <tr>
* <td><code>a</code> </td>
* <td>Am/pm 标记 </td>
* <td>Text </td>
......@@ -99,7 +102,7 @@ public class TimeUtils {
* <td>Number </td>
* <td><code>0</code> </td>
* </tr>
* <tr bgcolor="#eeeeff">
* <tr>
* <td><code>k</code> </td>
* <td>一天中的小时数(1-24) </td>
* <td>Number </td>
......@@ -111,7 +114,7 @@ public class TimeUtils {
* <td>Number </td>
* <td><code>0</code> </td>
* </tr>
* <tr bgcolor="#eeeeff">
* <tr>
* <td><code>h</code> </td>
* <td>am/pm 中的小时数(1-12) </td>
* <td>Number </td>
......@@ -123,7 +126,7 @@ public class TimeUtils {
* <td>Number </td>
* <td><code>30</code> </td>
* </tr>
* <tr bgcolor="#eeeeff">
* <tr>
* <td><code>s</code> </td>
* <td>分钟中的秒数 </td>
* <td>Number </td>
......@@ -135,7 +138,7 @@ public class TimeUtils {
* <td>Number </td>
* <td><code>978</code> </td>
* </tr>
* <tr bgcolor="#eeeeff">
* <tr>
* <td><code>z</code> </td>
* <td>时区 </td>
* <td>General time zone </td>
......@@ -149,27 +152,32 @@ public class TimeUtils {
* </tr>
* </table>
* <pre>
* yyyy-MM-dd 1969-12-31
* yyyy-MM-dd 1970-01-01
* yyyy-MM-dd HH:mm 1969-12-31 16:00
* yyyy-MM-dd HH:mm 1970-01-01 00:00
* yyyy-MM-dd HH:mmZ 1969-12-31 16:00-0800
* yyyy-MM-dd HH:mmZ 1970-01-01 00:00+0000
* yyyy-MM-dd HH:mm:ss.SSSZ 1969-12-31 16:00:00.000-0800
* yyyy-MM-dd HH:mm:ss.SSSZ 1970-01-01 00:00:00.000+0000
* yyyy-MM-dd'T'HH:mm:ss.SSSZ 1969-12-31T16:00:00.000-0800
* yyyy-MM-dd'T'HH:mm:ss.SSSZ 1970-01-01T00:00:00.000+0000
* HH:mm 15:44
* h:mm a 3:44 下午
* HH:mm z 15:44 CST
* HH:mm Z 15:44 +0800
* HH:mm zzzz 15:44 中国标准时间
* HH:mm:ss 15:44:40
* yyyy-MM-dd 2016-08-12
* yyyy-MM-dd HH:mm 2016-08-12 15:44
* yyyy-MM-dd HH:mm:ss 2016-08-12 15:44:40
* yyyy-MM-dd HH:mm:ss zzzz 2016-08-12 15:44:40 中国标准时间
* EEEE yyyy-MM-dd HH:mm:ss zzzz 星期五 2016-08-12 15:44:40 中国标准时间
* yyyy-MM-dd HH:mm:ss.SSSZ 2016-08-12 15:44:40.461+0800
* yyyy-MM-dd'T'HH:mm:ss.SSSZ 2016-08-12T15:44:40.461+0800
* yyyy.MM.dd G 'at' HH:mm:ss z 2016.08.12 公元 at 15:44:40 CST
* K:mm a 3:44 下午
* EEE, MMM d, ''yy 星期五, 八月 12, '16
* hh 'o''clock' a, zzzz 03 o'clock 下午, 中国标准时间
* yyyyy.MMMMM.dd GGG hh:mm aaa 02016.八月.12 公元 03:44 下午
* EEE, d MMM yyyy HH:mm:ss Z 星期五, 12 八月 2016 15:44:40 +0800
* yyMMddHHmmssZ 160812154440+0800
* yyyy-MM-dd'T'HH:mm:ss.SSSZ 2016-08-12T15:44:40.461+0800
* EEEE 'DATE('yyyy-MM-dd')' 'TIME('HH:mm:ss')' zzzz 星期五 DATE(2016-08-12) TIME(15:44:40) 中国标准时间
* </pre>
*/
public static final SimpleDateFormat DEFAULT_SDF = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
/**
* 各时间单位与毫秒的倍数
*/
public static final int UNIT_MSEC = 1;
public static final int UNIT_SEC = 1000;
public static final int UNIT_MIN = 60000;
public static final int UNIT_HOUR = 3600000;
public static final int UNIT_DAY = 86400000;
public static final SimpleDateFormat DEFAULT_SDF = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
/**
* 将时间戳转为时间字符串
......@@ -293,22 +301,22 @@ public class TimeUtils {
*
* @param milliseconds 毫秒时间戳
* @param unit <ul>
* <li>UNIT_MSEC:毫秒</li>
* <li>UNIT_SEC :秒</li>
* <li>UNIT_MIN :分</li>
* <li>UNIT_HOUR:小时</li>
* <li>UNIT_DAY :天</li>
* <li>MSEC:毫秒</li>
* <li>SEC :秒</li>
* <li>MIN :分</li>
* <li>HOUR:小时</li>
* <li>DAY :天</li>
* </ul>
* @return unit时间戳
*/
private static long milliseconds2Unit(long milliseconds, int unit) {
switch (unit) {
case UNIT_MSEC:
case UNIT_SEC:
case UNIT_MIN:
case UNIT_HOUR:
case UNIT_DAY:
return Math.abs(milliseconds) / unit;
case MSEC:
case SEC:
case MIN:
case HOUR:
case DAY:
return milliseconds / unit;
}
return -1;
}
......@@ -317,59 +325,60 @@ public class TimeUtils {
* 获取两个时间差(单位:unit)
* <p>time1和time2格式都为yyyy-MM-dd HH:mm:ss</p>
*
* @param time1 时间字符串1
* @param time2 时间字符串2
* @param time0 时间字符串1
* @param time1 时间字符串2
* @param unit <ul>
* <li>UNIT_MSEC:毫秒</li>
* <li>UNIT_SEC :秒</li>
* <li>UNIT_MIN :分</li>
* <li>UNIT_HOUR:小时</li>
* <li>UNIT_DAY :天</li>
* <li>MSEC:毫秒</li>
* <li>SEC :秒</li>
* <li>MIN :分</li>
* <li>HOUR:小时</li>
* <li>DAY :天</li>
* </ul>
* @return unit时间戳
*/
public static long getIntervalTime(String time1, String time2, int unit) {
return getIntervalTime(time1, time2, unit, DEFAULT_SDF);
public static long getIntervalTime(String time0, String time1, int unit) {
return getIntervalTime(time0, time1, unit, DEFAULT_SDF);
}
/**
* 获取两个时间差(单位:unit)
* <p>time1和time2格式都为format</p>
*
* @param time1 时间字符串1
* @param time2 时间字符串2
* @param time0 时间字符串1
* @param time1 时间字符串2
* @param unit <ul>
* <li>UNIT_MSEC:毫秒</li>
* <li>UNIT_SEC :秒</li>
* <li>UNIT_MIN :分</li>
* <li>UNIT_HOUR:小时</li>
* <li>UNIT_DAY :天</li>
* <li>MSEC:毫秒</li>
* <li>SEC :秒</li>
* <li>MIN :分</li>
* <li>HOUR:小时</li>
* <li>DAY :天</li>
* </ul>
* @param format 时间格式
* @return unit时间戳
*/
public static long getIntervalTime(String time1, String time2, int unit, SimpleDateFormat format) {
return milliseconds2Unit(string2Milliseconds(time1, format)
- string2Milliseconds(time2, format), unit);
public static long getIntervalTime(String time0, String time1, int unit, SimpleDateFormat format) {
return Math.abs(milliseconds2Unit(string2Milliseconds(time0, format)
- string2Milliseconds(time1, format), unit));
}
/**
* 获取两个时间差(单位:unit)
* <p>time1和time2都为Date类型</p>
*
* @param time1 Date类型时间1
* @param time2 Date类型时间2
* @param time0 Date类型时间1
* @param time1 Date类型时间2
* @param unit <ul>
* <li>UNIT_MSEC:毫秒</li>
* <li>UNIT_SEC :秒</li>
* <li>UNIT_MIN :分</li>
* <li>UNIT_HOUR:小时</li>
* <li>UNIT_DAY :天</li>
* <li>MSEC:毫秒</li>
* <li>SEC :秒</li>
* <li>MIN :分</li>
* <li>HOUR:小时</li>
* <li>DAY :天</li>
* </ul>
* @return unit时间戳
*/
public static long getIntervalTime(Date time1, Date time2, int unit) {
return milliseconds2Unit(date2Milliseconds(time2) - date2Milliseconds(time1), unit);
public static long getIntervalTime(Date time0, Date time1, int unit) {
return Math.abs(milliseconds2Unit(date2Milliseconds(time1)
- date2Milliseconds(time0), unit));
}
/**
......@@ -388,7 +397,7 @@ public class TimeUtils {
* @return 时间字符串
*/
public static String getCurTimeString() {
return milliseconds2String(getCurTimeMills());
return date2String(new Date());
}
/**
......@@ -399,7 +408,7 @@ public class TimeUtils {
* @return 时间字符串
*/
public static String getCurTimeString(SimpleDateFormat format) {
return milliseconds2String(getCurTimeMills(), format);
return date2String(new Date(), format);
}
/**
......@@ -418,11 +427,11 @@ public class TimeUtils {
*
* @param time 时间字符串
* @param unit <ul>
* <li>UNIT_MSEC:毫秒</li>
* <li>UNIT_SEC :秒</li>
* <li>UNIT_MIN :分</li>
* <li>UNIT_HOUR:小时</li>
* <li>UNIT_DAY :天</li>
* <li>MSEC:毫秒</li>
* <li>SEC :秒</li>
* <li>MIN :分</li>
* <li>HOUR:小时</li>
* <li>DAY :天</li>
* </ul>
* @return unit时间戳
*/
......@@ -436,11 +445,11 @@ public class TimeUtils {
*
* @param time 时间字符串
* @param unit <ul>
* <li>UNIT_MSEC:毫秒</li>
* <li>UNIT_SEC :秒</li>
* <li>UNIT_MIN :分</li>
* <li>UNIT_HOUR:小时</li>
* <li>UNIT_DAY :天</li>
* <li>MSEC:毫秒</li>
* <li>SEC :秒</li>
* <li>MIN :分</li>
* <li>HOUR:小时</li>
* <li>DAY :天</li>
* </ul>
* @param format 时间格式
* @return unit时间戳
......@@ -455,11 +464,11 @@ public class TimeUtils {
*
* @param time Date类型时间
* @param unit <ul>
* <li>UNIT_MSEC:毫秒</li>
* <li>UNIT_SEC :秒</li>
* <li>UNIT_MIN :分</li>
* <li>UNIT_HOUR:小时</li>
* <li>UNIT_DAY :天</li>
* <li>MSEC:毫秒</li>
* <li>SEC :秒</li>
* <li>MIN :分</li>
* <li>HOUR:小时</li>
* <li>DAY :天</li>
* </ul>
* @return unit时间戳
*/
......@@ -476,6 +485,5 @@ public class TimeUtils {
public static boolean isLeapYear(int year) {
return year % 4 == 0 && year % 100 != 0 || year % 400 == 0;
}
}
```
\ No newline at end of file
### 更新Log
#### 16/08/16 新增StringUtils及单元测试,完善正则工具类
#### 16/08/16 新增StringUtils及单元测试,完善正则工具类,版本更新1.1.0
#### 16/08/15 新增3DES和AES加密及单元检测,加密解密工具类基本完善,目录更新
#### 16/08/14 新增DES加密及单元检测
#### 16/08/13 新增MD2,SHA224,SHA256,SHA384,SHA512加密及单元测试,正折腾DES加密
......
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
group = 'com.github.blankj'
android {
compileSdkVersion 23
......@@ -25,4 +22,6 @@ dependencies {
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:3.1.2'
testCompile 'com.google.truth:truth:0.29'
}
\ No newline at end of file
}
apply from: "https://raw.githubusercontent.com/xiaopansky/android-library-publish-to-jcenter/master/bintrayUpload.gradle"
// gradlew bintrayUpload
\ No newline at end of file
#project
project.name=UtilCode
project.groupId=com.blankj
project.artifactId=utilcode
project.packaging=aar
project.siteUrl=https://github.com/Blankj/AndroidUtilCode
project.gitUrl=https://github.com/Blankj/AndroidUtilCode.git
#javadoc
javadoc.name=UtilCode
\ No newline at end of file
......@@ -60,6 +60,9 @@ public class NetworkUtils {
/**
* 判断网络是否可用
* <p>需添加权限 android.permission.ACCESS_NETWORK_STATE</p>
*
* @param context 上下文
* @return true: 可用<br>false: 不可用
*/
public static boolean isAvailable(Context context) {
NetworkInfo info = getActiveNetworkInfo(context);
......
package com.blankj.utilcode.utils;
import android.os.Environment;
import android.os.StatFs;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
/**
* <pre>
......@@ -41,136 +37,134 @@ public class SDCardUtils {
return Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator;
}
/**
* 获取SD卡的剩余容量 单位byte
*
* @return
*/
public static long getSDCardAllSize() {
if (isSDCardEnable()) {
StatFs stat = new StatFs(getSDCardPath());
// 获取空闲的数据块的数量
long availableBlocks = (long) stat.getAvailableBlocks() - 4;
// 获取单个数据块的大小(byte)
long freeBlocks = stat.getAvailableBlocks();
return freeBlocks * availableBlocks;
}
return 0;
}
/**
* 获取指定路径所在空间的剩余可用容量字节数,单位byte
*
* @param filePath
* @return 容量字节 SDCard可用空间,内部存储可用空间
*/
public static long getFreeBytes(String filePath) {
// 如果是sd卡的下的路径,则获取sd卡可用容量
if (filePath.startsWith(getSDCardPath())) {
filePath = getSDCardPath();
} else {// 如果是内部存储的路径,则获取内存存储的可用容量
filePath = Environment.getDataDirectory().getAbsolutePath();
}
StatFs stat = new StatFs(filePath);
long availableBlocks = (long) stat.getAvailableBlocks() - 4;
return stat.getBlockSize() * availableBlocks;
}
/**
* 获取系统存储路径
*
* @return
*/
public static String getRootDirectoryPath() {
return Environment.getRootDirectory().getAbsolutePath();
}
/**
* Check if the file is exists
*
* @param filePath
* @param fileName
* @return
*/
public static boolean isFileExistsInSDCard(String filePath, String fileName) {
boolean flag = false;
if (isSDCardEnable()) {
File file = new File(filePath, fileName);
if (file.exists()) {
flag = true;
}
}
return flag;
}
/**
* Write file to SD card
* @param filePath
* @param filename
* @param content
* @return
* @throws Exception
*/
public static boolean saveFileToSDCard(String filePath, String filename, String content)
throws Exception {
boolean flag = false;
if (isSDCardEnable()) {
File dir = new File(filePath);
if (!dir.exists()) {
dir.mkdir();
}
File file = new File(filePath, filename);
FileOutputStream outStream = new FileOutputStream(file);
outStream.write(content.getBytes());
outStream.close();
flag = true;
}
return flag;
}
/**
* Read file as stream from SD card
*
* @param fileName
* String PATH =
* Environment.getExternalStorageDirectory().getAbsolutePath() +
* "/dirName";
* @return
*/
public static byte[] readFileFromSDCard(String filePath, String fileName) {
byte[] buffer = null;
FileInputStream fin = null;
try {
if (isSDCardEnable()) {
String filePaht = filePath + "/" + fileName;
fin = new FileInputStream(filePaht);
int length = fin.available();
buffer = new byte[length];
fin.read(buffer);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (fin != null) fin.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return buffer;
}
/**
* Delete file
*
* @param filePath
* @param fileName
* filePath =
* android.os.Environment.getExternalStorageDirectory().getPath()
* @return
*/
public static boolean deleteSDFile(String filePath, String fileName) {
File file = new File(filePath + "/" + fileName);
return !(!file.exists() || file.isDirectory()) && file.delete();
}
// /**
// * 获取SD卡的剩余容量 单位byte
// *
// * @return
// */
// public static long getSDCardAllSize() {
// if (isSDCardEnable()) {
// StatFs stat = new StatFs(getSDCardPath());
// // 获取空闲的数据块的数量
// long availableBlocks = (long) stat.getAvailableBlocks() - 4;
// // 获取单个数据块的大小(byte)
// long freeBlocks = stat.getAvailableBlocks();
// return freeBlocks * availableBlocks;
// }
// return 0;
// }
//
// /**
// * 获取指定路径所在空间的剩余可用容量字节数,单位byte
// *
// * @param filePath
// * @return 容量字节 SDCard可用空间,内部存储可用空间
// */
// public static long getFreeBytes(String filePath) {
// // 如果是sd卡的下的路径,则获取sd卡可用容量
// if (filePath.startsWith(getSDCardPath())) {
// filePath = getSDCardPath();
// } else {// 如果是内部存储的路径,则获取内存存储的可用容量
// filePath = Environment.getDataDirectory().getAbsolutePath();
// }
// StatFs stat = new StatFs(filePath);
// long availableBlocks = (long) stat.getAvailableBlocks() - 4;
// return stat.getBlockSize() * availableBlocks;
// }
//
// /**
// * 获取系统存储路径
// *
// * @return
// */
// public static String getRootDirectoryPath() {
// return Environment.getRootDirectory().getAbsolutePath();
// }
//
// /**
// * Check if the file is exists
// *
// * @param filePath
// * @param fileName
// * @return
// */
// public static boolean isFileExistsInSDCard(String filePath, String fileName) {
// boolean flag = false;
// if (isSDCardEnable()) {
// File file = new File(filePath, fileName);
// if (file.exists()) {
// flag = true;
// }
// }
// return flag;
// }
//
// /**
// * Write file to SD card
// *
// * @param filePath
// * @param filename
// * @param content
// * @return
// * @throws Exception
// */
// public static boolean saveFileToSDCard(String filePath, String filename, String content)
// throws Exception {
// boolean flag = false;
// if (isSDCardEnable()) {
// File dir = new File(filePath);
// if (!dir.exists()) {
// dir.mkdir();
// }
// File file = new File(filePath, filename);
// FileOutputStream outStream = new FileOutputStream(file);
// outStream.write(content.getBytes());
// outStream.close();
// flag = true;
// }
// return flag;
// }
//
// /**
// * Read file as stream from SD card
// *
// * @param fileName String PATH =
// * Environment.getExternalStorageDirectory().getAbsolutePath() +
// * "/dirName";
// * @return
// */
// public static byte[] readFileFromSDCard(String filePath, String fileName) {
// byte[] buffer = null;
// FileInputStream fin = null;
// try {
// if (isSDCardEnable()) {
// String filePaht = filePath + "/" + fileName;
// fin = new FileInputStream(filePaht);
// int length = fin.available();
// buffer = new byte[length];
// fin.read(buffer);
// }
// } catch (Exception e) {
// e.printStackTrace();
// } finally {
// try {
// if (fin != null) fin.close();
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
// return buffer;
// }
//
// /**
// * Delete file
// *
// * @param filePath 文件路径
// * @param fileName 文件名
// * @return true: 成功<br>false: 失败
// */
// public static boolean deleteSDFile(String filePath, String fileName) {
// File file = new File(filePath + "/" + fileName);
// return !(!file.exists() || file.isDirectory()) && file.delete();
// }
}
\ No newline at end of file
......@@ -27,6 +27,7 @@ public class ShellUtils {
/**
* 判断设备是否root
* @return true: root<br>false: 没root
*/
public static boolean isRoot() {
return execCmd("echo root", true, false).result == 0;
......
......@@ -102,7 +102,7 @@ public class SizeUtils {
* <pre>
* SizeUtils.forceGetViewSize(view);
* SizeUtils.setListener(new SizeUtils.onGetSizeListener() {
* </span>@Override
* <span></span>@Override
* public void onGetSize(View view) {
* Log.d("tag", view.getWidth() + " " + view.getHeight());
* }
......
......@@ -30,7 +30,7 @@ public class TimeUtils {
* </p>
* 定义了以下模式字母(所有其他字符 'A' 到 'Z' 和 'a' 到 'z' 都被保留): <br>
* <table border="1" cellspacing="1" cellpadding="1" summary="Chart shows pattern letters, date/time component, presentation, and examples.">
* <tr bgcolor="#ccccff">
* <tr>
* <th align="left">字母</th>
* <th align="left">日期或时间元素</th>
* <th align="left">表示</th>
......@@ -42,7 +42,7 @@ public class TimeUtils {
* <td>Text</td>
* <td><code>AD</code></td>
* </tr>
* <tr bgcolor="#eeeeff">
* <tr>
* <td><code>y</code> </td>
* <td>年 </td>
* <td>Year </td>
......@@ -54,7 +54,7 @@ public class TimeUtils {
* <td>Month </td>
* <td><code>July</code>; <code>Jul</code>; <code>07</code> </td>
* </tr>
* <tr bgcolor="#eeeeff">
* <tr>
* <td><code>w</code> </td>
* <td>年中的周数 </td>
* <td>Number </td>
......@@ -66,7 +66,7 @@ public class TimeUtils {
* <td>Number </td>
* <td><code>2</code> </td>
* </tr>
* <tr bgcolor="#eeeeff">
* <tr>
* <td><code>D</code> </td>
* <td>年中的天数 </td>
* <td>Number </td>
......@@ -78,7 +78,7 @@ public class TimeUtils {
* <td>Number </td>
* <td><code>10</code> </td>
* </tr>
* <tr bgcolor="#eeeeff">
* <tr>
* <td><code>F</code> </td>
* <td>月份中的星期 </td>
* <td>Number </td>
......@@ -90,7 +90,7 @@ public class TimeUtils {
* <td>Text </td>
* <td><code>Tuesday</code>; <code>Tue</code> </td>
* </tr>
* <tr bgcolor="#eeeeff">
* <tr>
* <td><code>a</code> </td>
* <td>Am/pm 标记 </td>
* <td>Text </td>
......@@ -102,7 +102,7 @@ public class TimeUtils {
* <td>Number </td>
* <td><code>0</code> </td>
* </tr>
* <tr bgcolor="#eeeeff">
* <tr>
* <td><code>k</code> </td>
* <td>一天中的小时数(1-24) </td>
* <td>Number </td>
......@@ -114,7 +114,7 @@ public class TimeUtils {
* <td>Number </td>
* <td><code>0</code> </td>
* </tr>
* <tr bgcolor="#eeeeff">
* <tr>
* <td><code>h</code> </td>
* <td>am/pm 中的小时数(1-12) </td>
* <td>Number </td>
......@@ -126,7 +126,7 @@ public class TimeUtils {
* <td>Number </td>
* <td><code>30</code> </td>
* </tr>
* <tr bgcolor="#eeeeff">
* <tr>
* <td><code>s</code> </td>
* <td>分钟中的秒数 </td>
* <td>Number </td>
......@@ -138,7 +138,7 @@ public class TimeUtils {
* <td>Number </td>
* <td><code>978</code> </td>
* </tr>
* <tr bgcolor="#eeeeff">
* <tr>
* <td><code>z</code> </td>
* <td>时区 </td>
* <td>General time zone </td>
......@@ -485,6 +485,4 @@ public class TimeUtils {
public static boolean isLeapYear(int year) {
return year % 4 == 0 && year % 100 != 0 || year % 400 == 0;
}
}
}
\ No newline at end of file
......@@ -65,14 +65,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
......@@ -81,6 +73,16 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
......@@ -88,8 +90,10 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
......@@ -103,15 +107,15 @@
<orderEntry type="library" exported="" scope="TEST" name="xercesMinimal-1.9.6.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="maven-settings-2.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-library-1.3" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="asm-commons-5.0.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="ant-launcher-1.8.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="asm-commons-5.0.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="accessibility-test-framework-2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="xpp3_min-1.1.4c" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="nekohtml-1.9.6.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="wagon-http-lightweight-1.0-beta-6" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="maven-error-diagnostics-2.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="wagon-file-1.0-beta-6" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="nekohtml-1.9.6.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="asm-5.0.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="wagon-file-1.0-beta-6" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="maven-error-diagnostics-2.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="maven-repository-metadata-2.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="xstream-1.4.8" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="wagon-provider-api-1.0-beta-6" level="project" />
......@@ -120,29 +124,29 @@
<orderEntry type="library" exported="" scope="TEST" name="wagon-http-shared-1.0-beta-6" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="maven-model-2.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="xmlpull-1.1.3.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="error_prone_annotations-2.0.8" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="maven-artifact-2.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="error_prone_annotations-2.0.8" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="guava-19.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="truth-0.29" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="robolectric-annotations-3.1.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="icu4j-53.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="robolectric-utils-3.1.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="robolectric-3.1.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="asm-tree-5.0.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="sqlite4java-0.282" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="asm-tree-5.0.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="plexus-utils-1.5.15" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="maven-plugin-registry-2.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="asm-analysis-5.0.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="robolectric-resources-3.1.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="protobuf-java-2.6.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="maven-project-2.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="vtd-xml-2.11" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="plexus-container-default-1.0-alpha-9-stable-1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="vtd-xml-2.11" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="shadows-core-v23-3.1.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="plexus-container-default-1.0-alpha-9-stable-1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="classworlds-1.1-alpha-2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="maven-artifact-manager-2.2.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="shadows-core-v23-3.1.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="plexus-interpolation-1.11" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="maven-artifact-manager-2.2.1" level="project" />
</component>
</module>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册