From 1a82e34bf191f03078f751ef7fe0342b4d4a1bf9 Mon Sep 17 00:00:00 2001 From: sherlock Date: Thu, 8 Dec 2022 16:53:50 +0800 Subject: [PATCH] =?UTF-8?q?release:=20androidx-7.0.5=20fix=20=E9=87=8D?= =?UTF-8?q?=E5=AE=9A=E5=90=91=E5=9C=B0=E5=9D=80=E5=8A=A0=E8=BD=BD=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6=E5=8D=A1=E5=9C=A81%=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +-- .../library/glide/progress/ProgressManager.kt | 6 +++- sample/build.gradle | 6 ++-- .../bigimageviewpager/MainActivity.java | 30 ++++++++++++------- 4 files changed, 29 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index da56fb7..65f05b7 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ allprojects { ##### 此处显示的是本框架的最新版本号: ##### ⚠️注意:glide v3版本不再维护,最终版本为v3_4.0.2。建议使用androidx版本。 ``` -androidx用户 : 使用 androidx-7.0.4 +androidx用户 : 使用 androidx-7.0.5 对于glide4.x : 使用 v4_6.1.3 ``` @@ -54,7 +54,7 @@ dependencies { annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0' implementation 'com.github.bumptech.glide:okhttp3-integration:4.11.0' // BigImageViewPager https://github.com/SherlockGougou/BigImageViewPager - implementation 'com.github.SherlockGougou:BigImageViewPager:androidx-7.0.4' + implementation 'com.github.SherlockGougou:BigImageViewPager:androidx-7.0.5' ================================分割线================================== diff --git a/library/src/main/java/cc/shinichi/library/glide/progress/ProgressManager.kt b/library/src/main/java/cc/shinichi/library/glide/progress/ProgressManager.kt index 13f6be5..baab5b1 100644 --- a/library/src/main/java/cc/shinichi/library/glide/progress/ProgressManager.kt +++ b/library/src/main/java/cc/shinichi/library/glide/progress/ProgressManager.kt @@ -21,7 +21,11 @@ object ProgressManager { val onProgressListener = getProgressListener(url) val percentage = (bytesRead * 1f / totalBytes * 100f).toInt() val isComplete = percentage >= 100 - onProgressListener?.onProgress(url, isComplete, percentage, bytesRead, totalBytes) + listenersMap.let { + for (listener in it.values) { + listener.onProgress(url, isComplete, percentage, bytesRead, totalBytes) + } + } if (isComplete) { removeListener(url) } diff --git a/sample/build.gradle b/sample/build.gradle index bd49323..9ddc659 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -8,8 +8,8 @@ android { applicationId "cc.shinichi.bigimageviewpager" minSdkVersion 14 targetSdkVersion 32 - versionCode 704 - versionName "androidx-7.0.4" + versionCode 705 + versionName "androidx-7.0.5" } buildTypes { release { @@ -57,6 +57,6 @@ dependencies { annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0' implementation 'com.github.bumptech.glide:okhttp3-integration:4.11.0' // library -// implementation 'com.github.SherlockGougou:BigImageViewPager:androidx-7.0.4' +// implementation 'com.github.SherlockGougou:BigImageViewPager:androidx-7.0.5' implementation project(':library') } \ No newline at end of file diff --git a/sample/src/main/java/cc/shinichi/bigimageviewpager/MainActivity.java b/sample/src/main/java/cc/shinichi/bigimageviewpager/MainActivity.java index 7adb185..0535c14 100644 --- a/sample/src/main/java/cc/shinichi/bigimageviewpager/MainActivity.java +++ b/sample/src/main/java/cc/shinichi/bigimageviewpager/MainActivity.java @@ -63,12 +63,7 @@ public class MainActivity extends AppCompatActivity { private ImagePreview.LoadStrategy loadStrategy = ImagePreview.LoadStrategy.Default; private final String[] images = { - // 小尺寸图片 - "https://s1.ax1x.com/2020/10/16/0HXKv4.jpg", // 普通jpg图片 - "http://img6.16fan.com/201510/11/005258wdngg6rv0tpn8z9z.jpg", - "http://img6.16fan.com/201510/11/013553aj3kp9u6iuz6k9uj.jpg", - "http://img6.16fan.com/201510/11/011753fnanichdca0wbhxc.jpg", "http://img6.16fan.com/201510/11/011819zbzbciir9ctn295o.jpg", "http://img6.16fan.com/201510/11/004847l7w568jc5n5wn385.jpg", "http://img6.16fan.com/201510/11/004906z0a0a0e0hs56ce0t.jpg", @@ -77,6 +72,11 @@ public class MainActivity extends AppCompatActivity { "http://img6.16fan.com/201510/11/004955d8ftz3t1sttt7ft7.jpg", "http://img6.16fan.com/201510/11/005027qy2g55yyglb59zdu.jpg", "http://img6.16fan.com/201510/11/005229bbtxkczcl0btmw8e.jpg", + "http://img6.16fan.com/201510/11/005258wdngg6rv0tpn8z9z.jpg", + "http://img6.16fan.com/201510/11/013553aj3kp9u6iuz6k9uj.jpg", + "http://img6.16fan.com/201510/11/011753fnanichdca0wbhxc.jpg", + // 小尺寸图片 + "https://s1.ax1x.com/2020/10/16/0HXKv4.jpg", // 大图:5760 * 3840 "http://img6.16fan.com/attachments/wenzhang/201805/18/152660818127263ge.jpeg", // 长图:2280 * 22116 @@ -243,6 +243,14 @@ private void initData() { i.setOriginUrl("https://test-houbo-homework.oss-cn-shanghai.aliyuncs.com/第2课测试-画鸡蛋测试-111-1553831-1662516935.jpg"); imageInfoList.add(i); + // todo 测试带重定向的地址 + i = new ImageInfo(); + i.setThumbnailUrl("https://im.api.ovivas.cn/rest/v1/im/file/download?fileId=2022%2F12%2F05%2Fb22d9ae0-32a6-4420-b0ca-b1f79cac7aca%2Fthumbnail%2Fwx_camera_1670145692581%282%29.jpg"); + i.setOriginUrl("https://im.api.ovivas.cn/rest/v1/im/file/download?fileId=2022%2F12%2F05%2Fb22d9ae0-32a6-4420-b0ca-b1f79cac7aca%2Fwx_camera_1670145692581%282%29.jpg"); + imageInfoList.add(i); + + + // 一、最简单的调用: findViewById(R.id.buttonEasyUse).setOnClickListener(new View.OnClickListener() { @Override @@ -260,13 +268,13 @@ public void onClick(View v) { ImageView image3 = findViewById(R.id.image3); List list2 = new ArrayList<>(); - list2.add("http://img6.16fan.com/201510/11/005258wdngg6rv0tpn8z9z.jpg"); - list2.add("http://img6.16fan.com/201510/11/013553aj3kp9u6iuz6k9uj.jpg"); - list2.add("http://img6.16fan.com/201510/11/011753fnanichdca0wbhxc.jpg"); + list2.add("http://img6.16fan.com/201510/11/005258wdngg6rv0tpn8z9z.jpg-400"); + list2.add("http://img6.16fan.com/201510/11/013553aj3kp9u6iuz6k9uj.jpg-400"); + list2.add("http://img6.16fan.com/201510/11/011753fnanichdca0wbhxc.jpg-400"); - Glide.with(this).load("http://img6.16fan.com/201510/11/005258wdngg6rv0tpn8z9z.jpg").into(image1); - Glide.with(this).load("http://img6.16fan.com/201510/11/013553aj3kp9u6iuz6k9uj.jpg").into(image2); - Glide.with(this).load("http://img6.16fan.com/201510/11/011753fnanichdca0wbhxc.jpg").into(image3); + Glide.with(this).load("http://img6.16fan.com/201510/11/005258wdngg6rv0tpn8z9z.jpg-400").into(image1); + Glide.with(this).load("http://img6.16fan.com/201510/11/013553aj3kp9u6iuz6k9uj.jpg-400").into(image2); + Glide.with(this).load("http://img6.16fan.com/201510/11/011753fnanichdca0wbhxc.jpg-400").into(image3); image1.setOnClickListener(new View.OnClickListener() { @Override