Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mmm-rain
AndroidUtilCode
提交
e1a4a1a0
A
AndroidUtilCode
项目概览
mmm-rain
/
AndroidUtilCode
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
AndroidUtilCode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e1a4a1a0
编写于
7月 08, 2017
作者:
B
Blankj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
see 07/08 log
上级
47d2b34a
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
162 addition
and
5 deletion
+162
-5
app/build.gradle
app/build.gradle
+1
-0
settings.gradle
settings.gradle
+1
-1
subutil/.gitignore
subutil/.gitignore
+1
-0
subutil/build.gradle
subutil/build.gradle
+67
-0
subutil/proguard-rules.pro
subutil/proguard-rules.pro
+25
-0
subutil/src/main/AndroidManifest.xml
subutil/src/main/AndroidManifest.xml
+1
-0
subutil/src/main/java/com/blankj/subutil/util/LunarUtils.java
...til/src/main/java/com/blankj/subutil/util/LunarUtils.java
+1
-1
subutil/src/main/java/com/blankj/subutil/util/PinyinUtils.java
...il/src/main/java/com/blankj/subutil/util/PinyinUtils.java
+1
-1
subutil/src/main/java/com/blankj/subutil/util/ThreadPoolUtils.java
...rc/main/java/com/blankj/subutil/util/ThreadPoolUtils.java
+1
-1
subutil/src/main/java/com/blankj/subutil/util/Utils.java
subutil/src/main/java/com/blankj/subutil/util/Utils.java
+42
-0
subutil/src/main/java/com/blankj/subutil/util/VibrationUtils.java
...src/main/java/com/blankj/subutil/util/VibrationUtils.java
+1
-1
subutil/src/main/res/values/strings.xml
subutil/src/main/res/values/strings.xml
+3
-0
subutil/src/test/java/com/blankj/subutil/ExampleUnitTest.java
...til/src/test/java/com/blankj/subutil/ExampleUnitTest.java
+17
-0
未找到文件。
app/build.gradle
浏览文件 @
e1a4a1a0
...
...
@@ -53,6 +53,7 @@ dependencies {
def
leakCanary
=
"com.squareup.leakcanary:leakcanary-android-no-op:$LEAKCANARY_VERSION"
compile
project
(
':utilcode'
)
compile
project
(
':subutil'
)
compile
"com.android.support:appcompat-v7:$SUPPORT_VERSION"
compile
"com.android.support:support-v4:$SUPPORT_VERSION"
compile
"com.android.support:design:$SUPPORT_VERSION"
...
...
settings.gradle
浏览文件 @
e1a4a1a0
include
':app'
,
':utilcode'
include
':app'
,
':utilcode'
,
':subutil'
subutil/.gitignore
0 → 100644
浏览文件 @
e1a4a1a0
/build
subutil/build.gradle
0 → 100644
浏览文件 @
e1a4a1a0
apply
plugin:
'com.android.library'
apply
plugin:
'jacoco'
task
jacocoTestReport
(
type:
JacocoReport
,
dependsOn:
[
'testDebugUnitTest'
,
'createDebugCoverageReport'
])
{
reports
{
xml
.
enabled
=
true
html
.
enabled
=
true
}
def
fileFilter
=
[
'**/R.class'
,
'**/R$*.class'
,
'**/BuildConfig.*'
,
'**/Manifest*.*'
,
'**/*Test*.*'
,
'android/**/*.*'
]
def
debugTree
=
fileTree
(
dir:
"${buildDir}/intermediates/classes/debug"
,
excludes:
fileFilter
)
def
mainSrc
=
"${project.projectDir}/src/main/java"
sourceDirectories
=
files
([
mainSrc
])
classDirectories
=
files
([
debugTree
])
executionData
=
fileTree
(
dir:
"$buildDir"
,
includes:
[
"jacoco/testDebugUnitTest.exec"
,
"outputs/code-coverage/connected/*coverage.ec"
])
}
android
{
compileSdkVersion
25
buildToolsVersion
"25.0.3"
defaultConfig
{
minSdkVersion
14
versionCode
41
versionName
"1.7.1"
}
buildTypes
{
debug
{
testCoverageEnabled
true
proguardFiles
getDefaultProguardFile
(
'proguard-android.txt'
),
'proguard-rules.pro'
}
release
{
minifyEnabled
true
proguardFiles
getDefaultProguardFile
(
'proguard-android.txt'
),
'proguard-rules.pro'
}
}
lintOptions
{
abortOnError
false
}
}
tasks
.
matching
{
it
instanceof
Test
}.
all
{
testLogging
.
events
=
[
"failed"
,
"passed"
,
"skipped"
]
}
dependencies
{
final
SUPPORT_VERSION
=
'25.3.1'
final
JUNIT_VERSION
=
'4.12'
final
TRUTH_VERSION
=
'0.31'
final
ROBOLECTRIC_VERSION
=
'3.1.2'
provided
"com.android.support:appcompat-v7:$SUPPORT_VERSION"
provided
"com.android.support:support-v4:$SUPPORT_VERSION"
provided
"com.android.support:design:$SUPPORT_VERSION"
testCompile
"junit:junit:$JUNIT_VERSION"
testCompile
"org.robolectric:robolectric:$ROBOLECTRIC_VERSION"
}
//apply from: "https://raw.githubusercontent.com/xiaopansky/android-library-publish-to-jcenter/master/bintrayUpload.gradle"
//gradlew bintrayUpload
subutil/proguard-rules.pro
0 → 100644
浏览文件 @
e1a4a1a0
# Add project specific ProGuard rules here.
#
By
default
,
the
flags
in
this
file
are
appended
to
flags
specified
#
in
/
Users
/
Blankj
/
Library
/
Android
/
android_sdk
/
tools
/
proguard
/
proguard
-
android
.
txt
#
You
can
edit
the
include
path
and
order
by
changing
the
proguardFiles
#
directive
in
build
.
gradle
.
#
#
For
more
details
,
see
#
http
://
developer
.
android
.
com
/
guide
/
developing
/
tools
/
proguard
.
html
#
Add
any
project
specific
keep
options
here
:
#
If
your
project
uses
WebView
with
JS
,
uncomment
the
following
#
and
specify
the
fully
qualified
class
name
to
the
JavaScript
interface
#
class
:
#-
keepclassmembers
class
fqcn
.
of
.
javascript
.
interface
.
for
.
webview
{
#
public
*
;
#
}
#
Uncomment
this
to
preserve
the
line
number
information
for
#
debugging
stack
traces
.
#-
keepattributes
SourceFile
,
LineNumberTable
#
If
you
keep
the
line
number
information
,
uncomment
this
to
#
hide
the
original
source
file
name
.
#-
renamesourcefileattribute
SourceFile
subutil/src/main/AndroidManifest.xml
0 → 100644
浏览文件 @
e1a4a1a0
<manifest
package=
"com.blankj.subutil"
/>
utilcode/src/main/java/com/blankj/utilcode
/util/LunarUtils.java
→
subutil/src/main/java/com/blankj/subutil
/util/LunarUtils.java
浏览文件 @
e1a4a1a0
package
com.blankj.
utilcode
.util
;
package
com.blankj.
subutil
.util
;
/**
* <pre>
...
...
utilcode/src/main/java/com/blankj/utilcode
/util/PinyinUtils.java
→
subutil/src/main/java/com/blankj/subutil
/util/PinyinUtils.java
浏览文件 @
e1a4a1a0
package
com.blankj.
utilcode
.util
;
package
com.blankj.
subutil
.util
;
import
android.support.v4.util.SimpleArrayMap
;
...
...
utilcode/src/main/java/com/blankj/utilcode
/util/ThreadPoolUtils.java
→
subutil/src/main/java/com/blankj/subutil
/util/ThreadPoolUtils.java
浏览文件 @
e1a4a1a0
package
com.blankj.
utilcode
.util
;
package
com.blankj.
subutil
.util
;
import
android.support.annotation.IntDef
;
...
...
subutil/src/main/java/com/blankj/subutil/util/Utils.java
0 → 100644
浏览文件 @
e1a4a1a0
package
com.blankj.subutil.util
;
import
android.annotation.SuppressLint
;
import
android.content.Context
;
import
android.support.annotation.NonNull
;
/**
* <pre>
* author: Blankj
* blog : http://blankj.com
* time : 16/12/08
* desc : Utils初始化相关
* </pre>
*/
public
final
class
Utils
{
@SuppressLint
(
"StaticFieldLeak"
)
private
static
Context
context
;
private
Utils
()
{
throw
new
UnsupportedOperationException
(
"u can't instantiate me..."
);
}
/**
* 初始化工具类
*
* @param context 上下文
*/
public
static
void
init
(
@NonNull
final
Context
context
)
{
Utils
.
context
=
context
.
getApplicationContext
();
}
/**
* 获取ApplicationContext
*
* @return ApplicationContext
*/
public
static
Context
getContext
()
{
if
(
context
!=
null
)
return
context
;
throw
new
NullPointerException
(
"u should init first"
);
}
}
utilcode/src/main/java/com/blankj/utilcode
/util/VibrationUtils.java
→
subutil/src/main/java/com/blankj/subutil
/util/VibrationUtils.java
浏览文件 @
e1a4a1a0
package
com.blankj.
utilcode
.util
;
package
com.blankj.
subutil
.util
;
/**
* <pre>
...
...
subutil/src/main/res/values/strings.xml
0 → 100644
浏览文件 @
e1a4a1a0
<resources>
<string
name=
"app_name"
>
subutil
</string>
</resources>
subutil/src/test/java/com/blankj/subutil/ExampleUnitTest.java
0 → 100644
浏览文件 @
e1a4a1a0
package
com.blankj.subutil
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public
class
ExampleUnitTest
{
@Test
public
void
addition_isCorrect
()
throws
Exception
{
assertEquals
(
4
,
2
+
2
);
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录