Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mmm-rain
AndroidUtilCode
提交
9710722b
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,发现更多精彩内容 >>
提交
9710722b
编写于
1月 31, 2018
作者:
B
Blankj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
see 01/31 log
上级
cc7a785d
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
88 addition
and
22 deletion
+88
-22
README-CN.md
README-CN.md
+1
-1
README.md
README.md
+1
-1
app/build.gradle
app/build.gradle
+1
-1
app/src/main/java/com/blankj/androidutilcode/feature/core/activity/ActivityActivity.java
...droidutilcode/feature/core/activity/ActivityActivity.java
+2
-1
app/src/main/java/com/blankj/androidutilcode/feature/core/screen/ScreenActivity.java
...j/androidutilcode/feature/core/screen/ScreenActivity.java
+0
-2
build.gradle
build.gradle
+2
-2
subutil/src/main/java/com/blankj/subutil/util/CloneUtils.java
...til/src/main/java/com/blankj/subutil/util/CloneUtils.java
+66
-0
update_log.md
update_log.md
+2
-1
utilcode/README-CN.md
utilcode/README-CN.md
+1
-1
utilcode/README.md
utilcode/README.md
+1
-1
utilcode/src/main/java/com/blankj/utilcode/util/ImageUtils.java
...de/src/main/java/com/blankj/utilcode/util/ImageUtils.java
+9
-10
utilcode/src/main/java/com/blankj/utilcode/util/ScreenUtils.java
...e/src/main/java/com/blankj/utilcode/util/ScreenUtils.java
+2
-1
未找到文件。
README-CN.md
浏览文件 @
9710722b
...
...
@@ -41,7 +41,7 @@
[
logo
]:
https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/logo.png
[
aucsvg
]:
https://img.shields.io/badge/AndroidUtilCode-v1.12.
3
-brightgreen.svg
[
aucsvg
]:
https://img.shields.io/badge/AndroidUtilCode-v1.12.
4
-brightgreen.svg
[
auc
]:
https://github.com/Blankj/AndroidUtilCode
[
apisvg
]:
https://img.shields.io/badge/API-14+-brightgreen.svg
...
...
README.md
浏览文件 @
9710722b
...
...
@@ -41,7 +41,7 @@ If this ptoject helps you a lot, and you would like to support this ptoject's fu
[
logo
]:
https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/logo.png
[
aucsvg
]:
https://img.shields.io/badge/AndroidUtilCode-v1.12.
3
-brightgreen.svg
[
aucsvg
]:
https://img.shields.io/badge/AndroidUtilCode-v1.12.
4
-brightgreen.svg
[
auc
]:
https://github.com/Blankj/AndroidUtilCode
[
apisvg
]:
https://img.shields.io/badge/API-14+-brightgreen.svg
...
...
app/build.gradle
浏览文件 @
9710722b
...
...
@@ -67,7 +67,7 @@ dependencies {
debugImplementation
"com.squareup.leakcanary:leakcanary-android:$leakcanary_version"
releaseImplementation
"com.squareup.leakcanary:leakcanary-android-no-op:$leakcanary_version"
// implementation 'com.blankj:utilcode:1.12.
3
'
// implementation 'com.blankj:utilcode:1.12.
4
'
}
app/src/main/java/com/blankj/androidutilcode/feature/core/activity/ActivityActivity.java
浏览文件 @
9710722b
...
...
@@ -249,7 +249,6 @@ public class ActivityActivity extends BaseBackActivity {
private
Bundle
getOption
(
int
type
)
{
switch
(
type
)
{
default
:
case
0
:
return
ActivityOptionsCompat
.
makeCustomAnimation
(
this
,
R
.
anim
.
slide_in_right_1000
,
...
...
@@ -277,6 +276,8 @@ public class ActivityActivity extends BaseBackActivity {
viewSharedElement
,
getString
(
R
.
string
.
activity_shared_element
))
.
toBundle
();
default
:
return
null
;
}
}
}
app/src/main/java/com/blankj/androidutilcode/feature/core/screen/ScreenActivity.java
浏览文件 @
9710722b
...
...
@@ -61,8 +61,6 @@ public class ScreenActivity extends BaseBackActivity {
.
append
(
"isTablet: "
+
ScreenUtils
.
isTablet
())
.
create
()
);
}
@Override
...
...
build.gradle
浏览文件 @
9710722b
...
...
@@ -32,8 +32,8 @@ ext {
min_sdk_version
=
14
target_sdk_version
=
23
version_code
=
1
_012_00
3
version_name
=
'1.12.
3
'
// E.g 1.9.72 => 1,009,072
version_code
=
1
_012_00
4
version_name
=
'1.12.
4
'
// E.g 1.9.72 => 1,009,072
// App dependencies
support_version
=
'26.1.0'
...
...
subutil/src/main/java/com/blankj/subutil/util/CloneUtils.java
0 → 100644
浏览文件 @
9710722b
package
com.blankj.subutil.util
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.io.ObjectInputStream
;
import
java.io.ObjectOutputStream
;
import
java.io.Serializable
;
/**
* <pre>
* author: Blankj
* blog : http://blankj.com
* time : 2018/01/30
* desc : 克隆相关工具类
* </pre>
*/
public
final
class
CloneUtils
{
public
static
<
T
>
T
deepClone
(
final
Serializable
data
)
{
if
(
data
==
null
)
return
null
;
return
(
T
)
bytes2Object
(
serializable2Bytes
((
Serializable
)
data
));
}
private
static
byte
[]
serializable2Bytes
(
final
Serializable
serializable
)
{
if
(
serializable
==
null
)
return
null
;
ByteArrayOutputStream
baos
;
ObjectOutputStream
oos
=
null
;
try
{
oos
=
new
ObjectOutputStream
(
baos
=
new
ByteArrayOutputStream
());
oos
.
writeObject
(
serializable
);
return
baos
.
toByteArray
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
null
;
}
finally
{
try
{
if
(
oos
!=
null
)
{
oos
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
private
static
Object
bytes2Object
(
final
byte
[]
bytes
)
{
if
(
bytes
==
null
)
return
null
;
ObjectInputStream
ois
=
null
;
try
{
ois
=
new
ObjectInputStream
(
new
ByteArrayInputStream
(
bytes
));
return
ois
.
readObject
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
null
;
}
finally
{
try
{
if
(
ois
!=
null
)
{
ois
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
update_log.md
浏览文件 @
9710722b
*
18/01/27 修复 ToastUtils 默认样式问题,发布 1.12.2,新增 DeviceUtils#getSDKVersionName,发布 1.12.3
*
18/01/31 修复 default 相关的逻辑错误,发布 1.12.4
*
18/01/28 修复 ToastUtils 默认样式问题,发布 1.12.2,新增 DeviceUtils#getSDKVersionName,发布 1.12.3
*
18/01/27 修复 PermissionUtils 某些机型闪烁问题,发布 1.12.1
*
18/01/17 完善 ReflectUtils 及 单元测试,发布 1.12.0 版本
*
18/01/16 完善 ReflectUtils 及 单元测试
...
...
utilcode/README-CN.md
浏览文件 @
9710722b
...
...
@@ -2,7 +2,7 @@
Gradle:
```
groovy
compile
'com.blankj:utilcode:1.12.
3
'
compile
'com.blankj:utilcode:1.12.
4
'
```
...
...
utilcode/README.md
浏览文件 @
9710722b
...
...
@@ -2,7 +2,7 @@
Gradle:
```
groovy
compile
'com.blankj:utilcode:1.12.
3
'
compile
'com.blankj:utilcode:1.12.
4
'
```
...
...
utilcode/src/main/java/com/blankj/utilcode/util/ImageUtils.java
浏览文件 @
9710722b
...
...
@@ -576,33 +576,32 @@ public final class ImageUtils {
/**
* 获取图片旋转角度
* <p>返回 -1 表示异常</p>
*
* @param filePath 文件路径
* @return 旋转角度
*/
public
static
int
getRotateDegree
(
final
String
filePath
)
{
int
degree
=
0
;
try
{
ExifInterface
exifInterface
=
new
ExifInterface
(
filePath
);
int
orientation
=
exifInterface
.
getAttributeInt
(
ExifInterface
.
TAG_ORIENTATION
,
ExifInterface
.
ORIENTATION_NORMAL
);
ExifInterface
.
ORIENTATION_NORMAL
);
switch
(
orientation
)
{
default
:
case
ExifInterface
.
ORIENTATION_ROTATE_90
:
degree
=
90
;
break
;
return
90
;
case
ExifInterface
.
ORIENTATION_ROTATE_180
:
degree
=
180
;
break
;
return
180
;
case
ExifInterface
.
ORIENTATION_ROTATE_270
:
degree
=
270
;
break
;
return
270
;
default
:
return
0
;
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
return
-
1
;
}
return
degree
;
}
/**
...
...
utilcode/src/main/java/com/blankj/utilcode/util/ScreenUtils.java
浏览文件 @
9710722b
...
...
@@ -150,7 +150,6 @@ public final class ScreenUtils {
*/
public
static
int
getScreenRotation
(
@NonNull
final
Activity
activity
)
{
switch
(
activity
.
getWindowManager
().
getDefaultDisplay
().
getRotation
())
{
default
:
case
Surface
.
ROTATION_0
:
return
0
;
case
Surface
.
ROTATION_90
:
...
...
@@ -159,6 +158,8 @@ public final class ScreenUtils {
return
180
;
case
Surface
.
ROTATION_270
:
return
270
;
default
:
return
0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录