Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
门心叼龙
android-mvp-mvvm-flytour
提交
d5a89e0d
A
android-mvp-mvvm-flytour
项目概览
门心叼龙
/
android-mvp-mvvm-flytour
通知
7
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
6
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
android-mvp-mvvm-flytour
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
6
Issue
6
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d5a89e0d
编写于
1月 11, 2019
作者:
门心叼龙
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.bitmaputil增加了一个方法
2.NetUtil增增加了一个判断网络类型的方法
上级
b41435c1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
37 addition
and
2 deletion
+37
-2
lib_common/src/main/AndroidManifest.xml
lib_common/src/main/AndroidManifest.xml
+3
-1
lib_common/src/main/java/com/fly/tour/common/util/BitmapUtil.java
...on/src/main/java/com/fly/tour/common/util/BitmapUtil.java
+6
-0
lib_common/src/main/java/com/fly/tour/common/util/NetUtil.java
...ommon/src/main/java/com/fly/tour/common/util/NetUtil.java
+28
-1
未找到文件。
lib_common/src/main/AndroidManifest.xml
浏览文件 @
d5a89e0d
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.fly.tour.common"
/>
package=
"com.fly.tour.common"
>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
</manifest>
lib_common/src/main/java/com/fly/tour/common/util/BitmapUtil.java
浏览文件 @
d5a89e0d
...
...
@@ -406,6 +406,12 @@ public class BitmapUtil {
options
.
inJustDecodeBounds
=
false
;
return
BitmapFactory
.
decodeFile
(
path
,
options
);
}
/**
* 获取图片原始的宽、高
* @param url
* @return
*/
public
static
int
[]
getImageSize
(
String
url
)
{
int
[]
size
=
new
int
[]{
0
,
0
};
if
(
FileUtil
.
isImageFile
(
url
))
{
...
...
lib_common/src/main/java/com/fly/tour/common/util/NetUtil.java
浏览文件 @
d5a89e0d
...
...
@@ -7,6 +7,10 @@ import android.support.annotation.NonNull;
import
com.fly.tour.common.BaseApplication
;
import
static
com
.
fly
.
tour
.
common
.
util
.
NetUtil
.
NetType
.
NET_4G
;
import
static
com
.
fly
.
tour
.
common
.
util
.
NetUtil
.
NetType
.
NO_NET
;
import
static
com
.
fly
.
tour
.
common
.
util
.
NetUtil
.
NetType
.
WIFI
;
/**
* Description: <ToastUtil><br>
* Author: gxl<br>
...
...
@@ -64,5 +68,28 @@ public class NetUtil {
}
return
false
;
}
public
static
NetType
isNetWorkState
(
Context
context
)
{
ConnectivityManager
manager
=
(
ConnectivityManager
)
context
.
getSystemService
(
Context
.
CONNECTIVITY_SERVICE
);
NetworkInfo
activeNetwork
=
manager
.
getActiveNetworkInfo
();
if
(
activeNetwork
!=
null
)
{
if
(
activeNetwork
.
isConnected
())
{
if
(
activeNetwork
.
getType
()
==
ConnectivityManager
.
TYPE_WIFI
)
{
// Logger.v(TAG, "当前WiFi连接可用 ");
return
WIFI
;
}
else
if
(
activeNetwork
.
getType
()
==
ConnectivityManager
.
TYPE_MOBILE
)
{
// Logger.v(TAG, "当前移动网络连接可用 ");
return
NET_4G
;
}
}
else
{
// Logger.v(TAG, "当前没有网络连接,请确保你已经打开网络 ");
return
NO_NET
;
}
}
else
{
// Logger.v(TAG, "当前没有网络连接,请确保你已经打开网络 ");
return
NO_NET
;
}
return
NO_NET
;
}
public
enum
NetType
{
WIFI
,
NET_4G
,
NO_NET
};
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录