Skip to content

Commit 5cc3dc4

Browse files
committed
release 3.8.5
1 parent 323bbb0 commit 5cc3dc4

File tree

4 files changed

+8
-22
lines changed

4 files changed

+8
-22
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ xUtils 包含了orm, http(s), image, view注解, 但依然很轻量级(251K),
2626

2727
#### 使用Gradle构建时添加以下依赖即可:
2828
```javascript
29-
implementation 'org.xutils:xutils:3.8.4'
29+
implementation 'org.xutils:xutils:3.8.5'
3030
```
3131

3232
#### 混淆配置参考示例项目sample的配置

sample/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
<string name="remove">移除</string>
66
<string name="stop">停止</string>
77
<string name="start">开始下载</string>
8-
<string name="test_download_url">http://dl.bintray.com/wyouflf/maven/org/xutils/xutils/3.8.4/xutils-3.8.4.aar</string>
8+
<string name="test_download_url">http://dl.bintray.com/wyouflf/maven/org/xutils/xutils/3.8.5/xutils-3.8.5.aar</string>
99
</resources>

xutils/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apply plugin: 'com.jfrog.bintray'
55
def siteUrl = 'https://github.com/wyouflf/xUtils3'
66
def gitUrl = 'https://github.com/wyouflf/xUtils3.git'
77
group = "org.xutils"
8-
version = "3.8.4"
8+
version = "3.8.5"
99

1010
android {
1111
compileSdkVersion 28

xutils/src/main/java/org/xutils/image/ImageOptions.java

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.graphics.Bitmap;
44
import android.graphics.drawable.Drawable;
5+
import android.os.Build;
56
import android.view.ViewGroup;
67
import android.view.animation.Animation;
78
import android.widget.ImageView;
@@ -10,8 +11,6 @@
1011
import org.xutils.common.util.LogUtil;
1112
import org.xutils.http.RequestParams;
1213

13-
import java.lang.reflect.Field;
14-
1514
/**
1615
* Created by wyouflf on 15/8/21.
1716
* 图片加载参数
@@ -119,8 +118,10 @@ final void optimizeMaxSize(ImageView view) {
119118
}
120119
}
121120

122-
if (tempWidth <= 0) tempWidth = getImageViewFieldValue(view, "mMaxWidth");
123-
if (tempHeight <= 0) tempHeight = getImageViewFieldValue(view, "mMaxHeight");
121+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
122+
if (tempWidth <= 0) tempWidth = view.getMaxWidth();
123+
if (tempHeight <= 0) tempHeight = view.getMaxHeight();
124+
}
124125
}
125126

126127
if (tempWidth <= 0) tempWidth = screenWidth;
@@ -280,21 +281,6 @@ public String toString() {
280281
return sb.toString();
281282
}
282283

283-
private static int getImageViewFieldValue(ImageView view, String fieldName) {
284-
int value = 0;
285-
try {
286-
Field field = ImageView.class.getDeclaredField(fieldName);
287-
field.setAccessible(true);
288-
int fieldValue = (Integer) field.get(view);
289-
if (fieldValue > 0 && fieldValue < Integer.MAX_VALUE) {
290-
value = fieldValue;
291-
}
292-
} catch (Throwable ex) {
293-
LogUtil.w(ex.getMessage(), ex);
294-
}
295-
return value;
296-
}
297-
298284
public interface ParamsBuilder {
299285
RequestParams buildParams(RequestParams params, ImageOptions options);
300286
}

0 commit comments

Comments
 (0)