From 2fac071613e975e3e434dfad5bb975e2c3da8228 Mon Sep 17 00:00:00 2001 From: TommyLemon <1184482681@qq.com> Date: Sat, 27 Nov 2021 02:55:22 +0800 Subject: [PATCH 01/67] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=85=BE=E8=AE=AF=20AP?= =?UTF-8?q?IJSON=20=E7=9A=84=E5=8F=8B=E6=83=85=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/Tencent/APIJSON --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0c8affca..4481a1c0 100644 --- a/README.md +++ b/README.md @@ -303,7 +303,7 @@ SmartRefreshLayout 不需要添加混淆过滤代码,并且已经混淆测试 [github/Loror](https://github.com/Loror) [github/faith-hb/WidgetCase](https://github.com/faith-hb/WidgetCase) [github/Bamboy120315/Freedom](https://github.com/Bamboy120315/Freedom) -[github/TommyLemon/APIJSON](https://github.com/TommyLemon/APIJSON) +[github/Tencent/APIJSON](https://github.com/Tencent/APIJSON) [github/dengyuhan](https://github.com/dengyuhan) [github/zrp2017](https://github.com/zrp2017) [github/fly803/BaseProject](https://github.com/fly803/BaseProject) From 749878d0d918de004c11362e7245ed3ccb9fe6b1 Mon Sep 17 00:00:00 2001 From: Soul Date: Wed, 23 Feb 2022 14:54:04 +0800 Subject: [PATCH 02/67] =?UTF-8?q?=E6=9B=B4=E6=96=B0README=EF=BC=9A1.?= =?UTF-8?q?=E6=9B=B4=E6=96=B02.0.5=E4=BB=A5=E5=90=8E=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E7=9A=84=E5=86=99=E6=B3=95=202.=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=AC=E8=A7=92=E6=A0=87?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- README_EN.md | 29 +++++++++++++++-------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 4597aa28..aca5b3a5 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Arsenal](https://img.shields.io/badge/Arsenal%20-%20SmartRefresh-4cae4c.svg)](https://android-arsenal.com/details/1/6001) [![Maven](https://img.shields.io/badge/%20Maven%20-2.0.5-5bc0de.svg)](https://s01.oss.sonatype.org/#nexus-search;quick~refresh-layout-kernel) [![MinSdk](https://img.shields.io/badge/%20MinSdk%20-%2012%2B%20-f0ad4e.svg)](https://android-arsenal.com/api?level=12) -[![Methods](https://img.shields.io/badge/Methods%20%7C%20Size%20-%20784%20%7C%20121%20KB-d9534f.svg)](http://www.methodscount.com/?lib=com.scwang.smartrefresh%3ASmartRefreshLayout%3A1.0.4) +[![Methods](https://img.shields.io/badge/Methods%20%7C%20Size%20-%20784%20%7C%20121%20KB-d9534f.svg)](http://www.methodscount.com/?lib=io.github.scwang90:refresh%3ASmartRefreshLayout%3A1.0.4) ## [English](README_EN.md) | 中文 diff --git a/README_EN.md b/README_EN.md index accfcd69..f09fbe27 100644 --- a/README_EN.md +++ b/README_EN.md @@ -2,9 +2,9 @@ [![License](https://img.shields.io/badge/License%20-Apache%202-337ab7.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![Arsenal](https://img.shields.io/badge/Arsenal%20-%20SmartRefresh-4cae4c.svg)](https://android-arsenal.com/details/1/6001) -[![JCenter](https://img.shields.io/badge/%20Jcenter%20-2.0.3-5bc0de.svg)](https://bintray.com/scwang90/maven/refresh-layout-kernel/_latestVersion) +[![JCenter](https://img.shields.io/badge/%20Jcenter%20-2.0.5-5bc0de.svg)](https://bintray.com/scwang90/maven/refresh-layout-kernel/_latestVersion) [![MinSdk](https://img.shields.io/badge/%20MinSdk%20-%2012%2B%20-f0ad4e.svg)](https://android-arsenal.com/api?level=12) -[![Methods](https://img.shields.io/badge/Methods%20%7C%20Size%20-%20784%20%7C%20122%20KB-d9534f.svg)](http://www.methodscount.com/?lib=com.scwang.smartrefresh%3ASmartRefreshLayout%3A1.1.0) +[![Methods](https://img.shields.io/badge/Methods%20%7C%20Size%20-%20784%20%7C%20122%20KB-d9534f.svg)](http://www.methodscount.com/?lib=io.github.scwang90:refresh%3ASmartRefreshLayout%3A1.1.0) ## English | [中文](README.md) @@ -114,20 +114,21 @@ It is recommended that you copy the source code into the project whenever you ne ``` // Note: There will be no default Header and Footer after subcontracting. It needs to be added manually! -implementation 'com.scwang.smart:refresh-layout-kernel:2.0.3' //core -implementation 'com.scwang.smart:refresh-header-classics:2.0.3' //ClassicsHeader -implementation 'com.scwang.smart:refresh-header-radar:2.0.3' //BezierRadarHeader -implementation 'com.scwang.smart:refresh-header-falsify:2.0.3' //FalsifyHeader -implementation 'com.scwang.smart:refresh-header-material:2.0.3' //MaterialHeader -implementation 'com.scwang.smart:refresh-header-two-level:2.0.3' //TwoLevelHeader -implementation 'com.scwang.smart:refresh-footer-ball:2.0.3' //BallPulseFooter -implementation 'com.scwang.smart:refresh-footer-classics:2.0.3' //ClassicsFooter +// To search lastest version by https://search.maven.org/search?q=g:io.github.scwang90 +implementation 'io.github.scwang90:refresh-layout-kernel:2.0.5' //core +implementation 'io.github.scwang90:refresh-header-classics:2.0.5' //ClassicsHeader +implementation 'io.github.scwang90:refresh-header-radar:2.0.5' //BezierRadarHeader +implementation 'io.github.scwang90:refresh-header-falsify:2.0.5' //FalsifyHeader +implementation 'io.github.scwang90:refresh-header-material:2.0.5' //MaterialHeader +implementation 'io.github.scwang90:refresh-header-two-level:2.0.5' //TwoLevelHeader +implementation 'io.github.scwang90:refresh-footer-ball:2.0.5' //BallPulseFooter +implementation 'io.github.scwang90:refresh-footer-classics:2.0.5' //ClassicsFooter ``` - - - - + + + + If you use AndroidX, add it to gradle.properties From a66321074f5fcf8ed2a47be00ba3a3f1c15c455c Mon Sep 17 00:00:00 2001 From: Soul Date: Wed, 23 Feb 2022 15:20:22 +0800 Subject: [PATCH 03/67] =?UTF-8?q?README=20-=202.0.3=E5=8F=8A=E4=BB=A5?= =?UTF-8?q?=E4=B8=8B=E8=BF=98=E6=98=AF=E9=87=87=E7=94=A8=E7=9A=84=E6=97=A7?= =?UTF-8?q?=E5=8C=85=E5=90=8D=EF=BC=8C=E6=83=B3=E8=A6=81=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=96=B0=E5=8C=85=E5=90=8D=E9=9C=80=E8=A6=812.0.4=E5=8F=8A?= =?UTF-8?q?=E4=BB=A5=E4=B8=8A=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index aca5b3a5..a89802cc 100644 --- a/README.md +++ b/README.md @@ -119,14 +119,14 @@ V2.x 版本已经把依赖库拆分成8个包啦,用到的时候自行引用 ```gradle implementation 'androidx.appcompat:appcompat:1.0.0' //必须 1.0.0 以上 -implementation 'io.github.scwang90:refresh-layout-kernel:2.0.3' //核心必须依赖 -implementation 'io.github.scwang90:refresh-header-classics:2.0.3' //经典刷新头 -implementation 'io.github.scwang90:refresh-header-radar:2.0.3' //雷达刷新头 -implementation 'io.github.scwang90:refresh-header-falsify:2.0.3' //虚拟刷新头 -implementation 'io.github.scwang90:refresh-header-material:2.0.3' //谷歌刷新头 -implementation 'io.github.scwang90:refresh-header-two-level:2.0.3' //二级刷新头 -implementation 'io.github.scwang90:refresh-footer-ball:2.0.3' //球脉冲加载 -implementation 'io.github.scwang90:refresh-footer-classics:2.0.3' //经典加载 +implementation 'io.github.scwang90:refresh-layout-kernel:2.0.5' //核心必须依赖 +implementation 'io.github.scwang90:refresh-header-classics:2.0.5' //经典刷新头 +implementation 'io.github.scwang90:refresh-header-radar:2.0.5' //雷达刷新头 +implementation 'io.github.scwang90:refresh-header-falsify:2.0.5' //虚拟刷新头 +implementation 'io.github.scwang90:refresh-header-material:2.0.5' //谷歌刷新头 +implementation 'io.github.scwang90:refresh-header-two-level:2.0.5' //二级刷新头 +implementation 'io.github.scwang90:refresh-footer-ball:2.0.5' //球脉冲加载 +implementation 'io.github.scwang90:refresh-footer-classics:2.0.5' //经典加载 ``` From bdfa330d8c6d4595b539e78b9ec6f040f37dc381 Mon Sep 17 00:00:00 2001 From: jamgudev <826630153@qq.com> Date: Tue, 22 Mar 2022 22:13:03 +0800 Subject: [PATCH 04/67] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9C=A8overSpin?= =?UTF-8?q?=E5=A4=8D=E4=BD=8DcontentView=E5=88=B0=E5=8E=9F=E5=A7=8B?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E7=9A=84=E8=BF=87=E7=A8=8B=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E5=86=8D=E6=AC=A1=E6=8C=89=E4=B8=8B=E6=89=8B=E6=8C=87=E4=B8=8B?= =?UTF-8?q?=E6=8B=89contentView=E4=BC=9A=E5=AF=BC=E8=87=B4contentView?= =?UTF-8?q?=E5=90=91=E4=B8=8A=E8=B7=B3=E8=B7=83=E7=9A=84=E4=BD=93=E9=AA=8C?= =?UTF-8?q?=E3=80=82=E4=B8=8A=E6=8B=89=E5=8A=A0=E8=BD=BD=E6=9B=B4=E5=A4=9A?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E9=87=8D=E5=A4=8D=E7=B1=BB=E4=BC=BC=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E4=BA=A6=E4=BC=9A=E5=AF=BC=E8=87=B4contentView?= =?UTF-8?q?=E7=9A=84=E8=B7=B3=E8=B7=83=E3=80=82=20=EF=BC=88=E5=8F=AF?= =?UTF-8?q?=E5=B0=86mReboundDuration=E8=AE=BE=E9=95=BF=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=EF=BC=8C=E9=87=8D=E5=A4=8D=E4=BB=A5=E4=B8=8A=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E5=A4=8D=E7=8E=B0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../refresh/layout/SmartRefreshLayout.java | 57 +++++++++++++++++-- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java index 12be6f52..680f861c 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java @@ -1650,6 +1650,53 @@ protected void overSpinner() { } } + /** + * 给出阻尼计算的距离,计算原始滑动距离 + * @param originSpinner 阻尼计算过后的距离 + * @return Float, 原始滑动距离 + */ + protected int reverseCompute(float originSpinner) { + final View thisView = this; + double result = originSpinner; + if (mState == RefreshState.TwoLevel && originSpinner > 0) { + result = originSpinner; + } else if (mState == RefreshState.Refreshing && originSpinner >= 0) { + if (originSpinner < mHeaderHeight) { + result = originSpinner; + } else { + final float maxDragHeight = mHeaderMaxDragRate < 10 ? mHeaderHeight * mHeaderMaxDragRate : mHeaderMaxDragRate; + final double M = maxDragHeight - mHeaderHeight; + final double H = Math.max(mScreenHeightPixels * 4 / 3, thisView.getHeight()) - mHeaderHeight; + final double y = originSpinner; + result = ((-H * (Math.log(1 - y / M) / Math.log(100f))) + mHeaderHeight) / mDragRate; + } + } else if (originSpinner < 0 && (mState == RefreshState.Loading + || (mEnableFooterFollowWhenNoMoreData && mFooterNoMoreData && mFooterNoMoreDataEffective && isEnableRefreshOrLoadMore(mEnableLoadMore)) + || (mEnableAutoLoadMore && !mFooterNoMoreData && isEnableRefreshOrLoadMore(mEnableLoadMore)))) { + if (originSpinner > -mFooterHeight) { + result = originSpinner; + } else { + final float maxDragHeight = mFooterMaxDragRate < 10 ? mFooterHeight * mFooterMaxDragRate : mFooterMaxDragRate; + final double M = maxDragHeight - mFooterHeight; + final double H = Math.max(mScreenHeightPixels * 4 / 3, thisView.getHeight()) - mFooterHeight; + final double y = -originSpinner; + result = -((-H * (Math.log(1 - y / M) / Math.log(100f))) - mFooterHeight) / mDragRate; + } + } else if (originSpinner >= 0) { + final double M = mHeaderMaxDragRate < 10 ? mHeaderHeight * mHeaderMaxDragRate : mHeaderMaxDragRate; + final double H = Math.max(mScreenHeightPixels / 2, thisView.getHeight()); + final double y = originSpinner; + result = (-H * (Math.log(1 - y / M) / Math.log(100f))) / mDragRate; + } else { + final double M = mFooterMaxDragRate < 10 ? mFooterHeight * mFooterMaxDragRate : mFooterMaxDragRate; + final double H = Math.max(mScreenHeightPixels / 2, thisView.getHeight()); + final double y = -originSpinner; + result = -((-H * (Math.log(1 - y / M) / Math.log(100f))) - mFooterHeight) / mDragRate; + } + + return Math.round(Float.parseFloat(String.valueOf(result))); + } + /** * 黏性移动 spinner * @param spinner 偏移量 @@ -1699,7 +1746,7 @@ protected void moveSpinnerInfinitely(float spinner) { final double M = maxDragHeight - mHeaderHeight; final double H = Math.max(mScreenHeightPixels * 4 / 3, thisView.getHeight()) - mHeaderHeight; final double x = Math.max(0, (spinner - mHeaderHeight) * mDragRate); - final double y = Math.min(M * (1 - Math.pow(100, -x / (H == 0 ? 1 : H))), x);// 公式 y = M(1-100^(-x/H)) + final double y = M * (1 - Math.pow(100, -x / (H == 0 ? 1 : H)));// 公式 y = M(1-100^(-x/H)) mKernel.moveSpinner((int) y + mHeaderHeight, true); } } else if (spinner < 0 && (mState == RefreshState.Loading @@ -1712,20 +1759,20 @@ protected void moveSpinnerInfinitely(float spinner) { final double M = maxDragHeight - mFooterHeight; final double H = Math.max(mScreenHeightPixels * 4 / 3, thisView.getHeight()) - mFooterHeight; final double x = -Math.min(0, (spinner + mFooterHeight) * mDragRate); - final double y = -Math.min(M * (1 - Math.pow(100, -x / (H == 0 ? 1 : H))), x);// 公式 y = M(1-100^(-x/H)) + final double y = -M * (1 - Math.pow(100, -x / (H == 0 ? 1 : H)));// 公式 y = M(1-100^(-x/H)) mKernel.moveSpinner((int) y - mFooterHeight, true); } } else if (spinner >= 0) { final double M = mHeaderMaxDragRate < 10 ? mHeaderHeight * mHeaderMaxDragRate : mHeaderMaxDragRate; final double H = Math.max(mScreenHeightPixels / 2, thisView.getHeight()); final double x = Math.max(0, spinner * mDragRate); - final double y = Math.min(M * (1 - Math.pow(100, -x / (H == 0 ? 1 : H))), x);// 公式 y = M(1-100^(-x/H)) + final double y = M * (1 - Math.pow(100, -x / (H == 0 ? 1 : H)));// 公式 y = M(1-100^(-x/H)) mKernel.moveSpinner((int) y, true); } else { final double M = mFooterMaxDragRate < 10 ? mFooterHeight * mFooterMaxDragRate : mFooterMaxDragRate; final double H = Math.max(mScreenHeightPixels / 2, thisView.getHeight()); final double x = -Math.min(0, spinner * mDragRate); - final double y = -Math.min(M * (1 - Math.pow(100, -x / (H == 0 ? 1 : H))), x);// 公式 y = M(1-100^(-x/H)) + final double y = -M * (1 - Math.pow(100, -x / (H == 0 ? 1 : H)));// 公式 y = M(1-100^(-x/H)) mKernel.moveSpinner((int) y, true); } if (mEnableAutoLoadMore && !mFooterNoMoreData && isEnableRefreshOrLoadMore(mEnableLoadMore) && spinner < 0 @@ -1831,7 +1878,7 @@ public void onNestedScrollAccepted(@NonNull View child, @NonNull View target, in // Dispatch up to the nested parent mNestedChild.startNestedScroll(axes & ViewCompat.SCROLL_AXIS_VERTICAL); - mTotalUnconsumed = mSpinner;//0; + mTotalUnconsumed = reverseCompute(mSpinner);//0; mNestedInProgress = true; interceptAnimatorByAction(MotionEvent.ACTION_DOWN); From 0756cfefa0b59fb684fdec7dc52ff1c20e8d43c4 Mon Sep 17 00:00:00 2001 From: haoxiqiang Date: Tue, 7 Jun 2022 11:56:59 +0800 Subject: [PATCH 05/67] Update md_property.md --- art/md_property.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/art/md_property.md b/art/md_property.md index 12533472..2e77c0ed 100644 --- a/art/md_property.md +++ b/art/md_property.md @@ -17,10 +17,10 @@ public class RefreshActivity extends Activity { refreshLayout.setFooterHeight(100);//Footer标准高度(显示上拉高度>=标准高度 触发加载) refreshLayout.setFooterHeightPx(100);//同上-像素为单位 (V1.1.0删除) - refreshLayout.setFooterHeaderInsetStart(0);//设置 Header 起始位置偏移量 1.0.5 - refreshLayout.setFooterHeaderInsetStartPx(0);//同上-像素为单位 1.0.5 (V1.1.0删除) - refreshLayout.setFooterFooterInsetStart(0);//设置 Footer 起始位置偏移量 1.0.5 - refreshLayout.setFooterFooterInsetStartPx(0);//同上-像素为单位 1.0.5 (V1.1.0删除) + refreshLayout.setHeaderInsetStart(0);//设置 Header 起始位置偏移量 1.0.5 + refreshLayout.setHeaderInsetStartPx(0);//同上-像素为单位 1.0.5 (V1.1.0删除) + refreshLayout.setFooterInsetStart(0);//设置 Footer 起始位置偏移量 1.0.5 + refreshLayout.setFooterInsetStartPx(0);//同上-像素为单位 1.0.5 (V1.1.0删除) refreshLayout.setHeaderMaxDragRate(2);//最大显示下拉高度/Header标准高度 refreshLayout.setFooterMaxDragRate(2);//最大显示下拉高度/Footer标准高度 @@ -465,4 +465,4 @@ xml代码设置 |setEnableLastTime|boolean|是否显示上次更新时间(默认true)| |setTextSizeTitle|dimension|标题文字大小(默认16sp)| |setTextSizeTime|dimension|时间文字大小(默认12sp)| -|setLastUpdateText|string|手动设置更新时间,将不会自动更新时间| \ No newline at end of file +|setLastUpdateText|string|手动设置更新时间,将不会自动更新时间| From 87a2555b8d9e9e556759fac19b0f52516959bf49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A0=91=E6=9C=BE?= Date: Fri, 8 Jul 2022 17:44:30 +0800 Subject: [PATCH 06/67] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 35af04ea..ed9288f6 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,10 @@ SmartRefreshLayout以打造一个强大,稳定,成熟的下拉刷新框架 其他第三方的 [Ultra-Pull-To-Refresh](https://github.com/liaohuqiu/android-Ultra-Pull-To-Refresh)、[TwinklingRefreshLayout](https://github.com/lcodecorex/TwinklingRefreshLayout) 。 还集成了各种炫酷的 Header 和 Footer。 +## IOS版本 + +IOS版本:[链接](https://github.com/scwang90/SmartRefreshControl) + ## 国内加速 github 由于你懂的原因,下载速度缓慢,图片也无法查看,可以跳转 [国内镜像](https://gitee.com/scwang90/SmartRefreshLayout) @@ -35,6 +39,7 @@ github 由于你懂的原因,下载速度缓慢,图片也无法查看,可 - 支持 Header 和 Footer 交换混用 - 支持 AndroidX - 支持[横向刷新](https://github.com/scwang90/SmartRefreshHorizontal) + - 支持[IOS](https://github.com/scwang90/SmartRefreshControl) ## 传送门 From 4bea59fb2fcbeb6d07ad89d139725d7ee347ad88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A0=91=E6=9C=BE?= Date: Fri, 8 Jul 2022 17:46:20 +0800 Subject: [PATCH 07/67] Update README_EN.md --- README_EN.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README_EN.md b/README_EN.md index accfcd69..9e3faa77 100644 --- a/README_EN.md +++ b/README_EN.md @@ -114,14 +114,14 @@ It is recommended that you copy the source code into the project whenever you ne ``` // Note: There will be no default Header and Footer after subcontracting. It needs to be added manually! -implementation 'com.scwang.smart:refresh-layout-kernel:2.0.3' //core -implementation 'com.scwang.smart:refresh-header-classics:2.0.3' //ClassicsHeader -implementation 'com.scwang.smart:refresh-header-radar:2.0.3' //BezierRadarHeader -implementation 'com.scwang.smart:refresh-header-falsify:2.0.3' //FalsifyHeader -implementation 'com.scwang.smart:refresh-header-material:2.0.3' //MaterialHeader -implementation 'com.scwang.smart:refresh-header-two-level:2.0.3' //TwoLevelHeader -implementation 'com.scwang.smart:refresh-footer-ball:2.0.3' //BallPulseFooter -implementation 'com.scwang.smart:refresh-footer-classics:2.0.3' //ClassicsFooter +implementation 'com.scwang.smart:refresh-layout-kernel:2.0.5' //core +implementation 'com.scwang.smart:refresh-header-classics:2.0.5' //ClassicsHeader +implementation 'com.scwang.smart:refresh-header-radar:2.0.5' //BezierRadarHeader +implementation 'com.scwang.smart:refresh-header-falsify:2.0.5' //FalsifyHeader +implementation 'com.scwang.smart:refresh-header-material:2.0.5' //MaterialHeader +implementation 'com.scwang.smart:refresh-header-two-level:2.0.5' //TwoLevelHeader +implementation 'com.scwang.smart:refresh-footer-ball:2.0.5' //BallPulseFooter +implementation 'com.scwang.smart:refresh-footer-classics:2.0.5' //ClassicsFooter ``` From 72de71e33ae9dd29a3476422bfaf66a4151d80bb Mon Sep 17 00:00:00 2001 From: SCWANG Date: Fri, 19 Aug 2022 12:13:20 +0800 Subject: [PATCH 08/67] =?UTF-8?q?=20=C3=A4=E4=BC=98=E5=8C=96=E6=9D=90?= =?UTF-8?q?=E8=B4=A8=E5=9C=88=E5=9C=88=E7=9A=84=E5=88=B7=E6=96=B0=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../material/MaterialProgressDrawable.java | 60 +++++++++++-------- 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/MaterialProgressDrawable.java b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/MaterialProgressDrawable.java index 8a384f01..979f883d 100644 --- a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/MaterialProgressDrawable.java +++ b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/MaterialProgressDrawable.java @@ -114,6 +114,7 @@ public class MaterialProgressDrawable extends Drawable implements Animatable { private float mWidth; private float mHeight; boolean mFinishing; + boolean mIsRunning; public MaterialProgressDrawable(View parent) { mParent = parent; @@ -268,41 +269,48 @@ public int getOpacity() { @Override public boolean isRunning() { - final List animators = mAnimators; - final int N = animators.size(); - for (int i = 0; i < N; i++) { - final Animation animator = animators.get(i); - if (animator.hasStarted() && !animator.hasEnded()) { - return true; - } - } - return false; + return mIsRunning; +// final List animators = mAnimators; +// final int N = animators.size(); +// for (int i = 0; i < N; i++) { +// final Animation animator = animators.get(i); +// if (animator.hasStarted() && !animator.hasEnded()) { +// return true; +// } +// } +// return false; } @Override public void start() { - mAnimation.reset(); - mRing.storeOriginals(); - // Already showing some part of the ring - if (mRing.mEndTrim != mRing.mStartTrim) { - mFinishing = true; - mAnimation.setDuration(ANIMATION_DURATION / 2); - mParent.startAnimation(mAnimation); - } else { - mRing.setColorIndex(0); - mRing.resetOriginals(); - mAnimation.setDuration(ANIMATION_DURATION); - mParent.startAnimation(mAnimation); + if (!mIsRunning) { + mAnimation.reset(); + mRing.storeOriginals(); + // Already showing some part of the ring + if (mRing.mEndTrim != mRing.mStartTrim) { + mFinishing = true; + mAnimation.setDuration(ANIMATION_DURATION / 2); + mParent.startAnimation(mAnimation); + } else { + mRing.setColorIndex(0); + mRing.resetOriginals(); + mAnimation.setDuration(ANIMATION_DURATION); + mParent.startAnimation(mAnimation); + } + mIsRunning = true; } } @Override public void stop() { - mParent.clearAnimation(); - mRing.setColorIndex(0); - mRing.resetOriginals(); - showArrow(false); - setRotation(0); + if (mIsRunning) { + mParent.clearAnimation(); + mRing.setColorIndex(0); + mRing.resetOriginals(); + showArrow(false); + setRotation(0); + mIsRunning = false; + } } float getMinProgressArc(Ring ring) { From 1fdcaf2a29bba4d8e911725fce4f2e58c2ddbcd8 Mon Sep 17 00:00:00 2001 From: SCWANG Date: Fri, 2 Sep 2022 12:36:21 +0800 Subject: [PATCH 09/67] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/scwang/smart/refresh/layout/api/RefreshComponent.java | 2 +- .../com/scwang/smart/refresh/layout/simple/SimpleComponent.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java index a1491920..936a53cc 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java @@ -14,7 +14,7 @@ /** - * 刷新内部组件 + * 刷新组件 * Created by scwang on 2017/5/26. */ public interface RefreshComponent extends OnStateChangedListener { diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java index b8fbb668..5a1e1da8 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java @@ -24,7 +24,7 @@ /** * Component 初步实现 - * 实现 Header 和 Footer 时,继承 ComponentAbstract 的话可以少写很多接口方法 + * 实现 Header 和 Footer 时,继承 SimpleComponent 的话可以少写很多接口方法 * Created by scwang on 2018/2/6. */ public abstract class SimpleComponent extends RelativeLayout implements RefreshComponent { From 44e44a0bf0b567d0b14c6b03b038b854d921c21a Mon Sep 17 00:00:00 2001 From: SCWANG Date: Mon, 12 Sep 2022 12:42:45 +0800 Subject: [PATCH 10/67] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B7=BB=E5=8A=A0autoR?= =?UTF-8?q?efrsh=E7=BB=84=E4=BB=B6=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../smart/refresh/layout/api/RefreshComponent.java | 13 +++++++++++++ .../refresh/layout/simple/SimpleComponent.java | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java index 936a53cc..aa310c95 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java @@ -99,4 +99,17 @@ public interface RefreshComponent extends OnStateChangedListener { * @return 水平拖动需要消耗更多的时间和资源,所以如果不支持请返回false */ boolean isSupportHorizontalDrag(); + + /** + * Display refresh animation, Multifunction. + * 显示刷新动画并且触发刷新事件 + * @param delayed 开始延时 + * @param duration 拖拽动画持续时间 + * @param dragRate 拉拽的高度比率 + * @param animationOnly animation only 只有动画 + * @return If False is returned, this header does not support automatic refresh + * 返回 False 代表本Header不支持自动刷新 + */ + boolean autoRefresh(int delayed, int duration, float dragRate, boolean animationOnly); + } diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java index 5a1e1da8..c26f3378 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java @@ -188,4 +188,9 @@ public void onStateChanged(@NonNull RefreshLayout refreshLayout, @NonNull Refres public boolean setNoMoreData(boolean noMoreData) { return mWrappedInternal instanceof RefreshFooter && ((RefreshFooter) mWrappedInternal).setNoMoreData(noMoreData); } + + @Override + public boolean autoRefresh(int delayed, int duration, float dragRate, boolean animationOnly) { + return false; + } } From 2619abbb00846c913a96098d63a13b3f908f8933 Mon Sep 17 00:00:00 2001 From: SCWANG Date: Tue, 13 Sep 2022 12:46:25 +0800 Subject: [PATCH 11/67] =?UTF-8?q?=E4=BF=AE=E5=A4=8Ddemo=E4=B8=AD=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=AE=9E=E7=8E=B0autoRefresh=E7=9A=84=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activity/example/CustomExampleActivity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java index 85f080b5..b585bf2e 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java @@ -193,5 +193,10 @@ public void onHorizontalDrag(float percentX, int offsetX, int offsetMax) { public boolean isSupportHorizontalDrag() { return false; } + + @Override + public boolean autoRefresh(int delayed, int duration, float dragRate, boolean animationOnly) { + return false; + } } } From c8df47d273586367aad729a447cd0d74d06d45ec Mon Sep 17 00:00:00 2001 From: SCWANG Date: Sun, 18 Sep 2022 12:49:48 +0800 Subject: [PATCH 12/67] =?UTF-8?q?=E6=9C=89=E5=88=B7=E4=BC=98=E5=8C=96Mater?= =?UTF-8?q?ialHeader=E4=B8=AD=E7=9A=84=E4=BE=97=E8=AF=9D=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/scwang/smart/refresh/header/MaterialHeader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java index 913826e4..a3b3c465 100644 --- a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java +++ b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java @@ -230,7 +230,7 @@ public void onMoving(boolean isDragging, float percent, int offset, int height, @Override - public void onReleased(@NonNull RefreshLayout layout, int height, int maxDragHeight) { + public void onStartAnimator(@NonNull RefreshLayout refreshLayout, int height, int maxDragHeight) { mProgress.start(); } From 4377d87a0f796429b710e2a4e3cab8712431e422 Mon Sep 17 00:00:00 2001 From: SCWANG Date: Sat, 24 Sep 2022 12:53:46 +0800 Subject: [PATCH 13/67] =?UTF-8?q?=E5=88=9D=E6=AD=A5=E5=AE=9E=E7=8E=B0=20?= =?UTF-8?q?=20=20=20@Override?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../smart/refresh/header/MaterialHeader.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java index a3b3c465..b703e26e 100644 --- a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java +++ b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java @@ -1,5 +1,7 @@ package com.scwang.smart.refresh.header; +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; @@ -58,6 +60,7 @@ public class MaterialHeader extends SimpleComponent implements RefreshHeader { */ protected int mWaveHeight; protected int mHeadHeight; + protected int mInitHeight; protected Path mBezierPath; protected Paint mBezierPaint; protected RefreshState mState; @@ -184,6 +187,7 @@ public void onInitialized(@NonNull RefreshKernel kernel, int height, int maxDrag if (thisView.isInEditMode()) { mWaveHeight = mHeadHeight = height / 2; } + mInitHeight = height; } @Override @@ -372,4 +376,24 @@ public MaterialHeader setScrollableWhenRefreshing(boolean scrollable) { return this; } // + @Override + public boolean autoRefresh(int delayed, int duration, float dragRate, final boolean animationOnly) { + if (mShowBezierWave) { + //如果显示背景,使用旧版的 autoRefresh 动画 + return false; + } + final View circleView = mCircleView; + circleView.setAlpha(1); + circleView.setScaleX(0); + circleView.setScaleY(0); + circleView.setTranslationY(mInitHeight / 2f + mCircleDiameter / 2f); + circleView.animate().scaleX(1).scaleY(1).setStartDelay(delayed).setDuration(duration).setListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + mProgress.showArrow(false); + mProgress.start(); + } + }); + return true; + } } From 6a8760a22da0b69831a917f0db9203961fd9ae73 Mon Sep 17 00:00:00 2001 From: SCWANG Date: Mon, 3 Oct 2022 01:58:04 +0800 Subject: [PATCH 14/67] =?UTF-8?q?=E6=B7=BB=E5=8A=A0kernel=E5=86=85?= =?UTF-8?q?=E6=A0=B8=E5=8A=A8=E7=94=BB=E7=BB=93=E6=9D=9F=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../smart/refresh/header/MaterialHeader.java | 5 ++++- .../refresh/layout/SmartRefreshLayout.java | 21 +++++++++++++++++++ .../refresh/layout/api/RefreshKernel.java | 8 +++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java index b703e26e..de6e3e96 100644 --- a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java +++ b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java @@ -53,6 +53,7 @@ public class MaterialHeader extends SimpleComponent implements RefreshHeader { protected boolean mFinished; protected int mCircleDiameter; protected ImageView mCircleView; + protected RefreshKernel mKernel; protected MaterialProgressDrawable mProgress; /** @@ -187,6 +188,7 @@ public void onInitialized(@NonNull RefreshKernel kernel, int height, int maxDrag if (thisView.isInEditMode()) { mWaveHeight = mHeadHeight = height / 2; } + mKernel = kernel; mInitHeight = height; } @@ -390,8 +392,9 @@ public boolean autoRefresh(int delayed, int duration, float dragRate, final bool circleView.animate().scaleX(1).scaleY(1).setStartDelay(delayed).setDuration(duration).setListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { - mProgress.showArrow(false); +// mProgress.showArrow(false); mProgress.start(); + mKernel.onAutoRefreshAnimationEnd(animation, animationOnly); } }); return true; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java index 12be6f52..eddd573f 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java @@ -3960,6 +3960,27 @@ public RefreshKernel requestFloorBottomPullUpToCloseRate(float rate) { mTwoLevelBottomPullUpToCloseRate = rate; return this; } + + @Override + public RefreshKernel onAutoRefreshAnimationEnd(Animator animation, boolean animationOnly) { + if (animation != null && animation.getDuration() == 0) { + return this;//0 表示被取消 + } + reboundAnimator = null; + if (mRefreshHeader != null) { + if (mState != RefreshState.ReleaseToRefresh) { + this.setState(RefreshState.ReleaseToRefresh); + } + SmartRefreshLayout.this.setStateRefreshing(!animationOnly); + } else { + /* + * 2019-12-24 修复 mRefreshHeader=null 时状态错乱问题 + */ + this.setState(RefreshState.None); + } + return this; + } + // } // diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshKernel.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshKernel.java index 31301474..8389f0c6 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshKernel.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshKernel.java @@ -1,5 +1,6 @@ package com.scwang.smart.refresh.layout.api; +import android.animation.Animator; import android.animation.ValueAnimator; import android.support.annotation.NonNull; @@ -93,5 +94,12 @@ public interface RefreshKernel { * @return RefreshKernel */ RefreshKernel requestFloorBottomPullUpToCloseRate(float rate); + /** + * 当 autoRefresh 动画结束时,处理刷新状态的事件 + * @param animation 动画对象 + * @param animationOnly 是否只播放动画,不通知事件 + * @return RefreshKernel + */ + RefreshKernel onAutoRefreshAnimationEnd(Animator animation, boolean animationOnly); // } From 3b46a0ac221f5fa02f7ef004379aa4879503b405 Mon Sep 17 00:00:00 2001 From: SCWANG Date: Mon, 10 Oct 2022 21:36:48 +0800 Subject: [PATCH 15/67] =?UTF-8?q?=E8=81=94=E9=80=9ASmart=E7=9A=84autoRefre?= =?UTF-8?q?sh=E5=92=8CHeader=20=E7=9A=84autoRefresh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scwang/smart/refresh/layout/SmartRefreshLayout.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java index eddd573f..e30e9c11 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java @@ -3324,6 +3324,13 @@ public boolean autoRefreshAnimationOnly() { @Override public boolean autoRefresh(int delayed, final int duration, final float dragRate,final boolean animationOnly) { if (mState == RefreshState.None && isEnableRefreshOrLoadMore(mEnableRefresh)) { + setViceState(RefreshState.Refreshing); + if (mRefreshHeader.autoRefresh(delayed, duration, dragRate, animationOnly)) { + /* + * 2022-11-03 添加Header可以自己实现 autoRefresh ,返回true表示支持,返回False表示不支持,使用老版本的 autoRefresh + */ + return true; + } Runnable runnable = new Runnable() { @Override public void run() { @@ -3374,7 +3381,6 @@ public void onAnimationEnd(Animator animation) { reboundAnimator.start(); } }; - setViceState(RefreshState.Refreshing); if (delayed > 0) { mHandler.postDelayed(runnable, delayed); } else { From 3e8134f77df33e6ac02e9ca183730c6817018df2 Mon Sep 17 00:00:00 2001 From: SCWANG Date: Mon, 17 Oct 2022 23:16:23 +0800 Subject: [PATCH 16/67] =?UTF-8?q?=E4=BC=98=E5=8C=96Smart=20AutoRefresh=20?= =?UTF-8?q?=E5=8A=A8=E7=94=BB=E7=BB=93=E6=9D=9F=E7=9A=84=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../smart/refresh/layout/SmartRefreshLayout.java | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java index e30e9c11..2d23fe08 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java @@ -3361,21 +3361,7 @@ public void onAnimationUpdate(ValueAnimator animation) { reboundAnimator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { - if (animation != null && animation.getDuration() == 0) { - return;//0 表示被取消 - } - reboundAnimator = null; - if (mRefreshHeader != null) { - if (mState != RefreshState.ReleaseToRefresh) { - mKernel.setState(RefreshState.ReleaseToRefresh); - } - setStateRefreshing(!animationOnly); - } else { - /* - * 2019-12-24 修复 mRefreshHeader=null 时状态错乱问题 - */ - mKernel.setState(RefreshState.None); - } + mKernel.onAutoRefreshAnimationEnd(animation, animationOnly); } }); reboundAnimator.start(); From e672ad1b563d0c96311099d884839cc502c9606e Mon Sep 17 00:00:00 2001 From: SCWANG Date: Sun, 23 Oct 2022 21:54:35 +0800 Subject: [PATCH 17/67] =?UTF-8?q?=E5=86=B3=E5=AE=9A=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=8A=8AHeader=E7=9A=84autoRefresh=E6=94=B9=E6=88=90autoOpen?= =?UTF-8?q?=EF=BC=8C=E5=9B=A0=E4=B8=BAFooter=E4=B9=9F=E5=B0=86=E8=A6=81?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=EF=BC=8C=E5=8F=AF=E4=BB=A5=E5=85=AC=E7=94=A8?= =?UTF-8?q?=E8=BF=99=E4=B8=AA=E5=90=8D=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../refreshlayout/activity/example/CustomExampleActivity.java | 2 +- .../java/com/scwang/smart/refresh/header/MaterialHeader.java | 2 +- .../com/scwang/smart/refresh/layout/SmartRefreshLayout.java | 2 +- .../com/scwang/smart/refresh/layout/api/RefreshComponent.java | 2 +- .../com/scwang/smart/refresh/layout/simple/SimpleComponent.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java index b585bf2e..36548dbb 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java @@ -195,7 +195,7 @@ public boolean isSupportHorizontalDrag() { } @Override - public boolean autoRefresh(int delayed, int duration, float dragRate, boolean animationOnly) { + public boolean autoOpen(int delayed, int duration, float dragRate, boolean animationOnly) { return false; } } diff --git a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java index de6e3e96..3f1f635b 100644 --- a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java +++ b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java @@ -379,7 +379,7 @@ public MaterialHeader setScrollableWhenRefreshing(boolean scrollable) { } // @Override - public boolean autoRefresh(int delayed, int duration, float dragRate, final boolean animationOnly) { + public boolean autoOpen(int delayed, int duration, float dragRate, final boolean animationOnly) { if (mShowBezierWave) { //如果显示背景,使用旧版的 autoRefresh 动画 return false; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java index 2d23fe08..1dd0876b 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java @@ -3325,7 +3325,7 @@ public boolean autoRefreshAnimationOnly() { public boolean autoRefresh(int delayed, final int duration, final float dragRate,final boolean animationOnly) { if (mState == RefreshState.None && isEnableRefreshOrLoadMore(mEnableRefresh)) { setViceState(RefreshState.Refreshing); - if (mRefreshHeader.autoRefresh(delayed, duration, dragRate, animationOnly)) { + if (mRefreshHeader.autoOpen(delayed, duration, dragRate, animationOnly)) { /* * 2022-11-03 添加Header可以自己实现 autoRefresh ,返回true表示支持,返回False表示不支持,使用老版本的 autoRefresh */ diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java index aa310c95..28e81bac 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java @@ -110,6 +110,6 @@ public interface RefreshComponent extends OnStateChangedListener { * @return If False is returned, this header does not support automatic refresh * 返回 False 代表本Header不支持自动刷新 */ - boolean autoRefresh(int delayed, int duration, float dragRate, boolean animationOnly); + boolean autoOpen(int delayed, int duration, float dragRate, boolean animationOnly); } diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java index c26f3378..ce081f18 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java @@ -190,7 +190,7 @@ public boolean setNoMoreData(boolean noMoreData) { } @Override - public boolean autoRefresh(int delayed, int duration, float dragRate, boolean animationOnly) { + public boolean autoOpen(int delayed, int duration, float dragRate, boolean animationOnly) { return false; } } From 19720acf18b0ea183120de500dd8ceaabada853e Mon Sep 17 00:00:00 2001 From: SCWANG Date: Wed, 26 Oct 2022 23:39:57 +0800 Subject: [PATCH 18/67] =?UTF-8?q?=E5=8E=BB=E6=8E=89autoOpen=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E4=B8=AD=E7=9A=84=E5=BB=B6=E8=BF=9F=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activity/example/CustomExampleActivity.java | 2 +- .../com/scwang/smart/refresh/header/MaterialHeader.java | 6 +++--- .../scwang/smart/refresh/layout/api/RefreshComponent.java | 2 +- .../scwang/smart/refresh/layout/simple/SimpleComponent.java | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java index 36548dbb..188795c3 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java @@ -195,7 +195,7 @@ public boolean isSupportHorizontalDrag() { } @Override - public boolean autoOpen(int delayed, int duration, float dragRate, boolean animationOnly) { + public boolean autoOpen(int duration, float dragRate, boolean animationOnly) { return false; } } diff --git a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java index 3f1f635b..9510bee9 100644 --- a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java +++ b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java @@ -379,7 +379,7 @@ public MaterialHeader setScrollableWhenRefreshing(boolean scrollable) { } // @Override - public boolean autoOpen(int delayed, int duration, float dragRate, final boolean animationOnly) { + public boolean autoOpen(int duration, float dragRate, final boolean animationOnly) { if (mShowBezierWave) { //如果显示背景,使用旧版的 autoRefresh 动画 return false; @@ -389,10 +389,10 @@ public boolean autoOpen(int delayed, int duration, float dragRate, final boolean circleView.setScaleX(0); circleView.setScaleY(0); circleView.setTranslationY(mInitHeight / 2f + mCircleDiameter / 2f); - circleView.animate().scaleX(1).scaleY(1).setStartDelay(delayed).setDuration(duration).setListener(new AnimatorListenerAdapter() { + circleView.animate().scaleX(1).scaleY(1).setDuration(duration).setListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { -// mProgress.showArrow(false); + circleView.animate().setListener(null); mProgress.start(); mKernel.onAutoRefreshAnimationEnd(animation, animationOnly); } diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java index 28e81bac..67db9ae7 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java @@ -110,6 +110,6 @@ public interface RefreshComponent extends OnStateChangedListener { * @return If False is returned, this header does not support automatic refresh * 返回 False 代表本Header不支持自动刷新 */ - boolean autoOpen(int delayed, int duration, float dragRate, boolean animationOnly); + boolean autoOpen(int duration, float dragRate, boolean animationOnly); } diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java index ce081f18..e09dc1e6 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java @@ -190,7 +190,7 @@ public boolean setNoMoreData(boolean noMoreData) { } @Override - public boolean autoOpen(int delayed, int duration, float dragRate, boolean animationOnly) { + public boolean autoOpen(int duration, float dragRate, boolean animationOnly) { return false; } } From 148698456f1f31777433b4510bfa2de0d1817c5c Mon Sep 17 00:00:00 2001 From: SCWANG Date: Wed, 26 Oct 2022 23:45:47 +0800 Subject: [PATCH 19/67] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=81=97=E6=BC=8F?= =?UTF-8?q?=E7=9A=84=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/scwang/smart/refresh/layout/api/RefreshComponent.java | 1 - 1 file changed, 1 deletion(-) diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java index 67db9ae7..52f3a5fe 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java @@ -103,7 +103,6 @@ public interface RefreshComponent extends OnStateChangedListener { /** * Display refresh animation, Multifunction. * 显示刷新动画并且触发刷新事件 - * @param delayed 开始延时 * @param duration 拖拽动画持续时间 * @param dragRate 拉拽的高度比率 * @param animationOnly animation only 只有动画 From afc052abd1162d3ced7ba819a373b7dcb64adc6a Mon Sep 17 00:00:00 2001 From: SCWANG Date: Sun, 30 Oct 2022 16:55:38 +0800 Subject: [PATCH 20/67] =?UTF-8?q?kernel=20=E6=B7=BB=E5=8A=A0=20onAutoLoadM?= =?UTF-8?q?oreAnimationEnd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../refresh/layout/SmartRefreshLayout.java | 36 +++++++++++-------- .../refresh/layout/api/RefreshKernel.java | 7 ++++ 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java index 1dd0876b..fcea3113 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java @@ -3454,21 +3454,7 @@ public void onAnimationUpdate(ValueAnimator animation) { reboundAnimator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { - if (animation != null && animation.getDuration() == 0) { - return;//0 表示被取消 - } - reboundAnimator = null; - if (mRefreshFooter != null) { - if (mState != RefreshState.ReleaseToLoad) { - mKernel.setState(RefreshState.ReleaseToLoad); - } - setStateLoading(!animationOnly); - } else { - /* - * 2019-12-24 修复 mRefreshFooter=null 时状态错乱问题 - */ - mKernel.setState(RefreshState.None); - } + mKernel.onAutoLoadMoreAnimationEnd(animation, animationOnly); } }); reboundAnimator.start(); @@ -3973,6 +3959,26 @@ public RefreshKernel onAutoRefreshAnimationEnd(Animator animation, boolean anima return this; } + @Override + public RefreshKernel onAutoLoadMoreAnimationEnd(Animator animation, boolean animationOnly) { + if (animation != null && animation.getDuration() == 0) { + return this;//0 表示被取消 + } + reboundAnimator = null; + if (mRefreshFooter != null) { + if (mState != RefreshState.ReleaseToLoad) { + this.setState(RefreshState.ReleaseToLoad); + } + SmartRefreshLayout.this.setStateLoading(!animationOnly); + } else { + /* + * 2019-12-24 修复 mRefreshFooter=null 时状态错乱问题 + */ + this.setState(RefreshState.None); + } + return this; + } + // } // diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshKernel.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshKernel.java index 8389f0c6..43db68a9 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshKernel.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshKernel.java @@ -101,5 +101,12 @@ public interface RefreshKernel { * @return RefreshKernel */ RefreshKernel onAutoRefreshAnimationEnd(Animator animation, boolean animationOnly); + /** + * 当 autoLoadMore 动画结束时,处理刷新状态的事件 + * @param animation 动画对象 + * @param animationOnly 是否只播放动画,不通知事件 + * @return RefreshKernel + */ + RefreshKernel onAutoLoadMoreAnimationEnd(Animator animation, boolean animationOnly); // } From 720cc75dcc45ec88195b34ffdb657919f4a58d60 Mon Sep 17 00:00:00 2001 From: SCWANG Date: Wed, 2 Nov 2022 23:02:14 +0800 Subject: [PATCH 21/67] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=B0=E7=9A=84autoO?= =?UTF-8?q?pen=E7=AE=97=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../smart/refresh/layout/SmartRefreshLayout.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java index fcea3113..5d7f98f4 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java @@ -3324,13 +3324,6 @@ public boolean autoRefreshAnimationOnly() { @Override public boolean autoRefresh(int delayed, final int duration, final float dragRate,final boolean animationOnly) { if (mState == RefreshState.None && isEnableRefreshOrLoadMore(mEnableRefresh)) { - setViceState(RefreshState.Refreshing); - if (mRefreshHeader.autoOpen(delayed, duration, dragRate, animationOnly)) { - /* - * 2022-11-03 添加Header可以自己实现 autoRefresh ,返回true表示支持,返回False表示不支持,使用老版本的 autoRefresh - */ - return true; - } Runnable runnable = new Runnable() { @Override public void run() { @@ -3345,6 +3338,13 @@ public void run() { mLastTouchX = thisView.getMeasuredWidth() / 2f; mKernel.setState(RefreshState.PullDownToRefresh); + if (mRefreshHeader != null && mRefreshHeader.autoOpen(duration, dragRate, animationOnly)) { + /* + * 2022-11-03 添加Header可以自己实现 autoOpen ,返回true表示支持,返回False表示不支持,使用老版本的 autoOpen + */ + return; + } + final float height = mHeaderHeight == 0 ? mHeaderTriggerRate : mHeaderHeight; final float dragHeight = dragRate < 10 ? height * dragRate : dragRate; reboundAnimator = ValueAnimator.ofInt(mSpinner, (int) (dragHeight)); @@ -3367,6 +3367,7 @@ public void onAnimationEnd(Animator animation) { reboundAnimator.start(); } }; + setViceState(RefreshState.Refreshing); if (delayed > 0) { mHandler.postDelayed(runnable, delayed); } else { From c0f84faa50e57a896eeba6a9ef77a047e715a224 Mon Sep 17 00:00:00 2001 From: SCWANG Date: Fri, 4 Nov 2022 22:45:16 +0800 Subject: [PATCH 22/67] =?UTF-8?q?=E5=88=9D=E6=AD=A5=E5=AE=8C=E6=88=90autoO?= =?UTF-8?q?pen=E5=AE=8C=E6=95=B4=E7=AE=97=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scwang/smart/refresh/layout/SmartRefreshLayout.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java index 5d7f98f4..5d1850a3 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java @@ -3439,6 +3439,13 @@ public void run() { mLastTouchX = thisView.getMeasuredWidth() / 2f; mKernel.setState(RefreshState.PullUpToLoad); + if (mRefreshFooter != null && mRefreshFooter.autoOpen(duration, dragRate, animationOnly)) { + /* + * 2022-11-03 添加Header可以自己实现 autoOpen ,返回true表示支持,返回False表示不支持,使用老版本的 autoOpen + */ + return; + } + final float height = mFooterHeight == 0 ? mFooterTriggerRate : mFooterHeight; final float dragHeight = dragRate < 10 ? dragRate * height : dragRate; reboundAnimator = ValueAnimator.ofInt(mSpinner, - (int) (dragHeight)); From 5b2e91711bbc50337062c2e583916820301214b2 Mon Sep 17 00:00:00 2001 From: SCWANG Date: Thu, 10 Nov 2022 13:39:11 +0800 Subject: [PATCH 23/67] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=8B=B1=E6=96=87IOS?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README_EN.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README_EN.md b/README_EN.md index 9e3faa77..b4aa37c0 100644 --- a/README_EN.md +++ b/README_EN.md @@ -10,6 +10,10 @@ SmartRefreshLayout's goal is to build a strong, stable and mature pull-down refresh layout framework, and to integrate all kinds of cool, diverse, practical and beautiful Headers and Footers. +## For IOS + +SmartRefreshControl:[Link](https://github.com/scwang90/SmartRefreshControl) + ## Features - Support multi-touch. From a5f3944e15ecbd7ef9ab9bd856ec020ff0f98480 Mon Sep 17 00:00:00 2001 From: firdausmaulan Date: Tue, 15 Nov 2022 20:17:01 +0700 Subject: [PATCH 24/67] Update dependencies & migrating to androidx --- README.md | 2 +- README_EN.md | 2 +- app/build.gradle | 47 +++++++------------ app/src/main/AndroidManifest.xml | 3 +- .../java/com/scwang/refreshlayout/App.java | 11 +---- .../activity/FragmentActivity.java | 12 +++-- .../activity/IndexMainActivity.java | 22 +++++---- .../example/AssignCodeExampleActivity.java | 8 ++-- .../example/AssignDefaultExampleActivity.java | 6 +-- .../example/AssignXmlExampleActivity.java | 6 +-- .../example/BasicExampleActivity.java | 11 +++-- .../example/CustomExampleActivity.java | 6 +-- .../activity/example/I18nExampleActivity.java | 9 ++-- .../example/ListenerExampleActivity.java | 6 +-- .../example/NestedLayoutExampleActivity.java | 15 +++--- .../example/OverScrollExampleActivity.java | 4 +- .../example/SnapHelperExampleActivity.java | 17 +++---- .../practice/BannerPracticeActivity.java | 16 +++---- .../practice/FeedListPracticeActivity.java | 4 +- .../practice/ProfilePracticeActivity.java | 4 +- .../practice/QQBrowserPracticeActivity.java | 4 +- .../practice/RepastPracticeActivity.java | 12 ++--- .../practice/WebViewPracticeActivity.java | 4 +- .../practice/WeiboPracticeActivity.java | 12 +++-- .../style/BezierCircleStyleActivity.java | 19 ++++---- .../style/BezierRadarStyleActivity.java | 18 +++---- .../activity/style/ClassicsStyleActivity.java | 22 +++++---- .../activity/style/DeliveryStyleActivity.java | 14 +++--- .../activity/style/DropBoxStyleActivity.java | 18 +++---- .../style/FlyRefreshStyleActivity.java | 27 ++++++----- .../style/FunGameBattleCityStyleActivity.java | 18 +++---- .../style/FunGameHitBlockStyleActivity.java | 18 +++---- .../activity/style/MaterialStyleActivity.java | 18 +++---- .../activity/style/PhoenixStyleActivity.java | 24 +++++----- .../style/StoreHouseStyleActivity.java | 18 +++---- .../activity/style/TaurusStyleActivity.java | 24 +++++----- .../style/WaterDropStyleActivity.java | 18 +++---- .../style/WaveSwipeStyleActivity.java | 18 +++---- .../adapter/BaseRecyclerAdapter.java | 7 +-- .../adapter/SmartViewHolder.java | 6 +-- .../example/BottomSheetExampleFragment.java | 20 ++++---- .../DisallowInterceptExampleFragment.java | 11 +++-- .../example/EmptyLayoutExampleFragment.java | 18 +++---- .../EmptyLayoutExampleFragmentInner.java | 18 +++---- .../EmptyLayoutExampleFragmentOuter.java | 18 +++---- .../example/FlexBoxLayoutManagerFragment.java | 11 +++-- .../example/HorizontalExampleFragment.java | 10 ++-- .../example/NestedScrollExampleFragment.java | 20 ++++---- .../NestedScrollExampleFragmentIntegral.java | 22 ++++----- .../NestedScrollExampleFragmentViewPager.java | 24 +++++----- .../example/NoMoreDataExampleFragment.java | 14 +++--- .../example/PureScrollExampleFragment.java | 18 +++---- .../PureScrollExampleFragmentFooter.java | 18 +++---- .../PureScrollExampleFragmentHeader.java | 18 +++---- .../example/SpecifyStyleExampleFragment.java | 18 +++---- .../example/StaggeredGridExampleFragment.java | 10 ++-- .../example/ThreeLevelExampleFragment.java | 10 ++-- .../example/ViewPagerExampleFragment.java | 25 +++++----- .../index/RefreshExampleFragment.java | 18 +++---- .../index/RefreshPracticeFragment.java | 18 +++---- .../fragment/index/RefreshStylesFragment.java | 18 +++---- .../practice/InstantPracticeFragment.java | 10 ++-- .../practice/SecondFloorPracticeFragment.java | 10 ++-- .../practice/TwoLevelPracticeFragment.java | 8 ++-- .../refreshlayout/util/DynamicTimeFormat.java | 2 +- .../refreshlayout/util/StatusBarUtil.java | 6 ++- .../widget/RefreshContentHorizontal.java | 2 +- .../widget/ScrollBoundaryHorizontal.java | 2 +- .../widget/SmartRefreshHorizontal.java | 4 +- app/src/main/res/drawable/ic_list_divider.xml | 2 +- .../layout/activity_example_assign_code.xml | 2 +- .../activity_example_assign_default.xml | 2 +- .../layout/activity_example_assign_xml.xml | 2 +- .../res/layout/activity_example_basic.xml | 6 +-- .../res/layout/activity_example_custom.xml | 2 +- .../main/res/layout/activity_example_i18n.xml | 2 +- .../res/layout/activity_example_listener.xml | 2 +- .../layout/activity_example_overscroll.xml | 2 +- .../res/layout/activity_example_region.xml | 4 +- .../layout/activity_example_snaphelper.xml | 6 +-- .../main/res/layout/activity_experiment.xml | 9 ++-- .../main/res/layout/activity_fly_refresh.xml | 18 +++---- .../main/res/layout/activity_index_main.xml | 7 +-- .../res/layout/activity_practice_banner.xml | 4 +- .../res/layout/activity_practice_feedlist.xml | 6 +-- .../res/layout/activity_practice_profile.xml | 2 +- .../layout/activity_practice_qqbrowser.xml | 2 +- .../res/layout/activity_practice_repast.xml | 4 +- .../res/layout/activity_practice_webview.xml | 2 +- .../res/layout/activity_practice_weibo.xml | 42 ++++++++--------- .../main/res/layout/activity_style_bezier.xml | 4 +- .../main/res/layout/activity_style_circle.xml | 4 +- .../res/layout/activity_style_classics.xml | 4 +- .../res/layout/activity_style_delivery.xml | 4 +- .../res/layout/activity_style_dropbox.xml | 4 +- .../activity_style_fungame_battlecity.xml | 4 +- .../activity_style_fungame_hitblock.xml | 4 +- .../res/layout/activity_style_material.xml | 4 +- .../res/layout/activity_style_phoenix.xml | 18 +++---- .../res/layout/activity_style_storehouse.xml | 4 +- .../main/res/layout/activity_style_taurus.xml | 18 +++---- .../res/layout/activity_style_water_drop.xml | 4 +- .../res/layout/activity_style_wave_swipe.xml | 4 +- .../layout/common_independence_recycler.xml | 4 +- .../layout/fragment_example_bottom_sheet.xml | 4 +- .../fragment_example_disallow_intercept.xml | 6 +-- .../layout/fragment_example_emptylayout.xml | 4 +- .../fragment_example_emptylayout_inner.xml | 4 +- .../fragment_example_emptylayout_outer.xml | 4 +- .../layout/fragment_example_horizontal.xml | 6 +-- .../layout/fragment_example_nestedscroll.xml | 18 +++---- ...fragment_example_nestedscroll_integral.xml | 28 +++++------ ...agment_example_nestedscroll_view_pager.xml | 20 ++++---- .../layout/fragment_example_purescroll.xml | 4 +- .../fragment_example_purescroll_header.xml | 4 +- .../fragment_example_staggered_grid.xml | 6 +-- .../layout/fragment_example_three_level.xml | 4 +- .../res/layout/fragment_example_viewpager.xml | 6 +-- .../fragment_flexbox_layout_manager.xml | 4 +- .../layout/fragment_no_more_data_example.xml | 6 +-- .../res/layout/fragment_practice_instant.xml | 8 ++-- .../layout/fragment_practice_second_floor.xml | 8 ++-- .../res/layout/fragment_practice_twolevel.xml | 6 +-- .../res/layout/fragment_refresh_example.xml | 8 ++-- .../res/layout/fragment_refresh_practive.xml | 4 +- .../res/layout/fragment_refresh_styles.xml | 4 +- .../res/layout/item_example_snap_helper.xml | 4 +- .../main/res/layout/item_practice_repast.xml | 3 +- .../main/res/layout/item_style_delivery.xml | 4 +- build.gradle | 11 ++--- gradle.properties | 3 ++ gradle/wrapper/gradle-wrapper.properties | 2 +- refresh-drawable-paint/build.gradle | 13 ++--- .../smart/drawable/ProgressDrawable.java | 3 +- refresh-drawable-path/build.gradle | 13 ++--- .../scwang/smart/drawable/PathsDrawable.java | 2 +- .../smart/drawable/path/PathParser.java | 2 +- refresh-footer-ball/build.gradle | 13 ++--- .../smart/refresh/footer/BallPulseFooter.java | 10 ++-- refresh-footer-classics/build.gradle | 13 ++--- .../smart/refresh/classics/ArrowDrawable.java | 2 +- .../refresh/classics/ClassicsAbstract.java | 11 +++-- .../smart/refresh/footer/ClassicsFooter.java | 4 +- refresh-footer/build.gradle | 11 ++--- refresh-header-classics/build.gradle | 13 ++--- .../smart/refresh/header/ClassicsHeader.java | 11 +++-- refresh-header-falsify/build.gradle | 11 ++--- .../smart/refresh/header/FalsifyFooter.java | 2 +- .../smart/refresh/header/FalsifyHeader.java | 2 +- .../header/falsify/FalsifyAbstract.java | 2 +- refresh-header-material/build.gradle | 11 ++--- .../smart/refresh/header/MaterialHeader.java | 11 +++-- .../header/material/CircleImageView.java | 2 +- .../material/MaterialProgressDrawable.java | 10 ++-- refresh-header-radar/build.gradle | 11 ++--- .../refresh/header/BezierRadarHeader.java | 8 ++-- refresh-header-two-level/build.gradle | 11 ++--- .../smart/refresh/header/TwoLevelHeader.java | 7 +-- .../header/listener/OnTwoLevelListener.java | 2 +- refresh-header/build.gradle | 15 ++---- .../refresh/header/BezierCircleHeader.java | 6 +-- .../smart/refresh/header/DeliveryHeader.java | 6 +-- .../smart/refresh/header/DropBoxHeader.java | 8 ++-- .../refresh/header/FlyRefreshHeader.java | 9 ++-- .../header/FunGameBattleCityHeader.java | 2 +- .../refresh/header/FunGameHitBlockHeader.java | 4 +- .../smart/refresh/header/PhoenixHeader.java | 4 +- .../refresh/header/StoreHouseHeader.java | 4 +- .../smart/refresh/header/TaurusHeader.java | 4 +- .../smart/refresh/header/WaterDropHeader.java | 4 +- .../smart/refresh/header/WaveSwipeHeader.java | 8 ++-- .../header/flyrefresh/MountainSceneView.java | 8 ++-- .../refresh/header/fungame/FunGameBase.java | 4 +- .../refresh/header/fungame/FunGameView.java | 6 +-- .../header/waterdrop/WaterDropView.java | 2 +- .../refresh/header/waveswipe/WaveView.java | 2 +- .../smartrefresh/header/DeliveryHeader.java | 2 +- .../smartrefresh/header/DropBoxHeader.java | 2 +- refresh-layout-kernel/build.gradle | 12 ++--- .../refresh/layout/SmartRefreshLayout.java | 23 ++++----- .../refresh/layout/api/RefreshComponent.java | 15 +++--- .../refresh/layout/api/RefreshContent.java | 2 +- .../refresh/layout/api/RefreshFooter.java | 9 ++-- .../refresh/layout/api/RefreshKernel.java | 2 +- .../refresh/layout/api/RefreshLayout.java | 12 ++--- .../listener/DefaultRefreshFooterCreator.java | 2 +- .../listener/DefaultRefreshHeaderCreator.java | 2 +- .../listener/DefaultRefreshInitializer.java | 2 +- .../layout/listener/OnLoadMoreListener.java | 2 +- .../layout/listener/OnRefreshListener.java | 2 +- .../listener/OnStateChangedListener.java | 11 +++-- .../layout/simple/SimpleComponent.java | 6 +-- .../layout/simple/SimpleMultiListener.java | 2 +- .../smart/refresh/layout/util/DesignUtil.java | 5 +- .../smart/refresh/layout/util/SmartUtil.java | 15 +++--- .../layout/wrapper/RefreshContentWrapper.java | 9 ++-- .../src/main/res/values/attrs.xml | 4 +- refresh-layout/build.gradle | 12 ++--- .../layout/SmartRefreshLayout.java | 4 +- .../api/DefaultRefreshFooterCreator.java | 2 +- .../api/DefaultRefreshHeaderCreator.java | 2 +- .../layout/api/DefaultRefreshInitializer.java | 2 +- .../layout/api/OnTwoLevelListener.java | 2 +- .../layout/api/RefreshInternal.java | 2 +- .../layout/api/RefreshLayout.java | 4 +- .../layout/footer/BallPulseFooter.java | 2 +- .../layout/header/TwoLevelHeader.java | 4 +- .../layout/internal/InternalAbstract.java | 4 +- .../layout/listener/OnLoadMoreListener.java | 2 +- .../layout/listener/OnRefreshListener.java | 2 +- .../listener/OnStateChangedListener.java | 13 ++--- .../listener/SimpleMultiPurposeListener.java | 2 +- 212 files changed, 904 insertions(+), 939 deletions(-) diff --git a/README.md b/README.md index ed9288f6..250f0d76 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,7 @@ android.enableJetifier=true - - + android:label="@string/title_activity_index_main" + android:exported="true"> diff --git a/app/src/main/java/com/scwang/refreshlayout/App.java b/app/src/main/java/com/scwang/refreshlayout/App.java index 6cd64651..6f59a4b6 100644 --- a/app/src/main/java/com/scwang/refreshlayout/App.java +++ b/app/src/main/java/com/scwang/refreshlayout/App.java @@ -2,8 +2,8 @@ import android.app.Application; import android.content.Context; -import android.support.annotation.NonNull; -import android.support.v7.app.AppCompatDelegate; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatDelegate; import com.scwang.refreshlayout.util.DynamicTimeFormat; import com.scwang.smartrefresh.layout.SmartRefreshLayout; @@ -15,7 +15,6 @@ import com.scwang.smartrefresh.layout.api.RefreshLayout; import com.scwang.smartrefresh.layout.footer.ClassicsFooter; import com.scwang.smartrefresh.layout.header.ClassicsHeader; -import com.squareup.leakcanary.LeakCanary; /** * @@ -62,11 +61,5 @@ public RefreshFooter createRefreshFooter(@NonNull Context context, @NonNull Refr @Override public void onCreate() { super.onCreate(); - if (LeakCanary.isInAnalyzerProcess(this)) { - // This process is dedicated to LeakCanary for heap analysis. - // You should not init your app in this process. - return; - } - LeakCanary.install(this); } } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/FragmentActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/FragmentActivity.java index 2a5346c9..67369455 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/FragmentActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/FragmentActivity.java @@ -4,11 +4,13 @@ import android.content.Context; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentTransaction; -import android.support.v7.app.AppCompatActivity; +import androidx.annotation.Nullable; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentTransaction; + import android.widget.FrameLayout; import java.util.HashMap; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/IndexMainActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/IndexMainActivity.java index 70ce8d49..26885693 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/IndexMainActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/IndexMainActivity.java @@ -2,16 +2,18 @@ import android.animation.ValueAnimator; import android.os.Bundle; -import android.support.annotation.IdRes; -import android.support.annotation.NonNull; -import android.support.design.widget.BottomNavigationView; -import android.support.design.widget.BottomNavigationView.OnNavigationItemSelectedListener; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentStatePagerAdapter; -import android.support.v4.view.ViewPager; -import android.support.v7.app.AppCompatActivity; + +import androidx.annotation.IdRes; +import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.FragmentStatePagerAdapter; +import androidx.viewpager.widget.ViewPager; + import android.view.MenuItem; +import com.google.android.material.bottomnavigation.BottomNavigationView; +import com.google.android.material.navigation.NavigationBarView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.fragment.index.RefreshExampleFragment; import com.scwang.refreshlayout.fragment.index.RefreshPracticeFragment; @@ -20,7 +22,7 @@ import java.lang.reflect.Field; -public class IndexMainActivity extends AppCompatActivity implements OnNavigationItemSelectedListener { +public class IndexMainActivity extends AppCompatActivity implements NavigationBarView.OnItemSelectedListener { private enum TabFragment { practice(R.id.navigation_practice, RefreshPracticeFragment.class), @@ -72,7 +74,7 @@ protected void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_index_main); final BottomNavigationView navigation = findViewById(R.id.navigation); - navigation.setOnNavigationItemSelectedListener(this); + navigation.setOnItemSelectedListener(this); ViewPager viewPager = findViewById(R.id.content); viewPager.setAdapter(new FragmentStatePagerAdapter(getSupportFragmentManager()) { diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignCodeExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignCodeExampleActivity.java index c277547e..488a617e 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignCodeExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignCodeExampleActivity.java @@ -1,9 +1,11 @@ package com.scwang.refreshlayout.activity.example; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; +import androidx.appcompat.widget.Toolbar; + +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; + import com.scwang.refreshlayout.R; import com.scwang.smartrefresh.header.MaterialHeader; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignDefaultExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignDefaultExampleActivity.java index 2e2a184a..8247c33b 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignDefaultExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignDefaultExampleActivity.java @@ -2,9 +2,9 @@ import android.content.Context; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.util.DynamicTimeFormat; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignXmlExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignXmlExampleActivity.java index b31e904c..2aeba794 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignXmlExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignXmlExampleActivity.java @@ -1,9 +1,9 @@ package com.scwang.refreshlayout.activity.example; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import com.scwang.refreshlayout.R; import com.scwang.smartrefresh.layout.api.RefreshLayout; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java index 25981c63..34a226bc 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java @@ -1,16 +1,17 @@ package com.scwang.refreshlayout.activity.example; import android.os.Bundle; -import android.support.design.widget.BottomSheetDialog; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import androidx.appcompat.widget.Toolbar; import android.view.View; import android.widget.AbsListView; import android.widget.ListView; import android.widget.Toast; +import com.google.android.material.bottomsheet.BottomSheetDialog; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java index 188795c3..4cebeb77 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java @@ -2,9 +2,9 @@ import android.content.Context; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import android.util.AttributeSet; import android.view.Gravity; import android.view.View; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java index b12967a1..44840b70 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java @@ -5,10 +5,11 @@ import android.content.res.Resources; import android.os.Build; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.annotation.StringRes; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; + +import androidx.annotation.Nullable; +import androidx.annotation.StringRes; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import android.util.DisplayMetrics; import android.view.View; import android.widget.AdapterView; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/ListenerExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/ListenerExampleActivity.java index 097fb76c..73377b3a 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/ListenerExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/ListenerExampleActivity.java @@ -1,9 +1,9 @@ package com.scwang.refreshlayout.activity.example; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import android.text.method.ScrollingMovementMethod; import android.widget.TextView; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/NestedLayoutExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/NestedLayoutExampleActivity.java index 9c6d1acd..d1d762cd 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/NestedLayoutExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/NestedLayoutExampleActivity.java @@ -1,13 +1,14 @@ package com.scwang.refreshlayout.activity.example; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; + +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.util.Log; import android.view.View; import android.widget.AdapterView; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/OverScrollExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/OverScrollExampleActivity.java index 96b4d39f..d73fc707 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/OverScrollExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/OverScrollExampleActivity.java @@ -1,8 +1,8 @@ package com.scwang.refreshlayout.activity.example; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import android.webkit.WebView; import android.webkit.WebViewClient; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/SnapHelperExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/SnapHelperExampleActivity.java index a35c1649..6d3692c8 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/SnapHelperExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/SnapHelperExampleActivity.java @@ -1,14 +1,15 @@ package com.scwang.refreshlayout.activity.example; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.PagerSnapHelper; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.SnapHelper; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.PagerSnapHelper; +import androidx.recyclerview.widget.RecyclerView; +import androidx.recyclerview.widget.SnapHelper; + +import androidx.appcompat.widget.Toolbar; import android.view.View; import android.widget.Switch; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/BannerPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/BannerPracticeActivity.java index 752b3f5a..232d73e3 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/BannerPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/BannerPracticeActivity.java @@ -3,12 +3,12 @@ import android.content.Context; import android.os.Build; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.widget.ImageView; @@ -34,9 +34,7 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; - -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; - +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; /** * 广告轮播-Banner */ diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/FeedListPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/FeedListPracticeActivity.java index 32ef413b..91f78459 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/FeedListPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/FeedListPracticeActivity.java @@ -1,8 +1,8 @@ package com.scwang.refreshlayout.activity.practice; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import com.scwang.refreshlayout.R; import com.scwang.smartrefresh.layout.api.RefreshLayout; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/ProfilePracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/ProfilePracticeActivity.java index 8ca0c915..ad60b21a 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/ProfilePracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/ProfilePracticeActivity.java @@ -1,8 +1,8 @@ package com.scwang.refreshlayout.activity.practice; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import android.view.View; import com.scwang.refreshlayout.R; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/QQBrowserPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/QQBrowserPracticeActivity.java index 327a609f..153efa24 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/QQBrowserPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/QQBrowserPracticeActivity.java @@ -2,8 +2,8 @@ import android.annotation.SuppressLint; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import android.view.View; import android.webkit.WebView; import android.webkit.WebViewClient; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/RepastPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/RepastPracticeActivity.java index 006cf76e..2997561d 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/RepastPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/RepastPracticeActivity.java @@ -1,12 +1,12 @@ package com.scwang.refreshlayout.activity.practice; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.View; import android.widget.Toast; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WebViewPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/WebViewPracticeActivity.java index 5fd3d6d2..aec206a6 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WebViewPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/WebViewPracticeActivity.java @@ -2,8 +2,8 @@ import android.annotation.SuppressLint; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import android.webkit.WebView; import android.webkit.WebViewClient; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java index 29e09cc0..7e090a4b 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java @@ -1,11 +1,13 @@ package com.scwang.refreshlayout.activity.practice; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v4.content.ContextCompat; -import android.support.v4.widget.NestedScrollView; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.content.ContextCompat; +import androidx.core.widget.NestedScrollView; + +import androidx.appcompat.widget.Toolbar; import android.view.View; import android.widget.Toast; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java index 1d89a735..590bbdd0 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java @@ -2,14 +2,14 @@ import android.os.Build; import android.os.Bundle; -import android.support.annotation.StringRes; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.StringRes; +import androidx.core.content.ContextCompat; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.View; import android.widget.AdapterView; @@ -23,7 +23,8 @@ import java.util.List; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; + public class BezierCircleStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java index c8ec2d7f..57d9421b 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java @@ -2,14 +2,14 @@ import android.os.Build; import android.os.Bundle; -import android.support.annotation.StringRes; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.StringRes; +import androidx.core.content.ContextCompat; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.View; import android.widget.AdapterView; @@ -24,7 +24,7 @@ import java.util.List; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; public class BezierRadarStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java index 8909cba2..fa9c7549 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java @@ -4,15 +4,17 @@ import android.graphics.drawable.LayerDrawable; import android.os.Build; import android.os.Bundle; -import android.support.annotation.StringRes; -import android.support.graphics.drawable.VectorDrawableCompat; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.StringRes; + +import androidx.core.content.ContextCompat; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat; + +import androidx.appcompat.widget.Toolbar; import android.view.View; import android.widget.AdapterView; import android.widget.ImageView; @@ -34,7 +36,7 @@ import java.util.Random; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; public class ClassicsStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java index 0bee9b44..c7c149ba 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java @@ -2,13 +2,13 @@ import android.os.Build; import android.os.Bundle; -import android.support.annotation.StringRes; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.StringRes; +import androidx.core.content.ContextCompat; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.View; import android.view.Window; import android.widget.AdapterView; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java index 5733c383..13b9b0c5 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java @@ -2,14 +2,14 @@ import android.os.Build; import android.os.Bundle; -import android.support.annotation.StringRes; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.StringRes; +import androidx.core.content.ContextCompat; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.View; import android.widget.AdapterView; @@ -21,7 +21,7 @@ import java.util.Arrays; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; public class DropBoxStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java index 233f4643..dbbc6b91 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java @@ -11,15 +11,13 @@ import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.OvalShape; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.design.widget.AppBarLayout; -import android.support.design.widget.CollapsingToolbarLayout; -import android.support.design.widget.FloatingActionButton; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; + +import androidx.core.content.ContextCompat; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -30,6 +28,9 @@ import android.widget.ImageView; import android.widget.TextView; +import com.google.android.material.appbar.AppBarLayout; +import com.google.android.material.appbar.CollapsingToolbarLayout; +import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.util.StatusBarUtil; import com.scwang.smartrefresh.header.FlyRefreshHeader; @@ -48,7 +49,7 @@ import java.util.Date; import java.util.Locale; -import jp.wasabeef.recyclerview.animators.BaseItemAnimator; +// import jp.wasabeef.recyclerview.animators.BaseItemAnimator; public class FlyRefreshStyleActivity extends AppCompatActivity { @@ -143,7 +144,7 @@ public void onHeaderMoving(RefreshHeader header, boolean isDragging, float perce mListView = findViewById(R.id.recyclerView); mListView.setLayoutManager(mLayoutManager); mListView.setAdapter(mAdapter); - mListView.setItemAnimator(new SampleItemAnimator()); + // mListView.setItemAnimator(new SampleItemAnimator()); mToolbarLayout = findViewById(R.id.toolbarLayout); mActionButton = findViewById(R.id.fab); /* @@ -307,7 +308,7 @@ public static class ItemData { } } - public static class SampleItemAnimator extends BaseItemAnimator { + /*public static class SampleItemAnimator extends BaseItemAnimator { @Override protected void preAnimateAddImpl(RecyclerView.ViewHolder holder) { @@ -341,7 +342,7 @@ protected void animateAddImpl(final RecyclerView.ViewHolder holder) { animator.start(); } - } + }*/ public static class ElasticOutInterpolator implements Interpolator { diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java index 19836885..1ce2aa9b 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java @@ -2,14 +2,14 @@ import android.os.Build; import android.os.Bundle; -import android.support.annotation.StringRes; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.StringRes; +import androidx.core.content.ContextCompat; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.View; import android.widget.AdapterView; @@ -23,7 +23,7 @@ import java.util.List; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; public class FunGameBattleCityStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java index b2c404fb..f647de03 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java @@ -2,14 +2,14 @@ import android.os.Build; import android.os.Bundle; -import android.support.annotation.StringRes; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.StringRes; +import androidx.core.content.ContextCompat; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.View; import android.widget.AdapterView; @@ -23,7 +23,7 @@ import java.util.List; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; public class FunGameHitBlockStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java index 895ae767..5e6621e7 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java @@ -2,14 +2,14 @@ import android.os.Build; import android.os.Bundle; -import android.support.annotation.StringRes; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.StringRes; +import androidx.core.content.ContextCompat; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.View; import android.widget.AdapterView; @@ -24,7 +24,7 @@ import java.util.List; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; public class MaterialStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java index c06c3399..9b4cc036 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java @@ -3,17 +3,17 @@ import android.content.res.ColorStateList; import android.os.Build; import android.os.Bundle; -import android.support.annotation.StringRes; -import android.support.design.widget.AppBarLayout; -import android.support.design.widget.CollapsingToolbarLayout; -import android.support.design.widget.FloatingActionButton; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.StringRes; +import com.google.android.material.appbar.AppBarLayout; +import com.google.android.material.appbar.CollapsingToolbarLayout; +import com.google.android.material.floatingactionbutton.FloatingActionButton; +import androidx.core.content.ContextCompat; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.View; import android.widget.AdapterView; @@ -27,7 +27,7 @@ import java.util.List; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; public class PhoenixStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java index a3f0fad6..c8cfed56 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java @@ -3,14 +3,14 @@ import android.graphics.Point; import android.os.Build; import android.os.Bundle; -import android.support.annotation.StringRes; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.StringRes; +import androidx.core.content.ContextCompat; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.View; import android.widget.AdapterView; @@ -26,7 +26,7 @@ import java.util.List; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; public class StoreHouseStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java index 3e335ef8..33477617 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java @@ -3,17 +3,17 @@ import android.content.res.ColorStateList; import android.os.Build; import android.os.Bundle; -import android.support.annotation.StringRes; -import android.support.design.widget.AppBarLayout; -import android.support.design.widget.CollapsingToolbarLayout; -import android.support.design.widget.FloatingActionButton; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.StringRes; +import com.google.android.material.appbar.AppBarLayout; +import com.google.android.material.appbar.CollapsingToolbarLayout; +import com.google.android.material.floatingactionbutton.FloatingActionButton; +import androidx.core.content.ContextCompat; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.View; import android.widget.AdapterView; @@ -27,7 +27,7 @@ import java.util.List; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; public class TaurusStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java index e57efabe..9dd9b35c 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java @@ -2,14 +2,14 @@ import android.os.Build; import android.os.Bundle; -import android.support.annotation.StringRes; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.StringRes; +import androidx.core.content.ContextCompat; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.View; import android.widget.AdapterView; @@ -23,7 +23,7 @@ import java.util.List; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; public class WaterDropStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java index d8f98b2b..c2ad4b1f 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java @@ -2,14 +2,14 @@ import android.os.Build; import android.os.Bundle; -import android.support.annotation.StringRes; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.StringRes; +import androidx.core.content.ContextCompat; +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.View; import android.widget.AdapterView; @@ -23,7 +23,7 @@ import java.util.List; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; public class WaveSwipeStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { diff --git a/app/src/main/java/com/scwang/refreshlayout/adapter/BaseRecyclerAdapter.java b/app/src/main/java/com/scwang/refreshlayout/adapter/BaseRecyclerAdapter.java index 690f25f8..6ed99baa 100644 --- a/app/src/main/java/com/scwang/refreshlayout/adapter/BaseRecyclerAdapter.java +++ b/app/src/main/java/com/scwang/refreshlayout/adapter/BaseRecyclerAdapter.java @@ -2,9 +2,10 @@ import android.database.DataSetObservable; import android.database.DataSetObserver; -import android.support.annotation.LayoutRes; -import android.support.annotation.NonNull; -import android.support.v7.widget.RecyclerView; + +import androidx.annotation.LayoutRes; +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/com/scwang/refreshlayout/adapter/SmartViewHolder.java b/app/src/main/java/com/scwang/refreshlayout/adapter/SmartViewHolder.java index 391b72e8..06a951fa 100644 --- a/app/src/main/java/com/scwang/refreshlayout/adapter/SmartViewHolder.java +++ b/app/src/main/java/com/scwang/refreshlayout/adapter/SmartViewHolder.java @@ -1,9 +1,9 @@ package com.scwang.refreshlayout.adapter; import android.content.res.Resources; -import android.support.annotation.StringRes; -import android.support.v4.content.ContextCompat; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.StringRes; +import androidx.core.content.ContextCompat; +import androidx.recyclerview.widget.RecyclerView; import android.util.TypedValue; import android.view.View; import android.widget.AdapterView; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java index 32097853..f3e46a07 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java @@ -2,15 +2,15 @@ import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.design.widget.BottomSheetDialog; -import android.support.v4.app.Fragment; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import com.google.android.material.bottomsheet.BottomSheetDialog; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -27,7 +27,7 @@ import java.util.Collection; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; /** * 使用示例-BottomSheet diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/DisallowInterceptExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/DisallowInterceptExampleFragment.java index b9f906a6..3db0f159 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/DisallowInterceptExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/DisallowInterceptExampleFragment.java @@ -3,11 +3,12 @@ import android.annotation.SuppressLint; import android.content.Context; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v7.widget.AppCompatTextView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.widget.AppCompatTextView; +import androidx.fragment.app.Fragment; + +import androidx.appcompat.widget.Toolbar; import android.util.AttributeSet; import android.view.*; import com.scwang.refreshlayout.R; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java index e328335f..209fed02 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java @@ -4,14 +4,14 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -33,7 +33,7 @@ import ezy.ui.layout.LoadingLayout; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; import static com.scwang.refreshlayout.R.id.recyclerView; import static com.scwang.refreshlayout.R.id.refreshLayout; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java index d434bf43..ebb7f7cb 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java @@ -4,14 +4,14 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -35,7 +35,7 @@ import java.util.Arrays; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; /** * 使用示例-空布页面 diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java index 1b0a2a77..2116643f 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java @@ -4,14 +4,14 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -32,7 +32,7 @@ import java.util.Arrays; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; import static com.scwang.refreshlayout.R.id.recyclerView; import static com.scwang.refreshlayout.R.id.refreshLayout; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/FlexBoxLayoutManagerFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/FlexBoxLayoutManagerFragment.java index c3f9ed25..e0025f33 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/FlexBoxLayoutManagerFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/FlexBoxLayoutManagerFragment.java @@ -2,16 +2,17 @@ import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; + import com.google.android.flexbox.AlignItems; import com.google.android.flexbox.FlexDirection; import com.google.android.flexbox.FlexWrap; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/HorizontalExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/HorizontalExampleFragment.java index 2e46f041..935191c7 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/HorizontalExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/HorizontalExampleFragment.java @@ -3,11 +3,11 @@ import android.os.Build; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java index c92fb47a..2b5384c4 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java @@ -4,15 +4,15 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.design.widget.AppBarLayout; -import android.support.v4.app.Fragment; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import com.google.android.material.appbar.AppBarLayout; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -29,7 +29,7 @@ import java.util.Arrays; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; /** * 使用示例-嵌套滚动 diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java index c832fe14..2686a890 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java @@ -3,17 +3,17 @@ import android.content.Context; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentStatePagerAdapter; -import android.support.v4.view.ViewPager; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentStatePagerAdapter; +import androidx.viewpager.widget.ViewPager; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java index a49041fe..43f11716 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java @@ -2,18 +2,18 @@ import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.design.widget.AppBarLayout; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentStatePagerAdapter; -import android.support.v4.view.ViewPager; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import com.google.android.material.appbar.AppBarLayout; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentStatePagerAdapter; +import androidx.viewpager.widget.ViewPager; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NoMoreDataExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NoMoreDataExampleFragment.java index 7ac5ed38..02efa464 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NoMoreDataExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NoMoreDataExampleFragment.java @@ -2,12 +2,12 @@ import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -25,7 +25,7 @@ import java.util.Random; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; /** * A simple {@link Fragment} subclass. diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragment.java index ba8aec22..a0bb2864 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragment.java @@ -4,14 +4,14 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -25,7 +25,7 @@ import java.util.Arrays; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; /** * 使用示例-纯滚动模式 diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentFooter.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentFooter.java index de8e18e5..4131f3cd 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentFooter.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentFooter.java @@ -4,14 +4,14 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -27,7 +27,7 @@ import java.util.Arrays; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; /** * 使用示例-纯滚动模式 diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java index 40eb467c..efa05603 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java @@ -4,14 +4,14 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -28,7 +28,7 @@ import java.util.Arrays; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; /** * 使用示例-纯滚动模式 diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/SpecifyStyleExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/SpecifyStyleExampleFragment.java index a640fb7c..fb53d290 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/SpecifyStyleExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/SpecifyStyleExampleFragment.java @@ -4,14 +4,14 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -28,7 +28,7 @@ import java.util.Arrays; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; /** * 使用示例-指定样式 diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/StaggeredGridExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/StaggeredGridExampleFragment.java index be68421a..46a6bd54 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/StaggeredGridExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/StaggeredGridExampleFragment.java @@ -1,11 +1,11 @@ package com.scwang.refreshlayout.fragment.example; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/ThreeLevelExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/ThreeLevelExampleFragment.java index f7247429..5afe8f68 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/ThreeLevelExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/ThreeLevelExampleFragment.java @@ -2,11 +2,11 @@ import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java index 6f6328cf..a6dc53a2 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java @@ -2,23 +2,24 @@ import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.annotation.StringRes; -import android.support.design.widget.TabLayout; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentStatePagerAdapter; -import android.support.v4.view.ViewPager; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.StringRes; + +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentStatePagerAdapter; +import androidx.viewpager.widget.ViewPager; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Toast; +import com.google.android.material.tabs.TabLayout; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java index 66b740ca..25cc3b26 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java @@ -4,14 +4,14 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.annotation.StringRes; -import android.support.v4.app.Fragment; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.StringRes; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -33,7 +33,7 @@ import java.util.Arrays; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; /** * 使用示例 diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java index b76d3dd9..ae9fb420 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java @@ -4,14 +4,14 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.annotation.StringRes; -import android.support.v4.app.Fragment; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.StringRes; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -35,7 +35,7 @@ import java.util.Arrays; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; /** * 实战演示 diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshStylesFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshStylesFragment.java index ec6b39e3..3240b6f7 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshStylesFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshStylesFragment.java @@ -2,14 +2,14 @@ import android.content.Intent; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.annotation.StringRes; -import android.support.v4.app.Fragment; -import android.support.v7.widget.DefaultItemAnimator; -import android.support.v7.widget.DividerItemDecoration; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.StringRes; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -53,7 +53,7 @@ import java.util.Arrays; import static android.R.layout.simple_list_item_2; -import static android.support.v7.widget.DividerItemDecoration.VERTICAL; +import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; import static com.scwang.refreshlayout.R.id.recyclerView; /** diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java index f0b56b5f..b06db519 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java @@ -2,11 +2,11 @@ import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java index 84bcf741..0bb61ad9 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java @@ -1,11 +1,11 @@ package com.scwang.refreshlayout.fragment.practice; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.RecyclerView; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java index cfb90f0e..5e43de1c 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java @@ -1,10 +1,10 @@ package com.scwang.refreshlayout.fragment.practice; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/com/scwang/refreshlayout/util/DynamicTimeFormat.java b/app/src/main/java/com/scwang/refreshlayout/util/DynamicTimeFormat.java index e4c50423..028803d7 100644 --- a/app/src/main/java/com/scwang/refreshlayout/util/DynamicTimeFormat.java +++ b/app/src/main/java/com/scwang/refreshlayout/util/DynamicTimeFormat.java @@ -1,6 +1,6 @@ package com.scwang.refreshlayout.util; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import java.text.FieldPosition; import java.text.SimpleDateFormat; diff --git a/app/src/main/java/com/scwang/refreshlayout/util/StatusBarUtil.java b/app/src/main/java/com/scwang/refreshlayout/util/StatusBarUtil.java index b3ccf930..ab648f08 100644 --- a/app/src/main/java/com/scwang/refreshlayout/util/StatusBarUtil.java +++ b/app/src/main/java/com/scwang/refreshlayout/util/StatusBarUtil.java @@ -4,8 +4,7 @@ import android.content.Context; import android.content.res.Resources; import android.os.Build; -import android.support.annotation.FloatRange; -import android.support.annotation.RequiresApi; + import android.util.Log; import android.util.TypedValue; import android.view.View; @@ -13,6 +12,9 @@ import android.view.Window; import android.view.WindowManager; +import androidx.annotation.FloatRange; +import androidx.annotation.RequiresApi; + import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.regex.Pattern; diff --git a/app/src/main/java/com/scwang/refreshlayout/widget/RefreshContentHorizontal.java b/app/src/main/java/com/scwang/refreshlayout/widget/RefreshContentHorizontal.java index 63e12333..47ad0294 100644 --- a/app/src/main/java/com/scwang/refreshlayout/widget/RefreshContentHorizontal.java +++ b/app/src/main/java/com/scwang/refreshlayout/widget/RefreshContentHorizontal.java @@ -1,7 +1,7 @@ package com.scwang.refreshlayout.widget; import android.animation.ValueAnimator; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.view.View; import android.widget.AbsListView; diff --git a/app/src/main/java/com/scwang/refreshlayout/widget/ScrollBoundaryHorizontal.java b/app/src/main/java/com/scwang/refreshlayout/widget/ScrollBoundaryHorizontal.java index f13889bd..c3a0fa87 100644 --- a/app/src/main/java/com/scwang/refreshlayout/widget/ScrollBoundaryHorizontal.java +++ b/app/src/main/java/com/scwang/refreshlayout/widget/ScrollBoundaryHorizontal.java @@ -1,7 +1,7 @@ package com.scwang.refreshlayout.widget; import android.graphics.PointF; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; diff --git a/app/src/main/java/com/scwang/refreshlayout/widget/SmartRefreshHorizontal.java b/app/src/main/java/com/scwang/refreshlayout/widget/SmartRefreshHorizontal.java index b738fa0e..440c3f4b 100644 --- a/app/src/main/java/com/scwang/refreshlayout/widget/SmartRefreshHorizontal.java +++ b/app/src/main/java/com/scwang/refreshlayout/widget/SmartRefreshHorizontal.java @@ -1,8 +1,8 @@ package com.scwang.refreshlayout.widget; import android.content.Context; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/res/drawable/ic_list_divider.xml b/app/src/main/res/drawable/ic_list_divider.xml index d7ab10ac..1454d00a 100644 --- a/app/src/main/res/drawable/ic_list_divider.xml +++ b/app/src/main/res/drawable/ic_list_divider.xml @@ -10,7 +10,7 @@ - + diff --git a/app/src/main/res/layout/activity_example_assign_code.xml b/app/src/main/res/layout/activity_example_assign_code.xml index 22a451ad..bd1fc4af 100644 --- a/app/src/main/res/layout/activity_example_assign_code.xml +++ b/app/src/main/res/layout/activity_example_assign_code.xml @@ -7,7 +7,7 @@ android:orientation="vertical" tools:context="com.scwang.refreshlayout.activity.example.AssignCodeExampleActivity"> - diff --git a/app/src/main/res/layout/activity_example_assign_default.xml b/app/src/main/res/layout/activity_example_assign_default.xml index 93c33566..c67ef260 100644 --- a/app/src/main/res/layout/activity_example_assign_default.xml +++ b/app/src/main/res/layout/activity_example_assign_default.xml @@ -7,7 +7,7 @@ android:orientation="vertical" tools:context="com.scwang.refreshlayout.activity.example.AssignDefaultExampleActivity"> - diff --git a/app/src/main/res/layout/activity_example_assign_xml.xml b/app/src/main/res/layout/activity_example_assign_xml.xml index ef262518..9d8264d4 100644 --- a/app/src/main/res/layout/activity_example_assign_xml.xml +++ b/app/src/main/res/layout/activity_example_assign_xml.xml @@ -7,7 +7,7 @@ android:orientation="vertical" tools:context="com.scwang.refreshlayout.activity.example.AssignDefaultExampleActivity"> - diff --git a/app/src/main/res/layout/activity_example_basic.xml b/app/src/main/res/layout/activity_example_basic.xml index 16a4204b..6a91c78c 100644 --- a/app/src/main/res/layout/activity_example_basic.xml +++ b/app/src/main/res/layout/activity_example_basic.xml @@ -1,5 +1,5 @@ - - - + diff --git a/app/src/main/res/layout/activity_example_custom.xml b/app/src/main/res/layout/activity_example_custom.xml index 9f9d3249..0c3f871c 100644 --- a/app/src/main/res/layout/activity_example_custom.xml +++ b/app/src/main/res/layout/activity_example_custom.xml @@ -7,7 +7,7 @@ android:orientation="vertical" tools:context="com.scwang.refreshlayout.activity.example.CustomExampleActivity"> - diff --git a/app/src/main/res/layout/activity_example_i18n.xml b/app/src/main/res/layout/activity_example_i18n.xml index 85a9a03b..e4683c62 100644 --- a/app/src/main/res/layout/activity_example_i18n.xml +++ b/app/src/main/res/layout/activity_example_i18n.xml @@ -7,7 +7,7 @@ android:orientation="vertical" tools:context="com.scwang.refreshlayout.activity.example.I18nExampleActivity"> - diff --git a/app/src/main/res/layout/activity_example_listener.xml b/app/src/main/res/layout/activity_example_listener.xml index 2a594e78..cada019b 100644 --- a/app/src/main/res/layout/activity_example_listener.xml +++ b/app/src/main/res/layout/activity_example_listener.xml @@ -7,7 +7,7 @@ android:orientation="vertical" tools:context="com.scwang.refreshlayout.activity.example.ListenerExampleActivity"> - diff --git a/app/src/main/res/layout/activity_example_overscroll.xml b/app/src/main/res/layout/activity_example_overscroll.xml index 486eb406..4340a172 100644 --- a/app/src/main/res/layout/activity_example_overscroll.xml +++ b/app/src/main/res/layout/activity_example_overscroll.xml @@ -7,7 +7,7 @@ android:orientation="vertical" tools:context="com.scwang.refreshlayout.activity.example.OverScrollExampleActivity"> - diff --git a/app/src/main/res/layout/activity_example_region.xml b/app/src/main/res/layout/activity_example_region.xml index 80720129..edcfdffe 100644 --- a/app/src/main/res/layout/activity_example_region.xml +++ b/app/src/main/res/layout/activity_example_region.xml @@ -7,7 +7,7 @@ android:orientation="vertical" tools:context="com.scwang.refreshlayout.activity.example.NestedLayoutExampleActivity"> - @@ -47,7 +47,7 @@ - - - + - - + android:layout_height="match_parent"> - + @@ -50,4 +49,4 @@ - + diff --git a/app/src/main/res/layout/activity_fly_refresh.xml b/app/src/main/res/layout/activity_fly_refresh.xml index ee122cd0..6fd6d747 100644 --- a/app/src/main/res/layout/activity_fly_refresh.xml +++ b/app/src/main/res/layout/activity_fly_refresh.xml @@ -1,5 +1,5 @@ - - - - - - + + - - - + diff --git a/app/src/main/res/layout/activity_index_main.xml b/app/src/main/res/layout/activity_index_main.xml index fd6e059a..251e8fe3 100644 --- a/app/src/main/res/layout/activity_index_main.xml +++ b/app/src/main/res/layout/activity_index_main.xml @@ -8,18 +8,19 @@ android:orientation="vertical" tools:context="com.scwang.refreshlayout.activity.IndexMainActivity"> - - - - - - @@ -33,7 +33,7 @@ android:orientation="vertical" android:gravity="center_horizontal"> - - + - - diff --git a/app/src/main/res/layout/activity_practice_repast.xml b/app/src/main/res/layout/activity_practice_repast.xml index 9acbb1b8..4498792f 100644 --- a/app/src/main/res/layout/activity_practice_repast.xml +++ b/app/src/main/res/layout/activity_practice_repast.xml @@ -27,7 +27,7 @@ android:src="@mipmap/gif_header_repast" app:layout_srlSpinnerStyle="Scale" app:layout_srlBackgroundColor="@android:color/transparent"/> - - - - - - + - + - - - - + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_style_bezier.xml b/app/src/main/res/layout/activity_style_bezier.xml index 0f355ce9..9addd1d5 100644 --- a/app/src/main/res/layout/activity_style_bezier.xml +++ b/app/src/main/res/layout/activity_style_bezier.xml @@ -7,7 +7,7 @@ tools:context="com.scwang.refreshlayout.activity.style.BezierRadarStyleActivity" android:orientation="vertical"> - @@ -25,7 +25,7 @@ android:id="@+id/header" android:layout_width="match_parent" android:layout_height="match_parent"/> - - @@ -24,7 +24,7 @@ - - @@ -34,7 +34,7 @@ app:srlDrawableProgressSize="20dp" app:srlDrawableMarginRight="20dp" app:srlDrawableProgress="@drawable/ic_progress_puzzle"/> - - - - @@ -26,7 +26,7 @@ - - @@ -23,7 +23,7 @@ - - @@ -23,7 +23,7 @@ - - @@ -24,7 +24,7 @@ - - - - - - - + + - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_style_storehouse.xml b/app/src/main/res/layout/activity_style_storehouse.xml index 0523a09a..e9b34e63 100644 --- a/app/src/main/res/layout/activity_style_storehouse.xml +++ b/app/src/main/res/layout/activity_style_storehouse.xml @@ -7,7 +7,7 @@ tools:context="com.scwang.refreshlayout.activity.style.BezierRadarStyleActivity" android:orientation="vertical"> - @@ -27,7 +27,7 @@ android:layout_height="100dp" app:shhText="StoreHouse" app:shhLineWidth="2dp"/> - - - - - - - + + - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_style_water_drop.xml b/app/src/main/res/layout/activity_style_water_drop.xml index 6dc43ac7..d684b7ff 100644 --- a/app/src/main/res/layout/activity_style_water_drop.xml +++ b/app/src/main/res/layout/activity_style_water_drop.xml @@ -7,7 +7,7 @@ tools:context="com.scwang.refreshlayout.activity.style.WaterDropStyleActivity" android:orientation="vertical"> - @@ -25,7 +25,7 @@ - - @@ -24,7 +24,7 @@ - - @@ -16,7 +16,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" app:srlEnablePureScrollMode="true"> - - @@ -15,7 +15,7 @@ android:id="@+id/refreshLayout" android:layout_width="match_parent" android:layout_height="match_parent"> - - @@ -28,4 +28,4 @@ - + diff --git a/app/src/main/res/layout/fragment_example_emptylayout.xml b/app/src/main/res/layout/fragment_example_emptylayout.xml index 376cd93a..350c0231 100644 --- a/app/src/main/res/layout/fragment_example_emptylayout.xml +++ b/app/src/main/res/layout/fragment_example_emptylayout.xml @@ -6,7 +6,7 @@ android:orientation="vertical" tools:context="com.scwang.refreshlayout.fragment.example.EmptyLayoutExampleFragment"> - @@ -20,7 +20,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/white"> - - @@ -18,7 +18,7 @@ - - @@ -18,7 +18,7 @@ android:id="@+id/refreshLayout" android:layout_width="match_parent" android:layout_height="match_parent"> - - - - - - - - - + + - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_example_nestedscroll_integral.xml b/app/src/main/res/layout/fragment_example_nestedscroll_integral.xml index 633f9131..2c8658c2 100644 --- a/app/src/main/res/layout/fragment_example_nestedscroll_integral.xml +++ b/app/src/main/res/layout/fragment_example_nestedscroll_integral.xml @@ -7,7 +7,7 @@ android:orientation="vertical" tools:context="com.scwang.refreshlayout.fragment.example.NestedScrollExampleFragmentIntegral"> - - - + @@ -39,20 +39,20 @@ - - - - + - - - - - - + - + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_example_nestedscroll_view_pager.xml b/app/src/main/res/layout/fragment_example_nestedscroll_view_pager.xml index de8b4a98..2d5f860f 100644 --- a/app/src/main/res/layout/fragment_example_nestedscroll_view_pager.xml +++ b/app/src/main/res/layout/fragment_example_nestedscroll_view_pager.xml @@ -1,19 +1,19 @@ - - - - - - + + - - + @@ -57,7 +57,7 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_example_purescroll.xml b/app/src/main/res/layout/fragment_example_purescroll.xml index 80893ffa..9b03923c 100644 --- a/app/src/main/res/layout/fragment_example_purescroll.xml +++ b/app/src/main/res/layout/fragment_example_purescroll.xml @@ -6,7 +6,7 @@ android:orientation="vertical" tools:context="com.scwang.refreshlayout.fragment.example.PureScrollExampleFragment"> - @@ -17,7 +17,7 @@ android:layout_height="match_parent" app:srlEnableLoadMore="false" app:srlEnablePureScrollMode="true"> - - @@ -20,7 +20,7 @@ - - @@ -16,14 +16,14 @@ android:layout_width="match_parent" android:layout_height="match_parent" app:srlEnableOverScrollDrag="true"> - diff --git a/app/src/main/res/layout/fragment_example_three_level.xml b/app/src/main/res/layout/fragment_example_three_level.xml index 55721cb3..a0eda73d 100644 --- a/app/src/main/res/layout/fragment_example_three_level.xml +++ b/app/src/main/res/layout/fragment_example_three_level.xml @@ -6,7 +6,7 @@ android:orientation="vertical" tools:context="com.scwang.refreshlayout.fragment.example.ThreeLevelExampleFragment"> - @@ -48,7 +48,7 @@ android:layout_height="wrap_content" app:srlPrimaryColor="#3F51B5" app:srlAccentColor="#fff"/> - - @@ -23,12 +23,12 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> - - - @@ -16,7 +16,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" app:srlEnableNestedScrolling="true"> - diff --git a/app/src/main/res/layout/fragment_no_more_data_example.xml b/app/src/main/res/layout/fragment_no_more_data_example.xml index 2becf806..4a878ad6 100644 --- a/app/src/main/res/layout/fragment_no_more_data_example.xml +++ b/app/src/main/res/layout/fragment_no_more_data_example.xml @@ -6,7 +6,7 @@ android:orientation="vertical" tools:context="com.scwang.refreshlayout.fragment.example.NoMoreDataExampleFragment"> - - - - + - - + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/> - - + diff --git a/app/src/main/res/layout/fragment_practice_twolevel.xml b/app/src/main/res/layout/fragment_practice_twolevel.xml index adaaaa7a..50362648 100644 --- a/app/src/main/res/layout/fragment_practice_twolevel.xml +++ b/app/src/main/res/layout/fragment_practice_twolevel.xml @@ -6,13 +6,13 @@ android:orientation="vertical" tools:context="com.scwang.refreshlayout.fragment.practice.TwoLevelPracticeFragment"> - - + - - - - + diff --git a/app/src/main/res/layout/fragment_refresh_practive.xml b/app/src/main/res/layout/fragment_refresh_practive.xml index d3eef650..ae918c4d 100644 --- a/app/src/main/res/layout/fragment_refresh_practive.xml +++ b/app/src/main/res/layout/fragment_refresh_practive.xml @@ -6,7 +6,7 @@ android:orientation="vertical" tools:context="com.scwang.refreshlayout.fragment.index.RefreshPracticeFragment"> - @@ -20,7 +20,7 @@ - - @@ -22,7 +22,7 @@ - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/item_practice_repast.xml b/app/src/main/res/layout/item_practice_repast.xml index 1c06c2f2..56fdf439 100644 --- a/app/src/main/res/layout/item_practice_repast.xml +++ b/app/src/main/res/layout/item_practice_repast.xml @@ -26,8 +26,7 @@ + android:layout_height="55dp"/> - - + diff --git a/build.gradle b/build.gradle index 3941d9b2..511e96d3 100644 --- a/build.gradle +++ b/build.gradle @@ -3,20 +3,19 @@ buildscript { repositories { google() - jcenter() + mavenCentral() + gradlePluginPortal() } dependencies { - classpath 'com.android.tools.build:gradle:3.4.2' - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - classpath 'com.novoda:bintray-release:0.9.1' + classpath 'com.android.tools.build:gradle:7.2.2' } } allprojects { repositories { google() - jcenter() + mavenCentral() + gradlePluginPortal() } tasks.withType(Javadoc) { diff --git a/gradle.properties b/gradle.properties index 69576ac3..0774a4eb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,6 +16,9 @@ org.gradle.jvmargs=-Xmx1536m # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true +android.useAndroidX=true +android.enableJetifier=true + SMART_USER=scwang90 SMART_GROUP=com.scwang.smart SMART_VERSION=2.0.5 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f2737157..7ae80cef 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip diff --git a/refresh-drawable-paint/build.gradle b/refresh-drawable-paint/build.gradle index 3411ebdc..65193936 100644 --- a/refresh-drawable-paint/build.gradle +++ b/refresh-drawable-paint/build.gradle @@ -4,11 +4,11 @@ description = 'common drawables for refresh animations' android { - compileSdkVersion 28 + compileSdkVersion 33 defaultConfig { - minSdkVersion 16 - targetSdkVersion 28 + minSdkVersion 21 + targetSdkVersion 33 versionCode 1 versionName "1.0" @@ -28,10 +28,5 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { - exclude group: 'com.android.support', module: 'support-annotations' - }) - testImplementation 'junit:junit:4.12' - - compileOnly 'com.android.support:support-annotations:28.0.0' + implementation 'androidx.annotation:annotation:1.5.0' } diff --git a/refresh-drawable-paint/src/main/java/com/scwang/smart/drawable/ProgressDrawable.java b/refresh-drawable-paint/src/main/java/com/scwang/smart/drawable/ProgressDrawable.java index 6dfd59de..05197868 100644 --- a/refresh-drawable-paint/src/main/java/com/scwang/smart/drawable/ProgressDrawable.java +++ b/refresh-drawable-paint/src/main/java/com/scwang/smart/drawable/ProgressDrawable.java @@ -7,7 +7,8 @@ import android.graphics.Rect; import android.graphics.drawable.Animatable; import android.graphics.drawable.Drawable; -import android.support.annotation.NonNull; + +import androidx.annotation.NonNull; /** * 旋转动画 diff --git a/refresh-drawable-path/build.gradle b/refresh-drawable-path/build.gradle index 00d5aa72..00fd7ffe 100644 --- a/refresh-drawable-path/build.gradle +++ b/refresh-drawable-path/build.gradle @@ -4,11 +4,11 @@ description = 'path drawables for refresh animations' android { - compileSdkVersion 28 + compileSdkVersion 33 defaultConfig { - minSdkVersion 16 - targetSdkVersion 28 + minSdkVersion 21 + targetSdkVersion 33 versionCode 1 versionName "1.0" @@ -28,11 +28,6 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { - exclude group: 'com.android.support', module: 'support-annotations' - }) - testImplementation 'junit:junit:4.12' - + implementation 'androidx.legacy:legacy-support-v4:1.0.0' api project(':refresh-drawable-paint') - compileOnly 'com.android.support:support-v4:28.0.0' } diff --git a/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/PathsDrawable.java b/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/PathsDrawable.java index d532aa3b..1306830a 100644 --- a/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/PathsDrawable.java +++ b/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/PathsDrawable.java @@ -7,7 +7,7 @@ import android.graphics.Rect; import android.graphics.Region; import android.graphics.drawable.Drawable; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.scwang.smart.drawable.path.PathParser; diff --git a/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/path/PathParser.java b/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/path/PathParser.java index fd2daf25..fcde8de7 100644 --- a/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/path/PathParser.java +++ b/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/path/PathParser.java @@ -16,7 +16,7 @@ import android.graphics.Matrix; import android.graphics.Path; import android.os.Build; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import java.util.ArrayList; import java.util.List; diff --git a/refresh-footer-ball/build.gradle b/refresh-footer-ball/build.gradle index 835775c7..20243cbd 100644 --- a/refresh-footer-ball/build.gradle +++ b/refresh-footer-ball/build.gradle @@ -3,11 +3,11 @@ apply plugin: 'com.android.library' description = 'the footer BallPulseFooter of SmartRefreshLayout' android { - compileSdkVersion 28 + compileSdkVersion 33 defaultConfig { - minSdkVersion 16 - targetSdkVersion 28 + minSdkVersion 21 + targetSdkVersion 33 versionCode 1 versionName "1.0" @@ -26,12 +26,7 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - - compileOnly 'com.android.support:appcompat-v7:28.0.0' - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' - + implementation 'androidx.legacy:legacy-support-v4:1.0.0' compileOnly project(':refresh-layout-kernel') } diff --git a/refresh-footer-ball/src/main/java/com/scwang/smart/refresh/footer/BallPulseFooter.java b/refresh-footer-ball/src/main/java/com/scwang/smart/refresh/footer/BallPulseFooter.java index 069173ed..17a05274 100644 --- a/refresh-footer-ball/src/main/java/com/scwang/smart/refresh/footer/BallPulseFooter.java +++ b/refresh-footer-ball/src/main/java/com/scwang/smart/refresh/footer/BallPulseFooter.java @@ -6,10 +6,12 @@ import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; -import android.support.annotation.ColorInt; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.graphics.ColorUtils; + +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.graphics.ColorUtils; + import android.util.AttributeSet; import android.view.View; import android.view.animation.AccelerateDecelerateInterpolator; diff --git a/refresh-footer-classics/build.gradle b/refresh-footer-classics/build.gradle index 68603639..b5311e1c 100644 --- a/refresh-footer-classics/build.gradle +++ b/refresh-footer-classics/build.gradle @@ -3,11 +3,11 @@ apply plugin: 'com.android.library' description = 'the footer ClassicsFooter of SmartRefreshLayout' android { - compileSdkVersion 28 + compileSdkVersion 33 defaultConfig { - minSdkVersion 16 - targetSdkVersion 28 + minSdkVersion 21 + targetSdkVersion 33 versionCode 1 versionName "1.0" @@ -26,12 +26,7 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - - compileOnly 'com.android.support:appcompat-v7:28.0.0' - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' - + implementation 'androidx.legacy:legacy-support-v4:1.0.0' api project(':refresh-drawable-paint') compileOnly project(':refresh-layout-kernel') } diff --git a/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/classics/ArrowDrawable.java b/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/classics/ArrowDrawable.java index 95268023..6a121437 100644 --- a/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/classics/ArrowDrawable.java +++ b/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/classics/ArrowDrawable.java @@ -4,7 +4,7 @@ import android.graphics.Path; import android.graphics.Rect; import android.graphics.drawable.Drawable; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.scwang.smart.drawable.PaintDrawable; diff --git a/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/classics/ClassicsAbstract.java b/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/classics/ClassicsAbstract.java index f98beb18..7c07bf82 100644 --- a/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/classics/ClassicsAbstract.java +++ b/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/classics/ClassicsAbstract.java @@ -5,11 +5,12 @@ import android.graphics.drawable.Animatable; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; -import android.support.annotation.ColorInt; -import android.support.annotation.ColorRes; -import android.support.annotation.DrawableRes; -import android.support.annotation.NonNull; -import android.support.v4.content.ContextCompat; +import androidx.annotation.ColorInt; + +import androidx.annotation.ColorRes; +import androidx.annotation.DrawableRes; +import androidx.annotation.NonNull; +import androidx.core.content.ContextCompat; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; diff --git a/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/footer/ClassicsFooter.java b/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/footer/ClassicsFooter.java index 3f8bd6ae..9c83486a 100644 --- a/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/footer/ClassicsFooter.java +++ b/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/footer/ClassicsFooter.java @@ -2,8 +2,8 @@ import android.content.Context; import android.content.res.TypedArray; -import android.support.annotation.ColorInt; -import android.support.annotation.NonNull; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; import android.util.AttributeSet; import android.util.TypedValue; import android.view.View; diff --git a/refresh-footer/build.gradle b/refresh-footer/build.gradle index 0914418a..24d4f49e 100644 --- a/refresh-footer/build.gradle +++ b/refresh-footer/build.gradle @@ -3,12 +3,12 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 28 + compileSdkVersion 33 defaultConfig { - minSdkVersion 16 - targetSdkVersion 28 + minSdkVersion 21 + targetSdkVersion 33 versionCode 1 versionName "1.0" @@ -27,11 +27,6 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { - exclude group: 'com.android.support', module: 'support-annotations' - }) - testImplementation 'junit:junit:4.12' - compileOnly project(':refresh-footer-ball') compileOnly project(':refresh-footer-classics') compileOnly project(':refresh-layout') diff --git a/refresh-header-classics/build.gradle b/refresh-header-classics/build.gradle index 4deeb511..b9ff4c11 100644 --- a/refresh-header-classics/build.gradle +++ b/refresh-header-classics/build.gradle @@ -3,11 +3,11 @@ apply plugin: 'com.android.library' description = 'the header ClassicsHeader of SmartRefreshLayout' android { - compileSdkVersion 28 + compileSdkVersion 33 defaultConfig { - minSdkVersion 16 - targetSdkVersion 28 + minSdkVersion 21 + targetSdkVersion 33 versionCode 1 versionName "1.0" @@ -26,12 +26,7 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - - compileOnly 'com.android.support:appcompat-v7:28.0.0' - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' - + implementation 'androidx.appcompat:appcompat:1.5.1' api project(':refresh-footer-classics') compileOnly project(':refresh-layout-kernel') diff --git a/refresh-header-classics/src/main/java/com/scwang/smart/refresh/header/ClassicsHeader.java b/refresh-header-classics/src/main/java/com/scwang/smart/refresh/header/ClassicsHeader.java index 3c5f6204..32d96f36 100644 --- a/refresh-header-classics/src/main/java/com/scwang/smart/refresh/header/ClassicsHeader.java +++ b/refresh-header-classics/src/main/java/com/scwang/smart/refresh/header/ClassicsHeader.java @@ -4,11 +4,12 @@ import android.content.Context; import android.content.SharedPreferences; import android.content.res.TypedArray; -import android.support.annotation.ColorInt; -import android.support.annotation.NonNull; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentActivity; -import android.support.v4.app.FragmentManager; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; + +import androidx.fragment.app.FragmentActivity; +import androidx.fragment.app.FragmentManager; import android.util.AttributeSet; import android.util.TypedValue; import android.view.View; diff --git a/refresh-header-falsify/build.gradle b/refresh-header-falsify/build.gradle index 8289ea56..22d61e4c 100644 --- a/refresh-header-falsify/build.gradle +++ b/refresh-header-falsify/build.gradle @@ -3,11 +3,11 @@ apply plugin: 'com.android.library' description = 'the header FalsifyHeader of SmartRefreshLayout' android { - compileSdkVersion 28 + compileSdkVersion 33 defaultConfig { - minSdkVersion 16 - targetSdkVersion 28 + minSdkVersion 21 + targetSdkVersion 33 versionCode 1 versionName "1.0" @@ -27,10 +27,7 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - compileOnly 'com.android.support:appcompat-v7:28.0.0' - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' + implementation 'androidx.appcompat:appcompat:1.5.1' compileOnly project(':refresh-layout-kernel') diff --git a/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/FalsifyFooter.java b/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/FalsifyFooter.java index 533cd83e..7d5ae589 100644 --- a/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/FalsifyFooter.java +++ b/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/FalsifyFooter.java @@ -1,7 +1,7 @@ package com.scwang.smart.refresh.header; import android.content.Context; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.util.AttributeSet; import com.scwang.smart.refresh.header.falsify.FalsifyAbstract; diff --git a/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/FalsifyHeader.java b/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/FalsifyHeader.java index 2b0aed70..09c4933b 100644 --- a/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/FalsifyHeader.java +++ b/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/FalsifyHeader.java @@ -1,7 +1,7 @@ package com.scwang.smart.refresh.header; import android.content.Context; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.util.AttributeSet; import com.scwang.smart.refresh.header.falsify.FalsifyAbstract; diff --git a/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/falsify/FalsifyAbstract.java b/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/falsify/FalsifyAbstract.java index d9d9298e..a48dd11f 100644 --- a/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/falsify/FalsifyAbstract.java +++ b/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/falsify/FalsifyAbstract.java @@ -4,7 +4,7 @@ import android.graphics.Canvas; import android.graphics.DashPathEffect; import android.graphics.Paint; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.util.AttributeSet; import android.view.Gravity; import android.view.View; diff --git a/refresh-header-material/build.gradle b/refresh-header-material/build.gradle index cf015528..42524aa7 100644 --- a/refresh-header-material/build.gradle +++ b/refresh-header-material/build.gradle @@ -3,11 +3,11 @@ apply plugin: 'com.android.library' description = 'the header MaterialHeader of SmartRefreshLayout' android { - compileSdkVersion 28 + compileSdkVersion 33 defaultConfig { - minSdkVersion 16 - targetSdkVersion 28 + minSdkVersion 21 + targetSdkVersion 33 versionCode 1 versionName "1.0" @@ -27,10 +27,7 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - compileOnly 'com.android.support:appcompat-v7:28.0.0' - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' + implementation 'androidx.appcompat:appcompat:1.5.1' compileOnly project(':refresh-layout-kernel') diff --git a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java index 9510bee9..64c0c981 100644 --- a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java +++ b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java @@ -7,11 +7,12 @@ import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Path; -import android.support.annotation.ColorInt; -import android.support.annotation.ColorRes; -import android.support.annotation.NonNull; -import android.support.annotation.VisibleForTesting; -import android.support.v4.content.ContextCompat; +import androidx.annotation.ColorInt; +import androidx.annotation.ColorRes; +import androidx.annotation.NonNull; + +import androidx.annotation.VisibleForTesting; +import androidx.core.content.ContextCompat; import android.util.AttributeSet; import android.util.DisplayMetrics; import android.view.View; diff --git a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/CircleImageView.java b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/CircleImageView.java index 52fa20bc..d1f0c215 100644 --- a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/CircleImageView.java +++ b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/CircleImageView.java @@ -25,7 +25,7 @@ import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.OvalShape; import android.os.Build; -import android.support.annotation.ColorInt; +import androidx.annotation.ColorInt; import android.view.View; import android.widget.ImageView; diff --git a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/MaterialProgressDrawable.java b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/MaterialProgressDrawable.java index 979f883d..8d08897d 100644 --- a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/MaterialProgressDrawable.java +++ b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/MaterialProgressDrawable.java @@ -27,10 +27,12 @@ import android.graphics.RectF; import android.graphics.drawable.Animatable; import android.graphics.drawable.Drawable; -import android.support.annotation.ColorInt; -import android.support.annotation.IntDef; -import android.support.annotation.NonNull; -import android.support.v4.view.animation.FastOutSlowInInterpolator; +import androidx.annotation.ColorInt; + +import androidx.annotation.IntDef; +import androidx.annotation.NonNull; +import androidx.interpolator.view.animation.FastOutSlowInInterpolator; + import android.util.DisplayMetrics; import android.view.View; import android.view.animation.Animation; diff --git a/refresh-header-radar/build.gradle b/refresh-header-radar/build.gradle index 891dc9da..8e50f759 100644 --- a/refresh-header-radar/build.gradle +++ b/refresh-header-radar/build.gradle @@ -3,11 +3,11 @@ apply plugin: 'com.android.library' description = 'the header BezierRadarHeader of SmartRefreshLayout' android { - compileSdkVersion 28 + compileSdkVersion 33 defaultConfig { - minSdkVersion 16 - targetSdkVersion 28 + minSdkVersion 21 + targetSdkVersion 33 versionCode 1 versionName "1.0" @@ -27,10 +27,7 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - compileOnly 'com.android.support:appcompat-v7:28.0.0' - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' + implementation 'androidx.appcompat:appcompat:1.5.1' compileOnly project(':refresh-layout-kernel') diff --git a/refresh-header-radar/src/main/java/com/scwang/smart/refresh/header/BezierRadarHeader.java b/refresh-header-radar/src/main/java/com/scwang/smart/refresh/header/BezierRadarHeader.java index d11d9886..9cd2f48a 100644 --- a/refresh-header-radar/src/main/java/com/scwang/smart/refresh/header/BezierRadarHeader.java +++ b/refresh-header-radar/src/main/java/com/scwang/smart/refresh/header/BezierRadarHeader.java @@ -9,10 +9,10 @@ import android.graphics.Paint; import android.graphics.Path; import android.graphics.RectF; -import android.support.annotation.ColorInt; -import android.support.annotation.ColorRes; -import android.support.annotation.NonNull; -import android.support.v4.content.ContextCompat; +import androidx.annotation.ColorInt; +import androidx.annotation.ColorRes; +import androidx.annotation.NonNull; +import androidx.core.content.ContextCompat; import android.util.AttributeSet; import android.view.View; import android.view.animation.AccelerateDecelerateInterpolator; diff --git a/refresh-header-two-level/build.gradle b/refresh-header-two-level/build.gradle index 6faa3a49..80fb2ce3 100644 --- a/refresh-header-two-level/build.gradle +++ b/refresh-header-two-level/build.gradle @@ -3,11 +3,11 @@ apply plugin: 'com.android.library' description = 'the header TwoLevelHeader of SmartRefreshLayout' android { - compileSdkVersion 28 + compileSdkVersion 33 defaultConfig { - minSdkVersion 16 - targetSdkVersion 28 + minSdkVersion 21 + targetSdkVersion 33 versionCode 1 versionName "1.0" @@ -30,10 +30,7 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - compileOnly 'com.android.support:appcompat-v7:28.0.0' - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' + implementation 'androidx.appcompat:appcompat:1.5.1' api project(':refresh-header-classics') compileOnly project(':refresh-layout-kernel') diff --git a/refresh-header-two-level/src/main/java/com/scwang/smart/refresh/header/TwoLevelHeader.java b/refresh-header-two-level/src/main/java/com/scwang/smart/refresh/header/TwoLevelHeader.java index 3d203468..a4051372 100644 --- a/refresh-header-two-level/src/main/java/com/scwang/smart/refresh/header/TwoLevelHeader.java +++ b/refresh-header-two-level/src/main/java/com/scwang/smart/refresh/header/TwoLevelHeader.java @@ -2,9 +2,10 @@ import android.content.Context; import android.content.res.TypedArray; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.view.NestedScrollingParent2; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.view.NestedScrollingParent2; + import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; diff --git a/refresh-header-two-level/src/main/java/com/scwang/smart/refresh/header/listener/OnTwoLevelListener.java b/refresh-header-two-level/src/main/java/com/scwang/smart/refresh/header/listener/OnTwoLevelListener.java index 55007332..708e67ca 100644 --- a/refresh-header-two-level/src/main/java/com/scwang/smart/refresh/header/listener/OnTwoLevelListener.java +++ b/refresh-header-two-level/src/main/java/com/scwang/smart/refresh/header/listener/OnTwoLevelListener.java @@ -1,6 +1,6 @@ package com.scwang.smart.refresh.header.listener; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.scwang.smart.refresh.layout.api.RefreshLayout; diff --git a/refresh-header/build.gradle b/refresh-header/build.gradle index 2a5278a5..97dd0835 100644 --- a/refresh-header/build.gradle +++ b/refresh-header/build.gradle @@ -3,10 +3,10 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 28 + compileSdkVersion 33 defaultConfig { - minSdkVersion 16 - targetSdkVersion 28 + minSdkVersion 21 + targetSdkVersion 33 versionCode 1 versionName SMART_VERSION @@ -25,17 +25,12 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { - exclude group: 'com.android.support', module: 'support-annotations' - }) - testImplementation 'junit:junit:4.12' - compileOnly 'com.android.support:support-annotations:28.0.0' - compileOnly 'com.android.support:support-v4:28.0.0' + implementation 'androidx.annotation:annotation:1.5.0' + implementation 'androidx.legacy:legacy-support-v4:1.0.0' compileOnly project(':refresh-layout') compileOnly project(':refresh-drawable-path') compileOnly project(':refresh-header-material') - compileOnly project(':refresh-layout-kernel') compileOnly project(':refresh-header-falsify') } diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/BezierCircleHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/BezierCircleHeader.java index 3aee4c45..750d8cb5 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/BezierCircleHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/BezierCircleHeader.java @@ -6,9 +6,9 @@ import android.graphics.Paint; import android.graphics.Path; import android.graphics.RectF; -import android.support.annotation.ColorInt; -import android.support.annotation.NonNull; -import android.support.v4.graphics.ColorUtils; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; +import androidx.core.graphics.ColorUtils; import android.util.AttributeSet; import android.view.View; import android.view.animation.AccelerateInterpolator; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/DeliveryHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/DeliveryHeader.java index 8c699c63..3134eced 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/DeliveryHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/DeliveryHeader.java @@ -4,9 +4,9 @@ import android.graphics.Canvas; import android.graphics.Rect; import android.graphics.drawable.Drawable; -import android.support.annotation.ColorInt; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.util.AttributeSet; import android.view.View; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/DropBoxHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/DropBoxHeader.java index 8f51c08e..7ae2cd94 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/DropBoxHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/DropBoxHeader.java @@ -10,10 +10,10 @@ import android.graphics.Path; import android.graphics.Rect; import android.graphics.drawable.Drawable; -import android.support.annotation.ColorInt; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.graphics.ColorUtils; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.graphics.ColorUtils; import android.util.AttributeSet; import android.view.View; import android.view.animation.AccelerateInterpolator; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FlyRefreshHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FlyRefreshHeader.java index c4a4f1c1..ee6f1aa8 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FlyRefreshHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FlyRefreshHeader.java @@ -6,10 +6,11 @@ import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.content.Context; -import android.support.annotation.ColorInt; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.view.animation.PathInterpolatorCompat; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.view.animation.PathInterpolatorCompat; + import android.util.AttributeSet; import android.view.View; import android.view.animation.AccelerateInterpolator; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameBattleCityHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameBattleCityHeader.java index 938c4abe..626bbc0e 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameBattleCityHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameBattleCityHeader.java @@ -4,7 +4,7 @@ import android.graphics.Canvas; import android.graphics.Point; import android.graphics.RectF; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.util.AttributeSet; import android.util.SparseArray; import android.view.View; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameHitBlockHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameHitBlockHeader.java index 84cdd018..11a25dc5 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameHitBlockHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameHitBlockHeader.java @@ -5,8 +5,8 @@ import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Point; -import android.support.annotation.NonNull; -import android.support.v4.graphics.ColorUtils; +import androidx.annotation.NonNull; +import androidx.core.graphics.ColorUtils; import android.util.AttributeSet; import android.view.View; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/PhoenixHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/PhoenixHeader.java index ab4b566e..bff0847b 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/PhoenixHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/PhoenixHeader.java @@ -7,8 +7,8 @@ import android.graphics.Matrix; import android.graphics.Rect; import android.graphics.drawable.Drawable; -import android.support.annotation.ColorInt; -import android.support.annotation.NonNull; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; import android.util.AttributeSet; import android.view.View; import android.view.animation.Animation; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/StoreHouseHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/StoreHouseHeader.java index 78d22e84..8cff5b86 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/StoreHouseHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/StoreHouseHeader.java @@ -7,8 +7,8 @@ import android.graphics.Color; import android.graphics.Matrix; import android.graphics.PointF; -import android.support.annotation.ColorInt; -import android.support.annotation.NonNull; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; import android.util.AttributeSet; import android.view.View; import android.view.animation.AccelerateInterpolator; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/TaurusHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/TaurusHeader.java index cc699675..fb7408b8 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/TaurusHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/TaurusHeader.java @@ -6,8 +6,8 @@ import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.drawable.Drawable; -import android.support.annotation.ColorInt; -import android.support.annotation.NonNull; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; import android.util.AttributeSet; import android.view.View; import android.view.animation.AccelerateDecelerateInterpolator; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaterDropHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaterDropHeader.java index 024ea56e..6900b62a 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaterDropHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaterDropHeader.java @@ -5,8 +5,8 @@ import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; -import android.support.annotation.ColorInt; -import android.support.annotation.NonNull; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java index 5b369490..e9796cba 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java @@ -5,10 +5,10 @@ import android.content.res.Resources; import android.content.res.TypedArray; import android.graphics.drawable.Drawable; -import android.support.annotation.ColorInt; -import android.support.annotation.IdRes; -import android.support.annotation.NonNull; -import android.support.v4.content.ContextCompat; +import androidx.annotation.ColorInt; +import androidx.annotation.IdRes; +import androidx.annotation.NonNull; +import androidx.core.content.ContextCompat; import android.util.AttributeSet; import android.util.DisplayMetrics; import android.view.View; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/flyrefresh/MountainSceneView.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/flyrefresh/MountainSceneView.java index 7c880f63..6b6b3546 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/flyrefresh/MountainSceneView.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/flyrefresh/MountainSceneView.java @@ -7,9 +7,11 @@ import android.graphics.Paint; import android.graphics.Path; import android.graphics.RectF; -import android.support.annotation.ColorInt; -import android.support.v4.graphics.ColorUtils; -import android.support.v4.view.animation.PathInterpolatorCompat; + +import androidx.annotation.ColorInt; +import androidx.core.graphics.ColorUtils; +import androidx.core.view.animation.PathInterpolatorCompat; + import android.util.AttributeSet; import android.view.View; import android.view.animation.Interpolator; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameBase.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameBase.java index 742e5003..a57980ff 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameBase.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameBase.java @@ -2,8 +2,8 @@ import android.annotation.SuppressLint; import android.content.Context; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameView.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameView.java index 15b4cb5c..953c037f 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameView.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameView.java @@ -9,9 +9,9 @@ import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; -import android.support.annotation.ColorInt; -import android.support.annotation.NonNull; -import android.support.v4.graphics.ColorUtils; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; +import androidx.core.graphics.ColorUtils; import android.text.TextPaint; import android.util.AttributeSet; import android.util.DisplayMetrics; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/waterdrop/WaterDropView.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/waterdrop/WaterDropView.java index b2a89e77..82160c9f 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/waterdrop/WaterDropView.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/waterdrop/WaterDropView.java @@ -6,7 +6,7 @@ import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; -import android.support.annotation.ColorInt; +import androidx.annotation.ColorInt; import android.view.View; import android.view.animation.DecelerateInterpolator; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/waveswipe/WaveView.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/waveswipe/WaveView.java index 00d7163d..5ef4a723 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/waveswipe/WaveView.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/waveswipe/WaveView.java @@ -24,7 +24,7 @@ import android.graphics.Path; import android.graphics.RectF; import android.os.Build; -import android.support.annotation.ColorInt; +import androidx.annotation.ColorInt; import android.view.View; import android.view.ViewTreeObserver; import android.view.animation.AccelerateDecelerateInterpolator; diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/DeliveryHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/DeliveryHeader.java index a5b17642..7ec74144 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/DeliveryHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/DeliveryHeader.java @@ -1,7 +1,7 @@ package com.scwang.smartrefresh.header; import android.content.Context; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.util.AttributeSet; import com.scwang.smartrefresh.layout.api.RefreshHeader; diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/DropBoxHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/DropBoxHeader.java index b705ce6c..14a0147b 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/DropBoxHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/DropBoxHeader.java @@ -1,7 +1,7 @@ package com.scwang.smartrefresh.header; import android.content.Context; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.util.AttributeSet; import com.scwang.smartrefresh.layout.api.RefreshHeader; diff --git a/refresh-layout-kernel/build.gradle b/refresh-layout-kernel/build.gradle index 8ac0c411..b760a61b 100644 --- a/refresh-layout-kernel/build.gradle +++ b/refresh-layout-kernel/build.gradle @@ -4,11 +4,11 @@ description = 'the kernel of SmartRefreshLayout' android { - compileSdkVersion 28 + compileSdkVersion 33 defaultConfig { - minSdkVersion 16 - targetSdkVersion 28 + minSdkVersion 21 + targetSdkVersion 33 versionCode 1 versionName "1.0" @@ -28,12 +28,8 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { - exclude group: 'com.android.support', module: 'support-annotations' - }) - testImplementation 'junit:junit:4.12' - compileOnly 'com.android.support:design:28.0.0' + implementation 'com.google.android.material:material:1.7.0' } //apply plugin: 'maven-publish' diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java index 5d1850a3..baa445ab 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java @@ -11,15 +11,6 @@ import android.graphics.Paint; import android.os.Handler; import android.os.Looper; -import android.support.annotation.ColorInt; -import android.support.annotation.ColorRes; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.content.ContextCompat; -import android.support.v4.view.NestedScrollingChildHelper; -import android.support.v4.view.NestedScrollingParent; -import android.support.v4.view.NestedScrollingParentHelper; -import android.support.v4.view.ViewCompat; import android.util.AttributeSet; import android.view.Gravity; import android.view.MotionEvent; @@ -72,6 +63,16 @@ import static com.scwang.smart.refresh.layout.util.SmartUtil.isContentView; import static java.lang.System.currentTimeMillis; +import androidx.annotation.ColorInt; +import androidx.annotation.ColorRes; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; +import androidx.core.view.NestedScrollingChildHelper; +import androidx.core.view.NestedScrollingParent; +import androidx.core.view.NestedScrollingParentHelper; +import androidx.core.view.ViewCompat; + /** * 智能刷新布局 * Intelligent RefreshLayout @@ -243,10 +244,10 @@ public SmartRefreshLayout(Context context, AttributeSet attrs) { TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.SmartRefreshLayout); - if (!ta.hasValue(R.styleable.SmartRefreshLayout_android_clipToPadding)) { + if (!ta.hasValue(R.styleable.SmartRefreshLayout_srlClipToPadding)) { super.setClipToPadding(false); } - if (!ta.hasValue(R.styleable.SmartRefreshLayout_android_clipChildren)) { + if (!ta.hasValue(R.styleable.SmartRefreshLayout_srlClipChildren)) { super.setClipChildren(false); } diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java index 52f3a5fe..aecd104c 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java @@ -1,17 +1,18 @@ package com.scwang.smart.refresh.layout.api; -import android.support.annotation.ColorInt; -import android.support.annotation.NonNull; -import android.support.annotation.RestrictTo; +import static androidx.annotation.RestrictTo.Scope.LIBRARY; +import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP; +import static androidx.annotation.RestrictTo.Scope.SUBCLASSES; + +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; +import androidx.annotation.RestrictTo; + import android.view.View; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; import com.scwang.smart.refresh.layout.listener.OnStateChangedListener; -import static android.support.annotation.RestrictTo.Scope.LIBRARY; -import static android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP; -import static android.support.annotation.RestrictTo.Scope.SUBCLASSES; - /** * 刷新组件 diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshContent.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshContent.java index 01c7e6b1..af592b1e 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshContent.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshContent.java @@ -1,7 +1,7 @@ package com.scwang.smart.refresh.layout.api; import android.animation.ValueAnimator.AnimatorUpdateListener; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.view.MotionEvent; import android.view.View; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshFooter.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshFooter.java index 97d289d2..b57745f8 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshFooter.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshFooter.java @@ -1,10 +1,11 @@ package com.scwang.smart.refresh.layout.api; -import android.support.annotation.RestrictTo; -import static android.support.annotation.RestrictTo.Scope.LIBRARY; -import static android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP; -import static android.support.annotation.RestrictTo.Scope.SUBCLASSES; +import static androidx.annotation.RestrictTo.Scope.LIBRARY; +import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP; +import static androidx.annotation.RestrictTo.Scope.SUBCLASSES; + +import androidx.annotation.RestrictTo; /** * 刷新底部 diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshKernel.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshKernel.java index 43db68a9..eac2cf2f 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshKernel.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshKernel.java @@ -2,7 +2,7 @@ import android.animation.Animator; import android.animation.ValueAnimator; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.scwang.smart.refresh.layout.constant.RefreshState; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshLayout.java index 262eb40a..2dfb49ef 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshLayout.java @@ -1,11 +1,11 @@ package com.scwang.smart.refresh.layout.api; -import android.support.annotation.ColorInt; -import android.support.annotation.ColorRes; -import android.support.annotation.FloatRange; -import android.support.annotation.IdRes; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.ColorInt; +import androidx.annotation.ColorRes; +import androidx.annotation.FloatRange; +import androidx.annotation.IdRes; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.view.View; import android.view.ViewGroup; import android.view.animation.Interpolator; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshFooterCreator.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshFooterCreator.java index 4d44dce3..7bf7a736 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshFooterCreator.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshFooterCreator.java @@ -1,7 +1,7 @@ package com.scwang.smart.refresh.layout.listener; import android.content.Context; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.scwang.smart.refresh.layout.api.RefreshFooter; import com.scwang.smart.refresh.layout.api.RefreshLayout; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshHeaderCreator.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshHeaderCreator.java index a13dbb43..85210553 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshHeaderCreator.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshHeaderCreator.java @@ -1,7 +1,7 @@ package com.scwang.smart.refresh.layout.listener; import android.content.Context; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.api.RefreshLayout; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshInitializer.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshInitializer.java index 5c0ad0d3..4782036b 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshInitializer.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshInitializer.java @@ -1,7 +1,7 @@ package com.scwang.smart.refresh.layout.listener; import android.content.Context; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.scwang.smart.refresh.layout.api.RefreshLayout; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/OnLoadMoreListener.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/OnLoadMoreListener.java index af77f052..c0186ff7 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/OnLoadMoreListener.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/OnLoadMoreListener.java @@ -1,6 +1,6 @@ package com.scwang.smart.refresh.layout.listener; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.scwang.smart.refresh.layout.api.RefreshLayout; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/OnRefreshListener.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/OnRefreshListener.java index 7bdaaf65..6f061027 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/OnRefreshListener.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/OnRefreshListener.java @@ -1,6 +1,6 @@ package com.scwang.smart.refresh.layout.listener; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.scwang.smart.refresh.layout.api.RefreshLayout; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/OnStateChangedListener.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/OnStateChangedListener.java index e70311bc..7cd38111 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/OnStateChangedListener.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/OnStateChangedListener.java @@ -1,15 +1,16 @@ package com.scwang.smart.refresh.layout.listener; -import android.support.annotation.NonNull; -import android.support.annotation.RestrictTo; +import static androidx.annotation.RestrictTo.Scope.LIBRARY; +import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP; +import static androidx.annotation.RestrictTo.Scope.SUBCLASSES; + +import androidx.annotation.NonNull; +import androidx.annotation.RestrictTo; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.RefreshState; -import static android.support.annotation.RestrictTo.Scope.LIBRARY; -import static android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP; -import static android.support.annotation.RestrictTo.Scope.SUBCLASSES; /** * 刷新状态改变监听器 diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java index e09dc1e6..66a99dc5 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java @@ -2,9 +2,9 @@ import android.annotation.SuppressLint; import android.content.Context; -import android.support.annotation.ColorInt; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleMultiListener.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleMultiListener.java index 975734de..34a0fa3d 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleMultiListener.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleMultiListener.java @@ -1,6 +1,6 @@ package com.scwang.smart.refresh.layout.simple; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.scwang.smart.refresh.layout.api.RefreshFooter; import com.scwang.smart.refresh.layout.api.RefreshHeader; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/DesignUtil.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/DesignUtil.java index aaffa3b6..2fc58b52 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/DesignUtil.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/DesignUtil.java @@ -1,10 +1,11 @@ package com.scwang.smart.refresh.layout.util; -import android.support.design.widget.AppBarLayout; -import android.support.design.widget.CoordinatorLayout; +import com.google.android.material.appbar.AppBarLayout; import android.view.View; import android.view.ViewGroup; +import androidx.coordinatorlayout.widget.CoordinatorLayout; + import com.scwang.smart.refresh.layout.api.RefreshKernel; import com.scwang.smart.refresh.layout.listener.CoordinatorLayoutListener; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/SmartUtil.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/SmartUtil.java index ec761689..271965fe 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/SmartUtil.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/SmartUtil.java @@ -3,13 +3,14 @@ import android.content.res.Resources; import android.graphics.PointF; import android.os.Build; -import android.support.annotation.NonNull; -import android.support.v4.view.NestedScrollingChild; -import android.support.v4.view.NestedScrollingParent; -import android.support.v4.view.ScrollingView; -import android.support.v4.view.ViewPager; -import android.support.v4.widget.NestedScrollView; -import android.support.v7.widget.RecyclerView; +import androidx.annotation.NonNull; + +import androidx.core.view.NestedScrollingChild; +import androidx.core.view.NestedScrollingParent; +import androidx.core.view.ScrollingView; +import androidx.viewpager.widget.ViewPager; +import androidx.core.widget.NestedScrollView; +import androidx.recyclerview.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import android.view.animation.Interpolator; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/wrapper/RefreshContentWrapper.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/wrapper/RefreshContentWrapper.java index c2153346..d3e68253 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/wrapper/RefreshContentWrapper.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/wrapper/RefreshContentWrapper.java @@ -3,10 +3,11 @@ import android.animation.ValueAnimator; import android.animation.ValueAnimator.AnimatorUpdateListener; import android.graphics.PointF; -import android.support.annotation.NonNull; -import android.support.v4.view.NestedScrollingChild; -import android.support.v4.view.NestedScrollingParent; -import android.support.v4.view.ViewPager; +import androidx.annotation.NonNull; + +import androidx.core.view.NestedScrollingChild; +import androidx.core.view.NestedScrollingParent; +import androidx.viewpager.widget.ViewPager; import android.view.Gravity; import android.view.MotionEvent; import android.view.View; diff --git a/refresh-layout-kernel/src/main/res/values/attrs.xml b/refresh-layout-kernel/src/main/res/values/attrs.xml index e0cdbacb..bcc48e08 100644 --- a/refresh-layout-kernel/src/main/res/values/attrs.xml +++ b/refresh-layout-kernel/src/main/res/values/attrs.xml @@ -41,8 +41,8 @@ - - + + diff --git a/refresh-layout/build.gradle b/refresh-layout/build.gradle index 200c215d..5ef70af4 100644 --- a/refresh-layout/build.gradle +++ b/refresh-layout/build.gradle @@ -3,11 +3,11 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 28 + compileSdkVersion 33 defaultConfig { - minSdkVersion 16 - targetSdkVersion 28 + minSdkVersion 21 + targetSdkVersion 33 versionCode 1 versionName "1.0" @@ -27,12 +27,8 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { - exclude group: 'com.android.support', module: 'support-annotations' - }) - testImplementation 'junit:junit:4.12' - compileOnly 'com.android.support:design:28.0.0' + implementation 'com.google.android.material:material:1.7.0' compileOnly project(':refresh-layout-kernel') compileOnly project(':refresh-footer-ball') compileOnly project(':refresh-header-falsify') diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java index 84952e71..5c4182ad 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java @@ -2,8 +2,8 @@ import android.annotation.SuppressLint; import android.content.Context; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.util.AttributeSet; import android.view.View; diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshFooterCreator.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshFooterCreator.java index 16dd939f..0cbcfc80 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshFooterCreator.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshFooterCreator.java @@ -1,7 +1,7 @@ package com.scwang.smartrefresh.layout.api; import android.content.Context; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; /** * 默认Footer创建器 diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshHeaderCreator.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshHeaderCreator.java index 628607ae..4a90695c 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshHeaderCreator.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshHeaderCreator.java @@ -1,7 +1,7 @@ package com.scwang.smartrefresh.layout.api; import android.content.Context; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; /** * 默认Header创建器 diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshInitializer.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshInitializer.java index 90fe2bf5..3d7bcab0 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshInitializer.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshInitializer.java @@ -1,7 +1,7 @@ package com.scwang.smartrefresh.layout.api; import android.content.Context; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; /** * 默认全局初始化器 diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/OnTwoLevelListener.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/OnTwoLevelListener.java index 3784f4a1..f7fd25d0 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/OnTwoLevelListener.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/OnTwoLevelListener.java @@ -1,6 +1,6 @@ package com.scwang.smartrefresh.layout.api; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; /** * 二级刷新监听器 diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshInternal.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshInternal.java index e85eb0e9..c09f73c0 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshInternal.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshInternal.java @@ -1,6 +1,6 @@ package com.scwang.smartrefresh.layout.api; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.scwang.smart.refresh.layout.api.RefreshComponent; import com.scwang.smartrefresh.layout.constant.SpinnerStyle; diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshLayout.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshLayout.java index 1cdb1cc1..200dc0a2 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshLayout.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshLayout.java @@ -1,7 +1,7 @@ package com.scwang.smartrefresh.layout.api; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener; import com.scwang.smartrefresh.layout.listener.OnMultiPurposeListener; diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/BallPulseFooter.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/BallPulseFooter.java index effb6069..4cfa9bdc 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/BallPulseFooter.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/BallPulseFooter.java @@ -1,7 +1,7 @@ package com.scwang.smartrefresh.layout.footer; import android.content.Context; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import android.util.AttributeSet; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java index 3905ea59..030a6da3 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java @@ -1,8 +1,8 @@ package com.scwang.smartrefresh.layout.header; import android.content.Context; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.util.AttributeSet; import com.scwang.smartrefresh.layout.api.OnTwoLevelListener; diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/InternalAbstract.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/InternalAbstract.java index 35df9d41..b9e0c926 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/InternalAbstract.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/InternalAbstract.java @@ -1,8 +1,8 @@ package com.scwang.smartrefresh.layout.internal; import android.content.Context; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.util.AttributeSet; import android.view.View; diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnLoadMoreListener.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnLoadMoreListener.java index 85b96bcc..fa5b7856 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnLoadMoreListener.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnLoadMoreListener.java @@ -1,6 +1,6 @@ package com.scwang.smartrefresh.layout.listener; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.scwang.smartrefresh.layout.api.RefreshLayout; diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnRefreshListener.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnRefreshListener.java index 149d74ab..5d986488 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnRefreshListener.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnRefreshListener.java @@ -1,6 +1,6 @@ package com.scwang.smartrefresh.layout.listener; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.scwang.smartrefresh.layout.api.RefreshLayout; diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnStateChangedListener.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnStateChangedListener.java index 4ba6ad67..d15d186d 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnStateChangedListener.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnStateChangedListener.java @@ -1,16 +1,17 @@ package com.scwang.smartrefresh.layout.listener; -import android.support.annotation.NonNull; -import android.support.annotation.RestrictTo; +import static androidx.annotation.RestrictTo.Scope.LIBRARY; +import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP; +import static androidx.annotation.RestrictTo.Scope.SUBCLASSES; + +import androidx.annotation.NonNull; +import androidx.annotation.RestrictTo; + import com.scwang.smartrefresh.layout.api.RefreshLayout; import com.scwang.smartrefresh.layout.constant.RefreshState; -import static android.support.annotation.RestrictTo.Scope.LIBRARY; -import static android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP; -import static android.support.annotation.RestrictTo.Scope.SUBCLASSES; - /** * 刷新状态改变监听器 * Created by scwang on 2017/5/26. diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/SimpleMultiPurposeListener.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/SimpleMultiPurposeListener.java index 97a43065..92a3d7b8 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/SimpleMultiPurposeListener.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/SimpleMultiPurposeListener.java @@ -1,6 +1,6 @@ package com.scwang.smartrefresh.layout.listener; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.scwang.smart.refresh.layout.listener.OnMultiListener; import com.scwang.smartrefresh.layout.api.RefreshFooter; From 4c0bac707ac28629c5a1db3fb4b7be22605bf790 Mon Sep 17 00:00:00 2001 From: findviewbyid Date: Thu, 12 Jan 2023 22:23:47 +0800 Subject: [PATCH 25/67] =?UTF-8?q?=E6=97=B6=E5=8C=BA=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=90=8E=E9=9C=80=E8=A6=81=E5=8F=8A=E6=97=B6=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E5=88=B7=E6=96=B0=E7=9A=84=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=90=A6=E5=88=99=E5=87=BA=E7=8E=B0=E4=B8=8B=E6=8B=89=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E6=97=B6=E9=97=B4=E4=B8=8E=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E4=B8=8D=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/scwang/smart/refresh/header/ClassicsHeader.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/refresh-header-classics/src/main/java/com/scwang/smart/refresh/header/ClassicsHeader.java b/refresh-header-classics/src/main/java/com/scwang/smart/refresh/header/ClassicsHeader.java index 3c5f6204..4e632940 100644 --- a/refresh-header-classics/src/main/java/com/scwang/smart/refresh/header/ClassicsHeader.java +++ b/refresh-header-classics/src/main/java/com/scwang/smart/refresh/header/ClassicsHeader.java @@ -29,9 +29,11 @@ import java.text.DateFormat; import java.text.SimpleDateFormat; +import java.util.Calendar; import java.util.Date; import java.util.List; import java.util.Locale; +import java.util.TimeZone; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; @@ -291,6 +293,7 @@ public void onStateChanged(@NonNull RefreshLayout refreshLayout, @NonNull Refres public ClassicsHeader setLastUpdateTime(Date time) { final View thisView = this; mLastTime = time; + mLastUpdateFormat.setCalendar(Calendar.getInstance(TimeZone.getDefault(), Locale.getDefault())); mLastUpdateText.setText(mLastUpdateFormat.format(time)); if (mShared != null && !thisView.isInEditMode()) { mShared.edit().putLong(KEY_LAST_UPDATE_TIME, time.getTime()).apply(); From 3cc935dac2a993357a6393513a7adbd83fcc5140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A0=91=E6=9C=BE?= Date: Thu, 27 Apr 2023 14:51:38 +0800 Subject: [PATCH 26/67] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新最新版本为 2.0.6 --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1f8d52bd..30c94edb 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![License](https://img.shields.io/badge/License%20-Apache%202-337ab7.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![Arsenal](https://img.shields.io/badge/Arsenal%20-%20SmartRefresh-4cae4c.svg)](https://android-arsenal.com/details/1/6001) -[![Maven](https://img.shields.io/badge/%20Maven%20-2.0.5-5bc0de.svg)](https://s01.oss.sonatype.org/#nexus-search;quick~refresh-layout-kernel) +[![Maven](https://img.shields.io/badge/%20Maven%20-2.0.6-5bc0de.svg)](https://s01.oss.sonatype.org/#nexus-search;quick~refresh-layout-kernel) [![MinSdk](https://img.shields.io/badge/%20MinSdk%20-%2012%2B%20-f0ad4e.svg)](https://android-arsenal.com/api?level=12) [![Methods](https://img.shields.io/badge/Methods%20%7C%20Size%20-%20784%20%7C%20121%20KB-d9534f.svg)](http://www.methodscount.com/?lib=io.github.scwang90:refresh%3ASmartRefreshLayout%3A1.0.4) @@ -124,14 +124,14 @@ V2.x 版本已经把依赖库拆分成8个包啦,用到的时候自行引用 ```gradle implementation 'androidx.appcompat:appcompat:1.0.0' //必须 1.0.0 以上 -implementation 'io.github.scwang90:refresh-layout-kernel:2.0.5' //核心必须依赖 -implementation 'io.github.scwang90:refresh-header-classics:2.0.5' //经典刷新头 -implementation 'io.github.scwang90:refresh-header-radar:2.0.5' //雷达刷新头 -implementation 'io.github.scwang90:refresh-header-falsify:2.0.5' //虚拟刷新头 -implementation 'io.github.scwang90:refresh-header-material:2.0.5' //谷歌刷新头 -implementation 'io.github.scwang90:refresh-header-two-level:2.0.5' //二级刷新头 -implementation 'io.github.scwang90:refresh-footer-ball:2.0.5' //球脉冲加载 -implementation 'io.github.scwang90:refresh-footer-classics:2.0.5' //经典加载 +implementation 'io.github.scwang90:refresh-layout-kernel:2.0.6' //核心必须依赖 +implementation 'io.github.scwang90:refresh-header-classics:2.0.6' //经典刷新头 +implementation 'io.github.scwang90:refresh-header-radar:2.0.6' //雷达刷新头 +implementation 'io.github.scwang90:refresh-header-falsify:2.0.6' //虚拟刷新头 +implementation 'io.github.scwang90:refresh-header-material:2.0.6' //谷歌刷新头 +implementation 'io.github.scwang90:refresh-header-two-level:2.0.6' //二级刷新头 +implementation 'io.github.scwang90:refresh-footer-ball:2.0.6' //球脉冲加载 +implementation 'io.github.scwang90:refresh-footer-classics:2.0.6' //经典加载 ``` From 102fadf2f497ea89b9a29de4f656c10365a0520d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A0=91=E6=9C=BE?= Date: Thu, 27 Apr 2023 14:53:16 +0800 Subject: [PATCH 27/67] Update README_EN.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新英文版最新版本为 2.0.6 --- README_EN.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README_EN.md b/README_EN.md index 29565965..554f189a 100644 --- a/README_EN.md +++ b/README_EN.md @@ -2,9 +2,9 @@ [![License](https://img.shields.io/badge/License%20-Apache%202-337ab7.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![Arsenal](https://img.shields.io/badge/Arsenal%20-%20SmartRefresh-4cae4c.svg)](https://android-arsenal.com/details/1/6001) -[![JCenter](https://img.shields.io/badge/%20Jcenter%20-2.0.5-5bc0de.svg)](https://bintray.com/scwang90/maven/refresh-layout-kernel/_latestVersion) +[![Maven](https://img.shields.io/badge/%20Maven%20-2.0.6-5bc0de.svg)](https://s01.oss.sonatype.org/#nexus-search;quick~refresh-layout-kernel) [![MinSdk](https://img.shields.io/badge/%20MinSdk%20-%2012%2B%20-f0ad4e.svg)](https://android-arsenal.com/api?level=12) -[![Methods](https://img.shields.io/badge/Methods%20%7C%20Size%20-%20784%20%7C%20122%20KB-d9534f.svg)](http://www.methodscount.com/?lib=io.github.scwang90:refresh%3ASmartRefreshLayout%3A1.1.0) +[![Methods](https://img.shields.io/badge/Methods%20%7C%20Size%20-%20784%20%7C%20121%20KB-d9534f.svg)](http://www.methodscount.com/?lib=io.github.scwang90:refresh%3ASmartRefreshLayout%3A1.0.4) ## English | [中文](README.md) @@ -120,14 +120,14 @@ It is recommended that you copy the source code into the project whenever you ne // Note: There will be no default Header and Footer after subcontracting. It needs to be added manually! // To search lastest version by https://search.maven.org/search?q=g:io.github.scwang90 -implementation 'io.github.scwang90:refresh-layout-kernel:2.0.5' //core -implementation 'io.github.scwang90:refresh-header-classics:2.0.5' //ClassicsHeader -implementation 'io.github.scwang90:refresh-header-radar:2.0.5' //BezierRadarHeader -implementation 'io.github.scwang90:refresh-header-falsify:2.0.5' //FalsifyHeader -implementation 'io.github.scwang90:refresh-header-material:2.0.5' //MaterialHeader -implementation 'io.github.scwang90:refresh-header-two-level:2.0.5' //TwoLevelHeader -implementation 'io.github.scwang90:refresh-footer-ball:2.0.5' //BallPulseFooter -implementation 'io.github.scwang90:refresh-footer-classics:2.0.5' //ClassicsFooter +implementation 'io.github.scwang90:refresh-layout-kernel:2.0.6' //core +implementation 'io.github.scwang90:refresh-header-classics:2.0.6' //ClassicsHeader +implementation 'io.github.scwang90:refresh-header-radar:2.0.6' //BezierRadarHeader +implementation 'io.github.scwang90:refresh-header-falsify:2.0.6' //FalsifyHeader +implementation 'io.github.scwang90:refresh-header-material:2.0.6' //MaterialHeader +implementation 'io.github.scwang90:refresh-header-two-level:2.0.6' //TwoLevelHeader +implementation 'io.github.scwang90:refresh-footer-ball:2.0.6' //BallPulseFooter +implementation 'io.github.scwang90:refresh-footer-classics:2.0.6' //ClassicsFooter ``` From 8eb70bf74ef921e645d741b711e6562e93c957cb Mon Sep 17 00:00:00 2001 From: wsc Date: Wed, 23 Aug 2023 23:18:28 +0800 Subject: [PATCH 28/67] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=9A=E5=9C=A8=E5=88=B7=E6=96=B0=E5=8A=A8=E7=94=BB=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=97=A0=E6=B3=95=E8=B7=B3=E8=BD=AC=EF=BC=8C?= =?UTF-8?q?=20https://github.com/scwang90/SmartRefreshLayout/issues/1540?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../index/RefreshPracticeFragment.java | 27 ++++++++++ .../refresh/layout/SmartRefreshLayout.java | 52 ++++++++++++++++++- 2 files changed, 77 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java index b76d3dd9..799fff32 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java @@ -12,6 +12,7 @@ import android.support.v7.widget.DividerItemDecoration; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; +import android.support.v7.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -31,6 +32,11 @@ import com.scwang.refreshlayout.fragment.practice.InstantPracticeFragment; import com.scwang.refreshlayout.fragment.practice.SecondFloorPracticeFragment; import com.scwang.refreshlayout.util.StatusBarUtil; +import com.scwang.smart.refresh.layout.SmartRefreshLayout; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.constant.RefreshState; +import com.scwang.smart.refresh.layout.listener.OnRefreshListener; +import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; import java.util.Arrays; @@ -90,6 +96,27 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position } }); } + Toolbar toolbar = root.findViewById(R.id.toolbar); + + SmartRefreshLayout refreshLayout = root.findViewById(R.id.refreshLayout); + refreshLayout.setOnRefreshListener(new OnRefreshListener() { + @Override + public void onRefresh(@NonNull RefreshLayout refreshLayout) { + refreshLayout.finishRefresh(); + } + }); + refreshLayout.setOnMultiListener(new SimpleMultiListener() { + @Override + public void onStateChanged(@NonNull RefreshLayout refreshLayout, @NonNull RefreshState oldState, @NonNull RefreshState newState) { + toolbar.setTitle("实战 - " + oldState + " -> " + newState); + } + + @Override + public void onLoadMore(@NonNull RefreshLayout refreshLayout) { + refreshLayout.finishLoadMore(); + } + + }); } @Override diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java index 5d1850a3..b2faf4f9 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java @@ -209,6 +209,14 @@ public class SmartRefreshLayout extends ViewGroup implements RefreshLayout, Nest protected boolean mFooterLocked = false;//Footer 正在loading 的时候是否锁住 列表不能向上滚动 + /* + * https://github.com/scwang90/SmartRefreshLayout/issues/1540 + * 问题修复辅助变量,记录关闭动画执行时手势事件 ACTION_DOWN 的触发时间 和 按下的坐标 + */ + protected long mLastTimeOnActionDown = 0; + protected float mLastTouchXOnActionDown = 0; + protected float mLastTouchYOnActionDown = 0; + //全局默认 Footer 构造器 protected static DefaultRefreshFooterCreator sFooterCreator = null; //全局默认 Header 构造器 @@ -903,6 +911,17 @@ public boolean dispatchTouchEvent(MotionEvent e) { //--------------------------------------------------------------------------- // + if (action == MotionEvent.ACTION_DOWN) { + /* + * https://github.com/scwang90/SmartRefreshLayout/issues/1540 + * 辅助下面的问题修复,拦截手势事件的时候,对 MotionEvent.ACTION_DOWN 的触发时间进行备份 + * 计算是否点击需要判断 ACTION_DOWN 和 ACTION_UP 的时间间隔,还有按下坐标 + */ + mLastTouchXOnActionDown = touchX; + mLastTouchYOnActionDown = touchY; + mLastTimeOnActionDown = System.currentTimeMillis(); + } + //--------------------------------------------------------------------------- //嵌套滚动模式辅助 @@ -929,9 +948,38 @@ public boolean dispatchTouchEvent(MotionEvent e) { || (mHeaderNeedTouchEventWhenRefreshing && ((mState.isOpening || mState.isFinishing) && mState.isHeader)) || (mFooterNeedTouchEventWhenLoading && ((mState.isOpening || mState.isFinishing) && mState.isFooter))) { return super.dispatchTouchEvent(e); + } else if (mState.isFinishing) { + /* + * https://github.com/scwang90/SmartRefreshLayout/issues/1540 + * 在刷新动画关闭的时候,点击列表无法跳转, + * 是因为下面的 if (interceptAnimatorByAction || mState.isFinishing ) return false + * 屏蔽了所有手势事件,屏蔽的原因是如果关闭动画正在执行的时候,随意滑动列表会导致意外的错乱 + * 目前的修复方法并不是放开屏蔽,而是针对 先 ACTION_DOWN 再 ACTION_UP 的点击事件进行补偿处理 + * 从而实现,完成动画执行时,列表不可手动滑动,但是可以点击列表项 + */ + if (action == MotionEvent.ACTION_UP) { + //要求时间间隔小于半秒钟 + if (System.currentTimeMillis() - mLastTimeOnActionDown < 500) { + float dx = touchX - mLastTouchXOnActionDown; + float dy = touchY - mLastTouchYOnActionDown; + //要求坐标偏移小于系统阈值 + if (Math.abs(dx) < mTouchSlop && Math.abs(dy) < mTouchSlop) { + e.setAction(MotionEvent.ACTION_DOWN); + super.dispatchTouchEvent(e); + e.setAction(MotionEvent.ACTION_UP); + return super.dispatchTouchEvent(e); + } + } + } + /* + * 返回 true,但是不调用 super.dispatchTouchEvent(e),表示已经处理,但实际情况是没处理。 + * 这样在拦截到 down move 事件时,才会继续触发 up 事件 + * 否则 返回false 后面不会再接收到 move 和 up 的事件 + */ + return true; } - if (interceptAnimatorByAction(action) || mState.isFinishing + if (interceptAnimatorByAction(action) || (mState == RefreshState.Loading && mDisableContentWhenLoading) || (mState == RefreshState.Refreshing && mDisableContentWhenRefresh)) { return false; @@ -1685,7 +1733,7 @@ protected void moveSpinnerInfinitely(float spinner) { * 源码引用,然后删掉下面4行的代码 */ if (spinner > mScreenHeightPixels * 5 && (thisView.getTag() == null && thisView.getTag(R.id.srl_tag) == null) && mLastTouchY < mScreenHeightPixels / 6f && mLastTouchX < mScreenHeightPixels / 16f) { - String egg = "你这么死拉,臣妾做不到啊!"; + String egg = "不要再拉了,臣妾做不到啊!"; Toast.makeText(thisView.getContext(), egg, Toast.LENGTH_SHORT).show(); thisView.setTag(R.id.srl_tag, egg); } From f473a9ae3fa77daf15db249d5a30796b71a21f46 Mon Sep 17 00:00:00 2001 From: wsc Date: Sat, 26 Aug 2023 01:24:04 +0800 Subject: [PATCH 29/67] =?UTF-8?q?=E5=8F=91=E5=B8=83=E7=89=88=E6=9C=AC2.1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 22 +++++++++------- .../index/RefreshPracticeFragment.java | 25 +------------------ gradle.properties | 5 ++-- 3 files changed, 16 insertions(+), 36 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index a1c7abce..59966ad2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -51,6 +51,9 @@ android { repositories { maven { url "https://jitpack.io" } + mavenCentral() +// maven { url "https://s01.oss.sonatype.org/content/repositories/releases" } +// maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots" } } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') @@ -66,8 +69,8 @@ dependencies { implementation project(':refresh-footer') implementation project(':refresh-header') implementation project(':refresh-layout') - implementation project(':refresh-drawable-path') + implementation project(':refresh-drawable-path') implementation project(':refresh-layout-kernel') implementation project(':refresh-header-classics') implementation project(':refresh-header-radar') @@ -76,14 +79,15 @@ dependencies { implementation project(':refresh-header-two-level') implementation project(':refresh-footer-ball') -// implementation 'com.scwang.smart:refresh-layout-kernel:2.0.0-alpha-1' //核心必须依赖 -// implementation 'com.scwang.smart:refresh-header-classics:2.0.0-alpha-1' //经典刷新头 -// implementation 'com.scwang.smart:refresh-header-radar:2.0.0-alpha-1' //雷达刷新头 -// implementation 'com.scwang.smart:refresh-header-falsify:2.0.0-alpha-1' //虚拟刷新头 -// implementation 'com.scwang.smart:refresh-header-material:2.0.0-alpha-1' //谷歌刷新头 -// implementation 'com.scwang.smart:refresh-header-two-level:2.0.0-alpha-1' //二级刷新头 -// implementation 'com.scwang.smart:refresh-footer-ball:2.0.0-alpha-1' //球脉冲加载 -// implementation 'com.scwang.smart:refresh-footer-classics:2.0.0-alpha-1' //经典加载 +// implementation 'io.github.scwang90:refresh-drawable-path:2.1.0' //矢量路径 +// implementation 'io.github.scwang90:refresh-layout-kernel:2.1.0' //核心必须依赖 +// implementation 'io.github.scwang90:refresh-header-classics:2.1.0' //经典刷新头 +// implementation 'io.github.scwang90:refresh-header-radar:2.1.0' //雷达刷新头 +// implementation 'io.github.scwang90:refresh-header-falsify:2.1.0' //虚拟刷新头 +// implementation 'io.github.scwang90:refresh-header-material:2.1.0' //谷歌刷新头 +// implementation 'io.github.scwang90:refresh-header-two-level:2.1.0' //二级刷新头 +// implementation 'io.github.scwang90:refresh-footer-ball:2.1.0' //球脉冲加载 +// implementation 'io.github.scwang90:refresh-footer-classics:2.1.0' //经典加载 implementation 'com.android.support:design:28.0.0' diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java index 799fff32..ecd59bdf 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java @@ -12,7 +12,6 @@ import android.support.v7.widget.DividerItemDecoration; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -34,9 +33,6 @@ import com.scwang.refreshlayout.util.StatusBarUtil; import com.scwang.smart.refresh.layout.SmartRefreshLayout; import com.scwang.smart.refresh.layout.api.RefreshLayout; -import com.scwang.smart.refresh.layout.constant.RefreshState; -import com.scwang.smart.refresh.layout.listener.OnRefreshListener; -import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; import java.util.Arrays; @@ -96,27 +92,8 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position } }); } - Toolbar toolbar = root.findViewById(R.id.toolbar); - SmartRefreshLayout refreshLayout = root.findViewById(R.id.refreshLayout); - refreshLayout.setOnRefreshListener(new OnRefreshListener() { - @Override - public void onRefresh(@NonNull RefreshLayout refreshLayout) { - refreshLayout.finishRefresh(); - } - }); - refreshLayout.setOnMultiListener(new SimpleMultiListener() { - @Override - public void onStateChanged(@NonNull RefreshLayout refreshLayout, @NonNull RefreshState oldState, @NonNull RefreshState newState) { - toolbar.setTitle("实战 - " + oldState + " -> " + newState); - } - - @Override - public void onLoadMore(@NonNull RefreshLayout refreshLayout) { - refreshLayout.finishLoadMore(); - } - - }); + refreshLayout.setOnRefreshListener(RefreshLayout::finishRefresh); } @Override diff --git a/gradle.properties b/gradle.properties index 69576ac3..8c3635e7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,12 +18,11 @@ org.gradle.jvmargs=-Xmx1536m SMART_USER=scwang90 SMART_GROUP=com.scwang.smart -SMART_VERSION=2.0.5 -# -SNAPSHOT +SMART_VERSION=2.1.0 SMART_PUBLISH=false SMART_GROUP_MVN=io.github.scwang90 SMART_EMAIL=scwang90@hotmail.com signing.keyId=888F6528 signing.password= -signing.secretKeyRingFile=/Users/scwang/.gnupg/secret-rsa.gpg +signing.secretKeyRingFile=../secret-rsa.gpg From d0bde464bdfa6c18d6205a7c077d5f2819c28426 Mon Sep 17 00:00:00 2001 From: wsc Date: Sun, 27 Aug 2023 01:33:36 +0800 Subject: [PATCH 30/67] =?UTF-8?q?=E5=8F=91=E5=B8=832.1.0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 18 +++++++++--------- README_EN.md | 18 +++++++++--------- gradle.properties | 4 ++-- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 30c94edb..0f463444 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![License](https://img.shields.io/badge/License%20-Apache%202-337ab7.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![Arsenal](https://img.shields.io/badge/Arsenal%20-%20SmartRefresh-4cae4c.svg)](https://android-arsenal.com/details/1/6001) -[![Maven](https://img.shields.io/badge/%20Maven%20-2.0.6-5bc0de.svg)](https://s01.oss.sonatype.org/#nexus-search;quick~refresh-layout-kernel) +[![Maven](https://img.shields.io/badge/%20Maven%20-2.1.0-5bc0de.svg)](https://s01.oss.sonatype.org/#nexus-search;quick~refresh-layout-kernel) [![MinSdk](https://img.shields.io/badge/%20MinSdk%20-%2012%2B%20-f0ad4e.svg)](https://android-arsenal.com/api?level=12) [![Methods](https://img.shields.io/badge/Methods%20%7C%20Size%20-%20784%20%7C%20121%20KB-d9534f.svg)](http://www.methodscount.com/?lib=io.github.scwang90:refresh%3ASmartRefreshLayout%3A1.0.4) @@ -124,14 +124,14 @@ V2.x 版本已经把依赖库拆分成8个包啦,用到的时候自行引用 ```gradle implementation 'androidx.appcompat:appcompat:1.0.0' //必须 1.0.0 以上 -implementation 'io.github.scwang90:refresh-layout-kernel:2.0.6' //核心必须依赖 -implementation 'io.github.scwang90:refresh-header-classics:2.0.6' //经典刷新头 -implementation 'io.github.scwang90:refresh-header-radar:2.0.6' //雷达刷新头 -implementation 'io.github.scwang90:refresh-header-falsify:2.0.6' //虚拟刷新头 -implementation 'io.github.scwang90:refresh-header-material:2.0.6' //谷歌刷新头 -implementation 'io.github.scwang90:refresh-header-two-level:2.0.6' //二级刷新头 -implementation 'io.github.scwang90:refresh-footer-ball:2.0.6' //球脉冲加载 -implementation 'io.github.scwang90:refresh-footer-classics:2.0.6' //经典加载 +implementation 'io.github.scwang90:refresh-layout-kernel:2.1.0' //核心必须依赖 +implementation 'io.github.scwang90:refresh-header-classics:2.1.0' //经典刷新头 +implementation 'io.github.scwang90:refresh-header-radar:2.1.0' //雷达刷新头 +implementation 'io.github.scwang90:refresh-header-falsify:2.1.0' //虚拟刷新头 +implementation 'io.github.scwang90:refresh-header-material:2.1.0' //谷歌刷新头 +implementation 'io.github.scwang90:refresh-header-two-level:2.1.0' //二级刷新头 +implementation 'io.github.scwang90:refresh-footer-ball:2.1.0' //球脉冲加载 +implementation 'io.github.scwang90:refresh-footer-classics:2.1.0' //经典加载 ``` diff --git a/README_EN.md b/README_EN.md index 554f189a..bf4878e3 100644 --- a/README_EN.md +++ b/README_EN.md @@ -2,7 +2,7 @@ [![License](https://img.shields.io/badge/License%20-Apache%202-337ab7.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![Arsenal](https://img.shields.io/badge/Arsenal%20-%20SmartRefresh-4cae4c.svg)](https://android-arsenal.com/details/1/6001) -[![Maven](https://img.shields.io/badge/%20Maven%20-2.0.6-5bc0de.svg)](https://s01.oss.sonatype.org/#nexus-search;quick~refresh-layout-kernel) +[![Maven](https://img.shields.io/badge/%20Maven%20-2.1.0-5bc0de.svg)](https://s01.oss.sonatype.org/#nexus-search;quick~refresh-layout-kernel) [![MinSdk](https://img.shields.io/badge/%20MinSdk%20-%2012%2B%20-f0ad4e.svg)](https://android-arsenal.com/api?level=12) [![Methods](https://img.shields.io/badge/Methods%20%7C%20Size%20-%20784%20%7C%20121%20KB-d9534f.svg)](http://www.methodscount.com/?lib=io.github.scwang90:refresh%3ASmartRefreshLayout%3A1.0.4) @@ -120,14 +120,14 @@ It is recommended that you copy the source code into the project whenever you ne // Note: There will be no default Header and Footer after subcontracting. It needs to be added manually! // To search lastest version by https://search.maven.org/search?q=g:io.github.scwang90 -implementation 'io.github.scwang90:refresh-layout-kernel:2.0.6' //core -implementation 'io.github.scwang90:refresh-header-classics:2.0.6' //ClassicsHeader -implementation 'io.github.scwang90:refresh-header-radar:2.0.6' //BezierRadarHeader -implementation 'io.github.scwang90:refresh-header-falsify:2.0.6' //FalsifyHeader -implementation 'io.github.scwang90:refresh-header-material:2.0.6' //MaterialHeader -implementation 'io.github.scwang90:refresh-header-two-level:2.0.6' //TwoLevelHeader -implementation 'io.github.scwang90:refresh-footer-ball:2.0.6' //BallPulseFooter -implementation 'io.github.scwang90:refresh-footer-classics:2.0.6' //ClassicsFooter +implementation 'io.github.scwang90:refresh-layout-kernel:2.1.0' //core +implementation 'io.github.scwang90:refresh-header-classics:2.1.0' //ClassicsHeader +implementation 'io.github.scwang90:refresh-header-radar:2.1.0' //BezierRadarHeader +implementation 'io.github.scwang90:refresh-header-falsify:2.1.0' //FalsifyHeader +implementation 'io.github.scwang90:refresh-header-material:2.1.0' //MaterialHeader +implementation 'io.github.scwang90:refresh-header-two-level:2.1.0' //TwoLevelHeader +implementation 'io.github.scwang90:refresh-footer-ball:2.1.0' //BallPulseFooter +implementation 'io.github.scwang90:refresh-footer-classics:2.1.0' //ClassicsFooter ``` diff --git a/gradle.properties b/gradle.properties index 0774a4eb..aab1bab5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,7 +21,7 @@ android.enableJetifier=true SMART_USER=scwang90 SMART_GROUP=com.scwang.smart -SMART_VERSION=2.0.5 +SMART_VERSION=2.1.0 # -SNAPSHOT SMART_PUBLISH=false SMART_GROUP_MVN=io.github.scwang90 @@ -29,4 +29,4 @@ SMART_EMAIL=scwang90@hotmail.com signing.keyId=888F6528 signing.password= -signing.secretKeyRingFile=/Users/scwang/.gnupg/secret-rsa.gpg +signing.secretKeyRingFile=../secret-rsa.gpg From cbce8be405ae3b41aa926ab770f41007e812c347 Mon Sep 17 00:00:00 2001 From: wsc Date: Fri, 1 Sep 2023 13:33:09 +0800 Subject: [PATCH 31/67] =?UTF-8?q?=E6=9B=B4=E6=96=B0gr=20adle=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 9 ++- refresh-drawable-paint/build.gradle | 10 ++-- refresh-drawable-path/build.gradle | 9 +-- refresh-footer-ball/build.gradle | 11 ++-- refresh-footer-classics/build.gradle | 10 ++-- refresh-footer/build.gradle | 17 ++---- refresh-header-classics/build.gradle | 12 ++-- refresh-header-falsify/build.gradle | 10 ++-- refresh-header-material/build.gradle | 10 ++-- refresh-header-radar/build.gradle | 10 ++-- refresh-header-two-level/build.gradle | 10 ++-- refresh-header/build.gradle | 18 ++---- refresh-layout-kernel/build.gradle | 81 ++------------------------- refresh-layout/build.gradle | 20 ++----- 14 files changed, 71 insertions(+), 166 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ca1bee34..4d7f72e3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,12 +2,12 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 33 + compileSdkVersion 34 defaultConfig { applicationId "com.scwang.refreshlayout.app" minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -15,7 +15,6 @@ android { renderscriptTargetApi 25 renderscriptSupportModeEnabled true // Enable RS support - } signingConfigs { debug { @@ -54,11 +53,11 @@ repositories { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation 'com.google.android.material:material:1.7.0' + implementation 'com.google.android.material:material:1.10.0' debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.10' diff --git a/refresh-drawable-paint/build.gradle b/refresh-drawable-paint/build.gradle index 65193936..b94fee6c 100644 --- a/refresh-drawable-paint/build.gradle +++ b/refresh-drawable-paint/build.gradle @@ -4,16 +4,15 @@ description = 'common drawables for refresh animations' android { - compileSdkVersion 33 + compileSdkVersion 34 defaultConfig { minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 1 - versionName "1.0" + versionName SMART_VERSION testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } buildTypes { release { @@ -28,5 +27,6 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.annotation:annotation:1.5.0' + + implementation 'androidx.annotation:annotation:1.7.0' } diff --git a/refresh-drawable-path/build.gradle b/refresh-drawable-path/build.gradle index 00fd7ffe..2247e385 100644 --- a/refresh-drawable-path/build.gradle +++ b/refresh-drawable-path/build.gradle @@ -4,16 +4,15 @@ description = 'path drawables for refresh animations' android { - compileSdkVersion 33 + compileSdkVersion 34 defaultConfig { minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 1 - versionName "1.0" + versionName SMART_VERSION testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } buildTypes { release { @@ -28,6 +27,8 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + api project(':refresh-drawable-paint') } diff --git a/refresh-footer-ball/build.gradle b/refresh-footer-ball/build.gradle index 20243cbd..266446fc 100644 --- a/refresh-footer-ball/build.gradle +++ b/refresh-footer-ball/build.gradle @@ -3,16 +3,16 @@ apply plugin: 'com.android.library' description = 'the footer BallPulseFooter of SmartRefreshLayout' android { - compileSdkVersion 33 + + compileSdkVersion 34 defaultConfig { minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 1 - versionName "1.0" + versionName SMART_VERSION testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } buildTypes { @@ -26,7 +26,8 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'androidx.legacy:legacy-support-v4:1.0.0' - compileOnly project(':refresh-layout-kernel') + compileOnly project(':refresh-layout-kernel') } diff --git a/refresh-footer-classics/build.gradle b/refresh-footer-classics/build.gradle index b5311e1c..3b93c1fb 100644 --- a/refresh-footer-classics/build.gradle +++ b/refresh-footer-classics/build.gradle @@ -3,16 +3,16 @@ apply plugin: 'com.android.library' description = 'the footer ClassicsFooter of SmartRefreshLayout' android { - compileSdkVersion 33 + + compileSdkVersion 34 defaultConfig { minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 1 - versionName "1.0" + versionName SMART_VERSION testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } buildTypes { @@ -26,7 +26,9 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + api project(':refresh-drawable-paint') compileOnly project(':refresh-layout-kernel') } diff --git a/refresh-footer/build.gradle b/refresh-footer/build.gradle index 24d4f49e..1bff15fa 100644 --- a/refresh-footer/build.gradle +++ b/refresh-footer/build.gradle @@ -1,16 +1,15 @@ apply plugin: 'com.android.library' -//apply plugin: 'com.novoda.bintray-release' android { - compileSdkVersion 33 + compileSdkVersion 34 defaultConfig { minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 1 - versionName "1.0" + versionName SMART_VERSION testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } @@ -27,16 +26,8 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') + compileOnly project(':refresh-footer-ball') compileOnly project(':refresh-footer-classics') compileOnly project(':refresh-layout') } - -//publish { -// userOrg = SMART_USER -// groupId = 'com.scwang.smartrefresh' -// artifactId = 'SmartRefreshFooter' -// publishVersion = SMART_VERSION -// desc = 'Some delicate footers of SmartRefreshLayout' -// website = "https://github.com/scwang90/${rootProject.name}" -//} \ No newline at end of file diff --git a/refresh-header-classics/build.gradle b/refresh-header-classics/build.gradle index b9ff4c11..173da2f7 100644 --- a/refresh-header-classics/build.gradle +++ b/refresh-header-classics/build.gradle @@ -3,16 +3,16 @@ apply plugin: 'com.android.library' description = 'the header ClassicsHeader of SmartRefreshLayout' android { - compileSdkVersion 33 + + compileSdkVersion 34 defaultConfig { minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 1 - versionName "1.0" + versionName SMART_VERSION testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } buildTypes { @@ -26,7 +26,9 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.5.1' + + implementation 'androidx.appcompat:appcompat:1.6.1' + api project(':refresh-footer-classics') compileOnly project(':refresh-layout-kernel') diff --git a/refresh-header-falsify/build.gradle b/refresh-header-falsify/build.gradle index 22d61e4c..e710bdfb 100644 --- a/refresh-header-falsify/build.gradle +++ b/refresh-header-falsify/build.gradle @@ -3,16 +3,16 @@ apply plugin: 'com.android.library' description = 'the header FalsifyHeader of SmartRefreshLayout' android { - compileSdkVersion 33 + + compileSdkVersion 34 defaultConfig { minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 1 - versionName "1.0" + versionName SMART_VERSION testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } buildTypes { @@ -27,7 +27,7 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'androidx.appcompat:appcompat:1.6.1' compileOnly project(':refresh-layout-kernel') diff --git a/refresh-header-material/build.gradle b/refresh-header-material/build.gradle index 42524aa7..9da24a1a 100644 --- a/refresh-header-material/build.gradle +++ b/refresh-header-material/build.gradle @@ -3,16 +3,16 @@ apply plugin: 'com.android.library' description = 'the header MaterialHeader of SmartRefreshLayout' android { - compileSdkVersion 33 + + compileSdkVersion 34 defaultConfig { minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 1 - versionName "1.0" + versionName SMART_VERSION testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } buildTypes { @@ -27,7 +27,7 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'androidx.appcompat:appcompat:1.6.1' compileOnly project(':refresh-layout-kernel') diff --git a/refresh-header-radar/build.gradle b/refresh-header-radar/build.gradle index 8e50f759..59cf8d69 100644 --- a/refresh-header-radar/build.gradle +++ b/refresh-header-radar/build.gradle @@ -3,16 +3,16 @@ apply plugin: 'com.android.library' description = 'the header BezierRadarHeader of SmartRefreshLayout' android { - compileSdkVersion 33 + + compileSdkVersion 34 defaultConfig { minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 1 - versionName "1.0" + versionName SMART_VERSION testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } buildTypes { @@ -27,7 +27,7 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'androidx.appcompat:appcompat:1.6.1' compileOnly project(':refresh-layout-kernel') diff --git a/refresh-header-two-level/build.gradle b/refresh-header-two-level/build.gradle index 80fb2ce3..039e3444 100644 --- a/refresh-header-two-level/build.gradle +++ b/refresh-header-two-level/build.gradle @@ -3,16 +3,16 @@ apply plugin: 'com.android.library' description = 'the header TwoLevelHeader of SmartRefreshLayout' android { - compileSdkVersion 33 + + compileSdkVersion 34 defaultConfig { minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 1 - versionName "1.0" + versionName SMART_VERSION testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } buildTypes { @@ -30,7 +30,7 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'androidx.appcompat:appcompat:1.6.1' api project(':refresh-header-classics') compileOnly project(':refresh-layout-kernel') diff --git a/refresh-header/build.gradle b/refresh-header/build.gradle index 97dd0835..d61815ae 100644 --- a/refresh-header/build.gradle +++ b/refresh-header/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.library' -//apply plugin: 'com.novoda.bintray-release' android { - compileSdkVersion 33 + compileSdkVersion 34 + defaultConfig { minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 1 versionName SMART_VERSION @@ -26,20 +26,12 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.annotation:annotation:1.5.0' + implementation 'androidx.annotation:annotation:1.7.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0' + compileOnly project(':refresh-layout') compileOnly project(':refresh-drawable-path') compileOnly project(':refresh-header-material') compileOnly project(':refresh-layout-kernel') compileOnly project(':refresh-header-falsify') } - -//publish { -// userOrg = SMART_USER -// groupId = 'com.scwang.smartrefresh' -// artifactId = 'SmartRefreshHeader' -// publishVersion = SMART_VERSION -// desc = 'Some delicate headers of SmartRefreshLayout' -// website = "https://github.com/scwang90/${rootProject.name}" -//} diff --git a/refresh-layout-kernel/build.gradle b/refresh-layout-kernel/build.gradle index b760a61b..f84094c8 100644 --- a/refresh-layout-kernel/build.gradle +++ b/refresh-layout-kernel/build.gradle @@ -4,16 +4,15 @@ description = 'the kernel of SmartRefreshLayout' android { - compileSdkVersion 33 + compileSdkVersion 34 defaultConfig { minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 1 - versionName "1.0" + versionName SMART_VERSION testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } buildTypes { release { @@ -29,77 +28,5 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'com.google.android.material:material:1.7.0' + implementation 'com.google.android.material:material:1.10.0' } - -//apply plugin: 'maven-publish' -//apply plugin: 'signing' -// -//task androidSourcesJar(type: Jar) { -// archiveClassifier.set("sources") -// from android.sourceSets.main.java.source -// exclude "**/R.class" -// exclude "**/BuildConfig.class" -//} -// -//def projectName = name -//def projectDescription = description -//publishing { -// publications { -// mavenJava(MavenPublication) { -// // group id,发布后引用的依赖的 group id -// groupId SMART_GROUP_MVN -// // 发布后引用的依赖的 artifact id -// artifactId projectName -// // 发布的版本 -// version SMART_VERSION -// // 发布的 arr 的文件和源码文件 -// artifact("$buildDir/outputs/aar/${projectName}-release.aar") -// artifact androidSourcesJar -// pom { -// // 构件名称,可以自定义 -// name = projectName -// // 构件描述 -// description = projectDescription -// // 构件主页 -// url = "https://github.com/scwang90/${rootProject.name}" -// // 许可证名称和地址 -// licenses { -// license { -// name = 'The Apache License, Version 2.0' -// url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' -// } -// } -// // 开发者信息 -// developers { -// developer { -// name = SMART_USER -// email = SMART_EMAIL -// } -// } -// // 版本控制仓库地址 -// scm { -// url = "https://github.com/scwang90/${rootProject.name}" -// connection = "scm:git:github.com/scwang90/${rootProject.name}.git" -// developerConnection = "scm:git:ssh://git@github.com/scwang90/${rootProject.name}.git" -// } -// } -// } -// } -// repositories { -// maven { -// // 发布的位置,这里根据发布的版本区分了 SNAPSHOT 和最终版本两种情况 -// def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" -// def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/" -// url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl -// credentials { -// // 这里就是之前在 issues.sonatype.org 注册的账号 -// username "${properties["sonatype.username"]}" -// password new String(Base64.mimeDecoder.decode("${properties["sonatype.password"]}"), "UTF-8") -// } -// } -// } -//} -//signing { -// sign publishing.publications -//} \ No newline at end of file diff --git a/refresh-layout/build.gradle b/refresh-layout/build.gradle index 5ef70af4..b8540253 100644 --- a/refresh-layout/build.gradle +++ b/refresh-layout/build.gradle @@ -1,18 +1,16 @@ apply plugin: 'com.android.library' -//apply plugin: 'com.novoda.bintray-release' android { - compileSdkVersion 33 + compileSdkVersion 34 defaultConfig { minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 1 - versionName "1.0" + versionName SMART_VERSION testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } buildTypes { release { @@ -28,7 +26,8 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'com.google.android.material:material:1.7.0' + implementation 'com.google.android.material:material:1.10.0' + compileOnly project(':refresh-layout-kernel') compileOnly project(':refresh-footer-ball') compileOnly project(':refresh-header-falsify') @@ -36,12 +35,3 @@ dependencies { compileOnly project(':refresh-header-two-level') } -// -//publish { -// userOrg = SMART_USER -// groupId = 'com.scwang.smartrefresh' -// artifactId = 'SmartRefreshLayout' -// publishVersion = SMART_VERSION -// desc = 'An intelligent refresh layout' -// website = "https://github.com/scwang90/${rootProject.name}" -//} From 7cb33161f42582febd604452e7a4731bba35c46e Mon Sep 17 00:00:00 2001 From: wsc Date: Wed, 6 Sep 2023 14:07:31 +0800 Subject: [PATCH 32/67] =?UTF-8?q?=E8=A7=84=E8=8C=83=E5=8C=96=E6=9E=9A?= =?UTF-8?q?=E4=B8=BE=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../refreshlayout/activity/example/I18nExampleActivity.java | 2 +- .../activity/style/BezierCircleStyleActivity.java | 2 +- .../activity/style/BezierRadarStyleActivity.java | 2 +- .../refreshlayout/activity/style/ClassicsStyleActivity.java | 2 +- .../refreshlayout/activity/style/DeliveryStyleActivity.java | 2 +- .../refreshlayout/activity/style/DropBoxStyleActivity.java | 2 +- .../activity/style/FunGameBattleCityStyleActivity.java | 2 +- .../activity/style/FunGameHitBlockStyleActivity.java | 2 +- .../refreshlayout/activity/style/MaterialStyleActivity.java | 2 +- .../refreshlayout/activity/style/PhoenixStyleActivity.java | 2 +- .../activity/style/StoreHouseStyleActivity.java | 2 +- .../refreshlayout/activity/style/TaurusStyleActivity.java | 2 +- .../activity/style/WaterDropStyleActivity.java | 2 +- .../activity/style/WaveSwipeStyleActivity.java | 2 +- .../fragment/example/EmptyLayoutExampleFragment.java | 4 ++-- .../fragment/example/NestedScrollExampleFragment.java | 4 ++-- .../fragment/example/PureScrollExampleFragment.java | 4 ++-- .../fragment/example/SpecifyStyleExampleFragment.java | 4 ++-- .../fragment/example/ViewPagerExampleFragment.java | 6 +++--- .../fragment/index/RefreshExampleFragment.java | 4 ++-- .../fragment/index/RefreshPracticeFragment.java | 5 ++--- .../refreshlayout/fragment/index/RefreshStylesFragment.java | 4 ++-- 22 files changed, 31 insertions(+), 32 deletions(-) diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java index 44840b70..df39b155 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java @@ -36,7 +36,7 @@ private enum Item { i2(R.string.item_example_i18n_chinese), i3(R.string.item_example_i18n_english), ; - public int nameId; + public final int nameId; Item(@StringRes int nameId) { this.nameId = nameId; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java index 590bbdd0..84aff7cc 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java @@ -36,7 +36,7 @@ private enum Item { 绿色主题(R.string.item_style_theme_green_abstract), 蓝色主题(R.string.item_style_theme_blue_abstract), ; - public int nameId; + public final int nameId; Item(@StringRes int nameId) { this.nameId = nameId; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java index 57d9421b..b3ee8818 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java @@ -38,7 +38,7 @@ private enum Item { 绿色主题(R.string.item_style_theme_green_abstract), 蓝色主题(R.string.item_style_theme_blue_abstract), ; - public int nameId; + public final int nameId; Item(@StringRes int nameId) { this.nameId = nameId; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java index fa9c7549..0e43ab28 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java @@ -55,7 +55,7 @@ private enum Item { 绿色主题(R.string.item_style_theme_green_abstract), 蓝色主题(R.string.item_style_theme_blue_abstract), ; - public int nameId; + public final int nameId; Item(@StringRes int nameId) { this.nameId = nameId; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java index c7c149ba..0e0ab0d8 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java @@ -33,7 +33,7 @@ private enum Item { 绿色主题(R.string.item_style_theme_green_abstract), 蓝色主题(R.string.item_style_theme_blue_abstract), ; - public int nameId; + public final int nameId; Item(@StringRes int nameId) { this.nameId = nameId; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java index 13b9b0c5..0d9890ee 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java @@ -46,7 +46,7 @@ private enum Item { 绿色2主题(R.string.item_style_theme_green_abstract), 蓝色2主题(R.string.item_style_theme_blue_abstract), ; - public int nameId; + public final int nameId; Item(@StringRes int nameId) { this.nameId = nameId; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java index 1ce2aa9b..8a761b1b 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java @@ -34,7 +34,7 @@ private enum Item { 绿色主题(R.string.item_style_theme_green_abstract), 蓝色主题(R.string.item_style_theme_blue_abstract), ; - public int nameId; + public final int nameId; Item(@StringRes int nameId) { this.nameId = nameId; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java index f647de03..b30d6f80 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java @@ -34,7 +34,7 @@ private enum Item { 绿色主题(R.string.item_style_theme_green_abstract), 蓝色主题(R.string.item_style_theme_blue_abstract), ; - public int nameId; + public final int nameId; Item(@StringRes int nameId) { this.nameId = nameId; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java index 5e6621e7..aefd8db2 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java @@ -38,7 +38,7 @@ private enum Item { 绿色主题(R.string.item_style_theme_green_abstract), 蓝色主题(R.string.item_style_theme_blue_abstract), ; - public int nameId; + public final int nameId; Item(@StringRes int nameId) { this.nameId = nameId; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java index 9b4cc036..b511aebe 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java @@ -39,7 +39,7 @@ private enum Item { 绿色主题(R.string.item_style_theme_green_abstract), 蓝色主题(R.string.item_style_theme_blue_abstract), ; - public int nameId; + public final int nameId; Item(@StringRes int nameId) { this.nameId = nameId; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java index c8cfed56..96bbf966 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java @@ -40,7 +40,7 @@ private enum Item { 绿色主题(R.string.item_style_theme_green_abstract), 蓝色主题(R.string.item_style_theme_blue_abstract), ; - public int nameId; + public final int nameId; Item(@StringRes int nameId) { this.nameId = nameId; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java index 33477617..205ef267 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java @@ -39,7 +39,7 @@ private enum Item { 绿色主题(R.string.item_style_theme_green_abstract), 蓝色主题(R.string.item_style_theme_blue_abstract), ; - public int nameId; + public final int nameId; Item(@StringRes int nameId) { this.nameId = nameId; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java index 9dd9b35c..f7607fc8 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java @@ -36,7 +36,7 @@ private enum Item { 绿色主题(R.string.item_style_theme_green_abstract), 蓝色主题(R.string.item_style_theme_blue_abstract), ; - public int nameId; + public final int nameId; Item(@StringRes int nameId) { this.nameId = nameId; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java index c2ad4b1f..5d535ccb 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java @@ -35,7 +35,7 @@ private enum Item { 绿色主题(R.string.item_style_theme_green_abstract), 蓝色主题(R.string.item_style_theme_blue_abstract), ; - public int nameId; + public final int nameId; Item(@StringRes int nameId) { this.nameId = nameId; } diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java index 209fed02..6b2ca4ac 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java @@ -48,8 +48,8 @@ public enum Item { NestedInner("内部嵌套", EmptyLayoutExampleFragmentInner.class), NestedOuter("外部嵌套", EmptyLayoutExampleFragmentOuter.class), ; - public String name; - public Class clazz; + public final String name; + public final Class clazz; Item(String name, Class clazz) { this.name = name; this.clazz = clazz; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java index 2b5384c4..8be615a9 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java @@ -42,8 +42,8 @@ public enum Item { NestedIntegral("整体嵌套", NestedScrollExampleFragmentIntegral.class), NestedViewPager("ViewPager", NestedScrollExampleFragmentViewPager.class), ; - public String name; - public Class clazz; + public final String name; + public final Class clazz; Item(String name, Class clazz) { this.name = name; this.clazz = clazz; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragment.java index a0bb2864..1de1c8e4 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragment.java @@ -38,8 +38,8 @@ public enum Item { HeaderOnly("代码中单独指定Header", PureScrollExampleFragmentHeader.class), FooterOnly("XML中单独指定Footer", PureScrollExampleFragmentFooter.class), ; - public String name; - public Class clazz; + public final String name; + public final Class clazz; Item(String name, Class clazz) { this.name = name; this.clazz = clazz; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/SpecifyStyleExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/SpecifyStyleExampleFragment.java index fb53d290..e5a5a79d 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/SpecifyStyleExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/SpecifyStyleExampleFragment.java @@ -41,8 +41,8 @@ public enum Item { Code("代码指定", AssignCodeExampleActivity.class), Xml("XML指定", AssignXmlExampleActivity.class), ; - public String name; - public Class clazz; + public final String name; + public final Class clazz; Item(String name, Class clazz) { this.name = name; this.clazz = clazz; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java index a6dc53a2..86bac7be 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java @@ -41,12 +41,12 @@ public class ViewPagerExampleFragment extends Fragment implements OnRefreshListener, OnRefreshLoadMoreListener { - public enum Item { + private enum Item { NestedInner(R.string.item_example_pager_left, SmartFragment.class), NestedOuter(R.string.item_example_pager_right, SmartFragment.class), ; - public int nameId; - public Class clazz; + public final int nameId; + public final Class clazz; Item(@StringRes int nameId, Class clazz) { this.nameId = nameId; this.clazz = clazz; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java index 25cc3b26..0cf0165c 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java @@ -61,8 +61,8 @@ private enum Item { StaggeredGrid(R.string.index_example_disallow_intercept, StaggeredGridExampleFragment.class), // ThreeLevel(R.string.index_example_level, ThreeLevelExampleFragment.class), ; - public int nameId; - public Class clazz; + public final int nameId; + public final Class clazz; Item(@StringRes int nameId, Class clazz) { this.nameId = nameId; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java index ae9fb420..e504a5af 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java @@ -51,13 +51,12 @@ private enum Item { Weibo(R.string.index_practice_weibo, WeiboPracticeActivity.class), Banner(R.string.index_practice_banner, BannerPracticeActivity.class), QQBrowser(R.string.index_practice_qq_browser, QQBrowserPracticeActivity.class), -// TwoLevel("二级刷新", SecondFloorPracticeFragment.class), SecondFloor(R.string.index_practice_second_floor, SecondFloorPracticeFragment.class), Instant(R.string.index_practice_instant, InstantPracticeFragment.class) ; @StringRes - public int name; - public Class clazz; + public final int name; + public final Class clazz; Item(@StringRes int name, Class clazz) { this.name = name; this.clazz = clazz; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshStylesFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshStylesFragment.java index 3240b6f7..8d9501ea 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshStylesFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshStylesFragment.java @@ -79,8 +79,8 @@ private enum Item { StoreHouse(R.string.title_activity_style_storehouse, StoreHouseStyleActivity.class), Classics(R.string.title_activity_style_classics, ClassicsStyleActivity.class), ; - public int nameId; - public Class clazz; + public final int nameId; + public final Class clazz; Item(@StringRes int nameId, Class clazz) { this.nameId = nameId; this.clazz = clazz; From 46632ad1c7bf2fe34c08b899f5ded7a61c9ebb8f Mon Sep 17 00:00:00 2001 From: wsc Date: Fri, 8 Sep 2023 14:09:26 +0800 Subject: [PATCH 33/67] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B4=A1=E7=8C=AE=E6=84=9F=E8=B0=A2=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/scwang/smart/refresh/header/ClassicsHeader.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/refresh-header-classics/src/main/java/com/scwang/smart/refresh/header/ClassicsHeader.java b/refresh-header-classics/src/main/java/com/scwang/smart/refresh/header/ClassicsHeader.java index 2e25d41b..3928434c 100644 --- a/refresh-header-classics/src/main/java/com/scwang/smart/refresh/header/ClassicsHeader.java +++ b/refresh-header-classics/src/main/java/com/scwang/smart/refresh/header/ClassicsHeader.java @@ -294,6 +294,12 @@ public void onStateChanged(@NonNull RefreshLayout refreshLayout, @NonNull Refres public ClassicsHeader setLastUpdateTime(Date time) { final View thisView = this; mLastTime = time; + /* + * 时区修改后需要及时更新下拉刷新的时间否则出现下拉刷新的时间与系统时间不一致问题 + * 需要及时设置:mLastUpdateFormat.setCalendar + * 感谢:github 用户 findviewbyid 贡献的代码 + * 贡献日期:2023-01-12 + */ mLastUpdateFormat.setCalendar(Calendar.getInstance(TimeZone.getDefault(), Locale.getDefault())); mLastUpdateText.setText(mLastUpdateFormat.format(time)); if (mShared != null && !thisView.isInEditMode()) { From 3703d6737b519056b649e5c23660ab465b8cb983 Mon Sep 17 00:00:00 2001 From: wsc Date: Mon, 11 Sep 2023 14:11:43 +0800 Subject: [PATCH 34/67] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=BD=86=E6=9C=AA=E5=AE=8C=E6=88=90=E7=9A=84=E4=B8=89=E7=BA=A7?= =?UTF-8?q?=E5=88=B7=E9=80=89=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/ThreeLevelExampleFragment.java | 72 ------------------- .../index/RefreshExampleFragment.java | 1 - .../layout/fragment_example_three_level.xml | 65 ----------------- 3 files changed, 138 deletions(-) delete mode 100644 app/src/main/java/com/scwang/refreshlayout/fragment/example/ThreeLevelExampleFragment.java delete mode 100644 app/src/main/res/layout/fragment_example_three_level.xml diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/ThreeLevelExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/ThreeLevelExampleFragment.java deleted file mode 100644 index 5afe8f68..00000000 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/ThreeLevelExampleFragment.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.scwang.refreshlayout.fragment.example; - - -import android.os.Bundle; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.fragment.app.Fragment; -import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.listener.OnRefreshListener; - -import java.util.Arrays; -import java.util.List; - -import static android.R.layout.simple_list_item_2; - -/** - * 三级刷新 - * A simple {@link Fragment} subclass. - */ -public class ThreeLevelExampleFragment extends Fragment { - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - // Inflate the layout for this fragment - return inflater.inflate(R.layout.fragment_example_three_level, container, false); - } - - @Override - public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { - super.onViewCreated(view, savedInstanceState); - - final Toolbar toolbar = view.findViewById(R.id.toolbar); - toolbar.setNavigationOnClickListener(v -> getActivity().finish()); - - RecyclerView recyclerView = view.findViewById(R.id.recyclerView); - if (recyclerView != null) { - recyclerView.setAdapter(new BaseRecyclerAdapter(initData(), simple_list_item_2) { - @Override - protected void onBindViewHolder(SmartViewHolder holder, Void model, int position) { - holder.text(android.R.id.text1, getString(R.string.item_example_number_title, position)); - holder.text(android.R.id.text2, getString(R.string.item_example_number_abstract, position)); - holder.textColorId(android.R.id.text1, android.R.color.white); - holder.textColorId(android.R.id.text2, android.R.color.white); - } - }); - } - - RefreshLayout refreshLayout1 = view.findViewById(R.id.refreshLayout1); - if (refreshLayout1 != null) { - refreshLayout1.setOnRefreshListener((OnRefreshListener) refreshLayout -> refreshLayout.finishRefresh(1000)); - } - RefreshLayout refreshLayout2 = view.findViewById(R.id.refreshLayout2); - if (refreshLayout2 != null) { - refreshLayout2.getLayout().setEnabled(false); - refreshLayout2.setOnRefreshListener((OnRefreshListener) refreshLayout -> refreshLayout.finishRefresh(2000)); - } - } - - private List initData() { - return Arrays.asList(null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null); - } -} diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java index 0cf0165c..08508590 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java @@ -59,7 +59,6 @@ private enum Item { Horizontal(R.string.index_example_horizontal, HorizontalExampleFragment.class), DisallowIntercept(R.string.index_example_disallow_intercept, DisallowInterceptExampleFragment.class), StaggeredGrid(R.string.index_example_disallow_intercept, StaggeredGridExampleFragment.class), -// ThreeLevel(R.string.index_example_level, ThreeLevelExampleFragment.class), ; public final int nameId; public final Class clazz; diff --git a/app/src/main/res/layout/fragment_example_three_level.xml b/app/src/main/res/layout/fragment_example_three_level.xml deleted file mode 100644 index a0eda73d..00000000 --- a/app/src/main/res/layout/fragment_example_three_level.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - From 98e4a9f913f94c8494f2ae0cfdaa1693b1da6c65 Mon Sep 17 00:00:00 2001 From: wsc Date: Wed, 20 Sep 2023 15:21:43 +0800 Subject: [PATCH 35/67] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=85=BC=E5=AE=B9=20Vi?= =?UTF-8?q?ewPager2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activity/IndexMainActivity.java | 42 +++++++++------- .../NestedScrollExampleFragmentIntegral.java | 49 +++++-------------- .../NestedScrollExampleFragmentViewPager.java | 21 ++++---- .../example/ViewPagerExampleFragment.java | 45 +++++++++-------- .../main/res/layout/activity_index_main.xml | 2 +- ...fragment_example_nestedscroll_integral.xml | 2 +- ...agment_example_nestedscroll_view_pager.xml | 2 +- .../res/layout/fragment_example_viewpager.xml | 2 +- .../smart/refresh/layout/util/SmartUtil.java | 2 + .../layout/wrapper/RefreshContentWrapper.java | 3 +- 10 files changed, 81 insertions(+), 89 deletions(-) diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/IndexMainActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/IndexMainActivity.java index 26885693..4cd45b11 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/IndexMainActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/IndexMainActivity.java @@ -7,8 +7,8 @@ import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.appcompat.app.AppCompatActivity; -import androidx.fragment.app.FragmentStatePagerAdapter; -import androidx.viewpager.widget.ViewPager; +import androidx.viewpager2.adapter.FragmentStateAdapter; +import androidx.viewpager2.widget.ViewPager2; import android.view.MenuItem; @@ -24,6 +24,8 @@ public class IndexMainActivity extends AppCompatActivity implements NavigationBarView.OnItemSelectedListener { + private FragmentStateAdapter mPageAdapter; + private enum TabFragment { practice(R.id.navigation_practice, RefreshPracticeFragment.class), styles(R.id.navigation_style, RefreshStylesFragment.class), @@ -68,6 +70,9 @@ public static void onDestroy() { } } + private ViewPager2 mViewPager; + private ViewPager2.OnPageChangeCallback mPageChangedCallback; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -76,23 +81,27 @@ protected void onCreate(Bundle savedInstanceState) { final BottomNavigationView navigation = findViewById(R.id.navigation); navigation.setOnItemSelectedListener(this); - ViewPager viewPager = findViewById(R.id.content); - viewPager.setAdapter(new FragmentStatePagerAdapter(getSupportFragmentManager()) { + this.mPageChangedCallback = new ViewPager2.OnPageChangeCallback() { @Override - public int getCount() { - return TabFragment.values().length; + public void onPageSelected(int position) { + navigation.setSelectedItemId(TabFragment.values()[position].menuId); } + }; + this.mPageAdapter = new FragmentStateAdapter(this) { @Override - public Fragment getItem(int position) { - return TabFragment.values()[position].fragment(); + public int getItemCount() { + return TabFragment.values().length; } - }); - viewPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener(){ + @NonNull @Override - public void onPageSelected(int position) { - navigation.setSelectedItemId(TabFragment.values()[position].menuId); + public Fragment createFragment(int position) { + return TabFragment.values()[position].fragment(); } - }); + }; + + this.mViewPager = findViewById(R.id.content); + this.mViewPager.setAdapter(this.mPageAdapter); + this.mViewPager.registerOnPageChangeCallback(this.mPageChangedCallback); //状态栏透明和间距处理 StatusBarUtil.immersive(this, 0xff000000, 0.1f); @@ -102,9 +111,7 @@ public void onPageSelected(int position) { Field field = ValueAnimator.class.getDeclaredField("sDurationScale"); field.setAccessible(true); field.set(ValueAnimator.class, 1); - } catch (NoSuchFieldException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { + } catch (NoSuchFieldException | IllegalAccessException e) { e.printStackTrace(); } } @@ -112,12 +119,13 @@ public void onPageSelected(int position) { @Override protected void onDestroy() { super.onDestroy(); + mViewPager.unregisterOnPageChangeCallback(mPageChangedCallback); TabFragment.onDestroy(); } @Override public boolean onNavigationItemSelected(@NonNull MenuItem item) { - ((ViewPager)findViewById(R.id.content)).setCurrentItem(TabFragment.from(item.getItemId()).ordinal()); + mViewPager.setCurrentItem(TabFragment.from(item.getItemId()).ordinal()); // getSupportFragmentManager() // .beginTransaction() // .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN) diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java index 2686a890..52b0712e 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java @@ -7,8 +7,8 @@ import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; -import androidx.fragment.app.FragmentStatePagerAdapter; -import androidx.viewpager.widget.ViewPager; +import androidx.viewpager2.adapter.FragmentStateAdapter; +import androidx.viewpager2.widget.ViewPager2; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; @@ -46,11 +46,9 @@ */ public class NestedScrollExampleFragmentIntegral extends Fragment implements AdapterView.OnItemClickListener, OnRefreshLoadMoreListener { - private ViewPager mViewPager; + private ViewPager2 mViewPager; private SmartPagerAdapter mAdapter; -// private BaseRecyclerAdapter mAdapter; - @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_example_nestedscroll_integral, container, false); @@ -69,34 +67,10 @@ public void onViewCreated(@NonNull final View root, @Nullable Bundle savedInstan banner.start(); mViewPager = root.findViewById(R.id.viewPager); - mViewPager.setAdapter(mAdapter = new SmartPagerAdapter(getChildFragmentManager())); -// RecyclerView recyclerView = root.findViewById(R.id.recyclerView); -// recyclerView.setItemAnimator(new DefaultItemAnimator()); -// recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); -// recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), VERTICAL)); -// recyclerView.setAdapter(mAdapter = new BaseRecyclerAdapter(buildItems(), simple_list_item_2, NestedScrollExampleFragmentIntegral.this) { -// @Override -// protected void onBindViewHolder(SmartViewHolder holder, Item model, int position) { -// holder.text(android.R.id.text1, model.name()); -// holder.text(android.R.id.text2, model.name); -// holder.textColorId(android.R.id.text2, R.color.colorTextAssistant); -// } -// }); + mViewPager.setAdapter(mAdapter = new SmartPagerAdapter(this)); RefreshLayout refreshLayout = root.findViewById(R.id.refreshLayout); refreshLayout.setOnRefreshLoadMoreListener(this); -// refreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() { -// @Override -// public void onLoadMore(@NonNull final RefreshLayout refreshLayout) { -// refreshLayout.getLayout().postDelayed(new Runnable() { -// @Override -// public void run() { -// mAdapter.loadMore(buildItems()); -// refreshLayout.finishLoadMore(); -// } -// }, 2000); -// } -// }); TextView textView = root.findViewById(R.id.target); textView.setOnClickListener(v -> Toast.makeText(getContext(), "点击测试", Toast.LENGTH_SHORT).show()); @@ -125,25 +99,26 @@ public void displayImage(Context context, Object path, ImageView imageView) { } - public static class SmartPagerAdapter extends FragmentStatePagerAdapter { + public static class SmartPagerAdapter extends FragmentStateAdapter { private final SmartFragment[] fragments; - SmartPagerAdapter(FragmentManager fm) { + SmartPagerAdapter(Fragment fm) { super(fm); this.fragments = new SmartFragment[]{ new SmartFragment(),new SmartFragment() }; } + @NonNull @Override - public int getCount() { - return fragments.length; + public Fragment createFragment(int position) { + return fragments[position]; } @Override - public Fragment getItem(int position) { - return fragments[position]; + public int getItemCount() { + return fragments.length; } } @@ -186,7 +161,7 @@ public void onRefresh(final RefreshLayout refreshLayout) { refreshLayout.getLayout().postDelayed(() -> { mAdapter.refresh(buildItems()); refreshLayout.finishRefresh(); - refreshLayout.resetNoMoreData();//setNoMoreData(false); + refreshLayout.resetNoMoreData(); }, 2000); } diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java index 43f11716..693d7156 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java @@ -7,8 +7,8 @@ import com.google.android.material.appbar.AppBarLayout; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; -import androidx.fragment.app.FragmentStatePagerAdapter; -import androidx.viewpager.widget.ViewPager; +import androidx.viewpager2.adapter.FragmentStateAdapter; +import androidx.viewpager2.widget.ViewPager2; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; @@ -49,8 +49,8 @@ public void onViewCreated(@NonNull final View root, @Nullable Bundle savedInstan Toolbar toolbar = root.findViewById(R.id.toolbar); toolbar.setNavigationOnClickListener(v -> getActivity().finish()); - ViewPager viewPager = root.findViewById(R.id.viewPager); - viewPager.setAdapter(new SmartPagerAdapter(getChildFragmentManager())); + ViewPager2 viewPager = root.findViewById(R.id.viewPager); + viewPager.setAdapter(new SmartPagerAdapter(this)); /* * 监听 AppBarLayout 的关闭和开启 ActionButton 设置关闭隐藏动画 @@ -76,25 +76,26 @@ public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { } - public static class SmartPagerAdapter extends FragmentStatePagerAdapter { + public static class SmartPagerAdapter extends FragmentStateAdapter { private final SmartFragment[] fragments; - SmartPagerAdapter(FragmentManager fm) { + SmartPagerAdapter(Fragment fm) { super(fm); this.fragments = new SmartFragment[]{ new SmartFragment(),new SmartFragment() }; } + @NonNull @Override - public int getCount() { - return fragments.length; + public Fragment createFragment(int position) { + return fragments[position]; } @Override - public Fragment getItem(int position) { - return fragments[position]; + public int getItemCount() { + return fragments.length; } } diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java index 86bac7be..e7318471 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java @@ -7,19 +7,21 @@ import androidx.annotation.StringRes; import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentStatePagerAdapter; -import androidx.viewpager.widget.ViewPager; +import androidx.viewpager2.adapter.FragmentStateAdapter; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.appcompat.widget.Toolbar; +import androidx.viewpager2.widget.ViewPager2; + import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Toast; import com.google.android.material.tabs.TabLayout; +import com.google.android.material.tabs.TabLayoutMediator; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; @@ -40,7 +42,6 @@ */ public class ViewPagerExampleFragment extends Fragment implements OnRefreshListener, OnRefreshLoadMoreListener { - private enum Item { NestedInner(R.string.item_example_pager_left, SmartFragment.class), NestedOuter(R.string.item_example_pager_right, SmartFragment.class), @@ -53,8 +54,9 @@ private enum Item { } } - private ViewPager mViewPager; + private ViewPager2 mViewPager; private SmartPagerAdapter mAdapter; + private TabLayoutMediator mTabLayoutMediator; @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { @@ -76,8 +78,15 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat mViewPager = root.findViewById(R.id.viewPager); TabLayout mTabLayout = root.findViewById(R.id.tableLayout); - mViewPager.setAdapter(mAdapter = new SmartPagerAdapter(Item.values())); - mTabLayout.setupWithViewPager(mViewPager, true); + mViewPager.setAdapter(mAdapter = new SmartPagerAdapter(this, Item.values())); + + this.mTabLayoutMediator = new TabLayoutMediator(mTabLayout, mViewPager, true, true, new TabLayoutMediator.TabConfigurationStrategy() { + @Override + public void onConfigureTab(@NonNull TabLayout.Tab tab, int position) { + tab.setText(getString(Item.values()[position].nameId)); + } + }); + this.mTabLayoutMediator.attach(); } @Override @@ -91,34 +100,30 @@ public void onLoadMore(@NonNull RefreshLayout refreshLayout) { } - private class SmartPagerAdapter extends FragmentStatePagerAdapter { + private static class SmartPagerAdapter extends FragmentStateAdapter { private final Item[] items; private final SmartFragment[] fragments; - SmartPagerAdapter(Item... items) { - super(getChildFragmentManager()); + SmartPagerAdapter(Fragment fragment, Item... items) { + super(fragment); this.items = items; this.fragments = new SmartFragment[items.length]; } + @NonNull @Override - public int getCount() { - return items.length; - } - - @Override - public CharSequence getPageTitle(int position) { - return getString(items[position].nameId); - } - - @Override - public Fragment getItem(int position) { + public Fragment createFragment(int position) { if (fragments[position] == null) { fragments[position] = new SmartFragment(); } return fragments[position]; } + + @Override + public int getItemCount() { + return items.length; + } } public static class SmartFragment extends Fragment { diff --git a/app/src/main/res/layout/activity_index_main.xml b/app/src/main/res/layout/activity_index_main.xml index 251e8fe3..d52cb969 100644 --- a/app/src/main/res/layout/activity_index_main.xml +++ b/app/src/main/res/layout/activity_index_main.xml @@ -14,7 +14,7 @@ android:visibility="gone" tools:visibility="visible"/> - - - - 0; i--) { View child = viewGroup.getChildAt(i - 1); if (isTransformedTouchPointInView(viewGroup, child, event.x, event.y, point)) { - if (child instanceof ViewPager || !isContentView(child)) { + if (child instanceof ViewPager || child instanceof ViewPager2 || !isContentView(child)) { event.offset(point.x, point.y); child = findScrollableViewByPoint(child, event, orgScrollableView); event.offset(-point.x, -point.y); From 1c7eb3c47d8dd691e3cdbc2e92f7a1b4f5894b4b Mon Sep 17 00:00:00 2001 From: wsc Date: Fri, 22 Sep 2023 15:53:02 +0800 Subject: [PATCH 36/67] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 7 ++++++- .../com/scwang/refreshlayout/ExampleInstrumentedTest.java | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 4d7f72e3..bb5df5fc 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -85,8 +85,13 @@ dependencies { implementation 'de.hdodenhof:circleimageview:3.1.0' implementation 'jp.wasabeef:recyclerview-animators:2.2.6' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.3' - testImplementation 'junit:junit:4.13.2' implementation 'com.github.bumptech.glide:glide:4.13.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.13.0' + + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation platform('androidx.compose:compose-bom:2023.03.00') + androidTestImplementation 'androidx.compose.ui:ui-test-junit4' } diff --git a/app/src/androidTest/java/com/scwang/refreshlayout/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/scwang/refreshlayout/ExampleInstrumentedTest.java index 966b0d96..5ab251f1 100644 --- a/app/src/androidTest/java/com/scwang/refreshlayout/ExampleInstrumentedTest.java +++ b/app/src/androidTest/java/com/scwang/refreshlayout/ExampleInstrumentedTest.java @@ -1,8 +1,8 @@ package com.scwang.refreshlayout; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; @@ -19,7 +19,7 @@ public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.scwang.refreshlayout", appContext.getPackageName()); } From 8a21349c55a78b81469e61e0140d0485a12f255e Mon Sep 17 00:00:00 2001 From: wsc Date: Mon, 25 Sep 2023 16:52:01 +0800 Subject: [PATCH 37/67] =?UTF-8?q?=E6=92=A4=E5=9B=9E=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81=E8=B4=A1=E7=8C=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../refreshlayout/activity/IndexMainActivity.java | 3 +-- .../smart/refresh/layout/SmartRefreshLayout.java | 11 ++++++++--- refresh-layout-kernel/src/main/res/values/attrs.xml | 7 +++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/IndexMainActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/IndexMainActivity.java index 4cd45b11..c3717b41 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/IndexMainActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/IndexMainActivity.java @@ -24,8 +24,6 @@ public class IndexMainActivity extends AppCompatActivity implements NavigationBarView.OnItemSelectedListener { - private FragmentStateAdapter mPageAdapter; - private enum TabFragment { practice(R.id.navigation_practice, RefreshPracticeFragment.class), styles(R.id.navigation_style, RefreshStylesFragment.class), @@ -71,6 +69,7 @@ public static void onDestroy() { } private ViewPager2 mViewPager; + private FragmentStateAdapter mPageAdapter; private ViewPager2.OnPageChangeCallback mPageChangedCallback; @Override diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java index 1c824d03..31ad256b 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java @@ -78,8 +78,8 @@ * Intelligent RefreshLayout * Created by scwang on 2017/5/26. */ -@SuppressLint("RestrictedApi") @SuppressWarnings({"unused"}) +@SuppressLint("RestrictedApi") public class SmartRefreshLayout extends ViewGroup implements RefreshLayout, NestedScrollingParent/*, NestedScrollingChild*/ { // @@ -244,10 +244,15 @@ public SmartRefreshLayout(Context context, AttributeSet attrs) { TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.SmartRefreshLayout); - if (!ta.hasValue(R.styleable.SmartRefreshLayout_srlClipToPadding)) { + /** + * SmartRefreshLayout 继承 ViewGroup 后即使不设置 android:clipToPadding,也等效于 android:clipToPadding=true + * 特意添加 android:clipToPadding 来在 Java 代码中 判断是否设置过,没有设置强制 setClipToPadding(false) + * android:clipChildren 也是同样 + */ + if (!ta.hasValue(R.styleable.SmartRefreshLayout_android_clipToPadding)) { super.setClipToPadding(false); } - if (!ta.hasValue(R.styleable.SmartRefreshLayout_srlClipChildren)) { + if (!ta.hasValue(R.styleable.SmartRefreshLayout_android_clipChildren)) { super.setClipChildren(false); } diff --git a/refresh-layout-kernel/src/main/res/values/attrs.xml b/refresh-layout-kernel/src/main/res/values/attrs.xml index bcc48e08..ddde53f8 100644 --- a/refresh-layout-kernel/src/main/res/values/attrs.xml +++ b/refresh-layout-kernel/src/main/res/values/attrs.xml @@ -41,8 +41,11 @@ - - + + + + + From af825687ad0a2fa464a980093c7865ba2733762b Mon Sep 17 00:00:00 2001 From: wsc Date: Mon, 2 Oct 2023 18:21:59 +0800 Subject: [PATCH 38/67] =?UTF-8?q?=E9=87=8D=E7=BD=AEAndroid=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 8 +++----- refresh-drawable-paint/build.gradle | 6 +++++- .../scwang/smart/drawable/ExampleInstrumentedTest.java | 8 ++++---- refresh-drawable-path/build.gradle | 8 ++++++-- .../scwang/smart/drawable/ExampleInstrumentedTest.java | 8 ++++---- refresh-footer-ball/build.gradle | 8 ++++++-- .../smart/refresh/footer/ExampleInstrumentedTest.java | 10 +++++----- refresh-footer-classics/build.gradle | 8 ++++++-- .../smart/refresh/footer/ExampleInstrumentedTest.java | 10 +++++----- refresh-footer/build.gradle | 6 ++++++ .../smartrefresh/footer/ExampleInstrumentedTest.java | 10 +++++----- refresh-header-classics/build.gradle | 8 ++++++-- .../smart/refresh/header/ExampleInstrumentedTest.java | 8 ++++---- refresh-header-falsify/build.gradle | 7 +++++-- .../{footer => header}/ExampleInstrumentedTest.java | 8 ++++---- refresh-header-material/build.gradle | 7 +++++-- .../{footer => header}/ExampleInstrumentedTest.java | 8 ++++---- refresh-header-radar/build.gradle | 7 +++++-- .../{footer => header}/ExampleInstrumentedTest.java | 8 ++++---- refresh-header-two-level/build.gradle | 7 +++++-- .../{footer => header}/ExampleInstrumentedTest.java | 8 ++++---- refresh-header/build.gradle | 9 ++++++--- .../smartrefresh/header/ExampleInstrumentedTest.java | 6 +++--- refresh-layout-kernel/build.gradle | 6 +++++- .../smart/refresh/layout/ExampleInstrumentedTest.java | 6 +++--- .../smart/refresh/layout/SmartRefreshLayout.java | 2 +- refresh-layout/build.gradle | 7 +++++-- .../smartrefresh/layout/ExampleInstrumentedTest.java | 6 +++--- 28 files changed, 127 insertions(+), 81 deletions(-) rename refresh-header-falsify/src/androidTest/java/com/scwang/smart/refresh/{footer => header}/ExampleInstrumentedTest.java (67%) rename refresh-header-material/src/androidTest/java/com/scwang/smart/refresh/{footer => header}/ExampleInstrumentedTest.java (67%) rename refresh-header-radar/src/androidTest/java/com/scwang/smart/refresh/{footer => header}/ExampleInstrumentedTest.java (67%) rename refresh-header-two-level/src/androidTest/java/com/scwang/smart/refresh/{footer => header}/ExampleInstrumentedTest.java (67%) diff --git a/app/build.gradle b/app/build.gradle index bb5df5fc..0bd33ca4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -53,10 +53,10 @@ repositories { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' +// implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.cardview:cardview:1.0.0' - implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' +// implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'com.google.android.material:material:1.10.0' debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.10' @@ -92,6 +92,4 @@ dependencies { testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' - androidTestImplementation platform('androidx.compose:compose-bom:2023.03.00') - androidTestImplementation 'androidx.compose.ui:ui-test-junit4' } diff --git a/refresh-drawable-paint/build.gradle b/refresh-drawable-paint/build.gradle index b94fee6c..d6d153c5 100644 --- a/refresh-drawable-paint/build.gradle +++ b/refresh-drawable-paint/build.gradle @@ -28,5 +28,9 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.annotation:annotation:1.7.0' + compileOnly 'androidx.annotation:annotation:1.7.0' + + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } diff --git a/refresh-drawable-paint/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java b/refresh-drawable-paint/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java index f26cf7c9..056b18fa 100644 --- a/refresh-drawable-paint/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java +++ b/refresh-drawable-paint/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java @@ -1,8 +1,8 @@ package com.scwang.smart.drawable; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; @@ -19,8 +19,8 @@ public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); - assertEquals("com.scwang.smartrefresh.layout.test", appContext.getPackageName()); + assertEquals("com.scwang.smart.drawable.test", appContext.getPackageName()); } } diff --git a/refresh-drawable-path/build.gradle b/refresh-drawable-path/build.gradle index 2247e385..9ad35f39 100644 --- a/refresh-drawable-path/build.gradle +++ b/refresh-drawable-path/build.gradle @@ -28,7 +28,11 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.legacy:legacy-support-v4:1.0.0' - api project(':refresh-drawable-paint') + + compileOnly 'androidx.appcompat:appcompat:1.6.1' + + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } diff --git a/refresh-drawable-path/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java b/refresh-drawable-path/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java index f26cf7c9..056b18fa 100644 --- a/refresh-drawable-path/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java +++ b/refresh-drawable-path/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java @@ -1,8 +1,8 @@ package com.scwang.smart.drawable; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; @@ -19,8 +19,8 @@ public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); - assertEquals("com.scwang.smartrefresh.layout.test", appContext.getPackageName()); + assertEquals("com.scwang.smart.drawable.test", appContext.getPackageName()); } } diff --git a/refresh-footer-ball/build.gradle b/refresh-footer-ball/build.gradle index 266446fc..e2db6d91 100644 --- a/refresh-footer-ball/build.gradle +++ b/refresh-footer-ball/build.gradle @@ -27,7 +27,11 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.legacy:legacy-support-v4:1.0.0' - compileOnly project(':refresh-layout-kernel') + + compileOnly 'androidx.appcompat:appcompat:1.6.1' + + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } diff --git a/refresh-footer-ball/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java b/refresh-footer-ball/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java index eef94a70..25a30fa5 100644 --- a/refresh-footer-ball/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java +++ b/refresh-footer-ball/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java @@ -1,8 +1,8 @@ -package com.scwang.smart.refresh.header; +package com.scwang.smart.refresh.footer; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; @@ -17,9 +17,9 @@ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test - public void useAppContext() { + public void useAppContext() throws Exception { // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.scwang.smart.refresh.header.test", appContext.getPackageName()); } diff --git a/refresh-footer-classics/build.gradle b/refresh-footer-classics/build.gradle index 3b93c1fb..f9c8badb 100644 --- a/refresh-footer-classics/build.gradle +++ b/refresh-footer-classics/build.gradle @@ -27,8 +27,12 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.legacy:legacy-support-v4:1.0.0' - api project(':refresh-drawable-paint') compileOnly project(':refresh-layout-kernel') + + compileOnly 'androidx.appcompat:appcompat:1.6.1' + + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } diff --git a/refresh-footer-classics/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java b/refresh-footer-classics/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java index 03560746..5b7ffd41 100644 --- a/refresh-footer-classics/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java +++ b/refresh-footer-classics/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java @@ -1,8 +1,8 @@ package com.scwang.smart.refresh.footer; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; @@ -17,10 +17,10 @@ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test - public void useAppContext() { + public void useAppContext() throws Exception { // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); - assertEquals("com.scwang.smart.refresh.header.test", appContext.getPackageName()); + assertEquals("com.scwang.smart.refresh.footer.test", appContext.getPackageName()); } } diff --git a/refresh-footer/build.gradle b/refresh-footer/build.gradle index 1bff15fa..af202a4d 100644 --- a/refresh-footer/build.gradle +++ b/refresh-footer/build.gradle @@ -30,4 +30,10 @@ dependencies { compileOnly project(':refresh-footer-ball') compileOnly project(':refresh-footer-classics') compileOnly project(':refresh-layout') + + compileOnly 'androidx.appcompat:appcompat:1.6.1' + + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } diff --git a/refresh-footer/src/androidTest/java/com/scwang/smartrefresh/footer/ExampleInstrumentedTest.java b/refresh-footer/src/androidTest/java/com/scwang/smartrefresh/footer/ExampleInstrumentedTest.java index ad487ee7..663be1d8 100644 --- a/refresh-footer/src/androidTest/java/com/scwang/smartrefresh/footer/ExampleInstrumentedTest.java +++ b/refresh-footer/src/androidTest/java/com/scwang/smartrefresh/footer/ExampleInstrumentedTest.java @@ -1,8 +1,8 @@ -package com.scwang.smartrefreshfooter; +package com.scwang.smartrefresh.footer; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; @@ -19,8 +19,8 @@ public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); - assertEquals("com.scwang.smartrefreshfooter.test", appContext.getPackageName()); + assertEquals("com.scwang.smartrefresh.footer.test", appContext.getPackageName()); } } diff --git a/refresh-header-classics/build.gradle b/refresh-header-classics/build.gradle index 173da2f7..3527e6d7 100644 --- a/refresh-header-classics/build.gradle +++ b/refresh-header-classics/build.gradle @@ -27,9 +27,13 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.6.1' - api project(':refresh-footer-classics') compileOnly project(':refresh-layout-kernel') + compileOnly 'androidx.appcompat:appcompat:1.6.1' + + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + } diff --git a/refresh-header-classics/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java b/refresh-header-classics/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java index eef94a70..55431e28 100644 --- a/refresh-header-classics/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java +++ b/refresh-header-classics/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java @@ -1,8 +1,8 @@ package com.scwang.smart.refresh.header; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; @@ -17,9 +17,9 @@ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test - public void useAppContext() { + public void useAppContext() throws Exception { // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.scwang.smart.refresh.header.test", appContext.getPackageName()); } diff --git a/refresh-header-falsify/build.gradle b/refresh-header-falsify/build.gradle index e710bdfb..96c906fe 100644 --- a/refresh-header-falsify/build.gradle +++ b/refresh-header-falsify/build.gradle @@ -27,8 +27,11 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.6.1' - compileOnly project(':refresh-layout-kernel') + compileOnly 'androidx.appcompat:appcompat:1.6.1' + + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } diff --git a/refresh-header-falsify/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java b/refresh-header-falsify/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java similarity index 67% rename from refresh-header-falsify/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java rename to refresh-header-falsify/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java index eef94a70..55431e28 100644 --- a/refresh-header-falsify/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java +++ b/refresh-header-falsify/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java @@ -1,8 +1,8 @@ package com.scwang.smart.refresh.header; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; @@ -17,9 +17,9 @@ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test - public void useAppContext() { + public void useAppContext() throws Exception { // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.scwang.smart.refresh.header.test", appContext.getPackageName()); } diff --git a/refresh-header-material/build.gradle b/refresh-header-material/build.gradle index 9da24a1a..decd8c91 100644 --- a/refresh-header-material/build.gradle +++ b/refresh-header-material/build.gradle @@ -27,8 +27,11 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.6.1' - compileOnly project(':refresh-layout-kernel') + compileOnly 'androidx.appcompat:appcompat:1.6.1' + + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } diff --git a/refresh-header-material/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java b/refresh-header-material/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java similarity index 67% rename from refresh-header-material/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java rename to refresh-header-material/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java index eef94a70..55431e28 100644 --- a/refresh-header-material/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java +++ b/refresh-header-material/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java @@ -1,8 +1,8 @@ package com.scwang.smart.refresh.header; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; @@ -17,9 +17,9 @@ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test - public void useAppContext() { + public void useAppContext() throws Exception { // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.scwang.smart.refresh.header.test", appContext.getPackageName()); } diff --git a/refresh-header-radar/build.gradle b/refresh-header-radar/build.gradle index 59cf8d69..1f5aad38 100644 --- a/refresh-header-radar/build.gradle +++ b/refresh-header-radar/build.gradle @@ -27,8 +27,11 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.6.1' - compileOnly project(':refresh-layout-kernel') + compileOnly 'androidx.appcompat:appcompat:1.6.1' + + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } diff --git a/refresh-header-radar/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java b/refresh-header-radar/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java similarity index 67% rename from refresh-header-radar/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java rename to refresh-header-radar/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java index eef94a70..55431e28 100644 --- a/refresh-header-radar/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java +++ b/refresh-header-radar/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java @@ -1,8 +1,8 @@ package com.scwang.smart.refresh.header; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; @@ -17,9 +17,9 @@ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test - public void useAppContext() { + public void useAppContext() throws Exception { // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.scwang.smart.refresh.header.test", appContext.getPackageName()); } diff --git a/refresh-header-two-level/build.gradle b/refresh-header-two-level/build.gradle index 039e3444..4eb1735b 100644 --- a/refresh-header-two-level/build.gradle +++ b/refresh-header-two-level/build.gradle @@ -30,9 +30,12 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.6.1' - api project(':refresh-header-classics') compileOnly project(':refresh-layout-kernel') + compileOnly 'androidx.appcompat:appcompat:1.6.1' + + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } diff --git a/refresh-header-two-level/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java b/refresh-header-two-level/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java similarity index 67% rename from refresh-header-two-level/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java rename to refresh-header-two-level/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java index eef94a70..55431e28 100644 --- a/refresh-header-two-level/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java +++ b/refresh-header-two-level/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java @@ -1,8 +1,8 @@ package com.scwang.smart.refresh.header; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; @@ -17,9 +17,9 @@ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test - public void useAppContext() { + public void useAppContext() throws Exception { // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.scwang.smart.refresh.header.test", appContext.getPackageName()); } diff --git a/refresh-header/build.gradle b/refresh-header/build.gradle index d61815ae..92a2a06c 100644 --- a/refresh-header/build.gradle +++ b/refresh-header/build.gradle @@ -26,12 +26,15 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.annotation:annotation:1.7.0' - implementation 'androidx.legacy:legacy-support-v4:1.0.0' - compileOnly project(':refresh-layout') compileOnly project(':refresh-drawable-path') compileOnly project(':refresh-header-material') compileOnly project(':refresh-layout-kernel') compileOnly project(':refresh-header-falsify') + + compileOnly 'androidx.appcompat:appcompat:1.6.1' + + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } diff --git a/refresh-header/src/androidTest/java/com/scwang/smartrefresh/header/ExampleInstrumentedTest.java b/refresh-header/src/androidTest/java/com/scwang/smartrefresh/header/ExampleInstrumentedTest.java index 658713f9..8c0766c4 100644 --- a/refresh-header/src/androidTest/java/com/scwang/smartrefresh/header/ExampleInstrumentedTest.java +++ b/refresh-header/src/androidTest/java/com/scwang/smartrefresh/header/ExampleInstrumentedTest.java @@ -1,8 +1,8 @@ package com.scwang.smartrefresh.header; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; @@ -19,7 +19,7 @@ public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.scwang.smartrefresh.header.test", appContext.getPackageName()); } diff --git a/refresh-layout-kernel/build.gradle b/refresh-layout-kernel/build.gradle index f84094c8..bca4606e 100644 --- a/refresh-layout-kernel/build.gradle +++ b/refresh-layout-kernel/build.gradle @@ -28,5 +28,9 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'com.google.android.material:material:1.10.0' + compileOnly 'com.google.android.material:material:1.10.0' + + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } diff --git a/refresh-layout-kernel/src/androidTest/java/com/scwang/smart/refresh/layout/ExampleInstrumentedTest.java b/refresh-layout-kernel/src/androidTest/java/com/scwang/smart/refresh/layout/ExampleInstrumentedTest.java index 18d5469a..520e27f6 100644 --- a/refresh-layout-kernel/src/androidTest/java/com/scwang/smart/refresh/layout/ExampleInstrumentedTest.java +++ b/refresh-layout-kernel/src/androidTest/java/com/scwang/smart/refresh/layout/ExampleInstrumentedTest.java @@ -1,8 +1,8 @@ package com.scwang.smart.refresh.layout; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; @@ -19,7 +19,7 @@ public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.scwang.smartrefresh.layout.test", appContext.getPackageName()); } diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java index 31ad256b..e90380df 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java @@ -244,7 +244,7 @@ public SmartRefreshLayout(Context context, AttributeSet attrs) { TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.SmartRefreshLayout); - /** + /* * SmartRefreshLayout 继承 ViewGroup 后即使不设置 android:clipToPadding,也等效于 android:clipToPadding=true * 特意添加 android:clipToPadding 来在 Java 代码中 判断是否设置过,没有设置强制 setClipToPadding(false) * android:clipChildren 也是同样 diff --git a/refresh-layout/build.gradle b/refresh-layout/build.gradle index b8540253..c10663a2 100644 --- a/refresh-layout/build.gradle +++ b/refresh-layout/build.gradle @@ -26,12 +26,15 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'com.google.android.material:material:1.10.0' - compileOnly project(':refresh-layout-kernel') compileOnly project(':refresh-footer-ball') compileOnly project(':refresh-header-falsify') compileOnly project(':refresh-header-radar') compileOnly project(':refresh-header-two-level') + compileOnly 'com.google.android.material:material:1.10.0' + + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } diff --git a/refresh-layout/src/androidTest/java/com/scwang/smartrefresh/layout/ExampleInstrumentedTest.java b/refresh-layout/src/androidTest/java/com/scwang/smartrefresh/layout/ExampleInstrumentedTest.java index fc2af52b..82b1ee6b 100644 --- a/refresh-layout/src/androidTest/java/com/scwang/smartrefresh/layout/ExampleInstrumentedTest.java +++ b/refresh-layout/src/androidTest/java/com/scwang/smartrefresh/layout/ExampleInstrumentedTest.java @@ -1,8 +1,8 @@ package com.scwang.smartrefresh.layout; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; @@ -19,7 +19,7 @@ public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.scwang.smartrefresh.layout.test", appContext.getPackageName()); } From 71a12db80c50955dbc97a644dde654892c0c64f7 Mon Sep 17 00:00:00 2001 From: wsc Date: Sun, 8 Oct 2023 18:40:47 +0800 Subject: [PATCH 39/67] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E5=BE=97=E5=85=BC=E5=AE=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activity/example/I18nExampleActivity.java | 6 +-- .../activity/style/DeliveryStyleActivity.java | 12 ++---- .../example/HorizontalExampleFragment.java | 6 +-- .../refreshlayout/util/StatusBarUtil.java | 42 +++++++------------ .../scwang/smart/drawable/PaintDrawable.java | 1 + .../material/MaterialProgressDrawable.java | 1 + 6 files changed, 22 insertions(+), 46 deletions(-) diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java index df39b155..ba87df1b 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java @@ -94,11 +94,7 @@ private void changeAppLanguage(Locale locale) { Resources res = getResources(); DisplayMetrics dm = res.getDisplayMetrics(); Configuration conf = res.getConfiguration(); - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) { - conf.locale = locale; - } else { - conf.setLocale(locale); - } + conf.setLocale(locale); res.updateConfiguration(conf, dm); startActivity(new Intent(this, getClass())); overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out); diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java index 0e0ab0d8..745abea1 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java @@ -47,9 +47,7 @@ private enum Item { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_style_delivery); - if (Build.VERSION.SDK_INT >= 21) { - getWindow().setStatusBarColor(0xfff0f0f0); - } + getWindow().setStatusBarColor(0xfff0f0f0); if (Build.VERSION.SDK_INT >= 23) { Window window = getWindow(); int systemUiVisibility = window.getDecorView().getSystemUiVisibility(); @@ -90,9 +88,7 @@ public void onItemClick(AdapterView parent, View view, int position, long id) mToolbar.setTitleTextColor(0xffbbbbbb); mToolbar.setNavigationIcon(R.drawable.ic_arrow_back_gray_24dp); mRefreshLayout.setPrimaryColors(0xfff0f0f0, 0xffffffff); - if (Build.VERSION.SDK_INT >= 21) { - getWindow().setStatusBarColor(0xfff0f0f0); - } + getWindow().setStatusBarColor(0xfff0f0f0); if (Build.VERSION.SDK_INT >= 23) { Window window = getWindow(); int systemUiVisibility = window.getDecorView().getSystemUiVisibility(); @@ -121,9 +117,7 @@ private void setThemeColor(int colorPrimary, int colorPrimaryDark) { mToolbar.setTitleTextColor(ContextCompat.getColor(this, android.R.color.white)); mToolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp); mRefreshLayout.setPrimaryColorsId(colorPrimary, android.R.color.white); - if (Build.VERSION.SDK_INT >= 21) { - getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); - } + getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); if (Build.VERSION.SDK_INT >= 23) { Window window = getWindow(); int systemUiVisibility = window.getDecorView().getSystemUiVisibility(); diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/HorizontalExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/HorizontalExampleFragment.java index 935191c7..e0992341 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/HorizontalExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/HorizontalExampleFragment.java @@ -42,12 +42,10 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat super.onViewCreated(root, savedInstanceState); root.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - Objects.requireNonNull(getActivity()).getWindow().setStatusBarColor(0); - } + requireActivity().getWindow().setStatusBarColor(0); final Toolbar toolbar = root.findViewById(R.id.toolbar); - toolbar.setNavigationOnClickListener(v -> getActivity().finish()); + toolbar.setNavigationOnClickListener(v -> requireActivity().finish()); final RecyclerView recyclerView = root.findViewById(R.id.recyclerView); diff --git a/app/src/main/java/com/scwang/refreshlayout/util/StatusBarUtil.java b/app/src/main/java/com/scwang/refreshlayout/util/StatusBarUtil.java index ab648f08..8e666b6a 100644 --- a/app/src/main/java/com/scwang/refreshlayout/util/StatusBarUtil.java +++ b/app/src/main/java/com/scwang/refreshlayout/util/StatusBarUtil.java @@ -52,33 +52,21 @@ public static void immersive(Window window, int color) { } public static void immersive(Window window, int color, @FloatRange(from = 0.0, to = 1.0) float alpha) { - if (Build.VERSION.SDK_INT >= 21) { - window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); - window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); - window.setStatusBarColor(mixtureColor(color, alpha)); - - int systemUiVisibility = window.getDecorView().getSystemUiVisibility(); - systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; - systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE; - window.getDecorView().setSystemUiVisibility(systemUiVisibility); - } else if (Build.VERSION.SDK_INT >= 19) { - window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); - setTranslucentView((ViewGroup) window.getDecorView(), color, alpha); - } else if (Build.VERSION.SDK_INT >= MIN_API && Build.VERSION.SDK_INT > 16) { - int systemUiVisibility = window.getDecorView().getSystemUiVisibility(); - systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; - systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE; - window.getDecorView().setSystemUiVisibility(systemUiVisibility); - } + window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); + window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); + window.setStatusBarColor(mixtureColor(color, alpha)); + + int systemUiVisibility = window.getDecorView().getSystemUiVisibility(); + systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; + systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE; + window.getDecorView().setSystemUiVisibility(systemUiVisibility); } public static void color(Activity activity, int color) { - if (Build.VERSION.SDK_INT >= 21) { - Window window = activity.getWindow(); - window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); - window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); - window.setStatusBarColor(color); - } + Window window = activity.getWindow(); + window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); + window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); + window.setStatusBarColor(color); } // @@ -135,11 +123,9 @@ public static void darkMode(Window window, int color, @FloatRange(from = 0.0, to } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { darkModeForM(window, true); immersive(window, color, alpha); - } else if (Build.VERSION.SDK_INT >= 19) { + } else { window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); setTranslucentView((ViewGroup) window.getDecorView(), color, alpha); - } else { - immersive(window, color, alpha); } // if (Build.VERSION.SDK_INT >= 21) { // window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); @@ -172,7 +158,7 @@ private static void darkModeForM(Window window, boolean dark) { /** * 设置Flyme4+的darkMode,darkMode时候字体颜色及icon变黑 - * http://open-wiki.flyme.cn/index.php?title=Flyme%E7%B3%BB%E7%BB%9FAPI + * ... */ public static boolean darkModeForFlyme4(Window window, boolean dark) { boolean result = false; diff --git a/refresh-drawable-paint/src/main/java/com/scwang/smart/drawable/PaintDrawable.java b/refresh-drawable-paint/src/main/java/com/scwang/smart/drawable/PaintDrawable.java index a3c1ee92..84041b99 100644 --- a/refresh-drawable-paint/src/main/java/com/scwang/smart/drawable/PaintDrawable.java +++ b/refresh-drawable-paint/src/main/java/com/scwang/smart/drawable/PaintDrawable.java @@ -34,6 +34,7 @@ public void setColorFilter(ColorFilter cf) { } @Override + @Deprecated public int getOpacity() { return PixelFormat.TRANSLUCENT; } diff --git a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/MaterialProgressDrawable.java b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/MaterialProgressDrawable.java index 8d08897d..5c3805c9 100644 --- a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/MaterialProgressDrawable.java +++ b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/MaterialProgressDrawable.java @@ -265,6 +265,7 @@ void setRotation(float rotation) { } @Override + @Deprecated public int getOpacity() { return PixelFormat.TRANSLUCENT; } From 925f2933de8f1055900da084e838ae886ca6080f Mon Sep 17 00:00:00 2001 From: wsc Date: Tue, 10 Oct 2023 20:15:52 +0800 Subject: [PATCH 40/67] =?UTF-8?q?=E9=87=8D=E6=96=B0=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E8=B4=A1=E7=8C=AE=E8=80=85=E6=8F=90=E4=BE=9B=E7=9A=84=20revers?= =?UTF-8?q?eCompute=20=E5=87=BD=E6=95=B0=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E6=B7=BB=E5=8A=A0=E6=84=9F=E8=B0=A2=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../refresh/layout/SmartRefreshLayout.java | 124 ++++++++---------- 1 file changed, 53 insertions(+), 71 deletions(-) diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java index e90380df..b9bd0a88 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java @@ -1656,55 +1656,9 @@ protected void overSpinner() { } } - /** - * 给出阻尼计算的距离,计算原始滑动距离 - * @param originSpinner 阻尼计算过后的距离 - * @return Float, 原始滑动距离 - */ - protected int reverseCompute(float originSpinner) { - final View thisView = this; - double result = originSpinner; - if (mState == RefreshState.TwoLevel && originSpinner > 0) { - result = originSpinner; - } else if (mState == RefreshState.Refreshing && originSpinner >= 0) { - if (originSpinner < mHeaderHeight) { - result = originSpinner; - } else { - final float maxDragHeight = mHeaderMaxDragRate < 10 ? mHeaderHeight * mHeaderMaxDragRate : mHeaderMaxDragRate; - final double M = maxDragHeight - mHeaderHeight; - final double H = Math.max(mScreenHeightPixels * 4 / 3, thisView.getHeight()) - mHeaderHeight; - final double y = originSpinner; - result = ((-H * (Math.log(1 - y / M) / Math.log(100f))) + mHeaderHeight) / mDragRate; - } - } else if (originSpinner < 0 && (mState == RefreshState.Loading - || (mEnableFooterFollowWhenNoMoreData && mFooterNoMoreData && mFooterNoMoreDataEffective && isEnableRefreshOrLoadMore(mEnableLoadMore)) - || (mEnableAutoLoadMore && !mFooterNoMoreData && isEnableRefreshOrLoadMore(mEnableLoadMore)))) { - if (originSpinner > -mFooterHeight) { - result = originSpinner; - } else { - final float maxDragHeight = mFooterMaxDragRate < 10 ? mFooterHeight * mFooterMaxDragRate : mFooterMaxDragRate; - final double M = maxDragHeight - mFooterHeight; - final double H = Math.max(mScreenHeightPixels * 4 / 3, thisView.getHeight()) - mFooterHeight; - final double y = -originSpinner; - result = -((-H * (Math.log(1 - y / M) / Math.log(100f))) - mFooterHeight) / mDragRate; - } - } else if (originSpinner >= 0) { - final double M = mHeaderMaxDragRate < 10 ? mHeaderHeight * mHeaderMaxDragRate : mHeaderMaxDragRate; - final double H = Math.max(mScreenHeightPixels / 2, thisView.getHeight()); - final double y = originSpinner; - result = (-H * (Math.log(1 - y / M) / Math.log(100f))) / mDragRate; - } else { - final double M = mFooterMaxDragRate < 10 ? mFooterHeight * mFooterMaxDragRate : mFooterMaxDragRate; - final double H = Math.max(mScreenHeightPixels / 2, thisView.getHeight()); - final double y = -originSpinner; - result = -((-H * (Math.log(1 - y / M) / Math.log(100f))) - mFooterHeight) / mDragRate; - } - - return Math.round(Float.parseFloat(String.valueOf(result))); - } - /** * 黏性移动 spinner + * 阻尼计算,根据原始华东距离,计算出阻尼后的距离 * @param spinner 偏移量 */ protected void moveSpinnerInfinitely(float spinner) { @@ -1809,9 +1763,60 @@ public void run() { }, mReboundDuration); } } + + /** + * 感谢 jamgudev <826630153@qq.com> 2022-03-22 贡献的代码 (贡献原始函数:reverseCompute) + * 给出阻尼计算的距离,计算原始滑动距离 + * 与 moveSpinnerInfinitely 函数为反向计算 + * @param spinnerConvergence 阻尼计算过后的距离 + * @return 原始滑动距离 + */ + protected int reverseInfinitely(float spinnerConvergence) { + final View thisView = this; + double originSpinner; + if (mState == RefreshState.TwoLevel && spinnerConvergence > 0) { + originSpinner = spinnerConvergence; + } else if (mState == RefreshState.Refreshing && spinnerConvergence >= 0) { + if (spinnerConvergence < mHeaderHeight) { + originSpinner = spinnerConvergence; + } else { + final float maxDragHeight = mHeaderMaxDragRate < 10 ? mHeaderHeight * mHeaderMaxDragRate : mHeaderMaxDragRate; + final double M = maxDragHeight - mHeaderHeight; + final double H = Math.max(mScreenHeightPixels * 4 / 3, thisView.getHeight()) - mHeaderHeight; + final double y = spinnerConvergence; + originSpinner = ((-H * (Math.log(1 - y / M) / Math.log(100f))) + mHeaderHeight) / mDragRate; + } + } else if (spinnerConvergence < 0 && (mState == RefreshState.Loading + || (mEnableFooterFollowWhenNoMoreData && mFooterNoMoreData && mFooterNoMoreDataEffective && isEnableRefreshOrLoadMore(mEnableLoadMore)) + || (mEnableAutoLoadMore && !mFooterNoMoreData && isEnableRefreshOrLoadMore(mEnableLoadMore)))) { + if (spinnerConvergence > -mFooterHeight) { + originSpinner = spinnerConvergence; + } else { + final float maxDragHeight = mFooterMaxDragRate < 10 ? mFooterHeight * mFooterMaxDragRate : mFooterMaxDragRate; + final double M = maxDragHeight - mFooterHeight; + final double H = Math.max(mScreenHeightPixels * 4 / 3, thisView.getHeight()) - mFooterHeight; + final double y = -spinnerConvergence; + originSpinner = -((-H * (Math.log(1 - y / M) / Math.log(100f))) - mFooterHeight) / mDragRate; + } + } else if (spinnerConvergence >= 0) { + final double M = mHeaderMaxDragRate < 10 ? mHeaderHeight * mHeaderMaxDragRate : mHeaderMaxDragRate; + final double H = Math.max(mScreenHeightPixels / 2, thisView.getHeight()); + final double y = spinnerConvergence; + originSpinner = (-H * (Math.log(1 - y / M) / Math.log(100f))) / mDragRate; + } else { + final double M = mFooterMaxDragRate < 10 ? mFooterHeight * mFooterMaxDragRate : mFooterMaxDragRate; + final double H = Math.max(mScreenHeightPixels / 2, thisView.getHeight()); + final double y = -spinnerConvergence; + originSpinner = -((-H * (Math.log(1 - y / M) / Math.log(100f))) - mFooterHeight) / mDragRate; + } + + return Math.round((float)originSpinner); + } + // // + // protected boolean checkLayoutParams(ViewGroup.LayoutParams p) { // return p instanceof LayoutParams; // } @@ -1884,7 +1889,7 @@ public void onNestedScrollAccepted(@NonNull View child, @NonNull View target, in // Dispatch up to the nested parent mNestedChild.startNestedScroll(axes & ViewCompat.SCROLL_AXIS_VERTICAL); - mTotalUnconsumed = reverseCompute(mSpinner);//0; + mTotalUnconsumed = reverseInfinitely(mSpinner); mNestedInProgress = true; interceptAnimatorByAction(MotionEvent.ACTION_DOWN); @@ -3627,7 +3632,6 @@ public RefreshKernel setState(@NonNull RefreshState state) { case PullDownCanceled: if (!mState.isOpening && isEnableRefreshOrLoadMore(mEnableRefresh)) { notifyStateChanged(RefreshState.PullDownCanceled); -// resetStatus(); setState(RefreshState.None); } else { setViceState(RefreshState.PullDownCanceled); @@ -3636,7 +3640,6 @@ public RefreshKernel setState(@NonNull RefreshState state) { case PullUpCanceled: if (isEnableRefreshOrLoadMore(mEnableLoadMore) && !mState.isOpening && !(mFooterNoMoreData && mEnableFooterFollowWhenNoMoreData && mFooterNoMoreDataEffective)) { notifyStateChanged(RefreshState.PullUpCanceled); -// resetStatus(); setState(RefreshState.None); } else { setViceState(RefreshState.PullUpCanceled); @@ -3689,27 +3692,6 @@ public RefreshKernel setState(@NonNull RefreshState state) { default: notifyStateChanged(state); break; -// case RefreshFinish: { -// if (mState == RefreshState.Refreshing) { -// notifyStateChanged(RefreshState.RefreshFinish); -// } -// break; -// } -// case LoadFinish:{ -// if (mState == RefreshState.Loading) { -// notifyStateChanged(RefreshState.LoadFinish); -// } -// break; -// } -// case TwoLevelReleased: -// notifyStateChanged(RefreshState.TwoLevelReleased); -// break; -// case TwoLevelFinish: -// notifyStateChanged(RefreshState.TwoLevelFinish); -// break; -// case TwoLevel: -// notifyStateChanged(RefreshState.TwoLevel); -// break; } return null; } From 669476e0dcca0cc72397576f833144ea181c17a4 Mon Sep 17 00:00:00 2001 From: wsc Date: Sun, 15 Oct 2023 21:25:58 +0800 Subject: [PATCH 41/67] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../refresh/layout/SmartRefreshLayout.java | 275 ++++++++---------- 1 file changed, 126 insertions(+), 149 deletions(-) diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java index b3d8daeb..075142e3 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java @@ -12,6 +12,7 @@ import android.os.Handler; import android.os.Looper; import android.util.AttributeSet; +import android.util.Log; import android.view.Gravity; import android.view.MotionEvent; import android.view.VelocityTracker; @@ -779,7 +780,7 @@ protected void onDetachedFromWindow() { * @param drawingTime 绘制耗时 */ @Override - protected boolean drawChild(Canvas canvas, View child, long drawingTime) { + protected boolean drawChild(@NonNull Canvas canvas, View child, long drawingTime) { final View thisView = this; final View contentView = mRefreshContent != null ? mRefreshContent.getView() : null; if (mRefreshHeader != null && mRefreshHeader.getView() == child) { @@ -958,7 +959,7 @@ public boolean dispatchTouchEvent(MotionEvent e) { /* * https://github.com/scwang90/SmartRefreshLayout/issues/1540 * 在刷新动画关闭的时候,点击列表无法跳转, - * 是因为下面的 if (interceptAnimatorByAction || mState.isFinishing ) return false + * 是因为下面的 if (interceptAnimatorByAction || mState.isFinishing) return false * 屏蔽了所有手势事件,屏蔽的原因是如果关闭动画正在执行的时候,随意滑动列表会导致意外的错乱 * 目前的修复方法并不是放开屏蔽,而是针对 先 ACTION_DOWN 再 ACTION_UP 的点击事件进行补偿处理 * 从而实现,完成动画执行时,列表不可手动滑动,但是可以点击列表项 @@ -1048,7 +1049,6 @@ public boolean dispatchTouchEvent(MotionEvent e) { final ViewParent parent = thisView.getParent(); if (parent instanceof ViewGroup) { //修复问题 https://github.com/scwang90/SmartRefreshLayout/issues/580 - //noinspection RedundantCast ((ViewGroup)parent).requestDisallowInterceptTouchEvent(true);//通知父控件不要拦截事件 } } @@ -1130,6 +1130,7 @@ public boolean dispatchTouchEvent(MotionEvent e) { * 应用场景已经在英文注释中解释清楚,大部分第三方下拉刷新库都保留了这段代码,本库也不例外 */ @Override + @SuppressLint("ObsoleteSdkInt") public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) { // if this is a List < L or another view that doesn't support nested // scrolling, ignore this request so that the vertical scroll event @@ -1615,12 +1616,7 @@ public void onAnimationEnd(Animator animation) { } } }); - reboundAnimator.addUpdateListener(new AnimatorUpdateListener() { - @Override - public void onAnimationUpdate(ValueAnimator animation) { - mKernel.moveSpinner((int) animation.getAnimatedValue(), false); - } - }); + reboundAnimator.addUpdateListener(animation -> mKernel.moveSpinner((int) animation.getAnimatedValue(), false)); reboundAnimator.setStartDelay(startDelay); // reboundAnimator.setDuration(20000); reboundAnimator.start(); @@ -1699,6 +1695,7 @@ protected void overSpinner() { * 拖拽导致 状态重置 最终导致 显示 NoMoreData Footer 菊花却任然在转的情况 * overSpinner 时 LoadFinish 状态无任何操作即可 */ + Log.d("SmartRefreshLayout", "overSpinner 时 LoadFinish 状态无任何操作即可"); } else if (mSpinner != 0) { mKernel.animSpinner(0); } @@ -1795,18 +1792,15 @@ protected void moveSpinnerInfinitely(float spinner) { /* * 自动加载模式时,延迟触发 onLoadMore ,mReboundDuration 保证动画能顺利执行 */ - mHandler.postDelayed(new Runnable() { - @Override - public void run() { - if (mLoadMoreListener != null) { - mLoadMoreListener.onLoadMore(SmartRefreshLayout.this); - } else if (mOnMultiListener == null) { - finishLoadMore(2000);//如果没有任何加载监听器,两秒之后自动关闭 - } - final OnLoadMoreListener listener = mOnMultiListener; - if (listener != null) { - listener.onLoadMore(SmartRefreshLayout.this); - } + mHandler.postDelayed(() -> { + if (mLoadMoreListener != null) { + mLoadMoreListener.onLoadMore(SmartRefreshLayout.this); + } else if (mOnMultiListener == null) { + finishLoadMore(2000);//如果没有任何加载监听器,两秒之后自动关闭 + } + final OnLoadMoreListener listener = mOnMultiListener; + if (listener != null) { + listener.onLoadMore(SmartRefreshLayout.this); } }, mReboundDuration); } @@ -1831,7 +1825,7 @@ protected int reverseInfinitely(float spinnerConvergence) { final float maxDragHeight = mHeaderMaxDragRate < 10 ? mHeaderHeight * mHeaderMaxDragRate : mHeaderMaxDragRate; final double M = maxDragHeight - mHeaderHeight; final double H = Math.max(mScreenHeightPixels * 4 / 3, thisView.getHeight()) - mHeaderHeight; - final double y = spinnerConvergence; + final double y = spinnerConvergence * 1; originSpinner = ((-H * (Math.log(1 - y / M) / Math.log(100f))) + mHeaderHeight) / mDragRate; } } else if (spinnerConvergence < 0 && (mState == RefreshState.Loading @@ -1849,7 +1843,7 @@ protected int reverseInfinitely(float spinnerConvergence) { } else if (spinnerConvergence >= 0) { final double M = mHeaderMaxDragRate < 10 ? mHeaderHeight * mHeaderMaxDragRate : mHeaderMaxDragRate; final double H = Math.max(mScreenHeightPixels / 2, thisView.getHeight()); - final double y = spinnerConvergence; + final double y = spinnerConvergence * 1; originSpinner = (-H * (Math.log(1 - y / M) / Math.log(100f))) / mDragRate; } else { final double M = mFooterMaxDragRate < 10 ? mFooterHeight * mFooterMaxDragRate : mFooterMaxDragRate; @@ -3267,60 +3261,57 @@ public void run() { } } //准备:偏移并结束状态 - mHandler.postDelayed(new Runnable() { - @Override - public void run() { - AnimatorUpdateListener updateListener = null; - if (mEnableScrollContentWhenLoaded && offset < 0) { - updateListener = mRefreshContent.scrollContentWhenFinished(mSpinner); - if (updateListener != null) {//如果内容需要滚动显示新数据 - updateListener.onAnimationUpdate(ValueAnimator.ofInt(0, 0));//直接滚动, Footer 的距离 - } + mHandler.postDelayed(() -> { + AnimatorUpdateListener updateListener = null; + if (mEnableScrollContentWhenLoaded && offset < 0) { + updateListener = mRefreshContent.scrollContentWhenFinished(mSpinner); + if (updateListener != null) {//如果内容需要滚动显示新数据 + updateListener.onAnimationUpdate(ValueAnimator.ofInt(0, 0));//直接滚动, Footer 的距离 } - ValueAnimator animator = null;//动议动画和动画结束回调 - AnimatorListenerAdapter listenerAdapter = new AnimatorListenerAdapter() { - @Override - public void onAnimationEnd(Animator animation) { - if (animation != null && animation.getDuration() == 0) { - return;//0 表示被取消 - } - mFooterLocked = false; - if (noMoreData) { - setNoMoreData(true); - } - if (mState == RefreshState.LoadFinish) { - notifyStateChanged(RefreshState.None); - } + } + ValueAnimator animator = null;//动议动画和动画结束回调 + AnimatorListenerAdapter listenerAdapter = new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + if (animation != null && animation.getDuration() == 0) { + return;//0 表示被取消 } - }; - if (mSpinner > 0) { //大于0表示下拉, 这是 Header 可见, Footer 不可见 - animator = mKernel.animSpinner(0);//关闭 Header 回到原始状态 - } else if (updateListener != null || mSpinner == 0) {//如果 Header 和 Footer 都不可见 或者内容需要滚动显示新内容 - if (reboundAnimator != null) { - reboundAnimator.setDuration(0);//cancel会触发End调用,可以判断0来确定是否被cancel - reboundAnimator.cancel();//会触发 cancel 和 end 调用 - reboundAnimator = null;//取消之前的任何动画 + mFooterLocked = false; + if (noMoreData) { + setNoMoreData(true); } - //直接关闭 Header 或者 Header 到原始状态 - mKernel.moveSpinner(0, false); - mKernel.setState(RefreshState.None); - } else {//准备按正常逻辑关闭Footer - if (noMoreData && mEnableFooterFollowWhenNoMoreData) {//如果需要显示没有更多数据 - if (mSpinner >= -mFooterHeight) {//如果 Footer 的位置再可见范围内 - notifyStateChanged(RefreshState.None);//直接通知重置状态,不关闭 Footer - } else {//如果 Footer 的位置超出 Footer 显示高度 (这个情况的概率应该很低, 手指故意拖拽 Footer 向上超出原位置时会触发) - animator = mKernel.animSpinner(-mFooterHeight);//通过动画让 Footer 回到全显示状态位置 - } - } else { - animator = mKernel.animSpinner(0);//动画正常关闭 Footer + if (mState == RefreshState.LoadFinish) { + notifyStateChanged(RefreshState.None); } } - if (animator != null) { - animator.addListener(listenerAdapter);//如果通过动画关闭,绑定动画结束回调 + }; + if (mSpinner > 0) { //大于0表示下拉, 这是 Header 可见, Footer 不可见 + animator = mKernel.animSpinner(0);//关闭 Header 回到原始状态 + } else if (updateListener != null || mSpinner == 0) {//如果 Header 和 Footer 都不可见 或者内容需要滚动显示新内容 + if (reboundAnimator != null) { + reboundAnimator.setDuration(0);//cancel会触发End调用,可以判断0来确定是否被cancel + reboundAnimator.cancel();//会触发 cancel 和 end 调用 + reboundAnimator = null;//取消之前的任何动画 + } + //直接关闭 Header 或者 Header 到原始状态 + mKernel.moveSpinner(0, false); + mKernel.setState(RefreshState.None); + } else {//准备按正常逻辑关闭Footer + if (noMoreData && mEnableFooterFollowWhenNoMoreData) {//如果需要显示没有更多数据 + if (mSpinner >= -mFooterHeight) {//如果 Footer 的位置再可见范围内 + notifyStateChanged(RefreshState.None);//直接通知重置状态,不关闭 Footer + } else {//如果 Footer 的位置超出 Footer 显示高度 (这个情况的概率应该很低, 手指故意拖拽 Footer 向上超出原位置时会触发) + animator = mKernel.animSpinner(-mFooterHeight);//通过动画让 Footer 回到全显示状态位置 + } } else { - listenerAdapter.onAnimationEnd(null);//如果没有动画,立即执行结束回调(必须逻辑) + animator = mKernel.animSpinner(0);//动画正常关闭 Footer } } + if (animator != null) { + animator.addListener(listenerAdapter);//如果通过动画关闭,绑定动画结束回调 + } else { + listenerAdapter.onAnimationEnd(null);//如果没有动画,立即执行结束回调(必须逻辑) + } }, mSpinner < 0 ? startDelay : 0); } } @@ -3430,48 +3421,42 @@ public boolean autoRefreshAnimationOnly() { @Override public boolean autoRefresh(int delayed, final int duration, final float dragRate,final boolean animationOnly) { if (mState == RefreshState.None && isEnableRefreshOrLoadMore(mEnableRefresh)) { - Runnable runnable = new Runnable() { - @Override - public void run() { - if (mViceState != RefreshState.Refreshing) return; - if (reboundAnimator != null) { - reboundAnimator.setDuration(0);//cancel会触发End调用,可以判断0来确定是否被cancel - reboundAnimator.cancel();//会触发 cancel 和 end 调用 - reboundAnimator = null; - } - - final View thisView = SmartRefreshLayout.this; - mLastTouchX = thisView.getMeasuredWidth() / 2f; - mKernel.setState(RefreshState.PullDownToRefresh); + Runnable runnable = () -> { + if (mViceState != RefreshState.Refreshing) return; + if (reboundAnimator != null) { + reboundAnimator.setDuration(0);//cancel会触发End调用,可以判断0来确定是否被cancel + reboundAnimator.cancel();//会触发 cancel 和 end 调用 + reboundAnimator = null; + } - if (mRefreshHeader != null && mRefreshHeader.autoOpen(duration, dragRate, animationOnly)) { - /* - * 2022-11-03 添加Header可以自己实现 autoOpen ,返回true表示支持,返回False表示不支持,使用老版本的 autoOpen - */ - return; - } + final View thisView = SmartRefreshLayout.this; + mLastTouchX = thisView.getMeasuredWidth() / 2f; + mKernel.setState(RefreshState.PullDownToRefresh); - final float height = mHeaderHeight == 0 ? mHeaderTriggerRate : mHeaderHeight; - final float dragHeight = dragRate < 10 ? height * dragRate : dragRate; - reboundAnimator = ValueAnimator.ofInt(mSpinner, (int) (dragHeight)); - reboundAnimator.setDuration(duration); - reboundAnimator.setInterpolator(new SmartUtil(SmartUtil.INTERPOLATOR_VISCOUS_FLUID)); - reboundAnimator.addUpdateListener(new AnimatorUpdateListener() { - @Override - public void onAnimationUpdate(ValueAnimator animation) { - if (reboundAnimator != null && mRefreshHeader != null) { - mKernel.moveSpinner((int) animation.getAnimatedValue(), true); - } - } - }); - reboundAnimator.addListener(new AnimatorListenerAdapter() { - @Override - public void onAnimationEnd(Animator animation) { - mKernel.onAutoRefreshAnimationEnd(animation, animationOnly); - } - }); - reboundAnimator.start(); + if (mRefreshHeader != null && mRefreshHeader.autoOpen(duration, dragRate, animationOnly)) { + /* + * 2022-11-03 添加Header可以自己实现 autoOpen ,返回true表示支持,返回False表示不支持,使用老版本的 autoOpen + */ + return; } + + final float height = mHeaderHeight == 0 ? mHeaderTriggerRate : mHeaderHeight; + final float dragHeight = dragRate < 10 ? height * dragRate : dragRate; + reboundAnimator = ValueAnimator.ofInt(mSpinner, (int) (dragHeight)); + reboundAnimator.setDuration(duration); + reboundAnimator.setInterpolator(new SmartUtil(SmartUtil.INTERPOLATOR_VISCOUS_FLUID)); + reboundAnimator.addUpdateListener(animation -> { + if (reboundAnimator != null && mRefreshHeader != null) { + mKernel.moveSpinner((int) animation.getAnimatedValue(), true); + } + }); + reboundAnimator.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + mKernel.onAutoRefreshAnimationEnd(animation, animationOnly); + } + }); + reboundAnimator.start(); }; setViceState(RefreshState.Refreshing); if (delayed > 0) { @@ -3531,48 +3516,42 @@ public boolean autoLoadMoreAnimationOnly() { @Override public boolean autoLoadMore(int delayed, final int duration, final float dragRate, final boolean animationOnly) { if (mState == RefreshState.None && (isEnableRefreshOrLoadMore(mEnableLoadMore) && !mFooterNoMoreData)) { - Runnable runnable = new Runnable() { - @Override - public void run() { - if (mViceState != RefreshState.Loading)return; - if (reboundAnimator != null) { - reboundAnimator.setDuration(0);//cancel会触发End调用,可以判断0来确定是否被cancel - reboundAnimator.cancel();//会触发 cancel 和 end 调用 - reboundAnimator = null; - } - - final View thisView = SmartRefreshLayout.this; - mLastTouchX = thisView.getMeasuredWidth() / 2f; - mKernel.setState(RefreshState.PullUpToLoad); + Runnable runnable = () -> { + if (mViceState != RefreshState.Loading)return; + if (reboundAnimator != null) { + reboundAnimator.setDuration(0);//cancel会触发End调用,可以判断0来确定是否被cancel + reboundAnimator.cancel();//会触发 cancel 和 end 调用 + reboundAnimator = null; + } - if (mRefreshFooter != null && mRefreshFooter.autoOpen(duration, dragRate, animationOnly)) { - /* - * 2022-11-03 添加Header可以自己实现 autoOpen ,返回true表示支持,返回False表示不支持,使用老版本的 autoOpen - */ - return; - } + final View thisView = SmartRefreshLayout.this; + mLastTouchX = thisView.getMeasuredWidth() / 2f; + mKernel.setState(RefreshState.PullUpToLoad); - final float height = mFooterHeight == 0 ? mFooterTriggerRate : mFooterHeight; - final float dragHeight = dragRate < 10 ? dragRate * height : dragRate; - reboundAnimator = ValueAnimator.ofInt(mSpinner, - (int) (dragHeight)); - reboundAnimator.setDuration(duration); - reboundAnimator.setInterpolator(new SmartUtil(SmartUtil.INTERPOLATOR_VISCOUS_FLUID)); - reboundAnimator.addUpdateListener(new AnimatorUpdateListener() { - @Override - public void onAnimationUpdate(ValueAnimator animation) { - if (reboundAnimator != null && mRefreshFooter != null) { - mKernel.moveSpinner((int) animation.getAnimatedValue(), true); - } - } - }); - reboundAnimator.addListener(new AnimatorListenerAdapter() { - @Override - public void onAnimationEnd(Animator animation) { - mKernel.onAutoLoadMoreAnimationEnd(animation, animationOnly); - } - }); - reboundAnimator.start(); + if (mRefreshFooter != null && mRefreshFooter.autoOpen(duration, dragRate, animationOnly)) { + /* + * 2022-11-03 添加Header可以自己实现 autoOpen ,返回true表示支持,返回False表示不支持,使用老版本的 autoOpen + */ + return; } + + final float height = mFooterHeight == 0 ? mFooterTriggerRate : mFooterHeight; + final float dragHeight = dragRate < 10 ? dragRate * height : dragRate; + reboundAnimator = ValueAnimator.ofInt(mSpinner, - (int) (dragHeight)); + reboundAnimator.setDuration(duration); + reboundAnimator.setInterpolator(new SmartUtil(SmartUtil.INTERPOLATOR_VISCOUS_FLUID)); + reboundAnimator.addUpdateListener(animation -> { + if (reboundAnimator != null && mRefreshFooter != null) { + mKernel.moveSpinner((int) animation.getAnimatedValue(), true); + } + }); + reboundAnimator.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + mKernel.onAutoLoadMoreAnimationEnd(animation, animationOnly); + } + }); + reboundAnimator.start(); }; setViceState(RefreshState.Loading); if (delayed > 0) { @@ -3835,7 +3814,6 @@ public RefreshKernel moveSpinner(final int spinner, final boolean isDragging) { tSpinner = spinner; } else if (oldSpinner < 0) { changed = true; - tSpinner = 0; } } /* @@ -3847,7 +3825,6 @@ public RefreshKernel moveSpinner(final int spinner, final boolean isDragging) { tSpinner = spinner; } else if (oldSpinner > 0) { changed = true; - tSpinner = 0; } } if (changed) { From 0fe829c44c63c33791aba98f7efac7327a15ff87 Mon Sep 17 00:00:00 2001 From: wsc Date: Sat, 21 Oct 2023 21:49:17 +0800 Subject: [PATCH 42/67] =?UTF-8?q?=E8=A7=84=E8=8C=83=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=20NonNull=20=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/RefreshContentHorizontal.java | 2 +- .../smart/drawable/ProgressDrawable.java | 2 +- .../scwang/smart/drawable/view/PathsView.java | 4 ++- .../smart/refresh/footer/BallPulseFooter.java | 2 +- .../header/falsify/FalsifyAbstract.java | 2 +- .../smart/refresh/header/MaterialHeader.java | 2 +- .../refresh/header/BezierRadarHeader.java | 4 +-- .../refresh/header/BezierCircleHeader.java | 8 ++--- .../smart/refresh/header/DeliveryHeader.java | 4 +-- .../smart/refresh/header/DropBoxHeader.java | 8 ++--- .../refresh/header/FlyRefreshHeader.java | 4 +-- .../header/FunGameBattleCityHeader.java | 14 ++++---- .../refresh/header/FunGameHitBlockHeader.java | 2 +- .../smart/refresh/header/PhoenixHeader.java | 4 +-- .../refresh/header/StoreHouseHeader.java | 4 +-- .../smart/refresh/header/TaurusHeader.java | 6 ++-- .../smart/refresh/header/WaterDropHeader.java | 4 +-- .../smart/refresh/header/WaveSwipeHeader.java | 8 ++--- .../header/flyrefresh/MountainSceneView.java | 5 +-- .../refresh/header/fungame/FunGameView.java | 4 +-- .../header/waterdrop/WaterDropView.java | 14 ++++---- .../refresh/header/waveswipe/WaveView.java | 35 ++++++------------- .../header/BezierCircleHeader.java | 2 +- .../smartrefresh/header/DeliveryHeader.java | 2 +- .../smartrefresh/header/DropBoxHeader.java | 2 +- .../smartrefresh/header/FlyRefreshHeader.java | 2 +- .../header/FunGameBattleCityHeader.java | 2 +- .../header/FunGameHitBlockHeader.java | 2 +- .../smartrefresh/header/PhoenixHeader.java | 2 +- .../smartrefresh/header/StoreHouseHeader.java | 2 +- .../smartrefresh/header/TaurusHeader.java | 2 +- .../smartrefresh/header/WaterDropHeader.java | 2 +- .../smartrefresh/header/WaveSwipeHeader.java | 2 +- .../layout/wrapper/RefreshContentWrapper.java | 2 +- 34 files changed, 79 insertions(+), 87 deletions(-) diff --git a/app/src/main/java/com/scwang/refreshlayout/widget/RefreshContentHorizontal.java b/app/src/main/java/com/scwang/refreshlayout/widget/RefreshContentHorizontal.java index 47ad0294..af59bdfa 100644 --- a/app/src/main/java/com/scwang/refreshlayout/widget/RefreshContentHorizontal.java +++ b/app/src/main/java/com/scwang/refreshlayout/widget/RefreshContentHorizontal.java @@ -27,7 +27,7 @@ public ValueAnimator.AnimatorUpdateListener scrollContentWhenFinished(final int } @Override - public void onAnimationUpdate(ValueAnimator animation) { + public void onAnimationUpdate(@NonNull ValueAnimator animation) { int value = (int) animation.getAnimatedValue(); try { if (mScrollableView instanceof AbsListView) { diff --git a/refresh-drawable-paint/src/main/java/com/scwang/smart/drawable/ProgressDrawable.java b/refresh-drawable-paint/src/main/java/com/scwang/smart/drawable/ProgressDrawable.java index 05197868..dda33a3b 100644 --- a/refresh-drawable-paint/src/main/java/com/scwang/smart/drawable/ProgressDrawable.java +++ b/refresh-drawable-paint/src/main/java/com/scwang/smart/drawable/ProgressDrawable.java @@ -32,7 +32,7 @@ public ProgressDrawable() { } @Override - public void onAnimationUpdate(ValueAnimator animation) { + public void onAnimationUpdate(@NonNull ValueAnimator animation) { int value = (int) animation.getAnimatedValue(); mProgressDegree = 30 * (value / 30); final Drawable drawable = ProgressDrawable.this; diff --git a/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/view/PathsView.java b/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/view/PathsView.java index 171f22c6..7e285ab1 100644 --- a/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/view/PathsView.java +++ b/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/view/PathsView.java @@ -6,6 +6,8 @@ import android.util.AttributeSet; import android.view.View; +import androidx.annotation.NonNull; + import com.scwang.smart.drawable.PathsDrawable; /** @@ -54,7 +56,7 @@ protected void onLayout(boolean changed, int left, int top, int right, int botto } @Override - protected void onDraw(Canvas canvas) { + protected void onDraw(@NonNull Canvas canvas) { mPathsDrawable.draw(canvas); } diff --git a/refresh-footer-ball/src/main/java/com/scwang/smart/refresh/footer/BallPulseFooter.java b/refresh-footer-ball/src/main/java/com/scwang/smart/refresh/footer/BallPulseFooter.java index 17a05274..0db5e080 100644 --- a/refresh-footer-ball/src/main/java/com/scwang/smart/refresh/footer/BallPulseFooter.java +++ b/refresh-footer-ball/src/main/java/com/scwang/smart/refresh/footer/BallPulseFooter.java @@ -85,7 +85,7 @@ public BallPulseFooter(Context context, @Nullable AttributeSet attrs) { // @Override - protected void dispatchDraw(Canvas canvas) { + protected void dispatchDraw(@NonNull Canvas canvas) { final View thisView = this; final int width = thisView.getWidth(); final int height = thisView.getHeight(); diff --git a/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/falsify/FalsifyAbstract.java b/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/falsify/FalsifyAbstract.java index a48dd11f..bb07e6cb 100644 --- a/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/falsify/FalsifyAbstract.java +++ b/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/falsify/FalsifyAbstract.java @@ -30,7 +30,7 @@ protected FalsifyAbstract(Context context, AttributeSet attrs, int defStyleAttr) } @Override - protected void dispatchDraw(Canvas canvas) { + protected void dispatchDraw(@NonNull Canvas canvas) { super.dispatchDraw(canvas); final View thisView = this; if (thisView.isInEditMode()) {//这段代码在运行时不会执行,只会在Studio编辑预览时运行,不用在意性能问题 diff --git a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java index 64c0c981..0b72f8e5 100644 --- a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java +++ b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java @@ -164,7 +164,7 @@ protected void onLayout(boolean changed, int left, int top, int right, int botto } @Override - protected void dispatchDraw(Canvas canvas) { + protected void dispatchDraw(@NonNull Canvas canvas) { if (mShowBezierWave) { //重置画笔 mBezierPath.reset(); diff --git a/refresh-header-radar/src/main/java/com/scwang/smart/refresh/header/BezierRadarHeader.java b/refresh-header-radar/src/main/java/com/scwang/smart/refresh/header/BezierRadarHeader.java index 9cd2f48a..7a0b1c01 100644 --- a/refresh-header-radar/src/main/java/com/scwang/smart/refresh/header/BezierRadarHeader.java +++ b/refresh-header-radar/src/main/java/com/scwang/smart/refresh/header/BezierRadarHeader.java @@ -118,7 +118,7 @@ protected void onDetachedFromWindow() { // @Override - protected void dispatchDraw(Canvas canvas) { + protected void dispatchDraw(@NonNull Canvas canvas) { final View thisView = this; final int width = thisView.getWidth(); final int height = thisView.isInEditMode() ? thisView.getHeight() : mWaveOffsetY; @@ -378,7 +378,7 @@ protected class AnimatorUpdater implements ValueAnimator.AnimatorUpdateListener this.propertyName = name; } @Override - public void onAnimationUpdate(ValueAnimator animation) { + public void onAnimationUpdate(@NonNull ValueAnimator animation) { if (PROPERTY_RADAR_SCALE == propertyName) { mRadarScale = (float) animation.getAnimatedValue(); } else if (PROPERTY_WAVE_HEIGHT == propertyName) { diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/BezierCircleHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/BezierCircleHeader.java index 750d8cb5..81018cec 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/BezierCircleHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/BezierCircleHeader.java @@ -24,7 +24,7 @@ /** * CircleRefresh * Created by scwang on 2018/7/18. - * from https://github.com/tuesda/CircleRefreshLayout + * from ... */ public class BezierCircleHeader extends SimpleComponent implements RefreshHeader { @@ -82,7 +82,7 @@ public BezierCircleHeader(Context context, AttributeSet attrs) { // @Override - protected void dispatchDraw(Canvas canvas) { + protected void dispatchDraw(@NonNull Canvas canvas) { final View thisView = this; final int viewWidth = thisView.getWidth(); final int viewHeight = mHeight;//thisView.getHeight(); @@ -268,7 +268,7 @@ public void onReleased(@NonNull RefreshLayout refreshLayout, int height, int max float springRatio = 0; int status = 0;//0 还没开始弹起 1 向上弹起 2 在弹起的最高点停住 @Override - public void onAnimationUpdate(ValueAnimator animation) { + public void onAnimationUpdate(@NonNull ValueAnimator animation) { float curValue = (float) animation.getAnimatedValue(); if (status == 0 && curValue <= 0) { status = 1; @@ -324,7 +324,7 @@ public int onFinish(@NonNull RefreshLayout layout, boolean success) { ValueAnimator animator = ValueAnimator.ofFloat(0, 1); animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override - public void onAnimationUpdate(ValueAnimator animation) { + public void onAnimationUpdate(@NonNull ValueAnimator animation) { final View thisView = BezierCircleHeader.this; mFinishRatio = (float) animation.getAnimatedValue(); thisView.invalidate(); diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/DeliveryHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/DeliveryHeader.java index 3134eced..2886166e 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/DeliveryHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/DeliveryHeader.java @@ -22,7 +22,7 @@ /** * Refresh your delivery! * Created by scwang on 2017/6/25. - * design https://dribbble.com/shots/2753803-Refresh-your-delivery + * design ... */ public class DeliveryHeader extends SimpleComponent implements RefreshHeader { @@ -140,7 +140,7 @@ public DeliveryHeader(Context context, @Nullable AttributeSet attrs) { // @Override - protected void dispatchDraw(Canvas canvas) { + protected void dispatchDraw(@NonNull Canvas canvas) { final View thisView = this; final int width = thisView.getWidth(); final int height = mHeight;//thisView.getHeight(); diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/DropBoxHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/DropBoxHeader.java index 7ae2cd94..f5f32d73 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/DropBoxHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/DropBoxHeader.java @@ -31,7 +31,7 @@ /** * DropBoxRefresh * Created by scwang on 2017/6/24. - * design https://dribbble.com/shots/3470499-DropBox-Refresh + * design ... */ public class DropBoxHeader extends SimpleComponent implements RefreshHeader { @@ -156,7 +156,7 @@ protected void onAttachedToWindow() { mReboundAnimator.setDuration(300); mReboundAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override - public void onAnimationUpdate(ValueAnimator animation) { + public void onAnimationUpdate(@NonNull ValueAnimator animation) { final View thisView = DropBoxHeader.this; mReboundPercent = (float) animation.getAnimatedValue(); thisView.invalidate(); @@ -180,7 +180,7 @@ public void onAnimationEnd(Animator animation) { mDropOutAnimator.setDuration(300); mDropOutAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override - public void onAnimationUpdate(ValueAnimator animation) { + public void onAnimationUpdate(@NonNull ValueAnimator animation) { if (mDropOutPercent < 1 || mDropOutPercent >= 3) { mDropOutPercent = (float) animation.getAnimatedValue(); } else if (mDropOutPercent < 2) { @@ -221,7 +221,7 @@ protected void onDetachedFromWindow() { } @Override - protected void dispatchDraw(Canvas canvas) { + protected void dispatchDraw(@NonNull Canvas canvas) { final View thisView = this; final int width = thisView.getWidth(); diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FlyRefreshHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FlyRefreshHeader.java index ee6f1aa8..84b89464 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FlyRefreshHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FlyRefreshHeader.java @@ -25,7 +25,7 @@ /** * 纸飞机和山丘 * Created by scwang on 2017/6/6. - * from https://github.com/race604/FlyRefresh + * from ... */ public class FlyRefreshHeader extends FalsifyHeader implements RefreshHeader { @@ -113,7 +113,7 @@ public void onReleased(@NonNull RefreshLayout layout, int height, int maxDragHei valueAnimator.setDuration(300); valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override - public void onAnimationUpdate(ValueAnimator animation) { + public void onAnimationUpdate(@NonNull ValueAnimator animation) { onMoving(true,(float) animation.getAnimatedValue(), 0, 0, 0); } }); diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameBattleCityHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameBattleCityHeader.java index 626bbc0e..e355d34a 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameBattleCityHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameBattleCityHeader.java @@ -19,7 +19,7 @@ /** * Created by scwang on 2018/3/09. - * from https://github.com/Hitomis/FunGameRefresh + * from ... */ public class FunGameBattleCityHeader extends FunGameView { @@ -185,7 +185,7 @@ protected RectF generateEnemyTank(int index) { protected int getTrackIndex(int y) { int index = y / (mHeaderHeight / TANK_ROW_NUM); index = index >= TANK_ROW_NUM ? TANK_ROW_NUM - 1 : index; - index = index < 0 ? 0 : index; + index = Math.max(index, 0); return index; } @@ -217,11 +217,13 @@ protected void upLevel() { bulletSpeed += SmartUtil.dp2px(1); wipeOutNum = 0; - if (enemyTankSpace > 12) - enemyTankSpace -= 12; + if (enemyTankSpace > 12) { + enemyTankSpace -= 12; + } - if (bulletSpace > 30) - bulletSpace -= 30; + if (bulletSpace > 30) { + bulletSpace -= 30; + } } /** diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameHitBlockHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameHitBlockHeader.java index 11a25dc5..7b248e7c 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameHitBlockHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameHitBlockHeader.java @@ -20,7 +20,7 @@ /** * Created by scwang on 2018/2/29. - * from https://github.com/Hitomis/FunGameRefresh + * from ... */ public class FunGameHitBlockHeader extends FunGameView { diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/PhoenixHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/PhoenixHeader.java index bff0847b..5459ba13 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/PhoenixHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/PhoenixHeader.java @@ -28,7 +28,7 @@ /** * Phoenix * Created by scwang on 2017/5/31. - * from https://github.com/Yalantis/Phoenix + * from ... */ public class PhoenixHeader extends SimpleComponent implements RefreshHeader { @@ -258,7 +258,7 @@ public void setPrimaryColors(@ColorInt int ... colors) { // @Override - protected void dispatchDraw(Canvas canvas) { + protected void dispatchDraw(@NonNull Canvas canvas) { final View thisView = this; final int width = thisView.getWidth(); diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/StoreHouseHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/StoreHouseHeader.java index 8cff5b86..91e43a76 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/StoreHouseHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/StoreHouseHeader.java @@ -30,7 +30,7 @@ /** * StoreHouseHeader * Created by scwang on 2017/5/31. - * from https://github.com/liaohuqiu/android-Ultra-Pull-To-Refresh + * from ... */ @SuppressWarnings({"unused", "UnusedReturnValue", "SameParameterValue"}) public class StoreHouseHeader extends SimpleComponent implements RefreshHeader { @@ -119,7 +119,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { } @Override - protected void dispatchDraw(Canvas canvas) { + protected void dispatchDraw(@NonNull Canvas canvas) { final View thisView = this; final int c1 = canvas.save(); diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/TaurusHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/TaurusHeader.java index fb7408b8..4b9a47c8 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/TaurusHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/TaurusHeader.java @@ -32,7 +32,7 @@ /** * Taurus * Created by scwang on 2017/5/31. - * from https://github.com/Yalantis/Taurus + * from ... */ public class TaurusHeader extends SimpleComponent implements RefreshHeader { @@ -257,7 +257,7 @@ public void setPrimaryColors(@ColorInt int ... colors) { // @Override - protected void dispatchDraw(Canvas canvas) { + protected void dispatchDraw(@NonNull Canvas canvas) { final View thisView = this; final int width = thisView.getWidth(); @@ -297,7 +297,7 @@ protected void drawWinds(Canvas canvas, int width) { for (Map.Entry wind : mWinds.entrySet()) { // We want that interval will be greater than fifth part of draggable distance - if (Math.abs(wind.getKey() - tmp) > mHeaderHeight / RANDOM_Y_COEFFICIENT) { + if (Math.abs(wind.getKey() - tmp) > 1f * mHeaderHeight / RANDOM_Y_COEFFICIENT) { y = tmp; } else { y = 0; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaterDropHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaterDropHeader.java index 6900b62a..b8230843 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaterDropHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaterDropHeader.java @@ -31,7 +31,7 @@ /** * WaterDropHeader * Created by scwang on 2017/5/31. - * from https://github.com/THEONE10211024/WaterDropListView + * from ... */ public class WaterDropHeader extends SimpleComponent implements RefreshHeader { @@ -124,7 +124,7 @@ protected void onLayout(boolean changed, int l, int t, int r, int b) { // @Override - protected void dispatchDraw(Canvas canvas) { + protected void dispatchDraw(@NonNull Canvas canvas) { super.dispatchDraw(canvas); final View thisView = this; final View dropView = mWaterDropView; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java index e9796cba..f1b94c07 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java @@ -8,6 +8,7 @@ import androidx.annotation.ColorInt; import androidx.annotation.IdRes; import androidx.annotation.NonNull; +import androidx.appcompat.widget.AppCompatImageView; import androidx.core.content.ContextCompat; import android.util.AttributeSet; import android.util.DisplayMetrics; @@ -16,7 +17,6 @@ import android.view.animation.AccelerateDecelerateInterpolator; import android.view.animation.Animation; import android.view.animation.Transformation; -import android.widget.ImageView; import com.scwang.smart.refresh.header.material.MaterialProgressDrawable; import com.scwang.smart.refresh.header.waveswipe.WaveView; @@ -35,7 +35,7 @@ /** * 全屏水滴下拉头 * Created by scwang on 2017/6/4. - * from https://github.com/recruit-lifestyle/WaveSwipeRefreshLayout + * from ... */ @SuppressWarnings("unused") public class WaveSwipeHeader extends SimpleComponent implements RefreshHeader { @@ -273,7 +273,7 @@ public void onReleased(@NonNull RefreshLayout layout, int height, int maxDragHei animator.setInterpolator(new AccelerateDecelerateInterpolator()); animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override - public void onAnimationUpdate(ValueAnimator valueAnimator) { + public void onAnimationUpdate(@NonNull ValueAnimator valueAnimator) { final View circleView = mCircleView; circleView.setTranslationY( mWaveView.getCurrentCircleCenterY() + circleView.getHeight() / 2.f); @@ -372,7 +372,7 @@ public static boolean isOver600dp() { * * @author jmatsu */ - protected class ProgressAnimationImageView extends ImageView { + protected class ProgressAnimationImageView extends AppCompatImageView { /** * AnimationのStartとEnd時にListenerにアレする diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/flyrefresh/MountainSceneView.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/flyrefresh/MountainSceneView.java index 6b6b3546..7dfcc1b1 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/flyrefresh/MountainSceneView.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/flyrefresh/MountainSceneView.java @@ -9,6 +9,7 @@ import android.graphics.RectF; import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; import androidx.core.graphics.ColorUtils; import androidx.core.view.animation.PathInterpolatorCompat; @@ -21,7 +22,7 @@ /** * 山丘树木场景视图 * Created by scwang on 2018/5/28. - * from https://github.com/race604/FlyRefresh + * from ... */ @SuppressWarnings("UnnecessaryLocalVariable") public class MountainSceneView extends View { @@ -234,7 +235,7 @@ protected void drawTree(Canvas canvas, float scale, float baseX, float baseY, } @Override - protected void onDraw(Canvas canvas) { + protected void onDraw(@NonNull Canvas canvas) { super.onDraw(canvas); final View thisView = this; canvas.drawColor(COLOR_BACKGROUND); diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameView.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameView.java index 953c037f..bcc674e0 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameView.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameView.java @@ -33,7 +33,7 @@ /** * Created by scwang on 2018/2/29. - * https://github.com/Hitomis/FunGameRefresh + * from ... */ @SuppressWarnings("unused") public abstract class FunGameView extends FunGameBase { @@ -235,7 +235,7 @@ protected TextView createMaskView(Context context, String text, int textSize, in protected abstract void drawGame(Canvas canvas, int width, int height); @Override - protected void dispatchDraw(Canvas canvas) { + protected void dispatchDraw(@NonNull Canvas canvas) { final View thisView = this; final int width = thisView.getWidth(); final int height = mHeaderHeight; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/waterdrop/WaterDropView.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/waterdrop/WaterDropView.java index 82160c9f..8b065b66 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/waterdrop/WaterDropView.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/waterdrop/WaterDropView.java @@ -7,6 +7,8 @@ import android.graphics.Paint; import android.graphics.Path; import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; + import android.view.View; import android.view.animation.DecelerateInterpolator; @@ -16,7 +18,7 @@ /** * 下拉头中间的 “水滴” * Created by scwang on 2018/6/23. - * from https://github.com/THEONE10211024/WaterDropListView + * from ... */ @SuppressWarnings("unused") public class WaterDropView extends View { @@ -85,7 +87,7 @@ protected void onLayout(boolean changed, int left, int top, int right, int botto } @Override - protected void onDraw(Canvas canvas) { + protected void onDraw(@NonNull Canvas canvas) { super.onDraw(canvas); final View thisView = this; @@ -119,13 +121,13 @@ protected void makeBezierPath() { float top_y1 = (float) (topCircle.y + topCircle.radius * Math.sin(angle)); float top_x2 = (float) (topCircle.x + topCircle.radius * Math.cos(angle)); - float top_y2 = top_y1; + float top_y2 = top_y1 * 1; float bottom_x1 = (float) (bottomCircle.x - bottomCircle.radius * Math.cos(angle)); float bottom_y1 = (float) (bottomCircle.y + bottomCircle.radius * Math.sin(angle)); float bottom_x2 = (float) (bottomCircle.x + bottomCircle.radius * Math.cos(angle)); - float bottom_y2 = bottom_y1; + float bottom_y2 = bottom_y1 * 1; mPath.moveTo(topCircle.x, topCircle.y); @@ -167,8 +169,8 @@ public ValueAnimator createAnimator() { valueAnimator.setInterpolator(new DecelerateInterpolator()); valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override - public void onAnimationUpdate(ValueAnimator valueAnimator1) { - WaterDropView.this.updateCompleteState((float) valueAnimator1.getAnimatedValue()); + public void onAnimationUpdate(@NonNull ValueAnimator valueAnimator) { + WaterDropView.this.updateCompleteState((float) valueAnimator.getAnimatedValue()); final View thisView = WaterDropView.this; thisView.postInvalidate(); } diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/waveswipe/WaveView.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/waveswipe/WaveView.java index 5ef4a723..b96519c0 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/waveswipe/WaveView.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/waveswipe/WaveView.java @@ -23,8 +23,9 @@ import android.graphics.Paint; import android.graphics.Path; import android.graphics.RectF; -import android.os.Build; import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; + import android.view.View; import android.view.ViewTreeObserver; import android.view.animation.AccelerateDecelerateInterpolator; @@ -216,7 +217,7 @@ public class WaveView extends View implements ViewTreeObserver.OnPreDrawListener protected ValueAnimator.AnimatorUpdateListener mAnimatorUpdateListener = new ValueAnimator.AnimatorUpdateListener() { @Override - public void onAnimationUpdate(ValueAnimator valueAnimator) { + public void onAnimationUpdate(@NonNull ValueAnimator valueAnimator) { final View thisView = WaveView.this; thisView.postInvalidate(); } @@ -278,7 +279,7 @@ public boolean onPreDraw() { } @Override - protected void onDraw(Canvas canvas) { + protected void onDraw(@NonNull Canvas canvas) { super.onDraw(canvas); //引っ張ってる最中の波と終わったあとの波 // canvas.drawPath(mWavePath, mShadowPaint); @@ -439,11 +440,7 @@ public void beginPhase(float move1) { BEGIN_PHASE_POINTS[0][1], mWidth, 0); final View thisView = this; - if (Build.VERSION.SDK_INT >= 16) { - thisView.postInvalidateOnAnimation(); - } else { - thisView.invalidate(); - } + thisView.postInvalidateOnAnimation(); } @@ -480,11 +477,7 @@ public void appearPhase(float move1, float move2) { + mDropCircleRadius; final View thisView = this; - if (Build.VERSION.SDK_INT >= 16) { - thisView.postInvalidateOnAnimation(); - } else { - thisView.invalidate(); - } + thisView.postInvalidateOnAnimation(); } public void expandPhase(float move1, float move2, float move3) { @@ -538,11 +531,7 @@ public void expandPhase(float move1, float move2, float move3) { EXPAND_PHASE_POINTS[3][1]) + mDropCircleRadius; final View thisView = this; - if (Build.VERSION.SDK_INT >= 16) { - thisView.postInvalidateOnAnimation(); - } else { - thisView.invalidate(); - } + thisView.postInvalidateOnAnimation(); } /** @@ -571,14 +560,10 @@ public void startDropAnimation() { mDropCircleAnimator.setDuration(DROP_CIRCLE_ANIMATOR_DURATION); mDropCircleAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override - public void onAnimationUpdate(ValueAnimator animation) { + public void onAnimationUpdate(@NonNull ValueAnimator animation) { mCurrentCircleCenterY = (float) animation.getAnimatedValue(); final View thisView = WaveView.this; - if (Build.VERSION.SDK_INT >= 16) { - thisView.postInvalidateOnAnimation(); - } else { - thisView.invalidate(); - } + thisView.postInvalidateOnAnimation(); } }); mDropCircleAnimator.setInterpolator(new AccelerateDecelerateInterpolator()); @@ -629,7 +614,7 @@ public void startWaveAnimation(float h) { mWaveReverseAnimator.setDuration(WAVE_ANIMATOR_DURATION); mWaveReverseAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override - public void onAnimationUpdate(ValueAnimator valueAnimator) { + public void onAnimationUpdate(@NonNull ValueAnimator valueAnimator) { float h = (Float) valueAnimator.getAnimatedValue(); mWavePath.moveTo(0, 0); mWavePath.quadTo(0.25f * mWidth, 0, 0.333f * mWidth, h * 0.5f); diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/BezierCircleHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/BezierCircleHeader.java index dbcaefd6..5083029a 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/BezierCircleHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/BezierCircleHeader.java @@ -8,7 +8,7 @@ /** * CircleRefresh * Created by scwang on 2018/7/18. - * from https://github.com/tuesda/CircleRefreshLayout + * from ... */ public class BezierCircleHeader extends com.scwang.smart.refresh.header.BezierCircleHeader implements RefreshHeader { diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/DeliveryHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/DeliveryHeader.java index 7ec74144..2ba7e497 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/DeliveryHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/DeliveryHeader.java @@ -9,7 +9,7 @@ /** * Refresh your delivery! * Created by scwang on 2017/6/25. - * design https://dribbble.com/shots/2753803-Refresh-your-delivery + * design ... */ public class DeliveryHeader extends com.scwang.smart.refresh.header.DeliveryHeader implements RefreshHeader { diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/DropBoxHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/DropBoxHeader.java index 14a0147b..28bb1447 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/DropBoxHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/DropBoxHeader.java @@ -9,7 +9,7 @@ /** * DropBoxRefresh * Created by scwang on 2017/6/24. - * design https://dribbble.com/shots/3470499-DropBox-Refresh + * design ... */ public class DropBoxHeader extends com.scwang.smart.refresh.header.DropBoxHeader implements RefreshHeader { diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/FlyRefreshHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/FlyRefreshHeader.java index 713d4638..07fa3abb 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/FlyRefreshHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/FlyRefreshHeader.java @@ -8,7 +8,7 @@ /** * 纸飞机和山丘 * Created by scwang on 2017/6/6. - * from https://github.com/race604/FlyRefresh + * from ... */ public class FlyRefreshHeader extends com.scwang.smart.refresh.header.FlyRefreshHeader implements RefreshHeader { diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameBattleCityHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameBattleCityHeader.java index 15c321e1..a12d53ab 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameBattleCityHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameBattleCityHeader.java @@ -9,7 +9,7 @@ /** * Created by scwang on 2018/3/09. - * from https://github.com/Hitomis/FunGameRefresh + * from ... */ public class FunGameBattleCityHeader extends com.scwang.smart.refresh.header.FunGameBattleCityHeader implements RefreshHeader { diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameHitBlockHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameHitBlockHeader.java index 60585dec..6724fa9e 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameHitBlockHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameHitBlockHeader.java @@ -7,7 +7,7 @@ /** * Created by scwang on 2018/2/29. - * from https://github.com/Hitomis/FunGameRefresh + * from ... */ public class FunGameHitBlockHeader extends com.scwang.smart.refresh.header.FunGameHitBlockHeader implements RefreshHeader { diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/PhoenixHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/PhoenixHeader.java index 3e03e743..c6b41e32 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/PhoenixHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/PhoenixHeader.java @@ -8,7 +8,7 @@ /** * Phoenix * Created by scwang on 2017/5/31. - * from https://github.com/Yalantis/Phoenix + * from ... */ public class PhoenixHeader extends com.scwang.smart.refresh.header.PhoenixHeader implements RefreshHeader { diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/StoreHouseHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/StoreHouseHeader.java index 3824a9fc..5216b8d4 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/StoreHouseHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/StoreHouseHeader.java @@ -8,7 +8,7 @@ /** * StoreHouseHeader * Created by scwang on 2017/5/31. - * from https://github.com/liaohuqiu/android-Ultra-Pull-To-Refresh + * from ... */ public class StoreHouseHeader extends com.scwang.smart.refresh.header.StoreHouseHeader implements RefreshHeader { diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/TaurusHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/TaurusHeader.java index dd4c37d0..612ffed1 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/TaurusHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/TaurusHeader.java @@ -8,7 +8,7 @@ /** * Taurus * Created by scwang on 2017/5/31. - * from https://github.com/Yalantis/Taurus + * from ... */ public class TaurusHeader extends com.scwang.smart.refresh.header.TaurusHeader implements RefreshHeader { diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaterDropHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaterDropHeader.java index a3f28a6d..e67e6277 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaterDropHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaterDropHeader.java @@ -8,7 +8,7 @@ /** * WaterDropHeader * Created by scwang on 2017/5/31. - * from https://github.com/THEONE10211024/WaterDropListView + * from ... */ public class WaterDropHeader extends com.scwang.smart.refresh.header.WaterDropHeader implements RefreshHeader { diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaveSwipeHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaveSwipeHeader.java index 14db546b..dba0f1a5 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaveSwipeHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaveSwipeHeader.java @@ -8,7 +8,7 @@ /** * 全屏水滴下拉头 * Created by scwang on 2017/6/4. - * from https://github.com/recruit-lifestyle/WaveSwipeRefreshLayout + * from ... */ public class WaveSwipeHeader extends com.scwang.smart.refresh.header.WaveSwipeHeader implements RefreshHeader { diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/wrapper/RefreshContentWrapper.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/wrapper/RefreshContentWrapper.java index 46e7f03b..d3710a2b 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/wrapper/RefreshContentWrapper.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/wrapper/RefreshContentWrapper.java @@ -268,7 +268,7 @@ public AnimatorUpdateListener scrollContentWhenFinished(final int spinner) { } @Override - public void onAnimationUpdate(ValueAnimator animation) { + public void onAnimationUpdate(@NonNull ValueAnimator animation) { int value = (int) animation.getAnimatedValue(); try { float dy = (value - mLastSpinner) * mScrollableView.getScaleY(); From dd4e0f6bc4b37bb282be3e86fbb071e995dd9815 Mon Sep 17 00:00:00 2001 From: wsc Date: Thu, 26 Oct 2023 21:56:27 +0800 Subject: [PATCH 43/67] =?UTF-8?q?=E8=A7=84=E8=8C=83=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=20import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ExampleInstrumentedTest.java | 5 ++-- .../java/com/scwang/refreshlayout/App.java | 1 + .../activity/FragmentActivity.java | 5 ++-- .../activity/IndexMainActivity.java | 5 ++-- .../example/AssignCodeExampleActivity.java | 3 +-- .../example/AssignDefaultExampleActivity.java | 1 + .../example/AssignXmlExampleActivity.java | 1 + .../example/BasicExampleActivity.java | 10 ++++---- .../example/CustomExampleActivity.java | 7 +++--- .../activity/example/I18nExampleActivity.java | 9 ++++--- .../example/ListenerExampleActivity.java | 5 ++-- .../example/NestedLayoutExampleActivity.java | 12 +++++----- .../example/OverScrollExampleActivity.java | 5 ++-- .../example/SnapHelperExampleActivity.java | 8 +++---- .../practice/BannerPracticeActivity.java | 12 ++++++---- .../practice/FeedListPracticeActivity.java | 1 + .../practice/ProfilePracticeActivity.java | 2 +- .../practice/QQBrowserPracticeActivity.java | 6 ++--- .../practice/RepastPracticeActivity.java | 7 +++--- .../practice/WebViewPracticeActivity.java | 5 ++-- .../practice/WeiboPracticeActivity.java | 9 ++++--- .../style/BezierCircleStyleActivity.java | 9 +++---- .../style/BezierRadarStyleActivity.java | 9 +++---- .../activity/style/ClassicsStyleActivity.java | 13 +++++----- .../activity/style/DeliveryStyleActivity.java | 11 +++++---- .../activity/style/DropBoxStyleActivity.java | 9 +++---- .../style/FlyRefreshStyleActivity.java | 20 +++++++--------- .../style/FunGameBattleCityStyleActivity.java | 9 +++---- .../style/FunGameHitBlockStyleActivity.java | 9 +++---- .../activity/style/MaterialStyleActivity.java | 9 +++---- .../activity/style/PhoenixStyleActivity.java | 15 ++++++------ .../style/StoreHouseStyleActivity.java | 9 +++---- .../activity/style/TaurusStyleActivity.java | 15 ++++++------ .../style/WaterDropStyleActivity.java | 9 +++---- .../style/WaveSwipeStyleActivity.java | 9 +++---- .../adapter/BaseRecyclerAdapter.java | 8 +++---- .../adapter/SmartViewHolder.java | 7 +++--- .../example/BottomSheetExampleFragment.java | 16 +++++++------ .../DisallowInterceptExampleFragment.java | 13 ++++++---- .../example/EmptyLayoutExampleFragment.java | 13 +++++----- .../EmptyLayoutExampleFragmentInner.java | 17 ++++++------- .../EmptyLayoutExampleFragmentOuter.java | 17 ++++++------- .../example/FlexBoxLayoutManagerFragment.java | 12 +++++----- .../example/HorizontalExampleFragment.java | 11 ++++----- .../example/NestedScrollExampleFragment.java | 15 ++++++------ .../NestedScrollExampleFragmentIntegral.java | 24 +++++++++---------- .../NestedScrollExampleFragmentViewPager.java | 20 ++++++++-------- .../example/NoMoreDataExampleFragment.java | 11 +++++---- .../example/PureScrollExampleFragment.java | 13 +++++----- .../PureScrollExampleFragmentFooter.java | 13 +++++----- .../PureScrollExampleFragmentHeader.java | 13 +++++----- .../example/SpecifyStyleExampleFragment.java | 13 +++++----- .../example/StaggeredGridExampleFragment.java | 7 +++--- .../example/ViewPagerExampleFragment.java | 17 +++++++------ .../index/RefreshExampleFragment.java | 21 ++++++++++++---- .../index/RefreshPracticeFragment.java | 9 +++---- .../fragment/index/RefreshStylesFragment.java | 9 +++---- .../practice/InstantPracticeFragment.java | 9 +++---- .../practice/SecondFloorPracticeFragment.java | 11 +++++---- .../practice/TwoLevelPracticeFragment.java | 9 +++---- .../refreshlayout/util/StatusBarUtil.java | 1 - .../widget/RefreshContentHorizontal.java | 3 ++- .../widget/ScrollBoundaryHorizontal.java | 4 ++-- .../widget/SmartRefreshHorizontal.java | 14 ----------- .../main/res/layout/activity_experiment.xml | 2 -- app/src/main/res/layout/item_movie_item.xml | 1 - .../scwang/refreshlayout/ExampleUnitTest.java | 2 +- 67 files changed, 329 insertions(+), 300 deletions(-) diff --git a/app/src/androidTest/java/com/scwang/refreshlayout/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/scwang/refreshlayout/ExampleInstrumentedTest.java index 5ab251f1..da078597 100644 --- a/app/src/androidTest/java/com/scwang/refreshlayout/ExampleInstrumentedTest.java +++ b/app/src/androidTest/java/com/scwang/refreshlayout/ExampleInstrumentedTest.java @@ -1,13 +1,14 @@ package com.scwang.refreshlayout; import android.content.Context; -import androidx.test.platform.app.InstrumentationRegistry; + import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; import org.junit.Test; import org.junit.runner.RunWith; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Instrumentation test, which will execute on an Android device. diff --git a/app/src/main/java/com/scwang/refreshlayout/App.java b/app/src/main/java/com/scwang/refreshlayout/App.java index 6f59a4b6..579a3a30 100644 --- a/app/src/main/java/com/scwang/refreshlayout/App.java +++ b/app/src/main/java/com/scwang/refreshlayout/App.java @@ -2,6 +2,7 @@ import android.app.Application; import android.content.Context; + import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatDelegate; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/FragmentActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/FragmentActivity.java index 67369455..3f37f75f 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/FragmentActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/FragmentActivity.java @@ -4,15 +4,14 @@ import android.content.Context; import android.content.Intent; import android.os.Bundle; -import androidx.annotation.Nullable; +import android.widget.FrameLayout; +import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentTransaction; -import android.widget.FrameLayout; - import java.util.HashMap; import java.util.Map; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/IndexMainActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/IndexMainActivity.java index c3717b41..bcad5820 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/IndexMainActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/IndexMainActivity.java @@ -2,16 +2,15 @@ import android.animation.ValueAnimator; import android.os.Bundle; +import android.view.MenuItem; import androidx.annotation.IdRes; import androidx.annotation.NonNull; -import androidx.fragment.app.Fragment; import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.Fragment; import androidx.viewpager2.adapter.FragmentStateAdapter; import androidx.viewpager2.widget.ViewPager2; -import android.view.MenuItem; - import com.google.android.material.bottomnavigation.BottomNavigationView; import com.google.android.material.navigation.NavigationBarView; import com.scwang.refreshlayout.R; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignCodeExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignCodeExampleActivity.java index 488a617e..23948dc3 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignCodeExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignCodeExampleActivity.java @@ -1,11 +1,10 @@ package com.scwang.refreshlayout.activity.example; import android.os.Bundle; -import androidx.appcompat.widget.Toolbar; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; - +import androidx.appcompat.widget.Toolbar; import com.scwang.refreshlayout.R; import com.scwang.smartrefresh.header.MaterialHeader; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignDefaultExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignDefaultExampleActivity.java index 8247c33b..e8f1ed57 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignDefaultExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignDefaultExampleActivity.java @@ -2,6 +2,7 @@ import android.content.Context; import android.os.Bundle; + import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignXmlExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignXmlExampleActivity.java index 2aeba794..0b7cfced 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignXmlExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignXmlExampleActivity.java @@ -1,6 +1,7 @@ package com.scwang.refreshlayout.activity.example; import android.os.Bundle; + import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java index 34a226bc..2d7b2091 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java @@ -1,16 +1,16 @@ package com.scwang.refreshlayout.activity.example; import android.os.Bundle; -import androidx.appcompat.app.AppCompatActivity; -import androidx.recyclerview.widget.LinearLayoutManager; -import androidx.recyclerview.widget.RecyclerView; - -import androidx.appcompat.widget.Toolbar; import android.view.View; import android.widget.AbsListView; import android.widget.ListView; import android.widget.Toast; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + import com.google.android.material.bottomsheet.BottomSheetDialog; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java index 4cebeb77..79506862 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java @@ -2,9 +2,6 @@ import android.content.Context; import android.os.Bundle; -import androidx.annotation.NonNull; -import androidx.appcompat.app.AppCompatActivity; -import androidx.appcompat.widget.Toolbar; import android.util.AttributeSet; import android.view.Gravity; import android.view.View; @@ -14,6 +11,10 @@ import android.widget.Space; import android.widget.TextView; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; + import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java index ba87df1b..f70ac8fd 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java @@ -3,17 +3,16 @@ import android.content.Intent; import android.content.res.Configuration; import android.content.res.Resources; -import android.os.Build; import android.os.Bundle; +import android.util.DisplayMetrics; +import android.view.View; +import android.widget.AdapterView; +import android.widget.ListView; import androidx.annotation.Nullable; import androidx.annotation.StringRes; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; -import android.util.DisplayMetrics; -import android.view.View; -import android.widget.AdapterView; -import android.widget.ListView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/ListenerExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/ListenerExampleActivity.java index 73377b3a..5a5effcb 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/ListenerExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/ListenerExampleActivity.java @@ -1,11 +1,12 @@ package com.scwang.refreshlayout.activity.example; import android.os.Bundle; +import android.text.method.ScrollingMovementMethod; +import android.widget.TextView; + import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; -import android.text.method.ScrollingMovementMethod; -import android.widget.TextView; import com.scwang.refreshlayout.R; import com.scwang.smartrefresh.layout.api.RefreshFooter; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/NestedLayoutExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/NestedLayoutExampleActivity.java index d1d762cd..7a7f1960 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/NestedLayoutExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/NestedLayoutExampleActivity.java @@ -1,18 +1,18 @@ package com.scwang.refreshlayout.activity.example; import android.os.Bundle; +import android.util.Log; +import android.view.View; +import android.widget.AdapterView; +import android.widget.TextView; + import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; - +import androidx.appcompat.widget.Toolbar; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.util.Log; -import android.view.View; -import android.widget.AdapterView; -import android.widget.TextView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/OverScrollExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/OverScrollExampleActivity.java index d73fc707..9525e9d0 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/OverScrollExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/OverScrollExampleActivity.java @@ -1,11 +1,12 @@ package com.scwang.refreshlayout.activity.example; import android.os.Bundle; -import androidx.appcompat.app.AppCompatActivity; -import androidx.appcompat.widget.Toolbar; import android.webkit.WebView; import android.webkit.WebViewClient; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; + import com.scwang.refreshlayout.R; import com.scwang.smartrefresh.layout.api.RefreshLayout; import com.scwang.smartrefresh.layout.listener.OnRefreshListener; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/SnapHelperExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/SnapHelperExampleActivity.java index 6d3692c8..15628859 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/SnapHelperExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/SnapHelperExampleActivity.java @@ -1,18 +1,18 @@ package com.scwang.refreshlayout.activity.example; import android.os.Bundle; +import android.view.View; +import android.widget.Switch; + import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.PagerSnapHelper; import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.SnapHelper; -import androidx.appcompat.widget.Toolbar; -import android.view.View; -import android.widget.Switch; - import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/BannerPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/BannerPracticeActivity.java index 232d73e3..2c00c1dc 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/BannerPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/BannerPracticeActivity.java @@ -3,16 +3,17 @@ import android.content.Context; import android.os.Build; import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.ImageView; +import android.widget.Toast; + import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.LayoutInflater; -import android.view.View; -import android.widget.ImageView; -import android.widget.Toast; import com.bumptech.glide.Glide; import com.chad.library.adapter.base.BaseQuickAdapter; @@ -34,6 +35,7 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; + import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; /** * 广告轮播-Banner diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/FeedListPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/FeedListPracticeActivity.java index 91f78459..fdbc4cd6 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/FeedListPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/FeedListPracticeActivity.java @@ -1,6 +1,7 @@ package com.scwang.refreshlayout.activity.practice; import android.os.Bundle; + import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/ProfilePracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/ProfilePracticeActivity.java index ad60b21a..c459b04c 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/ProfilePracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/ProfilePracticeActivity.java @@ -1,9 +1,9 @@ package com.scwang.refreshlayout.activity.practice; import android.os.Bundle; + import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; -import android.view.View; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.util.StatusBarUtil; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/QQBrowserPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/QQBrowserPracticeActivity.java index 153efa24..c4f1bdb1 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/QQBrowserPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/QQBrowserPracticeActivity.java @@ -2,12 +2,12 @@ import android.annotation.SuppressLint; import android.os.Bundle; -import androidx.appcompat.app.AppCompatActivity; -import androidx.appcompat.widget.Toolbar; -import android.view.View; import android.webkit.WebView; import android.webkit.WebViewClient; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; + import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.util.StatusBarUtil; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/RepastPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/RepastPracticeActivity.java index 2997561d..2c89dafb 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/RepastPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/RepastPracticeActivity.java @@ -1,14 +1,15 @@ package com.scwang.refreshlayout.activity.practice; import android.os.Bundle; +import android.view.View; +import android.widget.Toast; + import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.View; -import android.widget.Toast; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WebViewPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/WebViewPracticeActivity.java index aec206a6..44e22989 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WebViewPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/WebViewPracticeActivity.java @@ -2,11 +2,12 @@ import android.annotation.SuppressLint; import android.os.Bundle; -import androidx.appcompat.app.AppCompatActivity; -import androidx.appcompat.widget.Toolbar; import android.webkit.WebView; import android.webkit.WebViewClient; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; + import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.util.StatusBarUtil; import com.scwang.smartrefresh.layout.api.RefreshLayout; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java index 7e090a4b..099be907 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java @@ -1,16 +1,15 @@ package com.scwang.refreshlayout.activity.practice; import android.os.Bundle; -import androidx.annotation.NonNull; +import android.view.View; +import android.widget.Toast; +import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import androidx.core.content.ContextCompat; import androidx.core.widget.NestedScrollView; -import androidx.appcompat.widget.Toolbar; -import android.view.View; -import android.widget.Toast; - import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.util.StatusBarUtil; import com.scwang.smartrefresh.layout.api.RefreshHeader; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java index 84aff7cc..d2e523ce 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java @@ -2,16 +2,17 @@ import android.os.Build; import android.os.Bundle; +import android.view.View; +import android.widget.AdapterView; + import androidx.annotation.StringRes; -import androidx.core.content.ContextCompat; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.View; -import android.widget.AdapterView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java index b3ee8818..8216d346 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java @@ -2,16 +2,17 @@ import android.os.Build; import android.os.Bundle; +import android.view.View; +import android.widget.AdapterView; + import androidx.annotation.StringRes; -import androidx.core.content.ContextCompat; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.View; -import android.widget.AdapterView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java index 0e43ab28..bbe27a45 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java @@ -4,21 +4,20 @@ import android.graphics.drawable.LayerDrawable; import android.os.Build; import android.os.Bundle; -import androidx.annotation.StringRes; +import android.view.View; +import android.widget.AdapterView; +import android.widget.ImageView; -import androidx.core.content.ContextCompat; +import androidx.annotation.StringRes; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat; -import androidx.appcompat.widget.Toolbar; -import android.view.View; -import android.widget.AdapterView; -import android.widget.ImageView; - import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java index 745abea1..5dd74898 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java @@ -2,16 +2,17 @@ import android.os.Build; import android.os.Bundle; +import android.view.View; +import android.view.Window; +import android.widget.AdapterView; + import androidx.annotation.StringRes; -import androidx.core.content.ContextCompat; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.View; -import android.view.Window; -import android.widget.AdapterView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java index 0d9890ee..d40dc80d 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java @@ -2,16 +2,17 @@ import android.os.Build; import android.os.Bundle; +import android.view.View; +import android.widget.AdapterView; + import androidx.annotation.StringRes; -import androidx.core.content.ContextCompat; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.View; -import android.widget.AdapterView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java index dbbc6b91..f60708a0 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java @@ -2,8 +2,6 @@ import android.animation.Animator; import android.animation.AnimatorListenerAdapter; -import android.animation.AnimatorSet; -import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.content.Context; import android.content.res.ColorStateList; @@ -11,31 +9,29 @@ import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.OvalShape; import android.os.Bundle; -import androidx.annotation.NonNull; - -import androidx.core.content.ContextCompat; -import androidx.appcompat.app.AppCompatActivity; -import androidx.recyclerview.widget.LinearLayoutManager; -import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.AccelerateInterpolator; -import android.view.animation.DecelerateInterpolator; import android.view.animation.Interpolator; -import android.view.animation.OvershootInterpolator; import android.widget.ImageView; import android.widget.TextView; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.CollapsingToolbarLayout; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.util.StatusBarUtil; -import com.scwang.smartrefresh.header.FlyRefreshHeader; import com.scwang.smart.refresh.header.flyrefresh.FlyView; import com.scwang.smart.refresh.header.flyrefresh.MountainSceneView; +import com.scwang.smartrefresh.header.FlyRefreshHeader; import com.scwang.smartrefresh.layout.api.RefreshHeader; import com.scwang.smartrefresh.layout.api.RefreshLayout; import com.scwang.smartrefresh.layout.listener.OnRefreshListener; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java index 8a761b1b..e48ab2e8 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java @@ -2,16 +2,17 @@ import android.os.Build; import android.os.Bundle; +import android.view.View; +import android.widget.AdapterView; + import androidx.annotation.StringRes; -import androidx.core.content.ContextCompat; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.View; -import android.widget.AdapterView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java index b30d6f80..d890153e 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java @@ -2,16 +2,17 @@ import android.os.Build; import android.os.Bundle; +import android.view.View; +import android.widget.AdapterView; + import androidx.annotation.StringRes; -import androidx.core.content.ContextCompat; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.View; -import android.widget.AdapterView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java index aefd8db2..9a16f069 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java @@ -2,16 +2,17 @@ import android.os.Build; import android.os.Bundle; +import android.view.View; +import android.widget.AdapterView; + import androidx.annotation.StringRes; -import androidx.core.content.ContextCompat; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.View; -import android.widget.AdapterView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java index b511aebe..ff659fa9 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java @@ -3,20 +3,21 @@ import android.content.res.ColorStateList; import android.os.Build; import android.os.Bundle; +import android.view.View; +import android.widget.AdapterView; + import androidx.annotation.StringRes; -import com.google.android.material.appbar.AppBarLayout; -import com.google.android.material.appbar.CollapsingToolbarLayout; -import com.google.android.material.floatingactionbutton.FloatingActionButton; -import androidx.core.content.ContextCompat; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.View; -import android.widget.AdapterView; +import com.google.android.material.appbar.AppBarLayout; +import com.google.android.material.appbar.CollapsingToolbarLayout; +import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java index 96bbf966..d9fa334d 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java @@ -3,16 +3,17 @@ import android.graphics.Point; import android.os.Build; import android.os.Bundle; +import android.view.View; +import android.widget.AdapterView; + import androidx.annotation.StringRes; -import androidx.core.content.ContextCompat; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.View; -import android.widget.AdapterView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java index 205ef267..cf10416e 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java @@ -3,20 +3,21 @@ import android.content.res.ColorStateList; import android.os.Build; import android.os.Bundle; +import android.view.View; +import android.widget.AdapterView; + import androidx.annotation.StringRes; -import com.google.android.material.appbar.AppBarLayout; -import com.google.android.material.appbar.CollapsingToolbarLayout; -import com.google.android.material.floatingactionbutton.FloatingActionButton; -import androidx.core.content.ContextCompat; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.View; -import android.widget.AdapterView; +import com.google.android.material.appbar.AppBarLayout; +import com.google.android.material.appbar.CollapsingToolbarLayout; +import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java index f7607fc8..6081f09a 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java @@ -2,16 +2,17 @@ import android.os.Build; import android.os.Bundle; +import android.view.View; +import android.widget.AdapterView; + import androidx.annotation.StringRes; -import androidx.core.content.ContextCompat; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.View; -import android.widget.AdapterView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java index 5d535ccb..7e0e6b97 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java @@ -2,16 +2,17 @@ import android.os.Build; import android.os.Bundle; +import android.view.View; +import android.widget.AdapterView; + import androidx.annotation.StringRes; -import androidx.core.content.ContextCompat; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.View; -import android.widget.AdapterView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; diff --git a/app/src/main/java/com/scwang/refreshlayout/adapter/BaseRecyclerAdapter.java b/app/src/main/java/com/scwang/refreshlayout/adapter/BaseRecyclerAdapter.java index 6ed99baa..588fa390 100644 --- a/app/src/main/java/com/scwang/refreshlayout/adapter/BaseRecyclerAdapter.java +++ b/app/src/main/java/com/scwang/refreshlayout/adapter/BaseRecyclerAdapter.java @@ -2,16 +2,16 @@ import android.database.DataSetObservable; import android.database.DataSetObserver; - -import androidx.annotation.LayoutRes; -import androidx.annotation.NonNull; -import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ListAdapter; +import androidx.annotation.LayoutRes; +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + import java.util.ArrayList; import java.util.Collection; import java.util.List; diff --git a/app/src/main/java/com/scwang/refreshlayout/adapter/SmartViewHolder.java b/app/src/main/java/com/scwang/refreshlayout/adapter/SmartViewHolder.java index 06a951fa..28671507 100644 --- a/app/src/main/java/com/scwang/refreshlayout/adapter/SmartViewHolder.java +++ b/app/src/main/java/com/scwang/refreshlayout/adapter/SmartViewHolder.java @@ -1,15 +1,16 @@ package com.scwang.refreshlayout.adapter; import android.content.res.Resources; -import androidx.annotation.StringRes; -import androidx.core.content.ContextCompat; -import androidx.recyclerview.widget.RecyclerView; import android.util.TypedValue; import android.view.View; import android.widget.AdapterView; import android.widget.ImageView; import android.widget.TextView; +import androidx.annotation.StringRes; +import androidx.core.content.ContextCompat; +import androidx.recyclerview.widget.RecyclerView; + @SuppressWarnings("UnusedReturnValue") public class SmartViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java index f3e46a07..b690d4ca 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java @@ -2,19 +2,20 @@ import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.google.android.material.bottomsheet.BottomSheetDialog; +import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; +import com.google.android.material.bottomsheet.BottomSheetDialog; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; @@ -38,6 +39,7 @@ public class BottomSheetExampleFragment extends Fragment { private BaseRecyclerAdapter mAdapter; @Override + @NonNull public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_example_bottom_sheet, container, false); } @@ -49,7 +51,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat root = onCreateView(LayoutInflater.from(getContext()), null, null); final Toolbar toolbar = root.findViewById(R.id.toolbar); - toolbar.setNavigationOnClickListener(v -> getActivity().finish()); + toolbar.setNavigationOnClickListener(v -> requireActivity().finish()); RefreshLayout refreshLayout = root.findViewById(R.id.refreshLayout); refreshLayout.setRefreshHeader(new ClassicsHeader(getContext()).setSpinnerStyle(SpinnerStyle.FixedBehind).setPrimaryColorId(R.color.colorPrimary).setAccentColorId(android.R.color.white)); @@ -73,7 +75,7 @@ protected void onBindViewHolder(SmartViewHolder holder, Void model, int position }); BottomSheetDialog dialog = new BottomSheetDialog(getContext()); - dialog.setOnDismissListener(dialog1 -> getActivity().finish()); + dialog.setOnDismissListener(dialog1 -> requireActivity().finish()); dialog.setContentView(root); dialog.setCancelable(false); dialog.show(); diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/DisallowInterceptExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/DisallowInterceptExampleFragment.java index 3db0f159..96617a2d 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/DisallowInterceptExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/DisallowInterceptExampleFragment.java @@ -3,14 +3,19 @@ import android.annotation.SuppressLint; import android.content.Context; import android.os.Bundle; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.view.MotionEvent; +import android.view.View; +import android.view.ViewConfiguration; +import android.view.ViewGroup; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.widget.AppCompatTextView; +import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; -import androidx.appcompat.widget.Toolbar; -import android.util.AttributeSet; -import android.view.*; import com.scwang.refreshlayout.R; /** @@ -31,7 +36,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat super.onViewCreated(root, savedInstanceState); final Toolbar toolbar = root.findViewById(R.id.toolbar); - toolbar.setNavigationOnClickListener(v -> getActivity().finish()); + toolbar.setNavigationOnClickListener(v -> requireActivity().finish()); } public static class MoveView extends AppCompatTextView { diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java index 6b2ca4ac..c7edc126 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java @@ -4,18 +4,19 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.AdapterView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.activity.FragmentActivity; @@ -71,7 +72,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat super.onViewCreated(root, savedInstanceState); final Toolbar toolbar = root.findViewById(R.id.toolbar); - toolbar.setNavigationOnClickListener(v -> getActivity().finish()); + toolbar.setNavigationOnClickListener(v -> requireActivity().finish()); mRefreshLayout = root.findViewById(refreshLayout); mRefreshLayout.setRefreshHeader(new ClassicsHeader(getContext()).setSpinnerStyle(SpinnerStyle.FixedBehind).setPrimaryColorId(R.color.colorPrimary).setAccentColorId(android.R.color.white)); diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java index ebb7f7cb..6fef40d5 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java @@ -4,20 +4,21 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; +import android.widget.ImageView; +import android.widget.TextView; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.AdapterView; -import android.widget.ImageView; -import android.widget.TextView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.activity.FragmentActivity; @@ -58,7 +59,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat super.onViewCreated(root, savedInstanceState); final Toolbar toolbar = root.findViewById(R.id.toolbar); - toolbar.setNavigationOnClickListener(v -> getActivity().finish()); + toolbar.setNavigationOnClickListener(v -> requireActivity().finish()); mRefreshLayout = root.findViewById(R.id.refreshLayout); mRefreshLayout.setRefreshHeader(new ClassicsHeader(getContext()).setSpinnerStyle(SpinnerStyle.FixedBehind).setPrimaryColorId(R.color.colorPrimary).setAccentColorId(android.R.color.white)); diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java index 2116643f..f0718d0d 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java @@ -4,20 +4,21 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; +import android.widget.ImageView; +import android.widget.TextView; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.AdapterView; -import android.widget.ImageView; -import android.widget.TextView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.activity.FragmentActivity; @@ -56,7 +57,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat super.onViewCreated(root, savedInstanceState); final Toolbar toolbar = root.findViewById(R.id.toolbar); - toolbar.setNavigationOnClickListener(v -> getActivity().finish()); + toolbar.setNavigationOnClickListener(v -> requireActivity().finish()); mRefreshLayout = root.findViewById(refreshLayout); mRefreshLayout.setRefreshHeader(new ClassicsHeader(getContext()).setSpinnerStyle(SpinnerStyle.FixedBehind).setPrimaryColorId(R.color.colorPrimary).setAccentColorId(android.R.color.white)); diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/FlexBoxLayoutManagerFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/FlexBoxLayoutManagerFragment.java index e0025f33..ef501f43 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/FlexBoxLayoutManagerFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/FlexBoxLayoutManagerFragment.java @@ -2,16 +2,16 @@ import android.os.Bundle; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.fragment.app.Fragment; -import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.widget.Toolbar; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.RecyclerView; import com.google.android.flexbox.AlignItems; import com.google.android.flexbox.FlexDirection; @@ -41,7 +41,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat final Toolbar toolbar = root.findViewById(R.id.toolbar); - toolbar.setNavigationOnClickListener(v -> getActivity().finish()); + toolbar.setNavigationOnClickListener(v -> requireActivity().finish()); FlexboxLayoutManager manager = new FlexboxLayoutManager(root.getContext()); //设置主轴排列方式 diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/HorizontalExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/HorizontalExampleFragment.java index e0992341..7fd25e97 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/HorizontalExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/HorizontalExampleFragment.java @@ -1,16 +1,16 @@ package com.scwang.refreshlayout.fragment.example; -import android.os.Build; import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; @@ -20,7 +20,6 @@ import java.util.Arrays; import java.util.Collection; -import java.util.Objects; import static android.R.layout.simple_list_item_2; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java index 8be615a9..287d925c 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java @@ -4,20 +4,21 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.google.android.material.appbar.AppBarLayout; +import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.AdapterView; +import com.google.android.material.appbar.AppBarLayout; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.activity.FragmentActivity; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; @@ -68,7 +69,7 @@ public void onViewCreated(@NonNull final View root, @Nullable Bundle savedInstan super.onViewCreated(root, savedInstanceState); Toolbar toolbar = root.findViewById(R.id.toolbar); - toolbar.setNavigationOnClickListener(v -> getActivity().finish()); + toolbar.setNavigationOnClickListener(v -> requireActivity().finish()); final BaseRecyclerAdapter adapter; RecyclerView recyclerView = root.findViewById(R.id.recyclerView); diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java index 52b0712e..ca085d57 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java @@ -3,17 +3,6 @@ import android.content.Context; import android.os.Bundle; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentManager; -import androidx.viewpager2.adapter.FragmentStateAdapter; -import androidx.viewpager2.widget.ViewPager2; -import androidx.recyclerview.widget.DefaultItemAnimator; -import androidx.recyclerview.widget.DividerItemDecoration; -import androidx.recyclerview.widget.LinearLayoutManager; -import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -22,6 +11,17 @@ import android.widget.TextView; import android.widget.Toast; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.widget.Toolbar; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.DividerItemDecoration; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.viewpager2.adapter.FragmentStateAdapter; +import androidx.viewpager2.widget.ViewPager2; + import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; @@ -59,7 +59,7 @@ public void onViewCreated(@NonNull final View root, @Nullable Bundle savedInstan super.onViewCreated(root, savedInstanceState); Toolbar toolbar = root.findViewById(R.id.toolbar); - toolbar.setNavigationOnClickListener(v -> getActivity().finish()); + toolbar.setNavigationOnClickListener(v -> requireActivity().finish()); Banner banner = root.findViewById(R.id.banner); banner.setImageLoader(new BannerImageLoader()); diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java index 693d7156..36307602 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java @@ -2,23 +2,23 @@ import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Toast; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.google.android.material.appbar.AppBarLayout; +import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentManager; -import androidx.viewpager2.adapter.FragmentStateAdapter; -import androidx.viewpager2.widget.ViewPager2; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.Toast; +import androidx.viewpager2.adapter.FragmentStateAdapter; +import androidx.viewpager2.widget.ViewPager2; +import com.google.android.material.appbar.AppBarLayout; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; @@ -47,7 +47,7 @@ public void onViewCreated(@NonNull final View root, @Nullable Bundle savedInstan super.onViewCreated(root, savedInstanceState); Toolbar toolbar = root.findViewById(R.id.toolbar); - toolbar.setNavigationOnClickListener(v -> getActivity().finish()); + toolbar.setNavigationOnClickListener(v -> requireActivity().finish()); ViewPager2 viewPager = root.findViewById(R.id.viewPager); viewPager.setAdapter(new SmartPagerAdapter(this)); diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NoMoreDataExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NoMoreDataExampleFragment.java index 02efa464..c229bb3d 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NoMoreDataExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NoMoreDataExampleFragment.java @@ -2,15 +2,16 @@ import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; @@ -50,7 +51,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat super.onViewCreated(root, savedInstanceState); final Toolbar toolbar = root.findViewById(R.id.toolbar); - toolbar.setNavigationOnClickListener(v -> getActivity().finish()); + toolbar.setNavigationOnClickListener(v -> requireActivity().finish()); RecyclerView recyclerView = root.findViewById(R.id.recyclerView); if (recyclerView != null) { diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragment.java index 1de1c8e4..2d306bc7 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragment.java @@ -4,18 +4,19 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.AdapterView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.activity.FragmentActivity; @@ -56,7 +57,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat super.onViewCreated(root, savedInstanceState); final Toolbar toolbar = root.findViewById(R.id.toolbar); - toolbar.setNavigationOnClickListener(v -> getActivity().finish()); + toolbar.setNavigationOnClickListener(v -> requireActivity().finish()); View view = root.findViewById(R.id.recyclerView); if (view instanceof RecyclerView) { diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentFooter.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentFooter.java index 4131f3cd..255e393d 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentFooter.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentFooter.java @@ -4,18 +4,19 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.AdapterView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.activity.FragmentActivity; @@ -45,7 +46,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat super.onViewCreated(root, savedInstanceState); Toolbar toolbar = root.findViewById(R.id.toolbar); - toolbar.setNavigationOnClickListener(v -> getActivity().finish()); + toolbar.setNavigationOnClickListener(v -> requireActivity().finish()); toolbar.setTitle("Footer单独使用"); RefreshLayout refreshLayout = root.findViewById(R.id.refreshLayout); diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java index efa05603..40822157 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java @@ -4,18 +4,19 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.AdapterView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.activity.FragmentActivity; @@ -46,7 +47,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat super.onViewCreated(root, savedInstanceState); final Toolbar toolbar = root.findViewById(R.id.toolbar); - toolbar.setNavigationOnClickListener(v -> getActivity().finish()); + toolbar.setNavigationOnClickListener(v -> requireActivity().finish()); RefreshLayout refreshLayout = root.findViewById(R.id.refreshLayout); refreshLayout.setRefreshHeader(new FalsifyHeader(getContext()));//也可以在 XML 中添加 FalsifyHeader diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/SpecifyStyleExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/SpecifyStyleExampleFragment.java index e5a5a79d..ab83afcf 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/SpecifyStyleExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/SpecifyStyleExampleFragment.java @@ -4,18 +4,19 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.AdapterView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.activity.FragmentActivity; @@ -59,7 +60,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat super.onViewCreated(root, savedInstanceState); final Toolbar toolbar = root.findViewById(R.id.toolbar); - toolbar.setNavigationOnClickListener(v -> getActivity().finish()); + toolbar.setNavigationOnClickListener(v -> requireActivity().finish()); toolbar.setTitle("指定样式"); View view = root.findViewById(R.id.recyclerView); diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/StaggeredGridExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/StaggeredGridExampleFragment.java index 46a6bd54..8b7f0dfb 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/StaggeredGridExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/StaggeredGridExampleFragment.java @@ -1,14 +1,15 @@ package com.scwang.refreshlayout.fragment.example; import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.RecyclerView; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java index e7318471..083087d9 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java @@ -2,24 +2,23 @@ import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Toast; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.StringRes; - +import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; -import androidx.viewpager2.adapter.FragmentStateAdapter; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; +import androidx.viewpager2.adapter.FragmentStateAdapter; import androidx.viewpager2.widget.ViewPager2; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.Toast; - import com.google.android.material.tabs.TabLayout; import com.google.android.material.tabs.TabLayoutMediator; import com.scwang.refreshlayout.R; @@ -68,7 +67,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat super.onViewCreated(root, savedInstanceState); final Toolbar toolbar = root.findViewById(R.id.toolbar); - toolbar.setNavigationOnClickListener(v -> getActivity().finish()); + toolbar.setNavigationOnClickListener(v -> requireActivity().finish()); RefreshLayout refreshLayout = root.findViewById(R.id.refreshLayout); refreshLayout.setOnRefreshLoadMoreListener(this); diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java index 08508590..f0bba6cd 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java @@ -4,6 +4,11 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.StringRes; @@ -12,10 +17,6 @@ import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.AdapterView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.activity.FragmentActivity; @@ -27,7 +28,17 @@ import com.scwang.refreshlayout.activity.example.SnapHelperExampleActivity; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.refreshlayout.fragment.example.*; +import com.scwang.refreshlayout.fragment.example.BottomSheetExampleFragment; +import com.scwang.refreshlayout.fragment.example.DisallowInterceptExampleFragment; +import com.scwang.refreshlayout.fragment.example.EmptyLayoutExampleFragment; +import com.scwang.refreshlayout.fragment.example.FlexBoxLayoutManagerFragment; +import com.scwang.refreshlayout.fragment.example.HorizontalExampleFragment; +import com.scwang.refreshlayout.fragment.example.NestedScrollExampleFragment; +import com.scwang.refreshlayout.fragment.example.NoMoreDataExampleFragment; +import com.scwang.refreshlayout.fragment.example.PureScrollExampleFragment; +import com.scwang.refreshlayout.fragment.example.SpecifyStyleExampleFragment; +import com.scwang.refreshlayout.fragment.example.StaggeredGridExampleFragment; +import com.scwang.refreshlayout.fragment.example.ViewPagerExampleFragment; import com.scwang.refreshlayout.util.StatusBarUtil; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java index 149d748e..3d29b6f2 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java @@ -4,6 +4,11 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.StringRes; @@ -12,10 +17,6 @@ import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.AdapterView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.activity.FragmentActivity; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshStylesFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshStylesFragment.java index 8d9501ea..079e93f1 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshStylesFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshStylesFragment.java @@ -2,6 +2,11 @@ import android.content.Intent; import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.StringRes; @@ -10,10 +15,6 @@ import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.AdapterView; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.activity.style.BezierCircleStyleActivity; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java index b06db519..8c7de313 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java @@ -2,14 +2,15 @@ import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java index 0bb61ad9..05bf0809 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java @@ -1,16 +1,17 @@ package com.scwang.refreshlayout.fragment.practice; import android.os.Bundle; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.fragment.app.Fragment; -import androidx.recyclerview.widget.RecyclerView; -import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Toast; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.widget.Toolbar; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.RecyclerView; + import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java index 5e43de1c..ffea8e46 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java @@ -1,15 +1,16 @@ package com.scwang.refreshlayout.fragment.practice; import android.os.Bundle; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.fragment.app.Fragment; -import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Toast; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.widget.Toolbar; +import androidx.fragment.app.Fragment; + import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.util.StatusBarUtil; import com.scwang.smartrefresh.layout.api.OnTwoLevelListener; diff --git a/app/src/main/java/com/scwang/refreshlayout/util/StatusBarUtil.java b/app/src/main/java/com/scwang/refreshlayout/util/StatusBarUtil.java index 8e666b6a..44868582 100644 --- a/app/src/main/java/com/scwang/refreshlayout/util/StatusBarUtil.java +++ b/app/src/main/java/com/scwang/refreshlayout/util/StatusBarUtil.java @@ -4,7 +4,6 @@ import android.content.Context; import android.content.res.Resources; import android.os.Build; - import android.util.Log; import android.util.TypedValue; import android.view.View; diff --git a/app/src/main/java/com/scwang/refreshlayout/widget/RefreshContentHorizontal.java b/app/src/main/java/com/scwang/refreshlayout/widget/RefreshContentHorizontal.java index af59bdfa..4298e6da 100644 --- a/app/src/main/java/com/scwang/refreshlayout/widget/RefreshContentHorizontal.java +++ b/app/src/main/java/com/scwang/refreshlayout/widget/RefreshContentHorizontal.java @@ -1,10 +1,11 @@ package com.scwang.refreshlayout.widget; import android.animation.ValueAnimator; -import androidx.annotation.NonNull; import android.view.View; import android.widget.AbsListView; +import androidx.annotation.NonNull; + import com.scwang.smart.refresh.layout.wrapper.RefreshContentWrapper; import static com.scwang.smartrefresh.layout.util.SmartUtil.scrollListBy; diff --git a/app/src/main/java/com/scwang/refreshlayout/widget/ScrollBoundaryHorizontal.java b/app/src/main/java/com/scwang/refreshlayout/widget/ScrollBoundaryHorizontal.java index c3a0fa87..8b9c8247 100644 --- a/app/src/main/java/com/scwang/refreshlayout/widget/ScrollBoundaryHorizontal.java +++ b/app/src/main/java/com/scwang/refreshlayout/widget/ScrollBoundaryHorizontal.java @@ -1,10 +1,10 @@ package com.scwang.refreshlayout.widget; import android.graphics.PointF; -import androidx.annotation.NonNull; import android.view.View; import android.view.ViewGroup; -import android.widget.AbsListView; + +import androidx.annotation.NonNull; import com.scwang.smartrefresh.layout.util.SmartUtil; diff --git a/app/src/main/java/com/scwang/refreshlayout/widget/SmartRefreshHorizontal.java b/app/src/main/java/com/scwang/refreshlayout/widget/SmartRefreshHorizontal.java index 440c3f4b..317b966c 100644 --- a/app/src/main/java/com/scwang/refreshlayout/widget/SmartRefreshHorizontal.java +++ b/app/src/main/java/com/scwang/refreshlayout/widget/SmartRefreshHorizontal.java @@ -1,26 +1,12 @@ package com.scwang.refreshlayout.widget; import android.content.Context; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; -import android.view.animation.Interpolator; -import android.widget.FrameLayout; import com.scwang.refreshlayout.R; import com.scwang.smart.refresh.layout.api.RefreshComponent; -import com.scwang.smart.refresh.layout.api.RefreshFooter; -import com.scwang.smart.refresh.layout.api.RefreshHeader; -import com.scwang.smart.refresh.layout.api.RefreshLayout; -import com.scwang.smart.refresh.layout.constant.RefreshState; -import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener; -import com.scwang.smart.refresh.layout.listener.OnMultiListener; -import com.scwang.smart.refresh.layout.listener.OnRefreshListener; -import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; -import com.scwang.smart.refresh.layout.listener.ScrollBoundaryDecider; -import com.scwang.smart.refresh.layout.util.SmartUtil; import com.scwang.smartrefresh.layout.SmartRefreshLayout; import com.scwang.smartrefresh.layout.impl.ScrollBoundaryDeciderAdapter; diff --git a/app/src/main/res/layout/activity_experiment.xml b/app/src/main/res/layout/activity_experiment.xml index e0c2d751..ab8e3fe5 100644 --- a/app/src/main/res/layout/activity_experiment.xml +++ b/app/src/main/res/layout/activity_experiment.xml @@ -1,7 +1,5 @@ diff --git a/app/src/main/res/layout/item_movie_item.xml b/app/src/main/res/layout/item_movie_item.xml index fd0a90ca..785065ae 100644 --- a/app/src/main/res/layout/item_movie_item.xml +++ b/app/src/main/res/layout/item_movie_item.xml @@ -1,6 +1,5 @@ Date: Wed, 1 Nov 2023 22:17:57 +0800 Subject: [PATCH 44/67] =?UTF-8?q?=E4=BC=98=E5=8C=96App=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=86=85=E7=9A=84=E4=BB=A3=E7=A0=81=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ExampleInstrumentedTest.java | 2 +- .../activity/FragmentActivity.java | 4 +- .../practice/QQBrowserPracticeActivity.java | 1 - .../practice/WeiboPracticeActivity.java | 6 +- .../style/BezierCircleStyleActivity.java | 4 +- .../style/BezierRadarStyleActivity.java | 4 +- .../activity/style/ClassicsStyleActivity.java | 24 ++--- .../activity/style/DropBoxStyleActivity.java | 4 +- .../style/FunGameBattleCityStyleActivity.java | 4 +- .../style/FunGameHitBlockStyleActivity.java | 4 +- .../activity/style/MaterialStyleActivity.java | 4 +- .../activity/style/PhoenixStyleActivity.java | 4 +- .../style/StoreHouseStyleActivity.java | 4 +- .../activity/style/TaurusStyleActivity.java | 4 +- .../style/WaterDropStyleActivity.java | 4 +- .../example/BottomSheetExampleFragment.java | 2 +- .../example/EmptyLayoutExampleFragment.java | 2 +- .../EmptyLayoutExampleFragmentInner.java | 2 +- .../EmptyLayoutExampleFragmentOuter.java | 2 +- .../example/NestedScrollExampleFragment.java | 2 +- .../NestedScrollExampleFragmentIntegral.java | 2 +- .../NestedScrollExampleFragmentViewPager.java | 2 +- .../example/NoMoreDataExampleFragment.java | 2 +- .../example/PureScrollExampleFragment.java | 2 +- .../PureScrollExampleFragmentFooter.java | 2 +- .../PureScrollExampleFragmentHeader.java | 2 +- .../example/SpecifyStyleExampleFragment.java | 2 +- .../example/ViewPagerExampleFragment.java | 4 +- .../index/RefreshExampleFragment.java | 2 +- .../index/RefreshPracticeFragment.java | 2 +- .../fragment/index/RefreshStylesFragment.java | 2 +- .../practice/InstantPracticeFragment.java | 2 +- .../practice/SecondFloorPracticeFragment.java | 2 +- .../practice/TwoLevelPracticeFragment.java | 2 +- .../refreshlayout/util/StatusBarUtil.java | 93 +++++++++---------- .../main/res/layout/activity_experiment.xml | 6 +- app/src/main/res/layout/item_movie_item.xml | 1 - app/src/main/res/values/strings.xml | 2 + .../scwang/refreshlayout/ExampleUnitTest.java | 2 +- 39 files changed, 90 insertions(+), 131 deletions(-) diff --git a/app/src/androidTest/java/com/scwang/refreshlayout/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/scwang/refreshlayout/ExampleInstrumentedTest.java index da078597..2d01d925 100644 --- a/app/src/androidTest/java/com/scwang/refreshlayout/ExampleInstrumentedTest.java +++ b/app/src/androidTest/java/com/scwang/refreshlayout/ExampleInstrumentedTest.java @@ -18,7 +18,7 @@ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test - public void useAppContext() throws Exception { + public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/FragmentActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/FragmentActivity.java index 3f37f75f..0f0cc357 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/FragmentActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/FragmentActivity.java @@ -80,9 +80,9 @@ protected void replaceFragment() { } // - private static Map typeCache = new HashMap<>(); + private static final Map> typeCache = new HashMap<>(); private Class getFragmentClass() throws ClassNotFoundException { - Class type = typeCache.get(mFragmentClazz); + Class type = typeCache.get(mFragmentClazz); if (type == null) { typeCache.put(mFragmentClazz, type = Class.forName(mFragmentClazz)); } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/QQBrowserPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/QQBrowserPracticeActivity.java index c4f1bdb1..5aada02d 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/QQBrowserPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/QQBrowserPracticeActivity.java @@ -34,7 +34,6 @@ protected void onCreate(Bundle savedInstanceState) { webView.getSettings().setJavaScriptEnabled(true); webView.setWebViewClient(new WebViewClient(){ @Override - @SuppressWarnings("deprecation") public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java index 099be907..2f6f6cd1 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java @@ -77,10 +77,10 @@ public void onHeaderMoving(RefreshHeader header, boolean isDragging, float perce }); scrollView.setOnScrollChangeListener(new NestedScrollView.OnScrollChangeListener() { private int lastScrollY = 0; - private int h = SmartUtil.dp2px(170); - private int color = ContextCompat.getColor(getApplicationContext(), R.color.colorPrimary)&0x00ffffff; + private final int h = SmartUtil.dp2px(170); + private final int color = ContextCompat.getColor(getApplicationContext(), R.color.colorPrimary)&0x00ffffff; @Override - public void onScrollChange(NestedScrollView v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) { + public void onScrollChange(@NonNull NestedScrollView v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) { if (lastScrollY < h) { scrollY = Math.min(h, scrollY); mScrollY = Math.min(scrollY, h); diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java index d2e523ce..f698e37e 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java @@ -109,9 +109,7 @@ public void onItemClick(AdapterView parent, View view, int position, long id) private void setThemeColor(int colorPrimary, int colorPrimaryDark) { mToolbar.setBackgroundResource(colorPrimary); mRefreshLayout.setPrimaryColorsId(colorPrimary, android.R.color.white); - if (Build.VERSION.SDK_INT >= 21) { - getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); - } + getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java index 8216d346..a27fbfd4 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java @@ -119,9 +119,7 @@ public void onItemClick(AdapterView parent, View view, int position, long id) private void setThemeColor(int colorPrimary, int colorPrimaryDark) { mToolbar.setBackgroundResource(colorPrimary); mRefreshLayout.setPrimaryColorsId(colorPrimary, android.R.color.white); - if (Build.VERSION.SDK_INT >= 21) { - getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); - } + getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java index bbe27a45..76ad23a8 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java @@ -39,8 +39,6 @@ public class ClassicsStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { - private BaseRecyclerAdapter mAdpater; - private enum Item { 尺寸拉伸(R.string.item_style_spinner_scale), 位置平移(R.string.item_style_spinner_translation), @@ -79,6 +77,7 @@ protected void onCreate(Bundle savedInstanceState) { int delta = new Random().nextInt(7 * 24 * 60 * 60 * 1000); mClassicsHeader = (ClassicsHeader)mRefreshLayout.getRefreshHeader(); + assert mClassicsHeader != null; mClassicsHeader.setLastUpdateTime(new Date(System.currentTimeMillis()-delta)); mClassicsHeader.setTimeFormat(new SimpleDateFormat("更新于 MM-dd HH:mm", Locale.CHINA)); mClassicsHeader.setTimeFormat(new DynamicTimeFormat("更新于 %s")); @@ -98,6 +97,7 @@ protected void onCreate(Bundle savedInstanceState) { List items = new ArrayList<>(); items.addAll(Arrays.asList(Item.values())); items.addAll(Arrays.asList(Item.values())); + BaseRecyclerAdapter mAdpater; recyclerView.setAdapter(mAdpater = new BaseRecyclerAdapter(items, simple_list_item_2,this) { @Override protected void onBindViewHolder(SmartViewHolder holder, Item model, int position) { @@ -142,11 +142,7 @@ public void onItemClick(AdapterView parent, View view, int position, long id) case 背后固定: mClassicsHeader.setSpinnerStyle(SpinnerStyle.FixedBehind); mRefreshLayout.setPrimaryColors(0xff444444, 0xffffffff); - if (Build.VERSION.SDK_INT >= 21) { - mDrawableProgress.setTint(0xffffffff); - } else if (mDrawableProgress instanceof VectorDrawableCompat) { - ((VectorDrawableCompat) mDrawableProgress).setTint(0xffffffff); - } + mDrawableProgress.setTint(0xffffffff); /* * 由于是后面才设置,需要手动更改视图的位置 * 如果在 onCreate 或者 xml 中设置好[SpinnerStyle] 就不用手动调整位置了 @@ -169,11 +165,7 @@ public void onItemClick(AdapterView parent, View view, int position, long id) setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark); mRefreshLayout.getLayout().setBackgroundResource(android.R.color.transparent); mRefreshLayout.setPrimaryColors(0, 0xff666666); - if (Build.VERSION.SDK_INT >= 21) { - mDrawableProgress.setTint(0xff666666); - } else if (mDrawableProgress instanceof VectorDrawableCompat) { - ((VectorDrawableCompat) mDrawableProgress).setTint(0xff666666); - } + mDrawableProgress.setTint(0xff666666); break; case 蓝色主题: setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark); @@ -197,12 +189,8 @@ public void onItemClick(AdapterView parent, View view, int position, long id) private void setThemeColor(int colorPrimary, int colorPrimaryDark) { mToolbar.setBackgroundResource(colorPrimary); mRefreshLayout.setPrimaryColorsId(colorPrimary, android.R.color.white); - if (Build.VERSION.SDK_INT >= 21) { - getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); - mDrawableProgress.setTint(0xffffffff); - } else if (mDrawableProgress instanceof VectorDrawableCompat) { - ((VectorDrawableCompat) mDrawableProgress).setTint(0xffffffff); - } + getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); + mDrawableProgress.setTint(0xffffffff); } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java index d40dc80d..18b18e8f 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java @@ -114,9 +114,7 @@ public void onItemClick(AdapterView parent, View view, int position, long id) private void setThemeColor(int colorPrimary, int colorPrimaryDark) { mToolbar.setBackgroundResource(colorPrimary); mRefreshLayout.setPrimaryColorsId(colorPrimary, android.R.color.white); - if (Build.VERSION.SDK_INT >= 21) { - getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); - } + getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java index e48ab2e8..046669ff 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java @@ -105,9 +105,7 @@ public void onItemClick(AdapterView parent, View view, int position, long id) private void setThemeColor(int colorPrimary, int colorPrimaryDark) { mToolbar.setBackgroundResource(colorPrimary); mRefreshLayout.setPrimaryColorsId(colorPrimary, android.R.color.white); - if (Build.VERSION.SDK_INT >= 21) { - getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); - } + getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java index d890153e..44e8e3cb 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java @@ -106,9 +106,7 @@ public void onItemClick(AdapterView parent, View view, int position, long id) private void setThemeColor(int colorPrimary, int colorPrimaryDark) { mToolbar.setBackgroundResource(colorPrimary); mRefreshLayout.setPrimaryColorsId(colorPrimary, android.R.color.white); - if (Build.VERSION.SDK_INT >= 21) { - getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); - } + getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java index 9a16f069..7b7ee820 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java @@ -122,9 +122,7 @@ private void setThemeColor(int colorPrimary, int colorPrimaryDark) { mRefreshLayout.setPrimaryColorsId(colorPrimary, android.R.color.white); mMaterialHeader.setProgressBackgroundColorSchemeResource(colorPrimary); mMaterialHeader.setColorSchemeResources(android.R.color.white); - if (Build.VERSION.SDK_INT >= 21) { - getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); - } + getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); } } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java index ff659fa9..c04565c2 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java @@ -150,9 +150,7 @@ private void setThemeColor(int colorPrimary, int colorPrimaryDark) { mRefreshLayout.setPrimaryColorsId(colorPrimary, android.R.color.white); mActionButton.setBackgroundColor(ContextCompat.getColor(this, colorPrimaryDark)); mActionButton.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(this, colorPrimaryDark))); - if (Build.VERSION.SDK_INT >= 21) { - getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); - } + getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); } } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java index d9fa334d..0fa782d4 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java @@ -135,9 +135,7 @@ public void onItemClick(AdapterView parent, View view, int position, long id) private void setThemeColor(int colorPrimary, int colorPrimaryDark) { mToolbar.setBackgroundResource(colorPrimary); mRefreshLayout.setPrimaryColorsId(colorPrimary, android.R.color.white); - if (Build.VERSION.SDK_INT >= 21) { - getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); - } + getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); } private List getPointList() { diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java index cf10416e..120b2085 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java @@ -150,9 +150,7 @@ private void setThemeColor(int colorPrimary, int colorPrimaryDark) { mRefreshLayout.setPrimaryColorsId(colorPrimary, android.R.color.white); mActionButton.setBackgroundColor(ContextCompat.getColor(this, colorPrimaryDark)); mActionButton.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(this, colorPrimaryDark))); - if (Build.VERSION.SDK_INT >= 21) { - getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); - } + getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); } } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java index 6081f09a..ba524fe8 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java @@ -113,9 +113,7 @@ public void onItemClick(AdapterView parent, View view, int position, long id) private void setThemeColor(int colorPrimary, int colorPrimaryDark) { mToolbar.setBackgroundResource(colorPrimary); mRefreshLayout.setPrimaryColorsId(colorPrimary, android.R.color.white); - if (Build.VERSION.SDK_INT >= 21) { - getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); - } + getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); } } diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java index b690d4ca..4610f6ff 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java @@ -63,7 +63,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat RecyclerView recyclerView = root.findViewById(R.id.recyclerView); recyclerView.setItemAnimator(new DefaultItemAnimator()); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); - recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), VERTICAL)); + recyclerView.addItemDecoration(new DividerItemDecoration(root.getContext(), VERTICAL)); recyclerView.setAdapter(mAdapter = new BaseRecyclerAdapter(initData(),simple_list_item_2) { @Override diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java index c7edc126..2eafe841 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java @@ -81,7 +81,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat mRecyclerView = root.findViewById(recyclerView); mRecyclerView.setItemAnimator(new DefaultItemAnimator()); mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext())); - mRecyclerView.addItemDecoration(new DividerItemDecoration(getContext(), VERTICAL)); + mRecyclerView.addItemDecoration(new DividerItemDecoration(root.getContext(), VERTICAL)); mLoadingLayout = root.findViewById(R.id.loading); mLoadingLayout.showEmpty(); diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java index 6fef40d5..d292351f 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java @@ -68,7 +68,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat RecyclerView recyclerView = root.findViewById(R.id.recyclerView); recyclerView.setItemAnimator(new DefaultItemAnimator()); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); - recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), VERTICAL)); + recyclerView.addItemDecoration(new DividerItemDecoration(root.getContext(), VERTICAL)); recyclerView.setAdapter(mAdapter = new BaseRecyclerAdapter(new ArrayList<>(), simple_list_item_2,EmptyLayoutExampleFragmentInner.this) { @Override protected void onBindViewHolder(SmartViewHolder holder, Item model, int position) { diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java index f0718d0d..a25443a1 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java @@ -66,7 +66,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat mRecyclerView = root.findViewById(recyclerView); mRecyclerView.setItemAnimator(new DefaultItemAnimator()); mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext())); - mRecyclerView.addItemDecoration(new DividerItemDecoration(getContext(), VERTICAL)); + mRecyclerView.addItemDecoration(new DividerItemDecoration(root.getContext(), VERTICAL)); mEmptyLayout = root.findViewById(R.id.empty); diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java index 287d925c..fc81295d 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java @@ -75,7 +75,7 @@ public void onViewCreated(@NonNull final View root, @Nullable Bundle savedInstan RecyclerView recyclerView = root.findViewById(R.id.recyclerView); recyclerView.setItemAnimator(new DefaultItemAnimator()); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); - recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), VERTICAL)); + recyclerView.addItemDecoration(new DividerItemDecoration(root.getContext(), VERTICAL)); recyclerView.setAdapter(adapter = new BaseRecyclerAdapter(Arrays.asList(Item.values()), simple_list_item_2, NestedScrollExampleFragment.this) { @Override protected void onBindViewHolder(SmartViewHolder holder, Item model, int position) { diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java index ca085d57..5a603829 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java @@ -137,7 +137,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat super.onViewCreated(view, savedInstanceState); mRecyclerView.setItemAnimator(new DefaultItemAnimator()); mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext())); - mRecyclerView.addItemDecoration(new DividerItemDecoration(getContext(),DividerItemDecoration.VERTICAL)); + mRecyclerView.addItemDecoration(new DividerItemDecoration(view.getContext(),DividerItemDecoration.VERTICAL)); mRecyclerView.setAdapter(mAdapter = new BaseRecyclerAdapter(buildItems(), simple_list_item_2) { @Override protected void onBindViewHolder(SmartViewHolder holder, Item model, int position) { diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java index 36307602..001e72e4 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java @@ -119,7 +119,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat super.onViewCreated(view, savedInstanceState); mRecyclerView.setItemAnimator(new DefaultItemAnimator()); mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext())); - mRecyclerView.addItemDecoration(new DividerItemDecoration(getContext(),DividerItemDecoration.VERTICAL)); + mRecyclerView.addItemDecoration(new DividerItemDecoration(view.getContext(),DividerItemDecoration.VERTICAL)); mRecyclerView.setAdapter(mAdapter = new BaseRecyclerAdapter(initData(), simple_list_item_2) { @Override protected void onBindViewHolder(SmartViewHolder holder, Void model, int position) { diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NoMoreDataExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NoMoreDataExampleFragment.java index c229bb3d..ff60a55c 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NoMoreDataExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NoMoreDataExampleFragment.java @@ -56,7 +56,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat RecyclerView recyclerView = root.findViewById(R.id.recyclerView); if (recyclerView != null) { recyclerView.setNestedScrollingEnabled(false); - recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), VERTICAL)); + recyclerView.addItemDecoration(new DividerItemDecoration(root.getContext(), VERTICAL)); recyclerView.setAdapter(mAdapter = new BaseRecyclerAdapter(simple_list_item_2) { @Override protected void onBindViewHolder(SmartViewHolder holder, Void model, int position) { diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragment.java index 2d306bc7..4a7c752a 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragment.java @@ -64,7 +64,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat RecyclerView recyclerView = (RecyclerView) view; recyclerView.setItemAnimator(new DefaultItemAnimator()); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); - recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), VERTICAL)); + recyclerView.addItemDecoration(new DividerItemDecoration(view.getContext(), VERTICAL)); recyclerView.setAdapter(new BaseRecyclerAdapter(Arrays.asList(Item.values()), simple_list_item_2,this) { @Override protected void onBindViewHolder(SmartViewHolder holder, Item model, int position) { diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentFooter.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentFooter.java index 255e393d..f5c386a1 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentFooter.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentFooter.java @@ -60,7 +60,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat RecyclerView recyclerView = (RecyclerView) view; recyclerView.setItemAnimator(new DefaultItemAnimator()); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); - recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), VERTICAL)); + recyclerView.addItemDecoration(new DividerItemDecoration(view.getContext(), VERTICAL)); recyclerView.setAdapter(new BaseRecyclerAdapter(Arrays.asList(Item.values()), simple_list_item_2,this) { @Override protected void onBindViewHolder(SmartViewHolder holder, Item model, int position) { diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java index 40822157..3b2c7d5a 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java @@ -57,7 +57,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat RecyclerView recyclerView = (RecyclerView) view; recyclerView.setItemAnimator(new DefaultItemAnimator()); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); - recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), VERTICAL)); + recyclerView.addItemDecoration(new DividerItemDecoration(root.getContext(), VERTICAL)); recyclerView.setAdapter(new BaseRecyclerAdapter(Arrays.asList(Item.values()), simple_list_item_2,this) { @Override protected void onBindViewHolder(SmartViewHolder holder, Item model, int position) { diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/SpecifyStyleExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/SpecifyStyleExampleFragment.java index ab83afcf..49457cb3 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/SpecifyStyleExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/SpecifyStyleExampleFragment.java @@ -68,7 +68,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat RecyclerView recyclerView = (RecyclerView) view; recyclerView.setItemAnimator(new DefaultItemAnimator()); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); - recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), VERTICAL)); + recyclerView.addItemDecoration(new DividerItemDecoration(root.getContext(), VERTICAL)); recyclerView.setAdapter(new BaseRecyclerAdapter(Arrays.asList(Item.values()), simple_list_item_2,this) { @Override protected void onBindViewHolder(SmartViewHolder holder, Item model, int position) { diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java index 083087d9..829c31be 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java @@ -139,9 +139,9 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat super.onViewCreated(view, savedInstanceState); RecyclerView recyclerView = (RecyclerView) view; - recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); + recyclerView.setLayoutManager(new LinearLayoutManager(view.getContext())); recyclerView.setItemAnimator(new DefaultItemAnimator()); - recyclerView.addItemDecoration(new DividerItemDecoration(getContext(),DividerItemDecoration.VERTICAL)); + recyclerView.addItemDecoration(new DividerItemDecoration(view.getContext(),DividerItemDecoration.VERTICAL)); recyclerView.setAdapter(mAdapter = new BaseRecyclerAdapter(initData(), simple_list_item_2) { @Override protected void onBindViewHolder(SmartViewHolder holder, Void model, int position) { diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java index f0bba6cd..4175298e 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java @@ -95,7 +95,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat RecyclerView recyclerView = (RecyclerView) view; recyclerView.setItemAnimator(new DefaultItemAnimator()); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); - recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), VERTICAL)); + recyclerView.addItemDecoration(new DividerItemDecoration(view.getContext(), VERTICAL)); recyclerView.setAdapter(new BaseRecyclerAdapter(Arrays.asList(Item.values()), simple_list_item_2,this) { @Override protected void onBindViewHolder(SmartViewHolder holder, Item model, int position) { diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java index 3d29b6f2..3ca53d41 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java @@ -82,7 +82,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat RecyclerView recyclerView = (RecyclerView) view; recyclerView.setItemAnimator(new DefaultItemAnimator()); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); - recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), VERTICAL)); + recyclerView.addItemDecoration(new DividerItemDecoration(view.getContext(), VERTICAL)); recyclerView.setAdapter(new BaseRecyclerAdapter(Arrays.asList(Item.values()), simple_list_item_2,this) { @Override protected void onBindViewHolder(SmartViewHolder holder, Item model, int position) { diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshStylesFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshStylesFragment.java index 079e93f1..4de1e6fb 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshStylesFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshStylesFragment.java @@ -104,7 +104,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat RecyclerView recyclerView = (RecyclerView) view; recyclerView.setItemAnimator(new DefaultItemAnimator()); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); - recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), VERTICAL)); + recyclerView.addItemDecoration(new DividerItemDecoration(view.getContext(), VERTICAL)); recyclerView.setAdapter(new BaseRecyclerAdapter(Arrays.asList(Item.values()), simple_list_item_2,this) { @NonNull @Override diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java index 8c7de313..703566f8 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java @@ -44,7 +44,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - getActivity().finish(); + requireActivity().finish(); } }); diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java index 05bf0809..ba386b6a 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java @@ -50,7 +50,7 @@ public void onViewCreated(@NonNull final View root, @Nullable Bundle savedInstan toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - getActivity().finish(); + requireActivity().finish(); } }); diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java index ffea8e46..4f94228d 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java @@ -38,7 +38,7 @@ public void onViewCreated(@NonNull final View root, @Nullable Bundle savedInstan toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - getActivity().finish(); + requireActivity().finish(); } }); diff --git a/app/src/main/java/com/scwang/refreshlayout/util/StatusBarUtil.java b/app/src/main/java/com/scwang/refreshlayout/util/StatusBarUtil.java index 44868582..53d1bfb3 100644 --- a/app/src/main/java/com/scwang/refreshlayout/util/StatusBarUtil.java +++ b/app/src/main/java/com/scwang/refreshlayout/util/StatusBarUtil.java @@ -71,8 +71,8 @@ public static void color(Activity activity, int color) { // public static void darkMode(Activity activity, boolean dark) { - if (isFlyme4Later()) { - darkModeForFlyme4(activity.getWindow(), dark); + if (isFlyMe4Later()) { + darkModeForFlyMe4(activity.getWindow(), dark); } else if (isMIUI6Later()) { darkModeForMIUI6(activity.getWindow(), dark); } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { @@ -82,8 +82,8 @@ public static void darkMode(Activity activity, boolean dark) { public static void darkModeCancel(Activity activity) { Window window = activity.getWindow(); - if (isFlyme4Later()) { - darkModeForFlyme4(window, false); + if (isFlyMe4Later()) { + darkModeForFlyMe4(window, false); } else if (isMIUI6Later()) { darkModeForMIUI6(window, false); } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { @@ -102,8 +102,8 @@ public static void darkMode(Activity activity, int color, @FloatRange(from = 0.0 public static void darkOnly(Activity activity) { Window window = activity.getWindow(); - if (isFlyme4Later()) { - darkModeForFlyme4(window, true); + if (isFlyMe4Later()) { + darkModeForFlyMe4(window, true); } else if (isMIUI6Later()) { darkModeForMIUI6(window, true); } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { @@ -113,8 +113,8 @@ public static void darkOnly(Activity activity) { /** 设置状态栏darkMode,字体颜色及icon变黑(目前支持MIUI6以上,Flyme4以上,Android M以上) */ public static void darkMode(Window window, int color, @FloatRange(from = 0.0, to = 1.0) float alpha) { - if (isFlyme4Later()) { - darkModeForFlyme4(window, true); + if (isFlyMe4Later()) { + darkModeForFlyMe4(window, true); immersive(window,color,alpha); } else if (isMIUI6Later()) { darkModeForMIUI6(window, true); @@ -159,24 +159,24 @@ private static void darkModeForM(Window window, boolean dark) { * 设置Flyme4+的darkMode,darkMode时候字体颜色及icon变黑 * ... */ - public static boolean darkModeForFlyme4(Window window, boolean dark) { + public static boolean darkModeForFlyMe4(Window window, boolean dark) { boolean result = false; if (window != null) { try { WindowManager.LayoutParams e = window.getAttributes(); Field darkFlag = WindowManager.LayoutParams.class.getDeclaredField("MEIZU_FLAG_DARK_STATUS_BAR_ICON"); - Field meizuFlags = WindowManager.LayoutParams.class.getDeclaredField("meizuFlags"); + Field flyMeFlags = WindowManager.LayoutParams.class.getDeclaredField("meizuFlags"); darkFlag.setAccessible(true); - meizuFlags.setAccessible(true); + flyMeFlags.setAccessible(true); int bit = darkFlag.getInt(null); - int value = meizuFlags.getInt(e); + int value = flyMeFlags.getInt(e); if (dark) { value |= bit; } else { value &= ~bit; } - meizuFlags.setInt(e, value); + flyMeFlags.setInt(e, value); window.setAttributes(e); result = true; } catch (Exception var8) { @@ -189,7 +189,7 @@ public static boolean darkModeForFlyme4(Window window, boolean dark) { /** * 设置MIUI6+的状态栏是否为darkMode,darkMode时候字体颜色及icon变黑 - * http://dev.xiaomi.com/doc/p=4769/ + * ... */ public static boolean darkModeForMIUI6(Window window, boolean dark) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { @@ -211,7 +211,7 @@ public static boolean darkModeForMIUI6(Window window, boolean dark) { } /** 判断是否Flyme4以上 */ - public static boolean isFlyme4Later() { + public static boolean isFlyMe4Later() { return Build.FINGERPRINT.contains("Flyme_OS_4") || Build.VERSION.INCREMENTAL.contains("Flyme_OS_4") || Pattern.compile("Flyme OS [4|5]", Pattern.CASE_INSENSITIVE).matcher(Build.DISPLAY).find(); @@ -223,6 +223,7 @@ public static boolean isMIUI6Later() { Class clz = Class.forName("android.os.SystemProperties"); Method mtd = clz.getMethod("get", String.class); String val = (String) mtd.invoke(null, "ro.miui.ui.version.name"); + assert val != null; val = val.replaceAll("[vV]", ""); int version = Integer.parseInt(val); return version >= 6; @@ -235,59 +236,49 @@ public static boolean isMIUI6Later() { /** 增加View的paddingTop,增加的值为状态栏高度 */ public static void setPadding(Context context, View view) { - if (Build.VERSION.SDK_INT >= MIN_API) { - view.setPadding(view.getPaddingLeft(), view.getPaddingTop() + getStatusBarHeight(context), - view.getPaddingRight(), view.getPaddingBottom()); - } + view.setPadding(view.getPaddingLeft(), view.getPaddingTop() + getStatusBarHeight(context), + view.getPaddingRight(), view.getPaddingBottom()); } /** 增加View的paddingTop,增加的值为状态栏高度 (智能判断,并设置高度)*/ public static void setPaddingSmart(Context context, View view) { - if (Build.VERSION.SDK_INT >= MIN_API) { - ViewGroup.LayoutParams lp = view.getLayoutParams(); - if (lp != null && lp.height > 0) { - lp.height += getStatusBarHeight(context);//增高 - } - view.setPadding(view.getPaddingLeft(), view.getPaddingTop() + getStatusBarHeight(context), - view.getPaddingRight(), view.getPaddingBottom()); + ViewGroup.LayoutParams lp = view.getLayoutParams(); + if (lp != null && lp.height > 0) { + lp.height += getStatusBarHeight(context);//增高 } + view.setPadding(view.getPaddingLeft(), view.getPaddingTop() + getStatusBarHeight(context), + view.getPaddingRight(), view.getPaddingBottom()); } /** 增加View的高度以及paddingTop,增加的值为状态栏高度.一般是在沉浸式全屏给ToolBar用的 */ public static void setHeightAndPadding(Context context, View view) { - if (Build.VERSION.SDK_INT >= MIN_API) { - ViewGroup.LayoutParams lp = view.getLayoutParams(); - lp.height += getStatusBarHeight(context);//增高 - view.setPadding(view.getPaddingLeft(), view.getPaddingTop() + getStatusBarHeight(context), - view.getPaddingRight(), view.getPaddingBottom()); - } + ViewGroup.LayoutParams lp = view.getLayoutParams(); + lp.height += getStatusBarHeight(context);//增高 + view.setPadding(view.getPaddingLeft(), view.getPaddingTop() + getStatusBarHeight(context), + view.getPaddingRight(), view.getPaddingBottom()); } /** 增加View上边距(MarginTop)一般是给高度为 WARP_CONTENT 的小控件用的*/ public static void setMargin(Context context, View view) { - if (Build.VERSION.SDK_INT >= MIN_API) { - ViewGroup.LayoutParams lp = view.getLayoutParams(); - if (lp instanceof ViewGroup.MarginLayoutParams) { - ((ViewGroup.MarginLayoutParams) lp).topMargin += getStatusBarHeight(context);//增高 - } - view.setLayoutParams(lp); + ViewGroup.LayoutParams lp = view.getLayoutParams(); + if (lp instanceof ViewGroup.MarginLayoutParams) { + ((ViewGroup.MarginLayoutParams) lp).topMargin += getStatusBarHeight(context);//增高 } + view.setLayoutParams(lp); } /** * 创建假的透明栏 */ public static void setTranslucentView(ViewGroup container, int color, @FloatRange(from = 0.0, to = 1.0) float alpha) { - if (Build.VERSION.SDK_INT >= 19) { - int mixtureColor = mixtureColor(color, alpha); - View translucentView = container.findViewById(android.R.id.custom); - if (translucentView == null && mixtureColor != 0) { - translucentView = new View(container.getContext()); - translucentView.setId(android.R.id.custom); - ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams( - ViewGroup.LayoutParams.MATCH_PARENT, getStatusBarHeight(container.getContext())); - container.addView(translucentView, lp); - } - if (translucentView != null) { - translucentView.setBackgroundColor(mixtureColor); - } + int mixtureColor = mixtureColor(color, alpha); + View translucentView = container.findViewById(android.R.id.custom); + if (translucentView == null && mixtureColor != 0) { + translucentView = new View(container.getContext()); + translucentView.setId(android.R.id.custom); + ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, getStatusBarHeight(container.getContext())); + container.addView(translucentView, lp); + } + if (translucentView != null) { + translucentView.setBackgroundColor(mixtureColor); } } diff --git a/app/src/main/res/layout/activity_experiment.xml b/app/src/main/res/layout/activity_experiment.xml index ab8e3fe5..3fe27d5b 100644 --- a/app/src/main/res/layout/activity_experiment.xml +++ b/app/src/main/res/layout/activity_experiment.xml @@ -11,17 +11,17 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" - android:text="Content"/> + android:text="@string/experiment_content"/> + android:text="@string/experiment_footer"/> + android:text="@string/experiment_footer"/> diff --git a/app/src/main/res/layout/item_movie_item.xml b/app/src/main/res/layout/item_movie_item.xml index 785065ae..c45a063d 100644 --- a/app/src/main/res/layout/item_movie_item.xml +++ b/app/src/main/res/layout/item_movie_item.xml @@ -10,7 +10,6 @@ android:layout_width="80dp" android:layout_height="100dp" android:layout_marginEnd="@dimen/dimenPaddingCommon" - android:layout_marginRight="@dimen/dimenPaddingCommon" android:contentDescription="@string/app_name" tools:background="#fff0f0f0"/> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e22804be..a917928c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -178,6 +178,8 @@ Hello blank fragment + Content + Footer diff --git a/app/src/test/java/com/scwang/refreshlayout/ExampleUnitTest.java b/app/src/test/java/com/scwang/refreshlayout/ExampleUnitTest.java index e8349b6a..8bb88466 100644 --- a/app/src/test/java/com/scwang/refreshlayout/ExampleUnitTest.java +++ b/app/src/test/java/com/scwang/refreshlayout/ExampleUnitTest.java @@ -11,7 +11,7 @@ */ public class ExampleUnitTest { @Test - public void addition_isCorrect() throws Exception { + public void addition_isCorrect() { assertEquals(4, 2 + 2); } } \ No newline at end of file From 010a4a2b470d6715530b6f095061ead3d2e997e5 Mon Sep 17 00:00:00 2001 From: wsc Date: Sun, 5 Nov 2023 22:47:18 +0800 Subject: [PATCH 45/67] =?UTF-8?q?=E4=BC=98=E5=8C=96App=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=86=85=E7=9A=84=E4=BB=A3=E7=A0=81=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activity/example/I18nExampleActivity.java | 14 ++--- .../style/BezierCircleStyleActivity.java | 29 +++++----- .../style/BezierRadarStyleActivity.java | 37 ++++++------- .../activity/style/ClassicsStyleActivity.java | 53 +++++++++---------- .../activity/style/DeliveryStyleActivity.java | 24 +++++---- .../activity/style/DropBoxStyleActivity.java | 52 +++++++++--------- .../style/FunGameBattleCityStyleActivity.java | 25 ++++----- .../style/FunGameHitBlockStyleActivity.java | 25 ++++----- .../activity/style/MaterialStyleActivity.java | 37 ++++++------- .../activity/style/PhoenixStyleActivity.java | 29 +++++----- .../style/StoreHouseStyleActivity.java | 37 ++++++------- .../activity/style/TaurusStyleActivity.java | 31 +++++------ .../style/WaterDropStyleActivity.java | 33 ++++++------ .../style/WaveSwipeStyleActivity.java | 33 ++++++------ 14 files changed, 234 insertions(+), 225 deletions(-) diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java index f70ac8fd..2c1a6567 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java @@ -31,9 +31,9 @@ public class I18nExampleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { private enum Item { - i1(R.string.item_example_i18n_system), - i2(R.string.item_example_i18n_chinese), - i3(R.string.item_example_i18n_english), + LanguageSystem(R.string.item_example_i18n_system), + LanguageChinese(R.string.item_example_i18n_chinese), + LanguageEnglish(R.string.item_example_i18n_english), ; public final int nameId; Item(@StringRes int nameId) { @@ -76,14 +76,14 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position @Override public void onItemClick(AdapterView parent, View view, int position, long id) { - switch (Item.values()[position % Item.values().length].nameId) { - case R.string.item_example_i18n_system: + switch (Item.values()[position % Item.values().length]) { + case LanguageSystem: changeAppLanguage(Locale.getDefault()); break; - case R.string.item_example_i18n_chinese: + case LanguageChinese: changeAppLanguage(Locale.CHINESE); break; - case R.string.item_example_i18n_english: + case LanguageEnglish: changeAppLanguage(Locale.ENGLISH); break; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java index f698e37e..32a27be5 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java @@ -1,6 +1,5 @@ package com.scwang.refreshlayout.activity.style; -import android.os.Build; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; @@ -30,15 +29,17 @@ public class BezierCircleStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { private enum Item { - 内容不偏移(R.string.item_style_content_translation_off), - 内容跟随偏移(R.string.item_style_content_translation_on), - 橙色主题(R.string.item_style_theme_orange_abstract), - 红色主题(R.string.item_style_theme_red_abstract), - 绿色主题(R.string.item_style_theme_green_abstract), - 蓝色主题(R.string.item_style_theme_blue_abstract), + ContentNoOffset("内容不偏移", R.string.item_style_content_translation_off), + ContentOffset("内容跟随偏移", R.string.item_style_content_translation_on), + ThemeOrange("橙色主题", R.string.item_style_theme_orange_abstract), + ThemeRed("红色主题", R.string.item_style_theme_red_abstract), + ThemeGreen("绿色主题", R.string.item_style_theme_green_abstract), + ThemeBlue("蓝色主题", R.string.item_style_theme_blue_abstract), ; + public final String remark; public final int nameId; - Item(@StringRes int nameId) { + Item(String remark, @StringRes int nameId) { + this.remark = remark; this.nameId = nameId; } } @@ -84,22 +85,22 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position @Override public void onItemClick(AdapterView parent, View view, int position, long id) { switch (Item.values()[position % Item.values().length]) { - case 内容不偏移: + case ContentNoOffset: mRefreshLayout.setEnableHeaderTranslationContent(false); break; - case 内容跟随偏移: + case ContentOffset: mRefreshLayout.setEnableHeaderTranslationContent(true); break; - case 蓝色主题: + case ThemeBlue: setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark); break; - case 绿色主题: + case ThemeGreen: setThemeColor(android.R.color.holo_green_light, android.R.color.holo_green_dark); break; - case 红色主题: + case ThemeRed: setThemeColor(android.R.color.holo_red_light, android.R.color.holo_red_dark); break; - case 橙色主题: + case ThemeOrange: setThemeColor(android.R.color.holo_orange_light, android.R.color.holo_orange_dark); break; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java index a27fbfd4..f2a0dbe1 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java @@ -1,6 +1,5 @@ package com.scwang.refreshlayout.activity.style; -import android.os.Build; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; @@ -30,17 +29,19 @@ public class BezierRadarStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { private enum Item { - 打开左右拖动(R.string.item_style_horizontal_drag_on), - 关闭左右拖动(R.string.item_style_horizontal_drag_off), - 内容不偏移(R.string.item_style_content_translation_off), - 内容跟随偏移(R.string.item_style_content_translation_on), - 橙色主题(R.string.item_style_theme_orange_abstract), - 红色主题(R.string.item_style_theme_red_abstract), - 绿色主题(R.string.item_style_theme_green_abstract), - 蓝色主题(R.string.item_style_theme_blue_abstract), + DragLeftRight("打开左右拖动", R.string.item_style_horizontal_drag_on), + DragUpDown("关闭左右拖动", R.string.item_style_horizontal_drag_off), + ContentNoOffset("内容不偏移", R.string.item_style_content_translation_off), + ContentOffset("内容跟随偏移", R.string.item_style_content_translation_on), + ThemeOrange("橙色主题", R.string.item_style_theme_orange_abstract), + ThemeRed("红色主题", R.string.item_style_theme_red_abstract), + ThemeGreen("绿色主题", R.string.item_style_theme_green_abstract), + ThemeBlue("蓝色主题", R.string.item_style_theme_blue_abstract), ; + public final String remark; public final int nameId; - Item(@StringRes int nameId) { + Item(String remark, @StringRes int nameId) { + this.remark = remark; this.nameId = nameId; } } @@ -88,28 +89,28 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position @Override public void onItemClick(AdapterView parent, View view, int position, long id) { switch (Item.values()[position % Item.values().length]) { - case 内容不偏移: + case ContentNoOffset: mRefreshLayout.setEnableHeaderTranslationContent(false); break; - case 内容跟随偏移: + case ContentOffset: mRefreshLayout.setEnableHeaderTranslationContent(true); break; - case 蓝色主题: + case ThemeBlue: setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark); break; - case 绿色主题: + case ThemeGreen: setThemeColor(android.R.color.holo_green_light, android.R.color.holo_green_dark); break; - case 红色主题: + case ThemeRed: setThemeColor(android.R.color.holo_red_light, android.R.color.holo_red_dark); break; - case 橙色主题: + case ThemeOrange: setThemeColor(android.R.color.holo_orange_light, android.R.color.holo_orange_dark); break; - case 打开左右拖动: + case DragLeftRight: mRefreshHeader.setEnableHorizontalDrag(true); break; - case 关闭左右拖动: + case DragUpDown: mRefreshHeader.setEnableHorizontalDrag(false); break; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java index 76ad23a8..1d0540ec 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java @@ -2,7 +2,6 @@ import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; -import android.os.Build; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; @@ -16,7 +15,6 @@ import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; @@ -40,20 +38,22 @@ public class ClassicsStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { private enum Item { - 尺寸拉伸(R.string.item_style_spinner_scale), - 位置平移(R.string.item_style_spinner_translation), - 背后固定(R.string.item_style_spinner_behind), - 显示时间(R.string.item_style_spinner_update_on), - 隐藏时间(R.string.item_style_spinner_update_off), -// 加载更多(R.string.item_style_load_more), - 默认主题(R.string.item_style_theme_default_abstract), - 橙色主题(R.string.item_style_theme_orange_abstract), - 红色主题(R.string.item_style_theme_red_abstract), - 绿色主题(R.string.item_style_theme_green_abstract), - 蓝色主题(R.string.item_style_theme_blue_abstract), + SizeScale("尺寸拉伸", R.string.item_style_spinner_scale), + PlaceMove("位置平移", R.string.item_style_spinner_translation), + FixedBehind("背后固定", R.string.item_style_spinner_behind), + TimeShow("显示时间", R.string.item_style_spinner_update_on), + TimeHide("隐藏时间", R.string.item_style_spinner_update_off), +// LoadMore("加载更多", R.string.item_style_load_more), + ThemeDefault("默认主题", R.string.item_style_theme_default_abstract), + ThemeOrange("橙色主题", R.string.item_style_theme_orange_abstract), + ThemeRed("红色主题", R.string.item_style_theme_red_abstract), + ThemeGreen("绿色主题", R.string.item_style_theme_green_abstract), + ThemeBlue("蓝色主题", R.string.item_style_theme_blue_abstract), ; + public final String remark; public final int nameId; - Item(@StringRes int nameId) { + Item(String remark, @StringRes int nameId) { + this.remark = remark; this.nameId = nameId; } } @@ -97,8 +97,7 @@ protected void onCreate(Bundle savedInstanceState) { List items = new ArrayList<>(); items.addAll(Arrays.asList(Item.values())); items.addAll(Arrays.asList(Item.values())); - BaseRecyclerAdapter mAdpater; - recyclerView.setAdapter(mAdpater = new BaseRecyclerAdapter(items, simple_list_item_2,this) { + recyclerView.setAdapter(new BaseRecyclerAdapter(items, simple_list_item_2,this) { @Override protected void onBindViewHolder(SmartViewHolder holder, Item model, int position) { holder.text(android.R.id.text1, model.name()); @@ -139,7 +138,7 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position @Override public void onItemClick(AdapterView parent, View view, int position, long id) { switch (Item.values()[position % Item.values().length]) { - case 背后固定: + case FixedBehind: mClassicsHeader.setSpinnerStyle(SpinnerStyle.FixedBehind); mRefreshLayout.setPrimaryColors(0xff444444, 0xffffffff); mDrawableProgress.setTint(0xffffffff); @@ -149,37 +148,37 @@ public void onItemClick(AdapterView parent, View view, int position, long id) */ mRefreshLayout.getLayout().bringChildToFront(mRecyclerView); break; - case 尺寸拉伸: + case SizeScale: mClassicsHeader.setSpinnerStyle(SpinnerStyle.values[1]); break; - case 位置平移: + case PlaceMove: mClassicsHeader.setSpinnerStyle(SpinnerStyle.Translate); break; - case 显示时间: + case TimeShow: mClassicsHeader.setEnableLastTime(true); break; - case 隐藏时间: + case TimeHide: mClassicsHeader.setEnableLastTime(false); break; - case 默认主题: + case ThemeDefault: setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark); mRefreshLayout.getLayout().setBackgroundResource(android.R.color.transparent); mRefreshLayout.setPrimaryColors(0, 0xff666666); mDrawableProgress.setTint(0xff666666); break; - case 蓝色主题: + case ThemeBlue: setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark); break; - case 绿色主题: + case ThemeGreen: setThemeColor(android.R.color.holo_green_light, android.R.color.holo_green_dark); break; - case 红色主题: + case ThemeRed: setThemeColor(android.R.color.holo_red_light, android.R.color.holo_red_dark); break; - case 橙色主题: + case ThemeOrange: setThemeColor(android.R.color.holo_orange_light, android.R.color.holo_orange_dark); break; -// case 加载更多: +// case LoadMore: // mRefreshLayout.autoLoadMore(); // return; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java index 5dd74898..339c340f 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java @@ -28,14 +28,16 @@ public class DeliveryStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { private enum Item { - 默认主题(R.string.item_style_theme_default_abstract), - 橙色主题(R.string.item_style_theme_orange_abstract), - 红色主题(R.string.item_style_theme_red_abstract), - 绿色主题(R.string.item_style_theme_green_abstract), - 蓝色主题(R.string.item_style_theme_blue_abstract), + ThemeDefault("默认主题", R.string.item_style_theme_default_abstract), + ThemeOrange("橙色主题", R.string.item_style_theme_orange_abstract), + ThemeRed("红色主题", R.string.item_style_theme_red_abstract), + ThemeGreen("绿色主题", R.string.item_style_theme_green_abstract), + ThemeBlue("蓝色主题", R.string.item_style_theme_blue_abstract), ; + public final String remark; public final int nameId; - Item(@StringRes int nameId) { + Item(String remark, @StringRes int nameId) { + this.remark = remark; this.nameId = nameId; } } @@ -84,7 +86,7 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position @Override public void onItemClick(AdapterView parent, View view, int position, long id) { switch (Item.values()[position % Item.values().length]) { - case 默认主题: + case ThemeDefault: mToolbar.setBackgroundResource(android.R.color.white); mToolbar.setTitleTextColor(0xffbbbbbb); mToolbar.setNavigationIcon(R.drawable.ic_arrow_back_gray_24dp); @@ -97,16 +99,16 @@ public void onItemClick(AdapterView parent, View view, int position, long id) window.getDecorView().setSystemUiVisibility(systemUiVisibility); } break; - case 蓝色主题: + case ThemeBlue: setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark); break; - case 绿色主题: + case ThemeGreen: setThemeColor(android.R.color.holo_green_light, android.R.color.holo_green_dark); break; - case 红色主题: + case ThemeRed: setThemeColor(android.R.color.holo_red_light, android.R.color.holo_red_dark); break; - case 橙色主题: + case ThemeOrange: setThemeColor(android.R.color.holo_orange_light, android.R.color.holo_orange_dark); break; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java index 18b18e8f..a0b94295 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java @@ -1,6 +1,5 @@ package com.scwang.refreshlayout.activity.style; -import android.os.Build; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; @@ -27,28 +26,29 @@ public class DropBoxStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { private enum Item { - 默认主题(R.string.item_style_theme_default_abstract), - 橙色主题(R.string.item_style_theme_orange_abstract), - 红色主题(R.string.item_style_theme_red_abstract), - 绿色主题(R.string.item_style_theme_green_abstract), - 蓝色主题(R.string.item_style_theme_blue_abstract), - - - 默认1主题(R.string.item_style_theme_default_abstract), - 橙色1主题(R.string.item_style_theme_orange_abstract), - 红色1主题(R.string.item_style_theme_red_abstract), - 绿色1主题(R.string.item_style_theme_green_abstract), - 蓝色1主题(R.string.item_style_theme_blue_abstract), - - - 默认2主题(R.string.item_style_theme_default_abstract), - 橙色2主题(R.string.item_style_theme_orange_abstract), - 红色2主题(R.string.item_style_theme_red_abstract), - 绿色2主题(R.string.item_style_theme_green_abstract), - 蓝色2主题(R.string.item_style_theme_blue_abstract), + ThemeDefault("默认主题", R.string.item_style_theme_default_abstract), + ThemeOrange("橙色主题", R.string.item_style_theme_orange_abstract), + ThemeRed("红色主题", R.string.item_style_theme_red_abstract), + ThemeGreen("绿色主题", R.string.item_style_theme_green_abstract), + ThemeBlue("蓝色主题", R.string.item_style_theme_blue_abstract), + + + ThemeDefault1("默认主题1", R.string.item_style_theme_default_abstract), + ThemeOrange1("橙色主题1", R.string.item_style_theme_orange_abstract), + ThemeRed1("红色主题1", R.string.item_style_theme_red_abstract), + ThemeGreen1("绿色主题1", R.string.item_style_theme_green_abstract), + ThemeBlue1("蓝色主题1", R.string.item_style_theme_blue_abstract), + + ThemeDefault2("默认主题2", R.string.item_style_theme_default_abstract), + ThemeOrange2("橙色主题2", R.string.item_style_theme_orange_abstract), + ThemeRed2("红色主题2", R.string.item_style_theme_red_abstract), + ThemeGreen2("绿色主题2", R.string.item_style_theme_green_abstract), + ThemeBlue2("蓝色主题2", R.string.item_style_theme_blue_abstract), ; + public final String remark; public final int nameId; - Item(@StringRes int nameId) { + Item(String remark, @StringRes int nameId) { + this.remark = remark; this.nameId = nameId; } } @@ -91,20 +91,20 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position @Override public void onItemClick(AdapterView parent, View view, int position, long id) { switch (Item.values()[position % Item.values().length]) { - case 默认主题: + case ThemeDefault: setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark); mRefreshLayout.setPrimaryColors(0xff283645, 0xff6ea9ff); break; - case 蓝色主题: + case ThemeBlue: setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark); break; - case 绿色主题: + case ThemeGreen: setThemeColor(android.R.color.holo_green_light, android.R.color.holo_green_dark); break; - case 红色主题: + case ThemeRed: setThemeColor(android.R.color.holo_red_light, android.R.color.holo_red_dark); break; - case 橙色主题: + case ThemeOrange: setThemeColor(android.R.color.holo_orange_light, android.R.color.holo_orange_dark); break; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java index 046669ff..2fb7dca8 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java @@ -1,6 +1,5 @@ package com.scwang.refreshlayout.activity.style; -import android.os.Build; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; @@ -29,14 +28,16 @@ public class FunGameBattleCityStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { private enum Item { - 默认主题(R.string.item_style_theme_default_abstract), - 橙色主题(R.string.item_style_theme_orange_abstract), - 红色主题(R.string.item_style_theme_red_abstract), - 绿色主题(R.string.item_style_theme_green_abstract), - 蓝色主题(R.string.item_style_theme_blue_abstract), + ThemeDefault("默认主题", R.string.item_style_theme_default_abstract), + ThemeOrange("橙色主题", R.string.item_style_theme_orange_abstract), + ThemeRed("红色主题", R.string.item_style_theme_red_abstract), + ThemeGreen("绿色主题", R.string.item_style_theme_green_abstract), + ThemeBlue("蓝色主题", R.string.item_style_theme_blue_abstract), ; + public final String remark; public final int nameId; - Item(@StringRes int nameId) { + Item(String remark, @StringRes int nameId) { + this.remark = remark; this.nameId = nameId; } } @@ -83,19 +84,19 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position @Override public void onItemClick(AdapterView parent, View view, int position, long id) { switch (Item.values()[position % Item.values().length]) { - case 默认主题: + case ThemeDefault: mRefreshLayout.setPrimaryColorsId(android.R.color.white, android.R.color.black); break; - case 蓝色主题: + case ThemeBlue: setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark); break; - case 绿色主题: + case ThemeGreen: setThemeColor(android.R.color.holo_green_light, android.R.color.holo_green_dark); break; - case 红色主题: + case ThemeRed: setThemeColor(android.R.color.holo_red_light, android.R.color.holo_red_dark); break; - case 橙色主题: + case ThemeOrange: setThemeColor(android.R.color.holo_orange_light, android.R.color.holo_orange_dark); break; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java index 44e8e3cb..7e947bfc 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java @@ -1,6 +1,5 @@ package com.scwang.refreshlayout.activity.style; -import android.os.Build; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; @@ -29,14 +28,16 @@ public class FunGameHitBlockStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { private enum Item { - 默认主题(R.string.item_style_theme_default_abstract), - 橙色主题(R.string.item_style_theme_orange_abstract), - 红色主题(R.string.item_style_theme_red_abstract), - 绿色主题(R.string.item_style_theme_green_abstract), - 蓝色主题(R.string.item_style_theme_blue_abstract), + ThemeDefault("默认主题", R.string.item_style_theme_default_abstract), + ThemeOrange("橙色主题", R.string.item_style_theme_orange_abstract), + ThemeRed("红色主题", R.string.item_style_theme_red_abstract), + ThemeGreen("绿色主题", R.string.item_style_theme_green_abstract), + ThemeBlue("蓝色主题", R.string.item_style_theme_blue_abstract), ; + public final String remark; public final int nameId; - Item(@StringRes int nameId) { + Item(String remark, @StringRes int nameId) { + this.remark = remark; this.nameId = nameId; } } @@ -84,19 +85,19 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position @Override public void onItemClick(AdapterView parent, View view, int position, long id) { switch (Item.values()[position % Item.values().length]) { - case 默认主题: + case ThemeDefault: mRefreshLayout.setPrimaryColorsId(android.R.color.white, android.R.color.black); break; - case 蓝色主题: + case ThemeBlue: setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark); break; - case 绿色主题: + case ThemeGreen: setThemeColor(android.R.color.holo_green_light, android.R.color.holo_green_dark); break; - case 红色主题: + case ThemeRed: setThemeColor(android.R.color.holo_red_light, android.R.color.holo_red_dark); break; - case 橙色主题: + case ThemeOrange: setThemeColor(android.R.color.holo_orange_light, android.R.color.holo_orange_dark); break; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java index 7b7ee820..04ea4059 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java @@ -1,6 +1,5 @@ package com.scwang.refreshlayout.activity.style; -import android.os.Build; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; @@ -30,17 +29,19 @@ public class MaterialStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { private enum Item { - 打开背景(R.string.item_style_bezier_on), - 关闭背景(R.string.item_style_bezier_off), - 内容不偏移(R.string.item_style_content_translation_off), - 内容跟随偏移(R.string.item_style_content_translation_on), - 橙色主题(R.string.item_style_theme_orange_abstract), - 红色主题(R.string.item_style_theme_red_abstract), - 绿色主题(R.string.item_style_theme_green_abstract), - 蓝色主题(R.string.item_style_theme_blue_abstract), + BackgroundOpen("打开背景", R.string.item_style_bezier_on), + BackgroundClose("关闭背景", R.string.item_style_bezier_off), + ContentNoOffset("内容不偏移", R.string.item_style_content_translation_off), + ContentOffset("内容跟随偏移", R.string.item_style_content_translation_on), + ThemeOrange("橙色主题", R.string.item_style_theme_orange_abstract), + ThemeRed("红色主题", R.string.item_style_theme_red_abstract), + ThemeGreen("绿色主题", R.string.item_style_theme_green_abstract), + ThemeThemeBlue("蓝色主题", R.string.item_style_theme_blue_abstract), ; + public final String remark; public final int nameId; - Item(@StringRes int nameId) { + Item(String remark, @StringRes int nameId) { + this.remark = remark; this.nameId = nameId; } } @@ -89,28 +90,28 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position @Override public void onItemClick(AdapterView parent, View view, int position, long id) { switch (Item.values()[position % Item.values().length]) { - case 内容不偏移: + case ContentNoOffset: mRefreshLayout.setEnableHeaderTranslationContent(false); break; - case 内容跟随偏移: + case ContentOffset: mRefreshLayout.setEnableHeaderTranslationContent(true); break; - case 打开背景: + case BackgroundOpen: mMaterialHeader.setShowBezierWave(true); break; - case 关闭背景: + case BackgroundClose: mMaterialHeader.setShowBezierWave(false); break; - case 蓝色主题: + case ThemeThemeBlue: setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark); break; - case 绿色主题: + case ThemeGreen: setThemeColor(android.R.color.holo_green_light, android.R.color.holo_green_dark); break; - case 红色主题: + case ThemeRed: setThemeColor(android.R.color.holo_red_light, android.R.color.holo_red_dark); break; - case 橙色主题: + case ThemeOrange: setThemeColor(android.R.color.holo_orange_light, android.R.color.holo_orange_dark); break; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java index c04565c2..8e031010 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java @@ -1,7 +1,6 @@ package com.scwang.refreshlayout.activity.style; import android.content.res.ColorStateList; -import android.os.Build; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; @@ -33,15 +32,17 @@ public class PhoenixStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { private enum Item { - 折叠(R.string.item_style_app_bar_collapse), - 展开(R.string.item_style_app_bar_expand), - 橙色主题(R.string.item_style_theme_orange_abstract), - 红色主题(R.string.item_style_theme_red_abstract), - 绿色主题(R.string.item_style_theme_green_abstract), - 蓝色主题(R.string.item_style_theme_blue_abstract), + Collapse("折叠", R.string.item_style_app_bar_collapse), + Expend("展开", R.string.item_style_app_bar_expand), + ThemeOrange("橙色主题", R.string.item_style_theme_orange_abstract), + ThemeRed("红色主题", R.string.item_style_theme_red_abstract), + ThemeGreen("绿色主题", R.string.item_style_theme_green_abstract), + ThemeBlue("蓝色主题", R.string.item_style_theme_blue_abstract), ; + public final String remark; public final int nameId; - Item(@StringRes int nameId) { + Item(String remark, @StringRes int nameId) { + this.remark = remark; this.nameId = nameId; } } @@ -117,26 +118,26 @@ public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { switch (Item.values()[position % Item.values().length]) { - case 折叠: + case Collapse: mAppBarLayout.setExpanded(false, true); mAppBarLayout.setEnabled(false); mRecyclerView.setNestedScrollingEnabled(false); break; - case 展开: + case Expend: mAppBarLayout.setEnabled(true); mAppBarLayout.setExpanded(true, true); mRecyclerView.setNestedScrollingEnabled(true); break; - case 蓝色主题: + case ThemeBlue: setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark); break; - case 绿色主题: + case ThemeGreen: setThemeColor(android.R.color.holo_green_light, android.R.color.holo_green_dark); break; - case 红色主题: + case ThemeRed: setThemeColor(android.R.color.holo_red_light, android.R.color.holo_red_dark); break; - case 橙色主题: + case ThemeOrange: setThemeColor(android.R.color.holo_orange_light, android.R.color.holo_orange_dark); break; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java index 0fa782d4..7f5e986b 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java @@ -1,7 +1,6 @@ package com.scwang.refreshlayout.activity.style; import android.graphics.Point; -import android.os.Build; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; @@ -32,17 +31,19 @@ public class StoreHouseStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { private enum Item { - 显示商标(R.string.item_style_store_house_brand), - 显示图标(R.string.item_style_store_house_icon), - 显示中文(R.string.item_style_store_house_chinese), - 显示英文(R.string.item_style_store_house_english), - 橙色主题(R.string.item_style_theme_orange_abstract), - 红色主题(R.string.item_style_theme_red_abstract), - 绿色主题(R.string.item_style_theme_green_abstract), - 蓝色主题(R.string.item_style_theme_blue_abstract), + ShowSymbol("显示商标", R.string.item_style_store_house_brand), + ShowIcon("显示图标", R.string.item_style_store_house_icon), + ShowChinese("显示中文", R.string.item_style_store_house_chinese), + ShowEnglish("显示英文", R.string.item_style_store_house_english), + ThemeOrange("橙色主题", R.string.item_style_theme_orange_abstract), + ThemeRed("红色主题", R.string.item_style_theme_red_abstract), + ThemeGreen("绿色主题", R.string.item_style_theme_green_abstract), + ThemeBlue("蓝色主题", R.string.item_style_theme_blue_abstract), ; + public final String remark; public final int nameId; - Item(@StringRes int nameId) { + Item(String remark, @StringRes int nameId) { + this.remark = remark; this.nameId = nameId; } } @@ -88,44 +89,44 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position @Override public void onItemClick(AdapterView parent, View view, int position, long id) { switch (Item.values()[position % Item.values().length]) { - case 显示中文: { + case ShowChinese: { RefreshHeader refreshHeader = mRefreshLayout.getRefreshHeader(); if (refreshHeader instanceof StoreHouseHeader) { ((StoreHouseHeader) refreshHeader).initWithPointList(getPointList()); } break; } - case 显示英文: { + case ShowEnglish: { RefreshHeader refreshHeader = mRefreshLayout.getRefreshHeader(); if (refreshHeader instanceof StoreHouseHeader) { ((StoreHouseHeader) refreshHeader).initWithString("SmartRefresh"); } break; } - case 显示图标: { + case ShowIcon: { RefreshHeader refreshHeader = mRefreshLayout.getRefreshHeader(); if (refreshHeader instanceof StoreHouseHeader) { ((StoreHouseHeader) refreshHeader).initWithStringArray(R.array.storehouse); } break; } - case 显示商标: { + case ShowSymbol: { RefreshHeader refreshHeader = mRefreshLayout.getRefreshHeader(); if (refreshHeader instanceof StoreHouseHeader) { ((StoreHouseHeader) refreshHeader).initWithStringArray(R.array.akta); } break; } - case 蓝色主题: + case ThemeBlue: setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark); break; - case 绿色主题: + case ThemeGreen: setThemeColor(android.R.color.holo_green_light, android.R.color.holo_green_dark); break; - case 红色主题: + case ThemeRed: setThemeColor(android.R.color.holo_red_light, android.R.color.holo_red_dark); break; - case 橙色主题: + case ThemeOrange: setThemeColor(android.R.color.holo_orange_light, android.R.color.holo_orange_dark); break; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java index 120b2085..20e507d2 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java @@ -1,7 +1,6 @@ package com.scwang.refreshlayout.activity.style; import android.content.res.ColorStateList; -import android.os.Build; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; @@ -33,15 +32,17 @@ public class TaurusStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { private enum Item { - 折叠(R.string.item_style_app_bar_collapse), - 展开(R.string.item_style_app_bar_expand), - 橙色主题(R.string.item_style_theme_orange_abstract), - 红色主题(R.string.item_style_theme_red_abstract), - 绿色主题(R.string.item_style_theme_green_abstract), - 蓝色主题(R.string.item_style_theme_blue_abstract), + Collapse("折叠", R.string.item_style_app_bar_collapse), + Expend("展开", R.string.item_style_app_bar_expand), + ThemeOrange("橙色主题", R.string.item_style_theme_orange_abstract), + ThemeRed("红色主题", R.string.item_style_theme_red_abstract), + ThemeGreen("绿色主题", R.string.item_style_theme_green_abstract), + ThemeBlue("蓝色主题", R.string.item_style_theme_blue_abstract), ; + public final String remark; public final int nameId; - Item(@StringRes int nameId) { + Item(String remark, @StringRes int nameId) { + this.remark = remark; this.nameId = nameId; } } @@ -97,7 +98,7 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position mActionButton = findViewById(R.id.fab); mAppBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() { boolean misAppbarExpand = true; - View fab = findViewById(R.id.fab); + final View fab = findViewById(R.id.fab); @Override public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { int scrollRange = appBarLayout.getTotalScrollRange(); @@ -117,26 +118,26 @@ public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { switch (Item.values()[position % Item.values().length]) { - case 折叠: + case Collapse: mAppBarLayout.setExpanded(false, true); mAppBarLayout.setEnabled(false); mRecyclerView.setNestedScrollingEnabled(false); break; - case 展开: + case Expend: mAppBarLayout.setEnabled(true); mAppBarLayout.setExpanded(true, true); mRecyclerView.setNestedScrollingEnabled(true); break; - case 蓝色主题: + case ThemeBlue: setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark); break; - case 绿色主题: + case ThemeGreen: setThemeColor(android.R.color.holo_green_light, android.R.color.holo_green_dark); break; - case 红色主题: + case ThemeRed: setThemeColor(android.R.color.holo_red_light, android.R.color.holo_red_dark); break; - case 橙色主题: + case ThemeOrange: setThemeColor(android.R.color.holo_orange_light, android.R.color.holo_orange_dark); break; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java index ba524fe8..6b76bf2c 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java @@ -1,6 +1,5 @@ package com.scwang.refreshlayout.activity.style; -import android.os.Build; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; @@ -29,16 +28,18 @@ public class WaterDropStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { private enum Item { - 内容不偏移(R.string.item_style_content_translation_off), - 内容跟随偏移(R.string.item_style_content_translation_on), - 默认主题(R.string.item_style_theme_default_abstract), - 橙色主题(R.string.item_style_theme_orange_abstract), - 红色主题(R.string.item_style_theme_red_abstract), - 绿色主题(R.string.item_style_theme_green_abstract), - 蓝色主题(R.string.item_style_theme_blue_abstract), + ContentNoOffset("内容不偏移", R.string.item_style_content_translation_off), + ContentOffset("内容跟随偏移", R.string.item_style_content_translation_on), + ThemeDefault("默认主题", R.string.item_style_theme_default_abstract), + ThemeOrange("橙色主题", R.string.item_style_theme_orange_abstract), + ThemeRed("红色主题", R.string.item_style_theme_red_abstract), + ThemeGreen("绿色主题", R.string.item_style_theme_green_abstract), + ThemeBlue("蓝色主题", R.string.item_style_theme_blue_abstract), ; + public final String remark; public final int nameId; - Item(@StringRes int nameId) { + Item(String remark, @StringRes int nameId) { + this.remark = remark; this.nameId = nameId; } } @@ -84,26 +85,26 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position @Override public void onItemClick(AdapterView parent, View view, int position, long id) { switch (Item.values()[position % Item.values().length]) { - case 内容不偏移: + case ContentNoOffset: mRefreshLayout.setEnableHeaderTranslationContent(false); break; - case 内容跟随偏移: + case ContentOffset: mRefreshLayout.setEnableHeaderTranslationContent(true); break; - case 默认主题: + case ThemeDefault: setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark); mRefreshLayout.setPrimaryColorsId(android.R.color.darker_gray); break; - case 蓝色主题: + case ThemeBlue: setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark); break; - case 绿色主题: + case ThemeGreen: setThemeColor(android.R.color.holo_green_light, android.R.color.holo_green_dark); break; - case 红色主题: + case ThemeRed: setThemeColor(android.R.color.holo_red_light, android.R.color.holo_red_dark); break; - case 橙色主题: + case ThemeOrange: setThemeColor(android.R.color.holo_orange_light, android.R.color.holo_orange_dark); break; } diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java index 7e0e6b97..deb92f19 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java @@ -1,6 +1,5 @@ package com.scwang.refreshlayout.activity.style; -import android.os.Build; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; @@ -29,15 +28,17 @@ public class WaveSwipeStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { private enum Item { - 内容不偏移(R.string.item_style_content_translation_off), - 内容跟随偏移(R.string.item_style_content_translation_on), - 橙色主题(R.string.item_style_theme_orange_abstract), - 红色主题(R.string.item_style_theme_red_abstract), - 绿色主题(R.string.item_style_theme_green_abstract), - 蓝色主题(R.string.item_style_theme_blue_abstract), + ContentNoOffset("内容不偏移", R.string.item_style_content_translation_off), + ContentOffset("内容跟随偏移", R.string.item_style_content_translation_on), + ThemeOrange("橙色主题", R.string.item_style_theme_orange_abstract), + ThemeRed("红色主题", R.string.item_style_theme_red_abstract), + ThemeGreen("绿色主题", R.string.item_style_theme_green_abstract), + ThemeBlue("蓝色主题", R.string.item_style_theme_blue_abstract), ; + public final String remark; public final int nameId; - Item(@StringRes int nameId) { + Item(String remark, @StringRes int nameId) { + this.remark = remark; this.nameId = nameId; } } @@ -84,22 +85,22 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position @Override public void onItemClick(AdapterView parent, View view, int position, long id) { switch (Item.values()[position % Item.values().length]) { - case 内容不偏移: + case ContentNoOffset: mRefreshLayout.setEnableHeaderTranslationContent(false); break; - case 内容跟随偏移: + case ContentOffset: mRefreshLayout.setEnableHeaderTranslationContent(true); break; - case 蓝色主题: + case ThemeBlue: setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark); break; - case 绿色主题: + case ThemeGreen: setThemeColor(android.R.color.holo_green_light, android.R.color.holo_green_dark); break; - case 红色主题: + case ThemeRed: setThemeColor(android.R.color.holo_red_light, android.R.color.holo_red_dark); break; - case 橙色主题: + case ThemeOrange: setThemeColor(android.R.color.holo_orange_light, android.R.color.holo_orange_dark); break; } @@ -109,9 +110,7 @@ public void onItemClick(AdapterView parent, View view, int position, long id) private void setThemeColor(int colorPrimary, int colorPrimaryDark) { mToolbar.setBackgroundResource(colorPrimary); mRefreshLayout.setPrimaryColorsId(colorPrimary, android.R.color.white); - if (Build.VERSION.SDK_INT >= 21) { - getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); - } + getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark)); } } From 3c716ff31fc085bc15f5320825a60239221c063b Mon Sep 17 00:00:00 2001 From: wsc Date: Wed, 8 Nov 2023 22:55:17 +0800 Subject: [PATCH 46/67] =?UTF-8?q?=E8=A7=84=E8=8C=83=E5=8C=96=E5=BA=93?= =?UTF-8?q?=E7=9A=84import=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../drawable/ExampleInstrumentedTest.java | 5 +++-- .../drawable/ExampleInstrumentedTest.java | 5 +++-- .../scwang/smart/drawable/PathsDrawable.java | 1 + .../smart/drawable/path/PathParser.java | 1 + .../footer/ExampleInstrumentedTest.java | 5 +++-- .../smart/refresh/footer/BallPulseFooter.java | 7 +++---- .../smart/refresh/footer/ExampleUnitTest.java | 2 +- .../footer/ExampleInstrumentedTest.java | 5 +++-- .../smart/refresh/classics/ArrowDrawable.java | 1 + .../refresh/classics/ClassicsAbstract.java | 12 +++++------ .../smart/refresh/footer/ClassicsFooter.java | 5 +++-- .../smart/refresh/footer/ExampleUnitTest.java | 2 +- .../footer/ExampleInstrumentedTest.java | 5 +++-- refresh-footer/src/main/AndroidManifest.xml | 3 +-- .../smartrefresh/footer/ExampleUnitTest.java | 4 ++-- .../header/ExampleInstrumentedTest.java | 5 +++-- .../smart/refresh/header/ClassicsHeader.java | 12 +++++------ .../smart/refresh/header/ExampleUnitTest.java | 2 +- .../header/ExampleInstrumentedTest.java | 5 +++-- .../smart/refresh/header/FalsifyFooter.java | 3 ++- .../smart/refresh/header/FalsifyHeader.java | 3 ++- .../header/falsify/FalsifyAbstract.java | 3 ++- .../smart/refresh/header/ExampleUnitTest.java | 2 +- .../header/ExampleInstrumentedTest.java | 5 +++-- .../smart/refresh/header/MaterialHeader.java | 12 +++++------ .../header/material/CircleImageView.java | 3 ++- .../material/MaterialProgressDrawable.java | 11 +++++----- .../smart/refresh/header/ExampleUnitTest.java | 2 +- .../header/ExampleInstrumentedTest.java | 5 +++-- .../refresh/header/BezierRadarHeader.java | 9 +++++---- .../smart/refresh/header/ExampleUnitTest.java | 2 +- .../header/ExampleInstrumentedTest.java | 5 +++-- .../smart/refresh/header/TwoLevelHeader.java | 12 +++++------ .../smart/refresh/header/ExampleUnitTest.java | 2 +- .../header/ExampleInstrumentedTest.java | 5 +++-- refresh-header/src/main/AndroidManifest.xml | 3 +-- .../refresh/header/BezierCircleHeader.java | 11 +++++----- .../smart/refresh/header/DeliveryHeader.java | 9 +++++---- .../smart/refresh/header/DropBoxHeader.java | 11 +++++----- .../refresh/header/FlyRefreshHeader.java | 10 +++++----- .../header/FunGameBattleCityHeader.java | 3 ++- .../refresh/header/FunGameHitBlockHeader.java | 5 +++-- .../smart/refresh/header/PhoenixHeader.java | 7 ++++--- .../refresh/header/StoreHouseHeader.java | 5 +++-- .../smart/refresh/header/TaurusHeader.java | 7 ++++--- .../smart/refresh/header/WaterDropHeader.java | 5 +++-- .../smart/refresh/header/WaveSwipeHeader.java | 13 ++++++------ .../header/flyrefresh/MountainSceneView.java | 7 +++---- .../refresh/header/fungame/FunGameBase.java | 7 ++++--- .../refresh/header/fungame/FunGameView.java | 7 ++++--- .../header/waterdrop/WaterDropView.java | 6 +++--- .../refresh/header/waveswipe/WaveView.java | 6 +++--- .../smartrefresh/header/DeliveryHeader.java | 3 ++- .../smartrefresh/header/DropBoxHeader.java | 3 ++- .../smartrefresh/header/ExampleUnitTest.java | 2 +- .../layout/ExampleInstrumentedTest.java | 5 +++-- .../refresh/layout/SmartRefreshLayout.java | 20 +++++++++---------- .../refresh/layout/api/RefreshComponent.java | 10 +++++----- .../refresh/layout/api/RefreshContent.java | 3 ++- .../refresh/layout/api/RefreshFooter.java | 4 ++-- .../refresh/layout/api/RefreshKernel.java | 1 + .../refresh/layout/api/RefreshLayout.java | 7 ++++--- .../listener/DefaultRefreshFooterCreator.java | 1 + .../listener/DefaultRefreshHeaderCreator.java | 1 + .../listener/DefaultRefreshInitializer.java | 1 + .../listener/OnStateChangedListener.java | 8 ++++---- .../layout/simple/SimpleComponent.java | 7 ++++--- .../smart/refresh/layout/util/DesignUtil.java | 2 +- .../smart/refresh/layout/util/SmartUtil.java | 18 ++++++++--------- .../layout/wrapper/RefreshContentWrapper.java | 12 +++++------ .../smartrefresh/layout/ExampleUnitTest.java | 2 +- .../layout/ExampleInstrumentedTest.java | 5 +++-- refresh-layout/src/main/AndroidManifest.xml | 3 +-- .../layout/SmartRefreshLayout.java | 6 +++--- .../api/DefaultRefreshFooterCreator.java | 1 + .../api/DefaultRefreshHeaderCreator.java | 1 + .../layout/api/DefaultRefreshInitializer.java | 1 + .../layout/footer/BallPulseFooter.java | 3 ++- .../layout/header/TwoLevelHeader.java | 3 ++- .../layout/internal/InternalAbstract.java | 5 +++-- .../listener/OnStateChangedListener.java | 9 ++++----- .../smartrefresh/layout/ExampleUnitTest.java | 2 +- 82 files changed, 242 insertions(+), 200 deletions(-) diff --git a/refresh-drawable-paint/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java b/refresh-drawable-paint/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java index 056b18fa..39ad9838 100644 --- a/refresh-drawable-paint/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java +++ b/refresh-drawable-paint/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java @@ -1,13 +1,14 @@ package com.scwang.smart.drawable; import android.content.Context; -import androidx.test.platform.app.InstrumentationRegistry; + import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; import org.junit.Test; import org.junit.runner.RunWith; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Instrumentation test, which will execute on an Android device. diff --git a/refresh-drawable-path/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java b/refresh-drawable-path/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java index 056b18fa..39ad9838 100644 --- a/refresh-drawable-path/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java +++ b/refresh-drawable-path/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java @@ -1,13 +1,14 @@ package com.scwang.smart.drawable; import android.content.Context; -import androidx.test.platform.app.InstrumentationRegistry; + import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; import org.junit.Test; import org.junit.runner.RunWith; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Instrumentation test, which will execute on an Android device. diff --git a/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/PathsDrawable.java b/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/PathsDrawable.java index 1306830a..ea57d900 100644 --- a/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/PathsDrawable.java +++ b/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/PathsDrawable.java @@ -7,6 +7,7 @@ import android.graphics.Rect; import android.graphics.Region; import android.graphics.drawable.Drawable; + import androidx.annotation.NonNull; import com.scwang.smart.drawable.path.PathParser; diff --git a/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/path/PathParser.java b/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/path/PathParser.java index fcde8de7..07fa6563 100644 --- a/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/path/PathParser.java +++ b/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/path/PathParser.java @@ -16,6 +16,7 @@ import android.graphics.Matrix; import android.graphics.Path; import android.os.Build; + import androidx.annotation.NonNull; import java.util.ArrayList; diff --git a/refresh-footer-ball/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java b/refresh-footer-ball/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java index 25a30fa5..f46855d3 100644 --- a/refresh-footer-ball/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java +++ b/refresh-footer-ball/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java @@ -1,13 +1,14 @@ package com.scwang.smart.refresh.footer; import android.content.Context; -import androidx.test.platform.app.InstrumentationRegistry; + import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; import org.junit.Test; import org.junit.runner.RunWith; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Instrumented test, which will execute on an Android device. diff --git a/refresh-footer-ball/src/main/java/com/scwang/smart/refresh/footer/BallPulseFooter.java b/refresh-footer-ball/src/main/java/com/scwang/smart/refresh/footer/BallPulseFooter.java index 0db5e080..0811f6df 100644 --- a/refresh-footer-ball/src/main/java/com/scwang/smart/refresh/footer/BallPulseFooter.java +++ b/refresh-footer-ball/src/main/java/com/scwang/smart/refresh/footer/BallPulseFooter.java @@ -6,16 +6,15 @@ import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; +import android.util.AttributeSet; +import android.view.View; +import android.view.animation.AccelerateDecelerateInterpolator; import androidx.annotation.ColorInt; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.core.graphics.ColorUtils; -import android.util.AttributeSet; -import android.view.View; -import android.view.animation.AccelerateDecelerateInterpolator; - import com.scwang.smart.refresh.footer.ball.R; import com.scwang.smart.refresh.layout.api.RefreshFooter; import com.scwang.smart.refresh.layout.api.RefreshLayout; diff --git a/refresh-footer-ball/src/test/java/com/scwang/smart/refresh/footer/ExampleUnitTest.java b/refresh-footer-ball/src/test/java/com/scwang/smart/refresh/footer/ExampleUnitTest.java index 3f8e8d7a..02e49e2c 100644 --- a/refresh-footer-ball/src/test/java/com/scwang/smart/refresh/footer/ExampleUnitTest.java +++ b/refresh-footer-ball/src/test/java/com/scwang/smart/refresh/footer/ExampleUnitTest.java @@ -2,7 +2,7 @@ import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Example local unit test, which will execute on the development machine (host). diff --git a/refresh-footer-classics/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java b/refresh-footer-classics/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java index 5b7ffd41..b916efd7 100644 --- a/refresh-footer-classics/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java +++ b/refresh-footer-classics/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java @@ -1,13 +1,14 @@ package com.scwang.smart.refresh.footer; import android.content.Context; -import androidx.test.platform.app.InstrumentationRegistry; + import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; import org.junit.Test; import org.junit.runner.RunWith; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Instrumented test, which will execute on an Android device. diff --git a/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/classics/ArrowDrawable.java b/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/classics/ArrowDrawable.java index 6a121437..31d7ae3d 100644 --- a/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/classics/ArrowDrawable.java +++ b/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/classics/ArrowDrawable.java @@ -4,6 +4,7 @@ import android.graphics.Path; import android.graphics.Rect; import android.graphics.drawable.Drawable; + import androidx.annotation.NonNull; import com.scwang.smart.drawable.PaintDrawable; diff --git a/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/classics/ClassicsAbstract.java b/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/classics/ClassicsAbstract.java index 7c07bf82..9af3682d 100644 --- a/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/classics/ClassicsAbstract.java +++ b/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/classics/ClassicsAbstract.java @@ -5,18 +5,18 @@ import android.graphics.drawable.Animatable; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; -import androidx.annotation.ColorInt; - -import androidx.annotation.ColorRes; -import androidx.annotation.DrawableRes; -import androidx.annotation.NonNull; -import androidx.core.content.ContextCompat; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; +import androidx.annotation.ColorInt; +import androidx.annotation.ColorRes; +import androidx.annotation.DrawableRes; +import androidx.annotation.NonNull; +import androidx.core.content.ContextCompat; + import com.scwang.smart.drawable.PaintDrawable; import com.scwang.smart.refresh.footer.classics.R; import com.scwang.smart.refresh.layout.api.RefreshComponent; diff --git a/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/footer/ClassicsFooter.java b/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/footer/ClassicsFooter.java index 9c83486a..36e13a5a 100644 --- a/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/footer/ClassicsFooter.java +++ b/refresh-footer-classics/src/main/java/com/scwang/smart/refresh/footer/ClassicsFooter.java @@ -2,12 +2,13 @@ import android.content.Context; import android.content.res.TypedArray; -import androidx.annotation.ColorInt; -import androidx.annotation.NonNull; import android.util.AttributeSet; import android.util.TypedValue; import android.view.View; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; + import com.scwang.smart.drawable.ProgressDrawable; import com.scwang.smart.refresh.classics.ArrowDrawable; import com.scwang.smart.refresh.classics.ClassicsAbstract; diff --git a/refresh-footer-classics/src/test/java/com/scwang/smart/refresh/footer/ExampleUnitTest.java b/refresh-footer-classics/src/test/java/com/scwang/smart/refresh/footer/ExampleUnitTest.java index 3f8e8d7a..02e49e2c 100644 --- a/refresh-footer-classics/src/test/java/com/scwang/smart/refresh/footer/ExampleUnitTest.java +++ b/refresh-footer-classics/src/test/java/com/scwang/smart/refresh/footer/ExampleUnitTest.java @@ -2,7 +2,7 @@ import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Example local unit test, which will execute on the development machine (host). diff --git a/refresh-footer/src/androidTest/java/com/scwang/smartrefresh/footer/ExampleInstrumentedTest.java b/refresh-footer/src/androidTest/java/com/scwang/smartrefresh/footer/ExampleInstrumentedTest.java index 663be1d8..9b4435f4 100644 --- a/refresh-footer/src/androidTest/java/com/scwang/smartrefresh/footer/ExampleInstrumentedTest.java +++ b/refresh-footer/src/androidTest/java/com/scwang/smartrefresh/footer/ExampleInstrumentedTest.java @@ -1,13 +1,14 @@ package com.scwang.smartrefresh.footer; import android.content.Context; -import androidx.test.platform.app.InstrumentationRegistry; + import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; import org.junit.Test; import org.junit.runner.RunWith; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Instrumentation test, which will execute on an Android device. diff --git a/refresh-footer/src/main/AndroidManifest.xml b/refresh-footer/src/main/AndroidManifest.xml index a935bd95..c4245268 100644 --- a/refresh-footer/src/main/AndroidManifest.xml +++ b/refresh-footer/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/refresh-footer/src/test/java/com/scwang/smartrefresh/footer/ExampleUnitTest.java b/refresh-footer/src/test/java/com/scwang/smartrefresh/footer/ExampleUnitTest.java index 98bbe58c..db103901 100644 --- a/refresh-footer/src/test/java/com/scwang/smartrefresh/footer/ExampleUnitTest.java +++ b/refresh-footer/src/test/java/com/scwang/smartrefresh/footer/ExampleUnitTest.java @@ -1,8 +1,8 @@ -package com.scwang.smartrefreshfooter; +package com.scwang.smartrefresh.footer; import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Example local unit test, which will execute on the development machine (host). diff --git a/refresh-header-classics/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java b/refresh-header-classics/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java index 55431e28..9b40845b 100644 --- a/refresh-header-classics/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java +++ b/refresh-header-classics/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java @@ -1,13 +1,14 @@ package com.scwang.smart.refresh.header; import android.content.Context; -import androidx.test.platform.app.InstrumentationRegistry; + import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; import org.junit.Test; import org.junit.runner.RunWith; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Instrumented test, which will execute on an Android device. diff --git a/refresh-header-classics/src/main/java/com/scwang/smart/refresh/header/ClassicsHeader.java b/refresh-header-classics/src/main/java/com/scwang/smart/refresh/header/ClassicsHeader.java index 3928434c..a24b8e08 100644 --- a/refresh-header-classics/src/main/java/com/scwang/smart/refresh/header/ClassicsHeader.java +++ b/refresh-header-classics/src/main/java/com/scwang/smart/refresh/header/ClassicsHeader.java @@ -4,12 +4,6 @@ import android.content.Context; import android.content.SharedPreferences; import android.content.res.TypedArray; -import androidx.annotation.ColorInt; -import androidx.annotation.NonNull; -import androidx.fragment.app.Fragment; - -import androidx.fragment.app.FragmentActivity; -import androidx.fragment.app.FragmentManager; import android.util.AttributeSet; import android.util.TypedValue; import android.view.View; @@ -18,6 +12,12 @@ import android.widget.RelativeLayout; import android.widget.TextView; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentActivity; +import androidx.fragment.app.FragmentManager; + import com.scwang.smart.drawable.ProgressDrawable; import com.scwang.smart.refresh.classics.ArrowDrawable; import com.scwang.smart.refresh.classics.ClassicsAbstract; diff --git a/refresh-header-classics/src/test/java/com/scwang/smart/refresh/header/ExampleUnitTest.java b/refresh-header-classics/src/test/java/com/scwang/smart/refresh/header/ExampleUnitTest.java index 80b4b488..7ca27811 100644 --- a/refresh-header-classics/src/test/java/com/scwang/smart/refresh/header/ExampleUnitTest.java +++ b/refresh-header-classics/src/test/java/com/scwang/smart/refresh/header/ExampleUnitTest.java @@ -2,7 +2,7 @@ import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Example local unit test, which will execute on the development machine (host). diff --git a/refresh-header-falsify/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java b/refresh-header-falsify/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java index 55431e28..9b40845b 100644 --- a/refresh-header-falsify/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java +++ b/refresh-header-falsify/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java @@ -1,13 +1,14 @@ package com.scwang.smart.refresh.header; import android.content.Context; -import androidx.test.platform.app.InstrumentationRegistry; + import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; import org.junit.Test; import org.junit.runner.RunWith; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Instrumented test, which will execute on an Android device. diff --git a/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/FalsifyFooter.java b/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/FalsifyFooter.java index 7d5ae589..b5c9a627 100644 --- a/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/FalsifyFooter.java +++ b/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/FalsifyFooter.java @@ -1,9 +1,10 @@ package com.scwang.smart.refresh.header; import android.content.Context; -import androidx.annotation.NonNull; import android.util.AttributeSet; +import androidx.annotation.NonNull; + import com.scwang.smart.refresh.header.falsify.FalsifyAbstract; import com.scwang.smart.refresh.layout.api.RefreshFooter; import com.scwang.smart.refresh.layout.api.RefreshKernel; diff --git a/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/FalsifyHeader.java b/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/FalsifyHeader.java index 09c4933b..5ec6eb19 100644 --- a/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/FalsifyHeader.java +++ b/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/FalsifyHeader.java @@ -1,9 +1,10 @@ package com.scwang.smart.refresh.header; import android.content.Context; -import androidx.annotation.NonNull; import android.util.AttributeSet; +import androidx.annotation.NonNull; + import com.scwang.smart.refresh.header.falsify.FalsifyAbstract; import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.api.RefreshLayout; diff --git a/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/falsify/FalsifyAbstract.java b/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/falsify/FalsifyAbstract.java index bb07e6cb..9e4eb69b 100644 --- a/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/falsify/FalsifyAbstract.java +++ b/refresh-header-falsify/src/main/java/com/scwang/smart/refresh/header/falsify/FalsifyAbstract.java @@ -4,12 +4,13 @@ import android.graphics.Canvas; import android.graphics.DashPathEffect; import android.graphics.Paint; -import androidx.annotation.NonNull; import android.util.AttributeSet; import android.view.Gravity; import android.view.View; import android.widget.TextView; +import androidx.annotation.NonNull; + import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.api.RefreshKernel; import com.scwang.smart.refresh.layout.api.RefreshLayout; diff --git a/refresh-header-falsify/src/test/java/com/scwang/smart/refresh/header/ExampleUnitTest.java b/refresh-header-falsify/src/test/java/com/scwang/smart/refresh/header/ExampleUnitTest.java index 80b4b488..7ca27811 100644 --- a/refresh-header-falsify/src/test/java/com/scwang/smart/refresh/header/ExampleUnitTest.java +++ b/refresh-header-falsify/src/test/java/com/scwang/smart/refresh/header/ExampleUnitTest.java @@ -2,7 +2,7 @@ import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Example local unit test, which will execute on the development machine (host). diff --git a/refresh-header-material/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java b/refresh-header-material/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java index 55431e28..9b40845b 100644 --- a/refresh-header-material/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java +++ b/refresh-header-material/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java @@ -1,13 +1,14 @@ package com.scwang.smart.refresh.header; import android.content.Context; -import androidx.test.platform.app.InstrumentationRegistry; + import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; import org.junit.Test; import org.junit.runner.RunWith; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Instrumented test, which will execute on an Android device. diff --git a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java index 0b72f8e5..74078c41 100644 --- a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java +++ b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java @@ -7,18 +7,18 @@ import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Path; -import androidx.annotation.ColorInt; -import androidx.annotation.ColorRes; -import androidx.annotation.NonNull; - -import androidx.annotation.VisibleForTesting; -import androidx.core.content.ContextCompat; import android.util.AttributeSet; import android.util.DisplayMetrics; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; +import androidx.annotation.ColorInt; +import androidx.annotation.ColorRes; +import androidx.annotation.NonNull; +import androidx.annotation.VisibleForTesting; +import androidx.core.content.ContextCompat; + import com.scwang.smart.refresh.header.material.CircleImageView; import com.scwang.smart.refresh.header.material.MaterialProgressDrawable; import com.scwang.smart.refresh.header.material.R; diff --git a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/CircleImageView.java b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/CircleImageView.java index d1f0c215..2dd76fec 100644 --- a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/CircleImageView.java +++ b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/CircleImageView.java @@ -25,10 +25,11 @@ import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.OvalShape; import android.os.Build; -import androidx.annotation.ColorInt; import android.view.View; import android.widget.ImageView; +import androidx.annotation.ColorInt; + /** * Private class created to work around issues with AnimationListeners being diff --git a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/MaterialProgressDrawable.java b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/MaterialProgressDrawable.java index 5c3805c9..eb2f8df9 100644 --- a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/MaterialProgressDrawable.java +++ b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/MaterialProgressDrawable.java @@ -27,12 +27,6 @@ import android.graphics.RectF; import android.graphics.drawable.Animatable; import android.graphics.drawable.Drawable; -import androidx.annotation.ColorInt; - -import androidx.annotation.IntDef; -import androidx.annotation.NonNull; -import androidx.interpolator.view.animation.FastOutSlowInInterpolator; - import android.util.DisplayMetrics; import android.view.View; import android.view.animation.Animation; @@ -40,6 +34,11 @@ import android.view.animation.LinearInterpolator; import android.view.animation.Transformation; +import androidx.annotation.ColorInt; +import androidx.annotation.IntDef; +import androidx.annotation.NonNull; +import androidx.interpolator.view.animation.FastOutSlowInInterpolator; + import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; diff --git a/refresh-header-material/src/test/java/com/scwang/smart/refresh/header/ExampleUnitTest.java b/refresh-header-material/src/test/java/com/scwang/smart/refresh/header/ExampleUnitTest.java index 80b4b488..7ca27811 100644 --- a/refresh-header-material/src/test/java/com/scwang/smart/refresh/header/ExampleUnitTest.java +++ b/refresh-header-material/src/test/java/com/scwang/smart/refresh/header/ExampleUnitTest.java @@ -2,7 +2,7 @@ import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Example local unit test, which will execute on the development machine (host). diff --git a/refresh-header-radar/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java b/refresh-header-radar/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java index 55431e28..9b40845b 100644 --- a/refresh-header-radar/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java +++ b/refresh-header-radar/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java @@ -1,13 +1,14 @@ package com.scwang.smart.refresh.header; import android.content.Context; -import androidx.test.platform.app.InstrumentationRegistry; + import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; import org.junit.Test; import org.junit.runner.RunWith; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Instrumented test, which will execute on an Android device. diff --git a/refresh-header-radar/src/main/java/com/scwang/smart/refresh/header/BezierRadarHeader.java b/refresh-header-radar/src/main/java/com/scwang/smart/refresh/header/BezierRadarHeader.java index 7a0b1c01..92650ff3 100644 --- a/refresh-header-radar/src/main/java/com/scwang/smart/refresh/header/BezierRadarHeader.java +++ b/refresh-header-radar/src/main/java/com/scwang/smart/refresh/header/BezierRadarHeader.java @@ -9,15 +9,16 @@ import android.graphics.Paint; import android.graphics.Path; import android.graphics.RectF; -import androidx.annotation.ColorInt; -import androidx.annotation.ColorRes; -import androidx.annotation.NonNull; -import androidx.core.content.ContextCompat; import android.util.AttributeSet; import android.view.View; import android.view.animation.AccelerateDecelerateInterpolator; import android.view.animation.Interpolator; +import androidx.annotation.ColorInt; +import androidx.annotation.ColorRes; +import androidx.annotation.NonNull; +import androidx.core.content.ContextCompat; + import com.scwang.smart.refresh.header.radar.R; import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.api.RefreshLayout; diff --git a/refresh-header-radar/src/test/java/com/scwang/smart/refresh/header/ExampleUnitTest.java b/refresh-header-radar/src/test/java/com/scwang/smart/refresh/header/ExampleUnitTest.java index 80b4b488..7ca27811 100644 --- a/refresh-header-radar/src/test/java/com/scwang/smart/refresh/header/ExampleUnitTest.java +++ b/refresh-header-radar/src/test/java/com/scwang/smart/refresh/header/ExampleUnitTest.java @@ -2,7 +2,7 @@ import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Example local unit test, which will execute on the development machine (host). diff --git a/refresh-header-two-level/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java b/refresh-header-two-level/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java index 55431e28..9b40845b 100644 --- a/refresh-header-two-level/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java +++ b/refresh-header-two-level/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java @@ -1,13 +1,14 @@ package com.scwang.smart.refresh.header; import android.content.Context; -import androidx.test.platform.app.InstrumentationRegistry; + import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; import org.junit.Test; import org.junit.runner.RunWith; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Instrumented test, which will execute on an Android device. diff --git a/refresh-header-two-level/src/main/java/com/scwang/smart/refresh/header/TwoLevelHeader.java b/refresh-header-two-level/src/main/java/com/scwang/smart/refresh/header/TwoLevelHeader.java index a4051372..9fb9d88f 100644 --- a/refresh-header-two-level/src/main/java/com/scwang/smart/refresh/header/TwoLevelHeader.java +++ b/refresh-header-two-level/src/main/java/com/scwang/smart/refresh/header/TwoLevelHeader.java @@ -2,24 +2,24 @@ import android.content.Context; import android.content.res.TypedArray; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.core.view.NestedScrollingParent2; - import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.view.NestedScrollingParent2; + import com.scwang.smart.refresh.header.listener.OnTwoLevelListener; import com.scwang.smart.refresh.header.two.level.R; -import com.scwang.smart.refresh.layout.simple.SimpleComponent; -import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.api.RefreshComponent; +import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.api.RefreshKernel; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.RefreshState; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; import com.scwang.smart.refresh.layout.listener.OnStateChangedListener; +import com.scwang.smart.refresh.layout.simple.SimpleComponent; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; diff --git a/refresh-header-two-level/src/test/java/com/scwang/smart/refresh/header/ExampleUnitTest.java b/refresh-header-two-level/src/test/java/com/scwang/smart/refresh/header/ExampleUnitTest.java index 80b4b488..7ca27811 100644 --- a/refresh-header-two-level/src/test/java/com/scwang/smart/refresh/header/ExampleUnitTest.java +++ b/refresh-header-two-level/src/test/java/com/scwang/smart/refresh/header/ExampleUnitTest.java @@ -2,7 +2,7 @@ import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Example local unit test, which will execute on the development machine (host). diff --git a/refresh-header/src/androidTest/java/com/scwang/smartrefresh/header/ExampleInstrumentedTest.java b/refresh-header/src/androidTest/java/com/scwang/smartrefresh/header/ExampleInstrumentedTest.java index 8c0766c4..17537b00 100644 --- a/refresh-header/src/androidTest/java/com/scwang/smartrefresh/header/ExampleInstrumentedTest.java +++ b/refresh-header/src/androidTest/java/com/scwang/smartrefresh/header/ExampleInstrumentedTest.java @@ -1,13 +1,14 @@ package com.scwang.smartrefresh.header; import android.content.Context; -import androidx.test.platform.app.InstrumentationRegistry; + import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; import org.junit.Test; import org.junit.runner.RunWith; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Instrumentation test, which will execute on an Android device. diff --git a/refresh-header/src/main/AndroidManifest.xml b/refresh-header/src/main/AndroidManifest.xml index 5e8e6b96..a6a27115 100644 --- a/refresh-header/src/main/AndroidManifest.xml +++ b/refresh-header/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/BezierCircleHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/BezierCircleHeader.java index 81018cec..930685cc 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/BezierCircleHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/BezierCircleHeader.java @@ -6,19 +6,20 @@ import android.graphics.Paint; import android.graphics.Path; import android.graphics.RectF; -import androidx.annotation.ColorInt; -import androidx.annotation.NonNull; -import androidx.core.graphics.ColorUtils; import android.util.AttributeSet; import android.view.View; import android.view.animation.AccelerateInterpolator; import android.view.animation.DecelerateInterpolator; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; +import androidx.core.graphics.ColorUtils; + +import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.api.RefreshKernel; import com.scwang.smart.refresh.layout.api.RefreshLayout; -import com.scwang.smart.refresh.layout.simple.SimpleComponent; -import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; +import com.scwang.smart.refresh.layout.simple.SimpleComponent; import com.scwang.smart.refresh.layout.util.SmartUtil; /** diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/DeliveryHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/DeliveryHeader.java index 2886166e..792d2323 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/DeliveryHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/DeliveryHeader.java @@ -4,19 +4,20 @@ import android.graphics.Canvas; import android.graphics.Rect; import android.graphics.drawable.Drawable; +import android.util.AttributeSet; +import android.view.View; + import androidx.annotation.ColorInt; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import android.util.AttributeSet; -import android.view.View; import com.scwang.smart.drawable.PathsDrawable; +import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.api.RefreshKernel; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.RefreshState; -import com.scwang.smart.refresh.layout.simple.SimpleComponent; -import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; +import com.scwang.smart.refresh.layout.simple.SimpleComponent; import com.scwang.smart.refresh.layout.util.SmartUtil; /** diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/DropBoxHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/DropBoxHeader.java index f5f32d73..e86663ea 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/DropBoxHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/DropBoxHeader.java @@ -10,21 +10,22 @@ import android.graphics.Path; import android.graphics.Rect; import android.graphics.drawable.Drawable; +import android.util.AttributeSet; +import android.view.View; +import android.view.animation.AccelerateInterpolator; + import androidx.annotation.ColorInt; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.core.graphics.ColorUtils; -import android.util.AttributeSet; -import android.view.View; -import android.view.animation.AccelerateInterpolator; import com.scwang.smart.drawable.PathsDrawable; +import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.api.RefreshKernel; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.RefreshState; -import com.scwang.smart.refresh.layout.simple.SimpleComponent; -import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; +import com.scwang.smart.refresh.layout.simple.SimpleComponent; import com.scwang.smart.refresh.layout.util.SmartUtil; import com.scwang.smartrefresh.header.R; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FlyRefreshHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FlyRefreshHeader.java index 84b89464..9dafd32c 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FlyRefreshHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FlyRefreshHeader.java @@ -6,16 +6,16 @@ import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.content.Context; -import androidx.annotation.ColorInt; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.core.view.animation.PathInterpolatorCompat; - import android.util.AttributeSet; import android.view.View; import android.view.animation.AccelerateInterpolator; import android.view.animation.DecelerateInterpolator; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.view.animation.PathInterpolatorCompat; + import com.scwang.smart.refresh.header.flyrefresh.MountainSceneView; import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.api.RefreshKernel; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameBattleCityHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameBattleCityHeader.java index e355d34a..e6801191 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameBattleCityHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameBattleCityHeader.java @@ -4,11 +4,12 @@ import android.graphics.Canvas; import android.graphics.Point; import android.graphics.RectF; -import androidx.annotation.NonNull; import android.util.AttributeSet; import android.util.SparseArray; import android.view.View; +import androidx.annotation.NonNull; + import com.scwang.smart.refresh.header.fungame.FunGameView; import com.scwang.smart.refresh.layout.api.RefreshKernel; import com.scwang.smart.refresh.layout.util.SmartUtil; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameHitBlockHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameHitBlockHeader.java index 7b248e7c..86d07fdb 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameHitBlockHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameHitBlockHeader.java @@ -5,11 +5,12 @@ import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Point; -import androidx.annotation.NonNull; -import androidx.core.graphics.ColorUtils; import android.util.AttributeSet; import android.view.View; +import androidx.annotation.NonNull; +import androidx.core.graphics.ColorUtils; + import com.scwang.smart.refresh.header.fungame.FunGameView; import com.scwang.smart.refresh.layout.api.RefreshKernel; import com.scwang.smartrefresh.header.R; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/PhoenixHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/PhoenixHeader.java index 5459ba13..60647265 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/PhoenixHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/PhoenixHeader.java @@ -7,8 +7,6 @@ import android.graphics.Matrix; import android.graphics.Rect; import android.graphics.drawable.Drawable; -import androidx.annotation.ColorInt; -import androidx.annotation.NonNull; import android.util.AttributeSet; import android.view.View; import android.view.animation.Animation; @@ -16,12 +14,15 @@ import android.view.animation.LinearInterpolator; import android.view.animation.Transformation; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; + import com.scwang.smart.drawable.PathsDrawable; import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.api.RefreshKernel; import com.scwang.smart.refresh.layout.api.RefreshLayout; -import com.scwang.smart.refresh.layout.simple.SimpleComponent; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; +import com.scwang.smart.refresh.layout.simple.SimpleComponent; import com.scwang.smart.refresh.layout.util.SmartUtil; import com.scwang.smartrefresh.header.R; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/StoreHouseHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/StoreHouseHeader.java index 91e43a76..136786e1 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/StoreHouseHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/StoreHouseHeader.java @@ -7,14 +7,15 @@ import android.graphics.Color; import android.graphics.Matrix; import android.graphics.PointF; -import androidx.annotation.ColorInt; -import androidx.annotation.NonNull; import android.util.AttributeSet; import android.view.View; import android.view.animation.AccelerateInterpolator; import android.view.animation.Animation; import android.view.animation.Transformation; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; + import com.scwang.smart.refresh.header.storehouse.StoreHouseBarItem; import com.scwang.smart.refresh.header.storehouse.StoreHousePath; import com.scwang.smart.refresh.layout.api.RefreshHeader; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/TaurusHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/TaurusHeader.java index 4b9a47c8..8281a494 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/TaurusHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/TaurusHeader.java @@ -6,8 +6,6 @@ import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.drawable.Drawable; -import androidx.annotation.ColorInt; -import androidx.annotation.NonNull; import android.util.AttributeSet; import android.view.View; import android.view.animation.AccelerateDecelerateInterpolator; @@ -16,12 +14,15 @@ import android.view.animation.Interpolator; import android.view.animation.Transformation; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; + import com.scwang.smart.drawable.PathsDrawable; import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.api.RefreshKernel; import com.scwang.smart.refresh.layout.api.RefreshLayout; -import com.scwang.smart.refresh.layout.simple.SimpleComponent; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; +import com.scwang.smart.refresh.layout.simple.SimpleComponent; import com.scwang.smart.refresh.layout.util.SmartUtil; import com.scwang.smartrefresh.header.R; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaterDropHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaterDropHeader.java index b8230843..5c13017e 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaterDropHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaterDropHeader.java @@ -5,13 +5,14 @@ import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; -import androidx.annotation.ColorInt; -import androidx.annotation.NonNull; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; + import com.scwang.smart.drawable.ProgressDrawable; import com.scwang.smart.refresh.header.material.MaterialProgressDrawable; import com.scwang.smart.refresh.header.waterdrop.WaterDropView; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java index f1b94c07..5510eba2 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java @@ -5,11 +5,6 @@ import android.content.res.Resources; import android.content.res.TypedArray; import android.graphics.drawable.Drawable; -import androidx.annotation.ColorInt; -import androidx.annotation.IdRes; -import androidx.annotation.NonNull; -import androidx.appcompat.widget.AppCompatImageView; -import androidx.core.content.ContextCompat; import android.util.AttributeSet; import android.util.DisplayMetrics; import android.view.View; @@ -18,13 +13,19 @@ import android.view.animation.Animation; import android.view.animation.Transformation; +import androidx.annotation.ColorInt; +import androidx.annotation.IdRes; +import androidx.annotation.NonNull; +import androidx.appcompat.widget.AppCompatImageView; +import androidx.core.content.ContextCompat; + import com.scwang.smart.refresh.header.material.MaterialProgressDrawable; import com.scwang.smart.refresh.header.waveswipe.WaveView; import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.RefreshState; -import com.scwang.smart.refresh.layout.simple.SimpleComponent; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; +import com.scwang.smart.refresh.layout.simple.SimpleComponent; import com.scwang.smart.refresh.layout.util.SmartUtil; import com.scwang.smartrefresh.header.R; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/flyrefresh/MountainSceneView.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/flyrefresh/MountainSceneView.java index 7dfcc1b1..ccda62c2 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/flyrefresh/MountainSceneView.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/flyrefresh/MountainSceneView.java @@ -7,16 +7,15 @@ import android.graphics.Paint; import android.graphics.Path; import android.graphics.RectF; +import android.util.AttributeSet; +import android.view.View; +import android.view.animation.Interpolator; import androidx.annotation.ColorInt; import androidx.annotation.NonNull; import androidx.core.graphics.ColorUtils; import androidx.core.view.animation.PathInterpolatorCompat; -import android.util.AttributeSet; -import android.view.View; -import android.view.animation.Interpolator; - import com.scwang.smartrefresh.header.R; /** diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameBase.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameBase.java index a57980ff..459ed19d 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameBase.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameBase.java @@ -2,19 +2,20 @@ import android.annotation.SuppressLint; import android.content.Context; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + import com.scwang.smart.refresh.layout.api.RefreshContent; import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.api.RefreshKernel; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.RefreshState; -import com.scwang.smart.refresh.layout.simple.SimpleComponent; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; +import com.scwang.smart.refresh.layout.simple.SimpleComponent; import com.scwang.smart.refresh.layout.util.SmartUtil; import static android.view.MotionEvent.ACTION_MASK; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameView.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameView.java index bcc674e0..88db598f 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameView.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameView.java @@ -9,9 +9,6 @@ import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; -import androidx.annotation.ColorInt; -import androidx.annotation.NonNull; -import androidx.core.graphics.ColorUtils; import android.text.TextPaint; import android.util.AttributeSet; import android.util.DisplayMetrics; @@ -22,6 +19,10 @@ import android.widget.RelativeLayout; import android.widget.TextView; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; +import androidx.core.graphics.ColorUtils; + import com.scwang.smart.refresh.layout.api.RefreshKernel; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.RefreshState; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/waterdrop/WaterDropView.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/waterdrop/WaterDropView.java index 8b065b66..a06a7a10 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/waterdrop/WaterDropView.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/waterdrop/WaterDropView.java @@ -6,12 +6,12 @@ import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; -import androidx.annotation.ColorInt; -import androidx.annotation.NonNull; - import android.view.View; import android.view.animation.DecelerateInterpolator; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; + import com.scwang.smartrefresh.layout.util.SmartUtil; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/waveswipe/WaveView.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/waveswipe/WaveView.java index b96519c0..13eba45a 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/waveswipe/WaveView.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/waveswipe/WaveView.java @@ -23,14 +23,14 @@ import android.graphics.Paint; import android.graphics.Path; import android.graphics.RectF; -import androidx.annotation.ColorInt; -import androidx.annotation.NonNull; - import android.view.View; import android.view.ViewTreeObserver; import android.view.animation.AccelerateDecelerateInterpolator; import android.view.animation.BounceInterpolator; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; + /** * @author amyu *

diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/DeliveryHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/DeliveryHeader.java index 2ba7e497..044791e4 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/DeliveryHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/DeliveryHeader.java @@ -1,9 +1,10 @@ package com.scwang.smartrefresh.header; import android.content.Context; -import androidx.annotation.Nullable; import android.util.AttributeSet; +import androidx.annotation.Nullable; + import com.scwang.smartrefresh.layout.api.RefreshHeader; /** diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/DropBoxHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/DropBoxHeader.java index 28bb1447..ce0967ff 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/DropBoxHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/DropBoxHeader.java @@ -1,9 +1,10 @@ package com.scwang.smartrefresh.header; import android.content.Context; -import androidx.annotation.Nullable; import android.util.AttributeSet; +import androidx.annotation.Nullable; + import com.scwang.smartrefresh.layout.api.RefreshHeader; /** diff --git a/refresh-header/src/test/java/com/scwang/smartrefresh/header/ExampleUnitTest.java b/refresh-header/src/test/java/com/scwang/smartrefresh/header/ExampleUnitTest.java index ccffdf53..597fc065 100644 --- a/refresh-header/src/test/java/com/scwang/smartrefresh/header/ExampleUnitTest.java +++ b/refresh-header/src/test/java/com/scwang/smartrefresh/header/ExampleUnitTest.java @@ -6,7 +6,7 @@ import java.util.Date; import java.util.Locale; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Example local unit test, which will execute on the development machine (host). diff --git a/refresh-layout-kernel/src/androidTest/java/com/scwang/smart/refresh/layout/ExampleInstrumentedTest.java b/refresh-layout-kernel/src/androidTest/java/com/scwang/smart/refresh/layout/ExampleInstrumentedTest.java index 520e27f6..8b5be6f8 100644 --- a/refresh-layout-kernel/src/androidTest/java/com/scwang/smart/refresh/layout/ExampleInstrumentedTest.java +++ b/refresh-layout-kernel/src/androidTest/java/com/scwang/smart/refresh/layout/ExampleInstrumentedTest.java @@ -1,13 +1,14 @@ package com.scwang.smart.refresh.layout; import android.content.Context; -import androidx.test.platform.app.InstrumentationRegistry; + import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; import org.junit.Test; import org.junit.runner.RunWith; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Instrumentation test, which will execute on an Android device. diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java index 075142e3..3f84df22 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java @@ -27,6 +27,16 @@ import android.widget.TextView; import android.widget.Toast; +import androidx.annotation.ColorInt; +import androidx.annotation.ColorRes; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; +import androidx.core.view.NestedScrollingChildHelper; +import androidx.core.view.NestedScrollingParent; +import androidx.core.view.NestedScrollingParentHelper; +import androidx.core.view.ViewCompat; + import com.scwang.smart.refresh.layout.api.RefreshComponent; import com.scwang.smart.refresh.layout.api.RefreshContent; import com.scwang.smart.refresh.layout.api.RefreshFooter; @@ -64,16 +74,6 @@ import static com.scwang.smart.refresh.layout.util.SmartUtil.isContentView; import static java.lang.System.currentTimeMillis; -import androidx.annotation.ColorInt; -import androidx.annotation.ColorRes; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.core.content.ContextCompat; -import androidx.core.view.NestedScrollingChildHelper; -import androidx.core.view.NestedScrollingParent; -import androidx.core.view.NestedScrollingParentHelper; -import androidx.core.view.ViewCompat; - /** * 智能刷新布局 * Intelligent RefreshLayout diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java index aecd104c..fff11584 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java @@ -1,18 +1,18 @@ package com.scwang.smart.refresh.layout.api; -import static androidx.annotation.RestrictTo.Scope.LIBRARY; -import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP; -import static androidx.annotation.RestrictTo.Scope.SUBCLASSES; +import android.view.View; import androidx.annotation.ColorInt; import androidx.annotation.NonNull; import androidx.annotation.RestrictTo; -import android.view.View; - import com.scwang.smart.refresh.layout.constant.SpinnerStyle; import com.scwang.smart.refresh.layout.listener.OnStateChangedListener; +import static androidx.annotation.RestrictTo.Scope.LIBRARY; +import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP; +import static androidx.annotation.RestrictTo.Scope.SUBCLASSES; + /** * 刷新组件 diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshContent.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshContent.java index af592b1e..47cb3200 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshContent.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshContent.java @@ -1,10 +1,11 @@ package com.scwang.smart.refresh.layout.api; import android.animation.ValueAnimator.AnimatorUpdateListener; -import androidx.annotation.NonNull; import android.view.MotionEvent; import android.view.View; +import androidx.annotation.NonNull; + import com.scwang.smart.refresh.layout.listener.ScrollBoundaryDecider; /** diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshFooter.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshFooter.java index b57745f8..b7c866cc 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshFooter.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshFooter.java @@ -1,12 +1,12 @@ package com.scwang.smart.refresh.layout.api; +import androidx.annotation.RestrictTo; + import static androidx.annotation.RestrictTo.Scope.LIBRARY; import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP; import static androidx.annotation.RestrictTo.Scope.SUBCLASSES; -import androidx.annotation.RestrictTo; - /** * 刷新底部 * Created by scwang on 2017/5/26. diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshKernel.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshKernel.java index eac2cf2f..30967a6f 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshKernel.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshKernel.java @@ -2,6 +2,7 @@ import android.animation.Animator; import android.animation.ValueAnimator; + import androidx.annotation.NonNull; import com.scwang.smart.refresh.layout.constant.RefreshState; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshLayout.java index 2dfb49ef..c06af704 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshLayout.java @@ -1,14 +1,15 @@ package com.scwang.smart.refresh.layout.api; +import android.view.View; +import android.view.ViewGroup; +import android.view.animation.Interpolator; + import androidx.annotation.ColorInt; import androidx.annotation.ColorRes; import androidx.annotation.FloatRange; import androidx.annotation.IdRes; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import android.view.View; -import android.view.ViewGroup; -import android.view.animation.Interpolator; import com.scwang.smart.refresh.layout.constant.RefreshState; import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshFooterCreator.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshFooterCreator.java index 7bf7a736..71257dad 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshFooterCreator.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshFooterCreator.java @@ -1,6 +1,7 @@ package com.scwang.smart.refresh.layout.listener; import android.content.Context; + import androidx.annotation.NonNull; import com.scwang.smart.refresh.layout.api.RefreshFooter; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshHeaderCreator.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshHeaderCreator.java index 85210553..cc68ad72 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshHeaderCreator.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshHeaderCreator.java @@ -1,6 +1,7 @@ package com.scwang.smart.refresh.layout.listener; import android.content.Context; + import androidx.annotation.NonNull; import com.scwang.smart.refresh.layout.api.RefreshHeader; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshInitializer.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshInitializer.java index 4782036b..1da630da 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshInitializer.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/DefaultRefreshInitializer.java @@ -1,6 +1,7 @@ package com.scwang.smart.refresh.layout.listener; import android.content.Context; + import androidx.annotation.NonNull; import com.scwang.smart.refresh.layout.api.RefreshLayout; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/OnStateChangedListener.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/OnStateChangedListener.java index 7cd38111..b4ad7c92 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/OnStateChangedListener.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/OnStateChangedListener.java @@ -1,16 +1,16 @@ package com.scwang.smart.refresh.layout.listener; -import static androidx.annotation.RestrictTo.Scope.LIBRARY; -import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP; -import static androidx.annotation.RestrictTo.Scope.SUBCLASSES; - import androidx.annotation.NonNull; import androidx.annotation.RestrictTo; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.RefreshState; +import static androidx.annotation.RestrictTo.Scope.LIBRARY; +import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP; +import static androidx.annotation.RestrictTo.Scope.SUBCLASSES; + /** * 刷新状态改变监听器 diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java index 66a99dc5..c699a2e7 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/simple/SimpleComponent.java @@ -2,14 +2,15 @@ import android.annotation.SuppressLint; import android.content.Context; -import androidx.annotation.ColorInt; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.widget.RelativeLayout; +import androidx.annotation.ColorInt; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + import com.scwang.smart.refresh.layout.SmartRefreshLayout; import com.scwang.smart.refresh.layout.api.RefreshComponent; import com.scwang.smart.refresh.layout.api.RefreshFooter; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/DesignUtil.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/DesignUtil.java index 2fc58b52..7e578fe2 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/DesignUtil.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/DesignUtil.java @@ -1,11 +1,11 @@ package com.scwang.smart.refresh.layout.util; -import com.google.android.material.appbar.AppBarLayout; import android.view.View; import android.view.ViewGroup; import androidx.coordinatorlayout.widget.CoordinatorLayout; +import com.google.android.material.appbar.AppBarLayout; import com.scwang.smart.refresh.layout.api.RefreshKernel; import com.scwang.smart.refresh.layout.listener.CoordinatorLayoutListener; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/SmartUtil.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/SmartUtil.java index 080a31a4..3adce509 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/SmartUtil.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/SmartUtil.java @@ -3,15 +3,6 @@ import android.content.res.Resources; import android.graphics.PointF; import android.os.Build; -import androidx.annotation.NonNull; - -import androidx.core.view.NestedScrollingChild; -import androidx.core.view.NestedScrollingParent; -import androidx.core.view.ScrollingView; -import androidx.viewpager.widget.ViewPager; -import androidx.viewpager2.widget.ViewPager2; -import androidx.core.widget.NestedScrollView; -import androidx.recyclerview.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import android.view.animation.Interpolator; @@ -20,6 +11,15 @@ import android.widget.ListView; import android.widget.ScrollView; +import androidx.annotation.NonNull; +import androidx.core.view.NestedScrollingChild; +import androidx.core.view.NestedScrollingParent; +import androidx.core.view.ScrollingView; +import androidx.core.widget.NestedScrollView; +import androidx.recyclerview.widget.RecyclerView; +import androidx.viewpager.widget.ViewPager; +import androidx.viewpager2.widget.ViewPager2; + import com.scwang.smart.refresh.layout.api.RefreshComponent; import com.scwang.smart.refresh.layout.kernel.R; diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/wrapper/RefreshContentWrapper.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/wrapper/RefreshContentWrapper.java index d3710a2b..5e154f11 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/wrapper/RefreshContentWrapper.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/wrapper/RefreshContentWrapper.java @@ -3,12 +3,6 @@ import android.animation.ValueAnimator; import android.animation.ValueAnimator.AnimatorUpdateListener; import android.graphics.PointF; -import androidx.annotation.NonNull; - -import androidx.core.view.NestedScrollingChild; -import androidx.core.view.NestedScrollingParent; -import androidx.viewpager.widget.ViewPager; -import androidx.viewpager2.widget.ViewPager2; import android.view.Gravity; import android.view.MotionEvent; import android.view.View; @@ -17,6 +11,12 @@ import android.widget.FrameLayout; import android.widget.Space; +import androidx.annotation.NonNull; +import androidx.core.view.NestedScrollingChild; +import androidx.core.view.NestedScrollingParent; +import androidx.viewpager.widget.ViewPager; +import androidx.viewpager2.widget.ViewPager2; + import com.scwang.smart.refresh.layout.api.RefreshContent; import com.scwang.smart.refresh.layout.api.RefreshKernel; import com.scwang.smart.refresh.layout.kernel.R; diff --git a/refresh-layout-kernel/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java b/refresh-layout-kernel/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java index 1bc7ef8a..249d273b 100644 --- a/refresh-layout-kernel/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java +++ b/refresh-layout-kernel/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java @@ -2,7 +2,7 @@ import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Example local unit test, which will execute on the development machine (host). diff --git a/refresh-layout/src/androidTest/java/com/scwang/smartrefresh/layout/ExampleInstrumentedTest.java b/refresh-layout/src/androidTest/java/com/scwang/smartrefresh/layout/ExampleInstrumentedTest.java index 82b1ee6b..7b99ebc9 100644 --- a/refresh-layout/src/androidTest/java/com/scwang/smartrefresh/layout/ExampleInstrumentedTest.java +++ b/refresh-layout/src/androidTest/java/com/scwang/smartrefresh/layout/ExampleInstrumentedTest.java @@ -1,13 +1,14 @@ package com.scwang.smartrefresh.layout; import android.content.Context; -import androidx.test.platform.app.InstrumentationRegistry; + import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; import org.junit.Test; import org.junit.runner.RunWith; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Instrumentation test, which will execute on an Android device. diff --git a/refresh-layout/src/main/AndroidManifest.xml b/refresh-layout/src/main/AndroidManifest.xml index 3d274dd7..9d89561f 100644 --- a/refresh-layout/src/main/AndroidManifest.xml +++ b/refresh-layout/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java index 5c4182ad..ab7b104d 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java @@ -2,12 +2,12 @@ import android.annotation.SuppressLint; import android.content.Context; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import android.util.AttributeSet; import android.view.View; -import com.scwang.smart.refresh.header.ClassicsHeader; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + import com.scwang.smartrefresh.layout.api.DefaultRefreshFooterCreator; import com.scwang.smartrefresh.layout.api.DefaultRefreshHeaderCreator; import com.scwang.smartrefresh.layout.api.DefaultRefreshInitializer; diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshFooterCreator.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshFooterCreator.java index 0cbcfc80..78b742f8 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshFooterCreator.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshFooterCreator.java @@ -1,6 +1,7 @@ package com.scwang.smartrefresh.layout.api; import android.content.Context; + import androidx.annotation.NonNull; /** diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshHeaderCreator.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshHeaderCreator.java index 4a90695c..691673f3 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshHeaderCreator.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshHeaderCreator.java @@ -1,6 +1,7 @@ package com.scwang.smartrefresh.layout.api; import android.content.Context; + import androidx.annotation.NonNull; /** diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshInitializer.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshInitializer.java index 3d7bcab0..e206d916 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshInitializer.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshInitializer.java @@ -1,6 +1,7 @@ package com.scwang.smartrefresh.layout.api; import android.content.Context; + import androidx.annotation.NonNull; /** diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/BallPulseFooter.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/BallPulseFooter.java index 4cfa9bdc..3a46479e 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/BallPulseFooter.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/BallPulseFooter.java @@ -1,9 +1,10 @@ package com.scwang.smartrefresh.layout.footer; import android.content.Context; -import androidx.annotation.Nullable; import android.util.AttributeSet; +import androidx.annotation.Nullable; + import com.scwang.smart.refresh.layout.constant.SpinnerStyle; import com.scwang.smartrefresh.layout.api.RefreshFooter; diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java index 030a6da3..77aaed3a 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java @@ -1,9 +1,10 @@ package com.scwang.smartrefresh.layout.header; import android.content.Context; +import android.util.AttributeSet; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import android.util.AttributeSet; import com.scwang.smartrefresh.layout.api.OnTwoLevelListener; import com.scwang.smartrefresh.layout.api.RefreshHeader; diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/InternalAbstract.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/InternalAbstract.java index b9e0c926..baf0f695 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/InternalAbstract.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/InternalAbstract.java @@ -1,11 +1,12 @@ package com.scwang.smartrefresh.layout.internal; import android.content.Context; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import android.util.AttributeSet; import android.view.View; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + import com.scwang.smart.refresh.layout.simple.SimpleComponent; import com.scwang.smartrefresh.layout.api.RefreshInternal; diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnStateChangedListener.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnStateChangedListener.java index d15d186d..71b78e5a 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnStateChangedListener.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnStateChangedListener.java @@ -1,17 +1,16 @@ package com.scwang.smartrefresh.layout.listener; -import static androidx.annotation.RestrictTo.Scope.LIBRARY; -import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP; -import static androidx.annotation.RestrictTo.Scope.SUBCLASSES; - import androidx.annotation.NonNull; import androidx.annotation.RestrictTo; - import com.scwang.smartrefresh.layout.api.RefreshLayout; import com.scwang.smartrefresh.layout.constant.RefreshState; +import static androidx.annotation.RestrictTo.Scope.LIBRARY; +import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP; +import static androidx.annotation.RestrictTo.Scope.SUBCLASSES; + /** * 刷新状态改变监听器 * Created by scwang on 2017/5/26. diff --git a/refresh-layout/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java b/refresh-layout/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java index 1bc7ef8a..249d273b 100644 --- a/refresh-layout/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java +++ b/refresh-layout/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java @@ -2,7 +2,7 @@ import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Example local unit test, which will execute on the development machine (host). From 9a798b3b81754c2b239c3e39df1424a77a4b9774 Mon Sep 17 00:00:00 2001 From: wsc Date: Fri, 10 Nov 2023 23:10:23 +0800 Subject: [PATCH 47/67] =?UTF-8?q?=E5=BA=93=E4=BB=A3=E7=A0=81=E8=A7=84?= =?UTF-8?q?=E8=8C=83=E4=BD=BF=E7=94=A8lambda=E8=A1=A8=E8=BE=BE=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../drawable/ExampleInstrumentedTest.java | 2 +- .../smart/drawable/ExampleUnitTest.java | 2 +- .../drawable/ExampleInstrumentedTest.java | 2 +- .../smart/drawable/path/PathParser.java | 2 + .../smart/drawable/ExampleUnitTest.java | 2 +- .../footer/ExampleInstrumentedTest.java | 2 +- .../footer/ExampleInstrumentedTest.java | 2 +- .../footer/ExampleInstrumentedTest.java | 2 +- .../smartrefresh/footer/ExampleUnitTest.java | 2 +- .../header/ExampleInstrumentedTest.java | 2 +- .../smart/refresh/header/ClassicsHeader.java | 12 +- .../header/ExampleInstrumentedTest.java | 2 +- .../header/ExampleInstrumentedTest.java | 2 +- .../header/material/CircleImageView.java | 103 +----------------- .../material/MaterialProgressDrawable.java | 13 +-- .../header/ExampleInstrumentedTest.java | 2 +- .../header/ExampleInstrumentedTest.java | 2 +- .../header/ExampleInstrumentedTest.java | 2 +- .../refresh/header/BezierCircleHeader.java | 11 +- .../smart/refresh/header/DropBoxHeader.java | 36 +++--- .../refresh/header/FlyRefreshHeader.java | 7 +- .../smart/refresh/header/WaveSwipeHeader.java | 11 +- .../header/waterdrop/WaterDropView.java | 11 +- .../refresh/header/waveswipe/WaveView.java | 42 +++---- .../smartrefresh/header/ExampleUnitTest.java | 2 +- .../layout/ExampleInstrumentedTest.java | 2 +- .../smart/refresh/layout/util/DesignUtil.java | 11 +- .../smart/refresh/layout/util/SmartUtil.java | 10 +- .../smartrefresh/layout/ExampleUnitTest.java | 2 +- .../layout/ExampleInstrumentedTest.java | 2 +- .../layout/SmartRefreshLayout.java | 51 +++------ .../layout/header/TwoLevelHeader.java | 7 +- .../layout/internal/InternalAbstract.java | 1 + .../smartrefresh/layout/ExampleUnitTest.java | 2 +- 34 files changed, 99 insertions(+), 267 deletions(-) diff --git a/refresh-drawable-paint/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java b/refresh-drawable-paint/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java index 39ad9838..8e21262d 100644 --- a/refresh-drawable-paint/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java +++ b/refresh-drawable-paint/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java @@ -18,7 +18,7 @@ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test - public void useAppContext() throws Exception { + public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); diff --git a/refresh-drawable-paint/src/test/java/com/scwang/smart/drawable/ExampleUnitTest.java b/refresh-drawable-paint/src/test/java/com/scwang/smart/drawable/ExampleUnitTest.java index 03ae0c30..d4c51452 100644 --- a/refresh-drawable-paint/src/test/java/com/scwang/smart/drawable/ExampleUnitTest.java +++ b/refresh-drawable-paint/src/test/java/com/scwang/smart/drawable/ExampleUnitTest.java @@ -11,7 +11,7 @@ */ public class ExampleUnitTest { @Test - public void addition_isCorrect() throws Exception { + public void addition_isCorrect() { assertEquals(4, 2 + 2); } } \ No newline at end of file diff --git a/refresh-drawable-path/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java b/refresh-drawable-path/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java index 39ad9838..8e21262d 100644 --- a/refresh-drawable-path/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java +++ b/refresh-drawable-path/src/androidTest/java/com/scwang/smart/drawable/ExampleInstrumentedTest.java @@ -18,7 +18,7 @@ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test - public void useAppContext() throws Exception { + public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); diff --git a/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/path/PathParser.java b/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/path/PathParser.java index 07fa6563..958047bb 100644 --- a/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/path/PathParser.java +++ b/refresh-drawable-path/src/main/java/com/scwang/smart/drawable/path/PathParser.java @@ -13,6 +13,7 @@ */ package com.scwang.smart.drawable.path; +import android.annotation.SuppressLint; import android.graphics.Matrix; import android.graphics.Path; import android.os.Build; @@ -59,6 +60,7 @@ private static float[] copyOfRange(@NonNull float[] original, int start, int end return result; } + @SuppressLint("ObsoleteSdkInt") public static List transformScale(float ratioWidth, float ratioHeight, List originPaths, List orginSvgs) { Matrix matrix = new Matrix(); matrix.setScale(ratioWidth, ratioHeight); diff --git a/refresh-drawable-path/src/test/java/com/scwang/smart/drawable/ExampleUnitTest.java b/refresh-drawable-path/src/test/java/com/scwang/smart/drawable/ExampleUnitTest.java index 03ae0c30..d4c51452 100644 --- a/refresh-drawable-path/src/test/java/com/scwang/smart/drawable/ExampleUnitTest.java +++ b/refresh-drawable-path/src/test/java/com/scwang/smart/drawable/ExampleUnitTest.java @@ -11,7 +11,7 @@ */ public class ExampleUnitTest { @Test - public void addition_isCorrect() throws Exception { + public void addition_isCorrect() { assertEquals(4, 2 + 2); } } \ No newline at end of file diff --git a/refresh-footer-ball/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java b/refresh-footer-ball/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java index f46855d3..d98e0058 100644 --- a/refresh-footer-ball/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java +++ b/refresh-footer-ball/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java @@ -18,7 +18,7 @@ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test - public void useAppContext() throws Exception { + public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); diff --git a/refresh-footer-classics/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java b/refresh-footer-classics/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java index b916efd7..ec071b1a 100644 --- a/refresh-footer-classics/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java +++ b/refresh-footer-classics/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java @@ -18,7 +18,7 @@ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test - public void useAppContext() throws Exception { + public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); diff --git a/refresh-footer/src/androidTest/java/com/scwang/smartrefresh/footer/ExampleInstrumentedTest.java b/refresh-footer/src/androidTest/java/com/scwang/smartrefresh/footer/ExampleInstrumentedTest.java index 9b4435f4..98c8551d 100644 --- a/refresh-footer/src/androidTest/java/com/scwang/smartrefresh/footer/ExampleInstrumentedTest.java +++ b/refresh-footer/src/androidTest/java/com/scwang/smartrefresh/footer/ExampleInstrumentedTest.java @@ -18,7 +18,7 @@ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test - public void useAppContext() throws Exception { + public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); diff --git a/refresh-footer/src/test/java/com/scwang/smartrefresh/footer/ExampleUnitTest.java b/refresh-footer/src/test/java/com/scwang/smartrefresh/footer/ExampleUnitTest.java index db103901..0270426c 100644 --- a/refresh-footer/src/test/java/com/scwang/smartrefresh/footer/ExampleUnitTest.java +++ b/refresh-footer/src/test/java/com/scwang/smartrefresh/footer/ExampleUnitTest.java @@ -11,7 +11,7 @@ */ public class ExampleUnitTest { @Test - public void addition_isCorrect() throws Exception { + public void addition_isCorrect() { assertEquals(4, 2 + 2); } } \ No newline at end of file diff --git a/refresh-header-classics/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java b/refresh-header-classics/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java index 9b40845b..e319e6a4 100644 --- a/refresh-header-classics/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java +++ b/refresh-header-classics/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java @@ -18,7 +18,7 @@ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test - public void useAppContext() throws Exception { + public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); diff --git a/refresh-header-classics/src/main/java/com/scwang/smart/refresh/header/ClassicsHeader.java b/refresh-header-classics/src/main/java/com/scwang/smart/refresh/header/ClassicsHeader.java index a24b8e08..45851d50 100644 --- a/refresh-header-classics/src/main/java/com/scwang/smart/refresh/header/ClassicsHeader.java +++ b/refresh-header-classics/src/main/java/com/scwang/smart/refresh/header/ClassicsHeader.java @@ -222,13 +222,11 @@ public ClassicsHeader(Context context, AttributeSet attrs) { try {//try 不能删除-否则会出现兼容性问题 if (context instanceof FragmentActivity) { FragmentManager manager = ((FragmentActivity) context).getSupportFragmentManager(); - if (manager != null) { - @SuppressLint("RestrictedApi") - List fragments = manager.getFragments(); - if (fragments.size() > 0) { - setLastUpdateTime(new Date()); - return; - } + @SuppressLint("RestrictedApi") + List fragments = manager.getFragments(); + if (fragments.size() > 0) { + setLastUpdateTime(new Date()); + return; } } } catch (Throwable e) { diff --git a/refresh-header-falsify/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java b/refresh-header-falsify/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java index 9b40845b..e319e6a4 100644 --- a/refresh-header-falsify/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java +++ b/refresh-header-falsify/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java @@ -18,7 +18,7 @@ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test - public void useAppContext() throws Exception { + public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); diff --git a/refresh-header-material/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java b/refresh-header-material/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java index 9b40845b..e319e6a4 100644 --- a/refresh-header-material/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java +++ b/refresh-header-material/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java @@ -18,7 +18,7 @@ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test - public void useAppContext() throws Exception { + public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); diff --git a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/CircleImageView.java b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/CircleImageView.java index 2dd76fec..557a6392 100644 --- a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/CircleImageView.java +++ b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/CircleImageView.java @@ -17,14 +17,8 @@ import android.annotation.SuppressLint; import android.content.Context; -import android.graphics.Canvas; -import android.graphics.Color; -import android.graphics.Paint; -import android.graphics.RadialGradient; -import android.graphics.Shader; import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.OvalShape; -import android.os.Build; import android.view.View; import android.widget.ImageView; @@ -39,90 +33,30 @@ @SuppressLint({"ViewConstructor", "AppCompatCustomView"}) public class CircleImageView extends ImageView { - protected static final int KEY_SHADOW_COLOR = 0x1E000000; - protected static final int FILL_SHADOW_COLOR = 0x3D000000; - // PX - protected static final float X_OFFSET = 0f; - protected static final float Y_OFFSET = 1.75f; protected static final float SHADOW_RADIUS = 3.5f; protected static final int SHADOW_ELEVATION = 4; - // private Animation.AnimationListener mListener; int mShadowRadius; public CircleImageView(Context context, int color) { super(context); final View thisView = this; final float density = thisView.getResources().getDisplayMetrics().density; - final int shadowYOffset = (int) (density * Y_OFFSET); - final int shadowXOffset = (int) (density * X_OFFSET); mShadowRadius = (int) (density * SHADOW_RADIUS); ShapeDrawable circle; - if (android.os.Build.VERSION.SDK_INT >= 21) { - circle = new ShapeDrawable(new OvalShape()); - thisView.setElevation(SHADOW_ELEVATION * density); - } else { - OvalShape oval = new OvalShadow(mShadowRadius); - circle = new ShapeDrawable(oval); - thisView.setLayerType(LAYER_TYPE_SOFTWARE, circle.getPaint()); - circle.getPaint().setShadowLayer(mShadowRadius, shadowXOffset, shadowYOffset, - KEY_SHADOW_COLOR); - final int padding = mShadowRadius; - // set padding so the inner image sits correctly within the shadow. - thisView.setPadding(padding, padding, padding, padding); - } + circle = new ShapeDrawable(new OvalShape()); + thisView.setElevation(SHADOW_ELEVATION * density); circle.getPaint().setColor(color); thisView.setBackground(circle); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - final View thisView = this; super.onMeasure(widthMeasureSpec, heightMeasureSpec); - if (Build.VERSION.SDK_INT < 21) { - super.setMeasuredDimension( - thisView.getMeasuredWidth() + mShadowRadius * 2, - thisView.getMeasuredHeight() + mShadowRadius * 2); - } } -// public void setAnimationListener(Animation.AnimationListener listener) { -// mListener = listener; -// } -// -// @Override -// public void onAnimationStart() { -// super.onAnimationStart(); -// if (mListener != null) { -// mListener.onAnimationStart(getAnimation()); -// } -// } -// -// @Override -// public void onAnimationEnd() { -// super.onAnimationEnd(); -// if (mListener != null) { -// mListener.onAnimationEnd(getAnimation()); -// } -// } - -// /** -// * Update the background color of the circle image view. -// * -// * @param colorRes Id of a color resource. -// */ -// public void setBackgroundColorRes(int colorRes) { -// Context context = getContext(); -// if (Build.VERSION.SDK_INT >= 23) { -// setBackgroundColor(context.getResources().getColor(colorRes, context.getTheme())); -// } else { -// //noinspection deprecation -// setBackgroundColor(context.getResources().getColor(colorRes)); -// } -// } -// @Override public void setBackgroundColor(@ColorInt int color) { final View thisView = this; @@ -131,37 +65,4 @@ public void setBackgroundColor(@ColorInt int color) { } } - private class OvalShadow extends OvalShape { - private RadialGradient mRadialGradient; - private Paint mShadowPaint; - - OvalShadow(int shadowRadius) { - super(); - mShadowPaint = new Paint(); - mShadowRadius = shadowRadius; - updateRadialGradient((int) super.rect().width()); - } - - @Override - protected void onResize(float width, float height) { - super.onResize(width, height); - updateRadialGradient((int) width); - } - - @Override - public void draw(Canvas canvas, Paint paint) { - final View thisView = CircleImageView.this; - final int viewWidth = thisView.getWidth(); - final int viewHeight = thisView.getHeight(); - canvas.drawCircle(viewWidth / 2f, viewHeight / 2f, viewWidth / 2f, mShadowPaint); - canvas.drawCircle(viewWidth / 2f, viewHeight / 2f, viewWidth / 2f - mShadowRadius, paint); - } - - private void updateRadialGradient(int diameter) { - mRadialGradient = new RadialGradient(diameter / 2f, diameter / 2f, - mShadowRadius, new int[] { FILL_SHADOW_COLOR, Color.TRANSPARENT }, - null, Shader.TileMode.CLAMP); - mShadowPaint.setShader(mRadialGradient); - } - } } diff --git a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/MaterialProgressDrawable.java b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/MaterialProgressDrawable.java index eb2f8df9..3ae4f315 100644 --- a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/MaterialProgressDrawable.java +++ b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/material/MaterialProgressDrawable.java @@ -41,8 +41,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; -import java.util.ArrayList; -import java.util.List; /** * Fancy progress indicator for Material theme. @@ -90,9 +88,6 @@ public class MaterialProgressDrawable extends Drawable implements Animatable { /** The number of points in the progress "star". */ private static final byte NUM_POINTS = 5; - /** The list of animators operating on this drawable. */ - private final List mAnimators = new ArrayList<>(); - /** The indicator ring, used to manage animation state. */ private final Ring mRing = new Ring(); @@ -109,7 +104,7 @@ public class MaterialProgressDrawable extends Drawable implements Animatable { private static final byte ARROW_HEIGHT_LARGE = 6; private static final float MAX_PROGRESS_ARC = .8f; - private View mParent; + private final View mParent; private Animation mAnimation; float mRotationCount; private float mWidth; @@ -321,7 +316,6 @@ float getMinProgressArc(Ring ring) { } // Adapted from ArgbEvaluator.java - @SuppressWarnings("RedundantCast") private int evaluateColorChange(float fraction, int startValue, int endValue) { int startA = (startValue >> 24) & 0xff; int startR = (startValue >> 16) & 0xff; @@ -457,7 +451,7 @@ public void onAnimationRepeat(Animation animation) { mAnimation = animation; } - private class Ring { + private static class Ring { final RectF mTempBounds = new RectF(); final Paint mPaint = new Paint(); final Paint mArrowPaint = new Paint(); @@ -482,9 +476,6 @@ private class Ring { double mRingCenterRadius; int mArrowWidth; int mArrowHeight; -// int mAlpha; -// final Paint mCirclePaint = new Paint(Paint.ANTI_ALIAS_FLAG); -// int mBackgroundColor; int mCurrentColor; Ring() { diff --git a/refresh-header-radar/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java b/refresh-header-radar/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java index 9b40845b..e319e6a4 100644 --- a/refresh-header-radar/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java +++ b/refresh-header-radar/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java @@ -18,7 +18,7 @@ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test - public void useAppContext() throws Exception { + public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); diff --git a/refresh-header-two-level/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java b/refresh-header-two-level/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java index 9b40845b..e319e6a4 100644 --- a/refresh-header-two-level/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java +++ b/refresh-header-two-level/src/androidTest/java/com/scwang/smart/refresh/header/ExampleInstrumentedTest.java @@ -18,7 +18,7 @@ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test - public void useAppContext() throws Exception { + public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); diff --git a/refresh-header/src/androidTest/java/com/scwang/smartrefresh/header/ExampleInstrumentedTest.java b/refresh-header/src/androidTest/java/com/scwang/smartrefresh/header/ExampleInstrumentedTest.java index 17537b00..19edc7d7 100644 --- a/refresh-header/src/androidTest/java/com/scwang/smartrefresh/header/ExampleInstrumentedTest.java +++ b/refresh-header/src/androidTest/java/com/scwang/smartrefresh/header/ExampleInstrumentedTest.java @@ -18,7 +18,7 @@ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test - public void useAppContext() throws Exception { + public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/BezierCircleHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/BezierCircleHeader.java index 930685cc..01a5f3d4 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/BezierCircleHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/BezierCircleHeader.java @@ -323,13 +323,10 @@ public int onFinish(@NonNull RefreshLayout layout, boolean success) { mShowOuter = false; final int DURATION_FINISH = 800; //动画时长 ValueAnimator animator = ValueAnimator.ofFloat(0, 1); - animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { - @Override - public void onAnimationUpdate(@NonNull ValueAnimator animation) { - final View thisView = BezierCircleHeader.this; - mFinishRatio = (float) animation.getAnimatedValue(); - thisView.invalidate(); - } + animator.addUpdateListener(animation -> { + final View thisView = BezierCircleHeader.this; + mFinishRatio = (float) animation.getAnimatedValue(); + thisView.invalidate(); }); animator.setInterpolator(new AccelerateInterpolator()); animator.setDuration(DURATION_FINISH); diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/DropBoxHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/DropBoxHeader.java index e86663ea..400bcf5b 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/DropBoxHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/DropBoxHeader.java @@ -155,13 +155,10 @@ protected void onAttachedToWindow() { mReboundAnimator = ValueAnimator.ofFloat(0, 1, 0); mReboundAnimator.setInterpolator(interpolator); mReboundAnimator.setDuration(300); - mReboundAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { - @Override - public void onAnimationUpdate(@NonNull ValueAnimator animation) { - final View thisView = DropBoxHeader.this; - mReboundPercent = (float) animation.getAnimatedValue(); - thisView.invalidate(); - } + mReboundAnimator.addUpdateListener(animation -> { + final View thisView = DropBoxHeader.this; + mReboundPercent = (float) animation.getAnimatedValue(); + thisView.invalidate(); }); mReboundAnimator.addListener(new AnimatorListenerAdapter() { @Override @@ -179,22 +176,19 @@ public void onAnimationEnd(Animator animation) { mDropOutAnimator = ValueAnimator.ofFloat(0, 1); mDropOutAnimator.setInterpolator(interpolator); mDropOutAnimator.setDuration(300); - mDropOutAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { - @Override - public void onAnimationUpdate(@NonNull ValueAnimator animation) { - if (mDropOutPercent < 1 || mDropOutPercent >= 3) { - mDropOutPercent = (float) animation.getAnimatedValue(); - } else if (mDropOutPercent < 2) { - mDropOutPercent = 1 + (float) animation.getAnimatedValue(); - } else if (mDropOutPercent < 3) { - mDropOutPercent = 2 + (float) animation.getAnimatedValue(); - if (mDropOutPercent == 3) { - mDropOutOverFlow = true; - } + mDropOutAnimator.addUpdateListener(animation -> { + if (mDropOutPercent < 1 || mDropOutPercent >= 3) { + mDropOutPercent = (float) animation.getAnimatedValue(); + } else if (mDropOutPercent < 2) { + mDropOutPercent = 1 + (float) animation.getAnimatedValue(); + } else if (mDropOutPercent < 3) { + mDropOutPercent = 2 + (float) animation.getAnimatedValue(); + if (mDropOutPercent == 3) { + mDropOutOverFlow = true; } - final View thisView = DropBoxHeader.this; - thisView.invalidate(); } + final View thisView = DropBoxHeader.this; + thisView.invalidate(); }); mDropOutAnimator.addListener(new AnimatorListenerAdapter() { @Override diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FlyRefreshHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FlyRefreshHeader.java index 9dafd32c..18d8f794 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FlyRefreshHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FlyRefreshHeader.java @@ -111,12 +111,7 @@ public void onReleased(@NonNull RefreshLayout layout, int height, int maxDragHei if (mCurrentPercent > 0) { ValueAnimator valueAnimator = ValueAnimator.ofFloat(mCurrentPercent, 0); valueAnimator.setDuration(300); - valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { - @Override - public void onAnimationUpdate(@NonNull ValueAnimator animation) { - onMoving(true,(float) animation.getAnimatedValue(), 0, 0, 0); - } - }); + valueAnimator.addUpdateListener(animation -> onMoving(true,(float) animation.getAnimatedValue(), 0, 0, 0)); valueAnimator.start(); mCurrentPercent = 0; } diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java index 5510eba2..e59e1262 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java @@ -272,13 +272,10 @@ public void onReleased(@NonNull RefreshLayout layout, int height, int maxDragHei ValueAnimator animator = ValueAnimator.ofFloat(0, 0); animator.setDuration(500); animator.setInterpolator(new AccelerateDecelerateInterpolator()); - animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { - @Override - public void onAnimationUpdate(@NonNull ValueAnimator valueAnimator) { - final View circleView = mCircleView; - circleView.setTranslationY( - mWaveView.getCurrentCircleCenterY() + circleView.getHeight() / 2.f); - } + animator.addUpdateListener(valueAnimator -> { + final View circleView = mCircleView; + circleView.setTranslationY( + mWaveView.getCurrentCircleCenterY() + circleView.getHeight() / 2.f); }); animator.start(); } diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/waterdrop/WaterDropView.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/waterdrop/WaterDropView.java index a06a7a10..ca7fb5b9 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/waterdrop/WaterDropView.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/waterdrop/WaterDropView.java @@ -167,13 +167,10 @@ protected double getAngle() { public ValueAnimator createAnimator() { ValueAnimator valueAnimator = ValueAnimator.ofFloat(1, 0.001f).setDuration(BACK_ANIM_DURATION); valueAnimator.setInterpolator(new DecelerateInterpolator()); - valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { - @Override - public void onAnimationUpdate(@NonNull ValueAnimator valueAnimator) { - WaterDropView.this.updateCompleteState((float) valueAnimator.getAnimatedValue()); - final View thisView = WaterDropView.this; - thisView.postInvalidate(); - } + valueAnimator.addUpdateListener(animator -> { + WaterDropView.this.updateCompleteState((float) animator.getAnimatedValue()); + final View thisView = WaterDropView.this; + thisView.postInvalidate(); }); return valueAnimator; } diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/waveswipe/WaveView.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/waveswipe/WaveView.java index 13eba45a..c161b4ba 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/waveswipe/WaveView.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/waveswipe/WaveView.java @@ -214,14 +214,10 @@ public class WaveView extends View implements ViewTreeObserver.OnPreDrawListener /** * 各AnimatorのAnimatorUpdateListener */ - protected ValueAnimator.AnimatorUpdateListener mAnimatorUpdateListener = - new ValueAnimator.AnimatorUpdateListener() { - @Override - public void onAnimationUpdate(@NonNull ValueAnimator valueAnimator) { - final View thisView = WaveView.this; - thisView.postInvalidate(); - } - }; + protected ValueAnimator.AnimatorUpdateListener mAnimatorUpdateListener = valueAnimator -> { + final View thisView = WaveView.this; + thisView.postInvalidate(); + }; /** * Constructor @@ -558,13 +554,10 @@ public void startDropAnimation() { mDropCircleAnimator = ValueAnimator.ofFloat(500 * (mWidth / 1440.f), mMaxDropHeight); mDropCircleAnimator.setDuration(DROP_CIRCLE_ANIMATOR_DURATION); - mDropCircleAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { - @Override - public void onAnimationUpdate(@NonNull ValueAnimator animation) { - mCurrentCircleCenterY = (float) animation.getAnimatedValue(); - final View thisView = WaveView.this; - thisView.postInvalidateOnAnimation(); - } + mDropCircleAnimator.addUpdateListener(animation -> { + mCurrentCircleCenterY = (float) animation.getAnimatedValue(); + final View thisView = WaveView.this; + thisView.postInvalidateOnAnimation(); }); mDropCircleAnimator.setInterpolator(new AccelerateDecelerateInterpolator()); mDropCircleAnimator.start(); @@ -612,17 +605,14 @@ public void startWaveAnimation(float h) { h = Math.min(h, MAX_WAVE_HEIGHT) * mWidth; mWaveReverseAnimator = ValueAnimator.ofFloat(h, 0.f); mWaveReverseAnimator.setDuration(WAVE_ANIMATOR_DURATION); - mWaveReverseAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { - @Override - public void onAnimationUpdate(@NonNull ValueAnimator valueAnimator) { - float h = (Float) valueAnimator.getAnimatedValue(); - mWavePath.moveTo(0, 0); - mWavePath.quadTo(0.25f * mWidth, 0, 0.333f * mWidth, h * 0.5f); - mWavePath.quadTo(mWidth * 0.5f, h * 1.4f, 0.666f * mWidth, h * 0.5f); - mWavePath.quadTo(0.75f * mWidth, 0, mWidth, 0); - final View thisView = WaveView.this; - thisView.postInvalidate(); - } + mWaveReverseAnimator.addUpdateListener(valueAnimator -> { + float h1 = (Float) valueAnimator.getAnimatedValue(); + mWavePath.moveTo(0, 0); + mWavePath.quadTo(0.25f * mWidth, 0, 0.333f * mWidth, h1 * 0.5f); + mWavePath.quadTo(mWidth * 0.5f, h1 * 1.4f, 0.666f * mWidth, h1 * 0.5f); + mWavePath.quadTo(0.75f * mWidth, 0, mWidth, 0); + final View thisView = WaveView.this; + thisView.postInvalidate(); }); mWaveReverseAnimator.setInterpolator(new BounceInterpolator()); mWaveReverseAnimator.start(); diff --git a/refresh-header/src/test/java/com/scwang/smartrefresh/header/ExampleUnitTest.java b/refresh-header/src/test/java/com/scwang/smartrefresh/header/ExampleUnitTest.java index 597fc065..5045cedb 100644 --- a/refresh-header/src/test/java/com/scwang/smartrefresh/header/ExampleUnitTest.java +++ b/refresh-header/src/test/java/com/scwang/smartrefresh/header/ExampleUnitTest.java @@ -15,7 +15,7 @@ */ public class ExampleUnitTest { @Test - public void addition_isCorrect() throws Exception { + public void addition_isCorrect() { System.out.println(new SimpleDateFormat("'Last update' M-d HH:mm", Locale.CHINA).format(new Date())); assertEquals(4, 2 + 2); } diff --git a/refresh-layout-kernel/src/androidTest/java/com/scwang/smart/refresh/layout/ExampleInstrumentedTest.java b/refresh-layout-kernel/src/androidTest/java/com/scwang/smart/refresh/layout/ExampleInstrumentedTest.java index 8b5be6f8..e0d43010 100644 --- a/refresh-layout-kernel/src/androidTest/java/com/scwang/smart/refresh/layout/ExampleInstrumentedTest.java +++ b/refresh-layout-kernel/src/androidTest/java/com/scwang/smart/refresh/layout/ExampleInstrumentedTest.java @@ -18,7 +18,7 @@ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test - public void useAppContext() throws Exception { + public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/DesignUtil.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/DesignUtil.java index 7e578fe2..2af47afe 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/DesignUtil.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/DesignUtil.java @@ -23,14 +23,9 @@ public static void checkCoordinatorLayout(View content, RefreshKernel kernel, fi for (int i = layout.getChildCount() - 1; i >= 0; i--) { View view = layout.getChildAt(i); if (view instanceof AppBarLayout) { - ((AppBarLayout) view).addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() { - @Override - public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { - listener.onCoordinatorUpdate( - verticalOffset >= 0, - (appBarLayout.getTotalScrollRange() + verticalOffset) <= 0); - } - }); + ((AppBarLayout) view).addOnOffsetChangedListener((appBarLayout, verticalOffset) -> listener.onCoordinatorUpdate( + verticalOffset >= 0, + (appBarLayout.getTotalScrollRange() + verticalOffset) <= 0)); } } } diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/SmartUtil.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/SmartUtil.java index 3adce509..793e9abb 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/SmartUtil.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/SmartUtil.java @@ -1,5 +1,6 @@ package com.scwang.smart.refresh.layout.util; +import android.annotation.SuppressLint; import android.content.res.Resources; import android.graphics.PointF; import android.os.Build; @@ -35,7 +36,7 @@ public class SmartUtil implements Interpolator { public static int INTERPOLATOR_VISCOUS_FLUID = 0; public static int INTERPOLATOR_DECELERATE = 1; - private int type; + private final int type; public SmartUtil(int type) { this.type = type; @@ -58,6 +59,7 @@ public static int measureViewHeight(View view) { return view.getMeasuredHeight(); } + @SuppressLint("ObsoleteSdkInt") public static void scrollListBy(@NonNull AbsListView listView, int y) { if (Build.VERSION.SDK_INT >= 19) { // Call the framework version directly @@ -108,9 +110,7 @@ public static void fling(View scrollableView, int velocity) { if (scrollableView instanceof ScrollView) { ((ScrollView) scrollableView).fling(velocity); } else if (scrollableView instanceof AbsListView) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - ((AbsListView) scrollableView).fling(velocity); - } + ((AbsListView) scrollableView).fling(velocity); } else if (scrollableView instanceof WebView) { ((WebView) scrollableView).flingScroll(0, velocity); } else if (scrollableView instanceof NestedScrollView) { @@ -213,7 +213,7 @@ public static boolean isTransformedTouchPointInView(@NonNull View group,@NonNull // // - private static float density = Resources.getSystem().getDisplayMetrics().density; + private static final float density = Resources.getSystem().getDisplayMetrics().density; /** * 根据手机的分辨率从 dp 的单位 转成为 px(像素) diff --git a/refresh-layout-kernel/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java b/refresh-layout-kernel/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java index 249d273b..200a432e 100644 --- a/refresh-layout-kernel/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java +++ b/refresh-layout-kernel/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java @@ -11,7 +11,7 @@ */ public class ExampleUnitTest { @Test - public void addition_isCorrect() throws Exception { + public void addition_isCorrect() { assertEquals(4, 2 + 2); } } \ No newline at end of file diff --git a/refresh-layout/src/androidTest/java/com/scwang/smartrefresh/layout/ExampleInstrumentedTest.java b/refresh-layout/src/androidTest/java/com/scwang/smartrefresh/layout/ExampleInstrumentedTest.java index 7b99ebc9..b1812fdb 100644 --- a/refresh-layout/src/androidTest/java/com/scwang/smartrefresh/layout/ExampleInstrumentedTest.java +++ b/refresh-layout/src/androidTest/java/com/scwang/smartrefresh/layout/ExampleInstrumentedTest.java @@ -18,7 +18,7 @@ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test - public void useAppContext() throws Exception { + public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java index ab7b104d..a027fc21 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java @@ -143,12 +143,7 @@ public RefreshHeader getRefreshHeader() { */ @Override public RefreshLayout setOnRefreshListener(final OnRefreshListener listener) { - super.setOnRefreshListener(new com.scwang.smart.refresh.layout.listener.OnRefreshListener() { - @Override - public void onRefresh(@NonNull com.scwang.smart.refresh.layout.api.RefreshLayout refreshLayout) { - listener.onRefresh(SmartRefreshLayout.this); - } - }); + super.setOnRefreshListener(refreshLayout -> listener.onRefresh(SmartRefreshLayout.this)); return this; } @@ -160,12 +155,7 @@ public void onRefresh(@NonNull com.scwang.smart.refresh.layout.api.RefreshLayout */ @Override public RefreshLayout setOnLoadMoreListener(final OnLoadMoreListener listener) { - super.setOnLoadMoreListener(new com.scwang.smart.refresh.layout.listener.OnLoadMoreListener() { - @Override - public void onLoadMore(@NonNull com.scwang.smart.refresh.layout.api.RefreshLayout refreshLayout) { - listener.onLoadMore(SmartRefreshLayout.this); - } - }); + super.setOnLoadMoreListener(refreshLayout -> listener.onLoadMore(SmartRefreshLayout.this)); return this; } @@ -234,15 +224,11 @@ public boolean canLoadMore(View content) { * @param creator Header构建器 */ public static void setDefaultRefreshHeaderCreator(@NonNull final DefaultRefreshHeaderCreator creator) { - com.scwang.smart.refresh.layout.SmartRefreshLayout.setDefaultRefreshHeaderCreator(new com.scwang.smart.refresh.layout.listener.DefaultRefreshHeaderCreator() { - @NonNull - @Override - public com.scwang.smart.refresh.layout.api.RefreshHeader createRefreshHeader(@NonNull Context context, @NonNull com.scwang.smart.refresh.layout.api.RefreshLayout layout) { - if (layout instanceof RefreshLayout) { - return creator.createRefreshHeader(context, (RefreshLayout) layout); - } else { - return new BezierRadarHeader(context); - } + com.scwang.smart.refresh.layout.SmartRefreshLayout.setDefaultRefreshHeaderCreator((context, layout) -> { + if (layout instanceof RefreshLayout) { + return creator.createRefreshHeader(context, (RefreshLayout) layout); + } else { + return new BezierRadarHeader(context); } }); } @@ -252,15 +238,11 @@ public com.scwang.smart.refresh.layout.api.RefreshHeader createRefreshHeader(@No * @param creator Footer构建器 */ public static void setDefaultRefreshFooterCreator(@NonNull final DefaultRefreshFooterCreator creator) { - com.scwang.smart.refresh.layout.SmartRefreshLayout.setDefaultRefreshFooterCreator(new com.scwang.smart.refresh.layout.listener.DefaultRefreshFooterCreator() { - @NonNull - @Override - public com.scwang.smart.refresh.layout.api.RefreshFooter createRefreshFooter(@NonNull Context context, @NonNull com.scwang.smart.refresh.layout.api.RefreshLayout layout) { - if (layout instanceof RefreshLayout) { - return creator.createRefreshFooter(context, (RefreshLayout) layout); - } else { - return new BallPulseFooter(context); - } + com.scwang.smart.refresh.layout.SmartRefreshLayout.setDefaultRefreshFooterCreator((context, layout) -> { + if (layout instanceof RefreshLayout) { + return creator.createRefreshFooter(context, (RefreshLayout) layout); + } else { + return new BallPulseFooter(context); } }); } @@ -270,12 +252,9 @@ public com.scwang.smart.refresh.layout.api.RefreshFooter createRefreshFooter(@No * @param initializer 全局初始化器 */ public static void setDefaultRefreshInitializer(@NonNull final DefaultRefreshInitializer initializer) { - com.scwang.smart.refresh.layout.SmartRefreshLayout.setDefaultRefreshInitializer(new com.scwang.smart.refresh.layout.listener.DefaultRefreshInitializer() { - @Override - public void initialize(@NonNull Context context, @NonNull com.scwang.smart.refresh.layout.api.RefreshLayout layout) { - if (layout instanceof RefreshLayout) { - initializer.initialize(context, (RefreshLayout)layout); - } + com.scwang.smart.refresh.layout.SmartRefreshLayout.setDefaultRefreshInitializer((context, layout) -> { + if (layout instanceof RefreshLayout) { + initializer.initialize(context, (RefreshLayout)layout); } }); } diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java index 77aaed3a..de5230da 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java @@ -29,12 +29,7 @@ public TwoLevelHeader(Context context, @Nullable AttributeSet attrs) { // public TwoLevelHeader setOnTwoLevelListener(final OnTwoLevelListener listener) { - super.setOnTwoLevelListener(new com.scwang.smart.refresh.header.listener.OnTwoLevelListener() { - @Override - public boolean onTwoLevel(@NonNull com.scwang.smart.refresh.layout.api.RefreshLayout refreshLayout) { - return listener.onTwoLevel((RefreshLayout) refreshLayout); - } - }); + super.setOnTwoLevelListener(layout -> listener.onTwoLevel((RefreshLayout) layout)); return this; } diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/InternalAbstract.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/InternalAbstract.java index baf0f695..a350bbc9 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/InternalAbstract.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/InternalAbstract.java @@ -14,6 +14,7 @@ * Internal 初步实现 * 实现 Header 和 Footer 时,继承 InternalAbstract 的话可以少写很多接口方法 * Created by scwang on 2018/2/6. + * @noinspection unused */ public abstract class InternalAbstract extends SimpleComponent { diff --git a/refresh-layout/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java b/refresh-layout/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java index 249d273b..200a432e 100644 --- a/refresh-layout/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java +++ b/refresh-layout/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java @@ -11,7 +11,7 @@ */ public class ExampleUnitTest { @Test - public void addition_isCorrect() throws Exception { + public void addition_isCorrect() { assertEquals(4, 2 + 2); } } \ No newline at end of file From e36dcec52005f93d2122ac9953f6a9e28f427f65 Mon Sep 17 00:00:00 2001 From: wsc Date: Mon, 13 Nov 2023 23:23:18 +0800 Subject: [PATCH 48/67] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=86=8D=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/scwang/smart/refresh/header/TwoLevelHeader.java | 2 +- .../com/scwang/smart/refresh/header/BezierCircleHeader.java | 5 ----- .../com/scwang/smart/refresh/header/WaveSwipeHeader.java | 6 ------ .../scwang/smart/refresh/header/fungame/FunGameBase.java | 6 ------ .../scwang/smartrefresh/layout/header/TwoLevelHeader.java | 1 - 5 files changed, 1 insertion(+), 19 deletions(-) diff --git a/refresh-header-two-level/src/main/java/com/scwang/smart/refresh/header/TwoLevelHeader.java b/refresh-header-two-level/src/main/java/com/scwang/smart/refresh/header/TwoLevelHeader.java index 9fb9d88f..42ac51be 100644 --- a/refresh-header-two-level/src/main/java/com/scwang/smart/refresh/header/TwoLevelHeader.java +++ b/refresh-header-two-level/src/main/java/com/scwang/smart/refresh/header/TwoLevelHeader.java @@ -27,8 +27,8 @@ /** * 二级刷新 * Created by scwang on 2017/5/26. + * @noinspection UnusedReturnValue, unused */ -@SuppressWarnings({"UnusedReturnValue", "unused"}) public class TwoLevelHeader extends SimpleComponent implements RefreshHeader, NestedScrollingParent2 { // diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/BezierCircleHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/BezierCircleHeader.java index 01a5f3d4..4e299dd3 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/BezierCircleHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/BezierCircleHeader.java @@ -351,10 +351,5 @@ public void setPrimaryColors(@ColorInt int ... colors) { } } -// @NonNull -// @Override -// public SpinnerStyle getSpinnerStyle() { -// return SpinnerStyle.Scale; -// } // } \ No newline at end of file diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java index e59e1262..f1715fff 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java @@ -345,12 +345,6 @@ public void setPrimaryColors(@ColorInt int ... colors) { } } } -// -// @NonNull -// @Override -// public SpinnerStyle getSpinnerStyle() { -// return SpinnerStyle.MatchLayout; -// } // // diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameBase.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameBase.java index 459ed19d..9c551594 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameBase.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameBase.java @@ -207,11 +207,5 @@ public int onFinish(@NonNull RefreshLayout layout, boolean success) { } return 0; } -// -// @NonNull -// @Override -// public SpinnerStyle getSpinnerStyle() { -// return SpinnerStyle.MatchLayout; -// } // } diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java index de5230da..d6dad851 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java @@ -3,7 +3,6 @@ import android.content.Context; import android.util.AttributeSet; -import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.scwang.smartrefresh.layout.api.OnTwoLevelListener; From 12dca99bedce7a41df02afc957cb0f61eb89e4fa Mon Sep 17 00:00:00 2001 From: wsc Date: Wed, 17 Jul 2024 13:43:29 +0800 Subject: [PATCH 49/67] =?UTF-8?q?demo=E6=8F=90=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/BasicExampleActivity.java | 1 + .../refresh/layout/SmartRefreshLayout.java | 30 +++++++++---------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java index 2d7b2091..d49325c1 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java @@ -127,6 +127,7 @@ private void loadMore(com.scwang.smartrefresh.layout.api.RefreshLayout layout) { } else { //刷新失败 layout.finishLoadMore(false); + Toast.makeText(getApplication(), "演示加载失败", Toast.LENGTH_SHORT).show(); } }, 2000); } diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java index 3f84df22..c213042b 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java @@ -22,21 +22,10 @@ import android.view.ViewParent; import android.view.animation.AnimationUtils; import android.view.animation.Interpolator; -import android.widget.AbsListView; import android.widget.Scroller; import android.widget.TextView; import android.widget.Toast; -import androidx.annotation.ColorInt; -import androidx.annotation.ColorRes; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.core.content.ContextCompat; -import androidx.core.view.NestedScrollingChildHelper; -import androidx.core.view.NestedScrollingParent; -import androidx.core.view.NestedScrollingParentHelper; -import androidx.core.view.ViewCompat; - import com.scwang.smart.refresh.layout.api.RefreshComponent; import com.scwang.smart.refresh.layout.api.RefreshContent; import com.scwang.smart.refresh.layout.api.RefreshFooter; @@ -74,6 +63,16 @@ import static com.scwang.smart.refresh.layout.util.SmartUtil.isContentView; import static java.lang.System.currentTimeMillis; +import androidx.annotation.ColorInt; +import androidx.annotation.ColorRes; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; +import androidx.core.view.NestedScrollingChildHelper; +import androidx.core.view.NestedScrollingParent; +import androidx.core.view.NestedScrollingParentHelper; +import androidx.core.view.ViewCompat; + /** * 智能刷新布局 * Intelligent RefreshLayout @@ -959,7 +958,7 @@ public boolean dispatchTouchEvent(MotionEvent e) { /* * https://github.com/scwang90/SmartRefreshLayout/issues/1540 * 在刷新动画关闭的时候,点击列表无法跳转, - * 是因为下面的 if (interceptAnimatorByAction || mState.isFinishing) return false + * 是因为下面的 if (interceptAnimatorByAction || mState.isFinishing ) return false * 屏蔽了所有手势事件,屏蔽的原因是如果关闭动画正在执行的时候,随意滑动列表会导致意外的错乱 * 目前的修复方法并不是放开屏蔽,而是针对 先 ACTION_DOWN 再 ACTION_UP 的点击事件进行补偿处理 * 从而实现,完成动画执行时,列表不可手动滑动,但是可以点击列表项 @@ -1049,6 +1048,7 @@ public boolean dispatchTouchEvent(MotionEvent e) { final ViewParent parent = thisView.getParent(); if (parent instanceof ViewGroup) { //修复问题 https://github.com/scwang90/SmartRefreshLayout/issues/580 + //noinspection RedundantCast ((ViewGroup)parent).requestDisallowInterceptTouchEvent(true);//通知父控件不要拦截事件 } } @@ -1130,14 +1130,12 @@ public boolean dispatchTouchEvent(MotionEvent e) { * 应用场景已经在英文注释中解释清楚,大部分第三方下拉刷新库都保留了这段代码,本库也不例外 */ @Override - @SuppressLint("ObsoleteSdkInt") public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) { // if this is a List < L or another view that doesn't support nested // scrolling, ignore this request so that the vertical scroll event // isn't stolen View target = mRefreshContent.getScrollableView(); - if ((android.os.Build.VERSION.SDK_INT >= 21 || !(target instanceof AbsListView)) - && (/*target == null || */ViewCompat.isNestedScrollingEnabled(target))) { + if (ViewCompat.isNestedScrollingEnabled(target)) { mEnableDisallowIntercept = disallowIntercept; super.requestDisallowInterceptTouchEvent(disallowIntercept); } @@ -1848,7 +1846,7 @@ protected int reverseInfinitely(float spinnerConvergence) { } else { final double M = mFooterMaxDragRate < 10 ? mFooterHeight * mFooterMaxDragRate : mFooterMaxDragRate; final double H = Math.max(mScreenHeightPixels / 2, thisView.getHeight()); - final double y = -spinnerConvergence; + final double y = -spinnerConvergence * 1; originSpinner = -((-H * (Math.log(1 - y / M) / Math.log(100f))) - mFooterHeight) / mDragRate; } From 66a2b2088b29176264a502bdcc8cfbe3dfdbb89d Mon Sep 17 00:00:00 2001 From: wsc Date: Sat, 3 Aug 2024 11:46:10 +0800 Subject: [PATCH 50/67] =?UTF-8?q?=E7=BA=BF=E4=B8=8A=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 38 +++++++++---------- build.gradle | 2 + refresh-footer/build.gradle | 7 +++- refresh-footer/src/main/AndroidManifest.xml | 2 +- refresh-header/build.gradle | 13 +++++-- refresh-header/src/main/AndroidManifest.xml | 2 +- .../smart/refresh/header/DropBoxHeader.java | 2 +- .../refresh/header/FunGameHitBlockHeader.java | 4 +- .../smart/refresh/header/PhoenixHeader.java | 2 +- .../refresh/header/StoreHouseHeader.java | 2 +- .../smart/refresh/header/TaurusHeader.java | 2 +- .../smart/refresh/header/WaveSwipeHeader.java | 2 +- .../header/flyrefresh/MountainSceneView.java | 2 +- .../refresh/header/fungame/FunGameView.java | 2 +- .../header/waterdrop/WaterDropView.java | 3 +- refresh-layout/build.gradle | 16 +++++--- refresh-layout/src/main/AndroidManifest.xml | 2 +- 17 files changed, 59 insertions(+), 44 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 369d6372..5a7676e7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -67,25 +67,25 @@ dependencies { implementation project(':refresh-footer') implementation project(':refresh-header') implementation project(':refresh-layout') - - implementation project(':refresh-drawable-path') - implementation project(':refresh-layout-kernel') - implementation project(':refresh-header-classics') - implementation project(':refresh-header-radar') - implementation project(':refresh-header-falsify') - implementation project(':refresh-header-material') - implementation project(':refresh-header-two-level') - implementation project(':refresh-footer-ball') - -// implementation 'io.github.scwang90:refresh-drawable-path:2.1.0' //矢量路径 -// implementation 'io.github.scwang90:refresh-layout-kernel:2.1.0' //核心必须依赖 -// implementation 'io.github.scwang90:refresh-header-classics:2.1.0' //经典刷新头 -// implementation 'io.github.scwang90:refresh-header-radar:2.1.0' //雷达刷新头 -// implementation 'io.github.scwang90:refresh-header-falsify:2.1.0' //虚拟刷新头 -// implementation 'io.github.scwang90:refresh-header-material:2.1.0' //谷歌刷新头 -// implementation 'io.github.scwang90:refresh-header-two-level:2.1.0' //二级刷新头 -// implementation 'io.github.scwang90:refresh-footer-ball:2.1.0' //球脉冲加载 -// implementation 'io.github.scwang90:refresh-footer-classics:2.1.0' //经典加载 +// +// implementation project(':refresh-drawable-path') +// implementation project(':refresh-layout-kernel') +// implementation project(':refresh-header-classics') +// implementation project(':refresh-header-radar') +// implementation project(':refresh-header-falsify') +// implementation project(':refresh-header-material') +// implementation project(':refresh-header-two-level') +// implementation project(':refresh-footer-ball') + + implementation 'io.github.scwang90:refresh-drawable-path:2.1.0' //矢量路径 + implementation 'io.github.scwang90:refresh-layout-kernel:2.1.0' //核心必须依赖 + implementation 'io.github.scwang90:refresh-header-classics:2.1.0' //经典刷新头 + implementation 'io.github.scwang90:refresh-header-radar:2.1.0' //雷达刷新头 + implementation 'io.github.scwang90:refresh-header-falsify:2.1.0' //虚拟刷新头 + implementation 'io.github.scwang90:refresh-header-material:2.1.0' //谷歌刷新头 + implementation 'io.github.scwang90:refresh-header-two-level:2.1.0' //二级刷新头 + implementation 'io.github.scwang90:refresh-footer-ball:2.1.0' //球脉冲加载 + implementation 'io.github.scwang90:refresh-footer-classics:2.1.0' //经典加载 implementation 'com.flyco.roundview:FlycoRoundView_Lib:1.1.4@aar' implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.50' diff --git a/build.gradle b/build.gradle index 511e96d3..d35edfa6 100644 --- a/build.gradle +++ b/build.gradle @@ -5,6 +5,8 @@ buildscript { google() mavenCentral() gradlePluginPortal() +// jcenter() +// maven { url 'https://maven.aliyun.com/repository/jcenter' } } dependencies { classpath 'com.android.tools.build:gradle:7.2.2' diff --git a/refresh-footer/build.gradle b/refresh-footer/build.gradle index af202a4d..2966c46c 100644 --- a/refresh-footer/build.gradle +++ b/refresh-footer/build.gradle @@ -27,9 +27,12 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - compileOnly project(':refresh-footer-ball') - compileOnly project(':refresh-footer-classics') compileOnly project(':refresh-layout') +// compileOnly project(':refresh-footer-ball') +// compileOnly project(':refresh-footer-classics') + + implementation 'io.github.scwang90:refresh-footer-ball:2.1.0' //球脉冲加载 + implementation 'io.github.scwang90:refresh-footer-classics:2.1.0' //经典加载 compileOnly 'androidx.appcompat:appcompat:1.6.1' diff --git a/refresh-footer/src/main/AndroidManifest.xml b/refresh-footer/src/main/AndroidManifest.xml index c4245268..96f0310d 100644 --- a/refresh-footer/src/main/AndroidManifest.xml +++ b/refresh-footer/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + diff --git a/refresh-header/build.gradle b/refresh-header/build.gradle index 92a2a06c..5e6d11a2 100644 --- a/refresh-header/build.gradle +++ b/refresh-header/build.gradle @@ -27,10 +27,15 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) compileOnly project(':refresh-layout') - compileOnly project(':refresh-drawable-path') - compileOnly project(':refresh-header-material') - compileOnly project(':refresh-layout-kernel') - compileOnly project(':refresh-header-falsify') +// compileOnly project(':refresh-drawable-path') +// compileOnly project(':refresh-header-material') +// compileOnly project(':refresh-layout-kernel') +// compileOnly project(':refresh-header-falsify') + + implementation 'io.github.scwang90:refresh-drawable-path:2.1.0' //矢量路径 + implementation 'io.github.scwang90:refresh-layout-kernel:2.1.0' //核心必须依赖 + implementation 'io.github.scwang90:refresh-header-falsify:2.1.0' //虚拟刷新头 + implementation 'io.github.scwang90:refresh-header-material:2.1.0' //谷歌刷新头 compileOnly 'androidx.appcompat:appcompat:1.6.1' diff --git a/refresh-header/src/main/AndroidManifest.xml b/refresh-header/src/main/AndroidManifest.xml index a6a27115..ad144e77 100644 --- a/refresh-header/src/main/AndroidManifest.xml +++ b/refresh-header/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/DropBoxHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/DropBoxHeader.java index 400bcf5b..bef22982 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/DropBoxHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/DropBoxHeader.java @@ -27,7 +27,7 @@ import com.scwang.smart.refresh.layout.constant.SpinnerStyle; import com.scwang.smart.refresh.layout.simple.SimpleComponent; import com.scwang.smart.refresh.layout.util.SmartUtil; -import com.scwang.smartrefresh.header.R; +import com.scwang.smart.refresh.header.R; /** * DropBoxRefresh diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameHitBlockHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameHitBlockHeader.java index 86d07fdb..5b4d0a4f 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameHitBlockHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameHitBlockHeader.java @@ -13,8 +13,8 @@ import com.scwang.smart.refresh.header.fungame.FunGameView; import com.scwang.smart.refresh.layout.api.RefreshKernel; -import com.scwang.smartrefresh.header.R; -import com.scwang.smartrefresh.layout.util.SmartUtil; +import com.scwang.smart.refresh.layout.util.SmartUtil; +import com.scwang.smart.refresh.header.R; import java.util.ArrayList; import java.util.List; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/PhoenixHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/PhoenixHeader.java index 60647265..f94f27cd 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/PhoenixHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/PhoenixHeader.java @@ -24,7 +24,7 @@ import com.scwang.smart.refresh.layout.constant.SpinnerStyle; import com.scwang.smart.refresh.layout.simple.SimpleComponent; import com.scwang.smart.refresh.layout.util.SmartUtil; -import com.scwang.smartrefresh.header.R; +import com.scwang.smart.refresh.header.R; /** * Phoenix diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/StoreHouseHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/StoreHouseHeader.java index 136786e1..8c218f18 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/StoreHouseHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/StoreHouseHeader.java @@ -23,7 +23,7 @@ import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.simple.SimpleComponent; import com.scwang.smart.refresh.layout.util.SmartUtil; -import com.scwang.smartrefresh.header.R; +import com.scwang.smart.refresh.header.R; import java.util.ArrayList; import java.util.List; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/TaurusHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/TaurusHeader.java index 8281a494..806e433b 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/TaurusHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/TaurusHeader.java @@ -24,7 +24,7 @@ import com.scwang.smart.refresh.layout.constant.SpinnerStyle; import com.scwang.smart.refresh.layout.simple.SimpleComponent; import com.scwang.smart.refresh.layout.util.SmartUtil; -import com.scwang.smartrefresh.header.R; +import com.scwang.smart.refresh.header.R; import java.util.HashMap; import java.util.Map; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java index f1715fff..0d21049c 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java @@ -27,7 +27,7 @@ import com.scwang.smart.refresh.layout.constant.SpinnerStyle; import com.scwang.smart.refresh.layout.simple.SimpleComponent; import com.scwang.smart.refresh.layout.util.SmartUtil; -import com.scwang.smartrefresh.header.R; +import com.scwang.smart.refresh.header.R; import static android.view.View.MeasureSpec.EXACTLY; import static android.view.View.MeasureSpec.getSize; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/flyrefresh/MountainSceneView.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/flyrefresh/MountainSceneView.java index ccda62c2..fa31fe4f 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/flyrefresh/MountainSceneView.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/flyrefresh/MountainSceneView.java @@ -16,7 +16,7 @@ import androidx.core.graphics.ColorUtils; import androidx.core.view.animation.PathInterpolatorCompat; -import com.scwang.smartrefresh.header.R; +import com.scwang.smart.refresh.header.R; /** * 山丘树木场景视图 diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameView.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameView.java index 88db598f..c439a09f 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameView.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameView.java @@ -27,7 +27,7 @@ import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.RefreshState; import com.scwang.smart.refresh.layout.util.SmartUtil; -import com.scwang.smartrefresh.header.R; +import com.scwang.smart.refresh.header.R; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/waterdrop/WaterDropView.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/waterdrop/WaterDropView.java index ca7fb5b9..6bb415eb 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/waterdrop/WaterDropView.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/waterdrop/WaterDropView.java @@ -12,8 +12,7 @@ import androidx.annotation.ColorInt; import androidx.annotation.NonNull; -import com.scwang.smartrefresh.layout.util.SmartUtil; - +import com.scwang.smart.refresh.layout.util.SmartUtil; /** * 下拉头中间的 “水滴” diff --git a/refresh-layout/build.gradle b/refresh-layout/build.gradle index c10663a2..31973687 100644 --- a/refresh-layout/build.gradle +++ b/refresh-layout/build.gradle @@ -26,11 +26,17 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - compileOnly project(':refresh-layout-kernel') - compileOnly project(':refresh-footer-ball') - compileOnly project(':refresh-header-falsify') - compileOnly project(':refresh-header-radar') - compileOnly project(':refresh-header-two-level') +// compileOnly project(':refresh-layout-kernel') +// compileOnly project(':refresh-footer-ball') +// compileOnly project(':refresh-header-falsify') +// compileOnly project(':refresh-header-radar') +// compileOnly project(':refresh-header-two-level') + + implementation 'io.github.scwang90:refresh-layout-kernel:2.1.0' //核心必须依赖 + implementation 'io.github.scwang90:refresh-header-radar:2.1.0' //雷达刷新头 + implementation 'io.github.scwang90:refresh-header-falsify:2.1.0' //虚拟刷新头 + implementation 'io.github.scwang90:refresh-header-two-level:2.1.0' //二级刷新头 + implementation 'io.github.scwang90:refresh-footer-ball:2.1.0' //球脉冲加载 compileOnly 'com.google.android.material:material:1.10.0' diff --git a/refresh-layout/src/main/AndroidManifest.xml b/refresh-layout/src/main/AndroidManifest.xml index 9d89561f..aa611f1c 100644 --- a/refresh-layout/src/main/AndroidManifest.xml +++ b/refresh-layout/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + From 6a2011b85abd4c456179a3c7abfb120802206407 Mon Sep 17 00:00:00 2001 From: wsc Date: Thu, 22 Aug 2024 14:37:32 +0800 Subject: [PATCH 51/67] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E4=BE=9D=E8=B5=96,=E6=B7=BB=E5=8A=A0=E6=B3=A8=E8=A7=A3?= =?UTF-8?q?=EF=BC=8C=E9=80=82=E9=85=8D=E6=97=A0Header=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 38 ++++++++--------- refresh-footer/build.gradle | 8 ++-- refresh-header/build.gradle | 18 ++++---- .../refresh/layout/SmartRefreshLayout.java | 42 +++++++++++-------- refresh-layout/build.gradle | 22 +++++----- 5 files changed, 68 insertions(+), 60 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5a7676e7..369d6372 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -67,25 +67,25 @@ dependencies { implementation project(':refresh-footer') implementation project(':refresh-header') implementation project(':refresh-layout') -// -// implementation project(':refresh-drawable-path') -// implementation project(':refresh-layout-kernel') -// implementation project(':refresh-header-classics') -// implementation project(':refresh-header-radar') -// implementation project(':refresh-header-falsify') -// implementation project(':refresh-header-material') -// implementation project(':refresh-header-two-level') -// implementation project(':refresh-footer-ball') - - implementation 'io.github.scwang90:refresh-drawable-path:2.1.0' //矢量路径 - implementation 'io.github.scwang90:refresh-layout-kernel:2.1.0' //核心必须依赖 - implementation 'io.github.scwang90:refresh-header-classics:2.1.0' //经典刷新头 - implementation 'io.github.scwang90:refresh-header-radar:2.1.0' //雷达刷新头 - implementation 'io.github.scwang90:refresh-header-falsify:2.1.0' //虚拟刷新头 - implementation 'io.github.scwang90:refresh-header-material:2.1.0' //谷歌刷新头 - implementation 'io.github.scwang90:refresh-header-two-level:2.1.0' //二级刷新头 - implementation 'io.github.scwang90:refresh-footer-ball:2.1.0' //球脉冲加载 - implementation 'io.github.scwang90:refresh-footer-classics:2.1.0' //经典加载 + + implementation project(':refresh-drawable-path') + implementation project(':refresh-layout-kernel') + implementation project(':refresh-header-classics') + implementation project(':refresh-header-radar') + implementation project(':refresh-header-falsify') + implementation project(':refresh-header-material') + implementation project(':refresh-header-two-level') + implementation project(':refresh-footer-ball') + +// implementation 'io.github.scwang90:refresh-drawable-path:2.1.0' //矢量路径 +// implementation 'io.github.scwang90:refresh-layout-kernel:2.1.0' //核心必须依赖 +// implementation 'io.github.scwang90:refresh-header-classics:2.1.0' //经典刷新头 +// implementation 'io.github.scwang90:refresh-header-radar:2.1.0' //雷达刷新头 +// implementation 'io.github.scwang90:refresh-header-falsify:2.1.0' //虚拟刷新头 +// implementation 'io.github.scwang90:refresh-header-material:2.1.0' //谷歌刷新头 +// implementation 'io.github.scwang90:refresh-header-two-level:2.1.0' //二级刷新头 +// implementation 'io.github.scwang90:refresh-footer-ball:2.1.0' //球脉冲加载 +// implementation 'io.github.scwang90:refresh-footer-classics:2.1.0' //经典加载 implementation 'com.flyco.roundview:FlycoRoundView_Lib:1.1.4@aar' implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.50' diff --git a/refresh-footer/build.gradle b/refresh-footer/build.gradle index 2966c46c..fbfedd4e 100644 --- a/refresh-footer/build.gradle +++ b/refresh-footer/build.gradle @@ -28,11 +28,11 @@ dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') compileOnly project(':refresh-layout') -// compileOnly project(':refresh-footer-ball') -// compileOnly project(':refresh-footer-classics') + compileOnly project(':refresh-footer-ball') + compileOnly project(':refresh-footer-classics') - implementation 'io.github.scwang90:refresh-footer-ball:2.1.0' //球脉冲加载 - implementation 'io.github.scwang90:refresh-footer-classics:2.1.0' //经典加载 +// implementation 'io.github.scwang90:refresh-footer-ball:2.1.0' //球脉冲加载 +// implementation 'io.github.scwang90:refresh-footer-classics:2.1.0' //经典加载 compileOnly 'androidx.appcompat:appcompat:1.6.1' diff --git a/refresh-header/build.gradle b/refresh-header/build.gradle index 5e6d11a2..f9f23d0b 100644 --- a/refresh-header/build.gradle +++ b/refresh-header/build.gradle @@ -27,15 +27,15 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) compileOnly project(':refresh-layout') -// compileOnly project(':refresh-drawable-path') -// compileOnly project(':refresh-header-material') -// compileOnly project(':refresh-layout-kernel') -// compileOnly project(':refresh-header-falsify') - - implementation 'io.github.scwang90:refresh-drawable-path:2.1.0' //矢量路径 - implementation 'io.github.scwang90:refresh-layout-kernel:2.1.0' //核心必须依赖 - implementation 'io.github.scwang90:refresh-header-falsify:2.1.0' //虚拟刷新头 - implementation 'io.github.scwang90:refresh-header-material:2.1.0' //谷歌刷新头 + compileOnly project(':refresh-drawable-path') + compileOnly project(':refresh-header-material') + compileOnly project(':refresh-layout-kernel') + compileOnly project(':refresh-header-falsify') + +// implementation 'io.github.scwang90:refresh-drawable-path:2.1.0' //矢量路径 +// implementation 'io.github.scwang90:refresh-layout-kernel:2.1.0' //核心必须依赖 +// implementation 'io.github.scwang90:refresh-header-falsify:2.1.0' //虚拟刷新头 +// implementation 'io.github.scwang90:refresh-header-material:2.1.0' //谷歌刷新头 compileOnly 'androidx.appcompat:appcompat:1.6.1' diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java index c213042b..24bca7d4 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java @@ -60,7 +60,6 @@ import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; import static com.scwang.smart.refresh.layout.util.SmartUtil.dp2px; import static com.scwang.smart.refresh.layout.util.SmartUtil.fling; -import static com.scwang.smart.refresh.layout.util.SmartUtil.isContentView; import static java.lang.System.currentTimeMillis; import androidx.annotation.ColorInt; @@ -176,7 +175,12 @@ public class SmartRefreshLayout extends ViewGroup implements RefreshLayout, Nest protected RefreshComponent mRefreshHeader; //下拉头部视图 protected RefreshComponent mRefreshFooter; //上拉底部视图 - protected RefreshContent mRefreshContent; //显示内容视图 + /** + * 显示内容视图 + * 根据开发设计,本变量最终不可能为空,因为在 onAttachedToWindow 中判断如果未设置内容视图 + * 会自动创建一个 TextView 提示必须创建,并且 TextView 会变为 内容视图 + */ + protected RefreshContent mRefreshContent; // protected Paint mPaint; @@ -343,16 +347,18 @@ protected void onFinishInflate() { throw new RuntimeException("最多只支持3个子View,Most only support three sub view"); } - int contentLevel = 0; - int indexContent = -1; + int contentLevel = 0; // 当前找到内容布局的级别(0还没找到 1普通内容 2可滚动内容) + int indexContent = -1; // 内容布局所在的序号 for (int i = 0; i < count; i++) { View view = super.getChildAt(i); - if (isContentView(view) && (contentLevel < 2 || i == 1)) { + if (SmartUtil.isContentView(view) && (contentLevel < 2 || i == 1)) { + // 可滚动内容 indexContent = i; - contentLevel = 2; + contentLevel = 2; // 标记为可滚动内容,不会再被替换 } else if (!(view instanceof RefreshComponent) && contentLevel < 1) { + // 普通内容 indexContent = i; - contentLevel = i > 0 ? 1 : 0; + contentLevel = i > 0 ? 1 : 0; // 如果是第一个标记为:未找到(第一个有可能是自定义Header),否则标记为:普通内容 } } @@ -383,7 +389,7 @@ protected void onFinishInflate() { } /** - * 重写 onAttachedToWindow 来完成 smart 的特定功能 + * 重写 onAttachedToWindow 来完成 smart 的特定功能 (在 onFinishInflate 之后执行) * 1.添加默认或者全局设置的 Header 和 Footer (缺省情况下才会) * 2.做 Content 为空时的 TextView 提示 * 3.智能开启 嵌套滚动 NestedScrollingEnabled @@ -395,6 +401,7 @@ protected void onAttachedToWindow() { mAttachedToWindow = true; final View thisView = this; + // 在非编辑模式下,如果 onFinishInflate 初始化组件未成功,onAttachedToWindow 可以进行补充处理 if (!thisView.isInEditMode()) { if (mRefreshHeader == null) { @@ -3079,7 +3086,7 @@ public void run() { notifyStateChanged(RefreshState.PullDownCanceled); } // mKernel.setState(RefreshState.None); - } else if (mState == RefreshState.Refreshing && mRefreshHeader != null && mRefreshContent != null) { + } else if (mState == RefreshState.Refreshing && mRefreshHeader != null) { count++; mHandler.postDelayed(this, more); //提前设置 状态为 RefreshFinish 防止 postDelayed 导致 finishRefresh 过后,外部判断 state 还是 Refreshing @@ -3092,6 +3099,7 @@ public void run() { setNoMoreData(true); } } else { + // 本else 分支的触发是的代码是上面的:count++;mHandler.postDelayed(this, more); int startDelay = mRefreshHeader.onFinish(SmartRefreshLayout.this, success); if (mOnMultiListener != null && mRefreshHeader instanceof RefreshHeader) { mOnMultiListener.onHeaderFinish((RefreshHeader) mRefreshHeader, success); @@ -3444,7 +3452,7 @@ public boolean autoRefresh(int delayed, final int duration, final float dragRate reboundAnimator.setDuration(duration); reboundAnimator.setInterpolator(new SmartUtil(SmartUtil.INTERPOLATOR_VISCOUS_FLUID)); reboundAnimator.addUpdateListener(animation -> { - if (reboundAnimator != null && mRefreshHeader != null) { + if (reboundAnimator != null) { mKernel.moveSpinner((int) animation.getAnimatedValue(), true); } }); @@ -4011,17 +4019,17 @@ public RefreshKernel onAutoRefreshAnimationEnd(Animator animation, boolean anima return this;//0 表示被取消 } reboundAnimator = null; - if (mRefreshHeader != null) { +// if (mRefreshHeader != null) { if (mState != RefreshState.ReleaseToRefresh) { this.setState(RefreshState.ReleaseToRefresh); } SmartRefreshLayout.this.setStateRefreshing(!animationOnly); - } else { - /* - * 2019-12-24 修复 mRefreshHeader=null 时状态错乱问题 - */ - this.setState(RefreshState.None); - } +// } else { +// /* +// * 2019-12-24 修复 mRefreshHeader=null 时状态错乱问题 +// */ +// this.setState(RefreshState.None); +// } return this; } diff --git a/refresh-layout/build.gradle b/refresh-layout/build.gradle index 31973687..15e0c78c 100644 --- a/refresh-layout/build.gradle +++ b/refresh-layout/build.gradle @@ -26,17 +26,17 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) -// compileOnly project(':refresh-layout-kernel') -// compileOnly project(':refresh-footer-ball') -// compileOnly project(':refresh-header-falsify') -// compileOnly project(':refresh-header-radar') -// compileOnly project(':refresh-header-two-level') - - implementation 'io.github.scwang90:refresh-layout-kernel:2.1.0' //核心必须依赖 - implementation 'io.github.scwang90:refresh-header-radar:2.1.0' //雷达刷新头 - implementation 'io.github.scwang90:refresh-header-falsify:2.1.0' //虚拟刷新头 - implementation 'io.github.scwang90:refresh-header-two-level:2.1.0' //二级刷新头 - implementation 'io.github.scwang90:refresh-footer-ball:2.1.0' //球脉冲加载 + compileOnly project(':refresh-layout-kernel') + compileOnly project(':refresh-footer-ball') + compileOnly project(':refresh-header-falsify') + compileOnly project(':refresh-header-radar') + compileOnly project(':refresh-header-two-level') + +// implementation 'io.github.scwang90:refresh-layout-kernel:2.1.0' //核心必须依赖 +// implementation 'io.github.scwang90:refresh-header-radar:2.1.0' //雷达刷新头 +// implementation 'io.github.scwang90:refresh-header-falsify:2.1.0' //虚拟刷新头 +// implementation 'io.github.scwang90:refresh-header-two-level:2.1.0' //二级刷新头 +// implementation 'io.github.scwang90:refresh-footer-ball:2.1.0' //球脉冲加载 compileOnly 'com.google.android.material:material:1.10.0' From f7ce7bb0e1ca7066ac7a485464a401c43b5767cc Mon Sep 17 00:00:00 2001 From: wsc Date: Tue, 27 Aug 2024 10:52:55 +0800 Subject: [PATCH 52/67] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=9A=E5=BD=93=E5=9C=BA=E9=80=92=E5=BD=92=E6=AD=BB=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF=EF=BC=8C=20java.lang.StackOverflowError=20https://git?= =?UTF-8?q?hub.com/scwang90/SmartRefreshLayout/issues/1579?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../refresh/layout/SmartRefreshLayout.java | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java index 24bca7d4..569f5a53 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java @@ -3086,7 +3086,7 @@ public void run() { notifyStateChanged(RefreshState.PullDownCanceled); } // mKernel.setState(RefreshState.None); - } else if (mState == RefreshState.Refreshing && mRefreshHeader != null) { + } else if (mState == RefreshState.Refreshing) { count++; mHandler.postDelayed(this, more); //提前设置 状态为 RefreshFinish 防止 postDelayed 导致 finishRefresh 过后,外部判断 state 还是 Refreshing @@ -3100,9 +3100,12 @@ public void run() { } } else { // 本else 分支的触发是的代码是上面的:count++;mHandler.postDelayed(this, more); - int startDelay = mRefreshHeader.onFinish(SmartRefreshLayout.this, success); - if (mOnMultiListener != null && mRefreshHeader instanceof RefreshHeader) { - mOnMultiListener.onHeaderFinish((RefreshHeader) mRefreshHeader, success); + int startDelay = 0; + if (mRefreshHeader != null) { + startDelay = mRefreshHeader.onFinish(SmartRefreshLayout.this, success); + if (mOnMultiListener != null && mRefreshHeader instanceof RefreshHeader) { + mOnMultiListener.onHeaderFinish((RefreshHeader) mRefreshHeader, success); + } } //startDelay < Integer.MAX_VALUE 表示 延时 startDelay 毫秒之后,回弹关闭刷新 if (startDelay < Integer.MAX_VALUE) { @@ -4019,17 +4022,10 @@ public RefreshKernel onAutoRefreshAnimationEnd(Animator animation, boolean anima return this;//0 表示被取消 } reboundAnimator = null; -// if (mRefreshHeader != null) { - if (mState != RefreshState.ReleaseToRefresh) { - this.setState(RefreshState.ReleaseToRefresh); - } - SmartRefreshLayout.this.setStateRefreshing(!animationOnly); -// } else { -// /* -// * 2019-12-24 修复 mRefreshHeader=null 时状态错乱问题 -// */ -// this.setState(RefreshState.None); -// } + if (mState != RefreshState.ReleaseToRefresh) { + this.setState(RefreshState.ReleaseToRefresh); + } + SmartRefreshLayout.this.setStateRefreshing(!animationOnly); return this; } From 5876d0d5e00427502c331e3edd2d17b2917e9c65 Mon Sep 17 00:00:00 2001 From: wsc Date: Sun, 15 Sep 2024 16:08:00 +0800 Subject: [PATCH 53/67] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=9ANullPointerException:=20Attempt=20to=20invoke=20interf?= =?UTF-8?q?ace=20method=20'onAutoRefreshAnimationEnd()'=20on=20a=20null=20?= =?UTF-8?q?object=20reference=20https://github.com/scwang90/SmartRefreshLa?= =?UTF-8?q?yout/issues/1584?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/scwang/smart/refresh/header/MaterialHeader.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java index 74078c41..d40a6f16 100644 --- a/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java +++ b/refresh-header-material/src/main/java/com/scwang/smart/refresh/header/MaterialHeader.java @@ -385,6 +385,10 @@ public boolean autoOpen(int duration, float dragRate, final boolean animationOnl //如果显示背景,使用旧版的 autoRefresh 动画 return false; } + if (mKernel == null) { + //如果必要的组件没有初始化,也使用旧版动画 autoRefresh 动画 + return false; + } final View circleView = mCircleView; circleView.setAlpha(1); circleView.setScaleX(0); From 31eaa331c97d74f278814c3086d5769bb8c17c4e Mon Sep 17 00:00:00 2001 From: wsc Date: Wed, 25 Sep 2024 23:24:08 +0800 Subject: [PATCH 54/67] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=9A=E5=A4=8D=E5=88=B6kernel=E4=BB=A3=E7=A0=81=E5=8F=A6?= =?UTF-8?q?=E5=A4=96=E8=B5=B7=E5=8C=85=E5=90=8D=E5=90=8E,=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E6=9B=B4=E5=A4=9A=E6=97=B6=E5=80=99recyclerview?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=B5=81=E7=95=85=E6=BB=9A=E5=8A=A8=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=97=AE=E9=A2=98=EF=BC=9AV2.1.0=E7=89=88?= =?UTF-8?q?=E6=9C=AC=EF=BC=8Cdemo=E6=A1=88=E4=BE=8B=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=AE=98=E6=96=B9=E4=B8=BB=E9=A2=98=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=93=8D=E4=BD=9C=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=EF=BC=8C=E8=A7=86=E5=9B=BE=E4=B8=8D=E5=8F=AF=E4=BB=A5=E6=BB=91?= =?UTF-8?q?=E5=8A=A8=EF=BC=8C=E4=BD=86=E6=98=AF=E5=93=8D=E5=BA=94=E7=82=B9?= =?UTF-8?q?=E5=87=BB=EF=BC=8Cv2.0.6=EF=BC=8Cv2.0.5=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=BF=99=E6=A0=B7=E7=9A=84=E9=97=AE=E9=A2=98=20https://github.?= =?UTF-8?q?com/scwang90/SmartRefreshLayout/issues/1576=20https://github.co?= =?UTF-8?q?m/scwang90/SmartRefreshLayout/issues/1585?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../refresh/layout/SmartRefreshLayout.java | 59 ++----------------- 1 file changed, 5 insertions(+), 54 deletions(-) diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java index 569f5a53..60d595fc 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java @@ -1756,7 +1756,7 @@ protected void moveSpinnerInfinitely(float spinner) { final double M = maxDragHeight - mHeaderHeight; final double H = Math.max(mScreenHeightPixels * 4 / 3, thisView.getHeight()) - mHeaderHeight; final double x = Math.max(0, (spinner - mHeaderHeight) * mDragRate); - final double y = M * (1 - Math.pow(100, -x / (H == 0 ? 1 : H)));// 公式 y = M(1-100^(-x/H)) + final double y = Math.min(M * (1 - Math.pow(100, -x / (H == 0 ? 1 : H))), x);// 公式 y = M(1-100^(-x/H)) mKernel.moveSpinner((int) y + mHeaderHeight, true); } } else if (spinner < 0 && (mState == RefreshState.Loading @@ -1769,20 +1769,20 @@ protected void moveSpinnerInfinitely(float spinner) { final double M = maxDragHeight - mFooterHeight; final double H = Math.max(mScreenHeightPixels * 4 / 3, thisView.getHeight()) - mFooterHeight; final double x = -Math.min(0, (spinner + mFooterHeight) * mDragRate); - final double y = -M * (1 - Math.pow(100, -x / (H == 0 ? 1 : H)));// 公式 y = M(1-100^(-x/H)) + final double y = -Math.min(M * (1 - Math.pow(100, -x / (H == 0 ? 1 : H))), x);// 公式 y = M(1-100^(-x/H)) mKernel.moveSpinner((int) y - mFooterHeight, true); } } else if (spinner >= 0) { final double M = mHeaderMaxDragRate < 10 ? mHeaderHeight * mHeaderMaxDragRate : mHeaderMaxDragRate; final double H = Math.max(mScreenHeightPixels / 2, thisView.getHeight()); final double x = Math.max(0, spinner * mDragRate); - final double y = M * (1 - Math.pow(100, -x / (H == 0 ? 1 : H)));// 公式 y = M(1-100^(-x/H)) + final double y = Math.min(M * (1 - Math.pow(100, -x / (H == 0 ? 1 : H))), x);// 公式 y = M(1-100^(-x/H)) mKernel.moveSpinner((int) y, true); } else { final double M = mFooterMaxDragRate < 10 ? mFooterHeight * mFooterMaxDragRate : mFooterMaxDragRate; final double H = Math.max(mScreenHeightPixels / 2, thisView.getHeight()); final double x = -Math.min(0, spinner * mDragRate); - final double y = -M * (1 - Math.pow(100, -x / (H == 0 ? 1 : H)));// 公式 y = M(1-100^(-x/H)) + final double y = -Math.min(M * (1 - Math.pow(100, -x / (H == 0 ? 1 : H))), x);// 公式 y = M(1-100^(-x/H)) mKernel.moveSpinner((int) y, true); } if (mEnableAutoLoadMore && !mFooterNoMoreData && isEnableRefreshOrLoadMore(mEnableLoadMore) && spinner < 0 @@ -1811,55 +1811,6 @@ protected void moveSpinnerInfinitely(float spinner) { } } - /** - * 感谢 jamgudev <826630153@qq.com> 2022-03-22 贡献的代码 (贡献原始函数:reverseCompute) - * 给出阻尼计算的距离,计算原始滑动距离 - * 与 moveSpinnerInfinitely 函数为反向计算 - * @param spinnerConvergence 阻尼计算过后的距离 - * @return 原始滑动距离 - */ - protected int reverseInfinitely(float spinnerConvergence) { - final View thisView = this; - double originSpinner; - if (mState == RefreshState.TwoLevel && spinnerConvergence > 0) { - originSpinner = spinnerConvergence; - } else if (mState == RefreshState.Refreshing && spinnerConvergence >= 0) { - if (spinnerConvergence < mHeaderHeight) { - originSpinner = spinnerConvergence; - } else { - final float maxDragHeight = mHeaderMaxDragRate < 10 ? mHeaderHeight * mHeaderMaxDragRate : mHeaderMaxDragRate; - final double M = maxDragHeight - mHeaderHeight; - final double H = Math.max(mScreenHeightPixels * 4 / 3, thisView.getHeight()) - mHeaderHeight; - final double y = spinnerConvergence * 1; - originSpinner = ((-H * (Math.log(1 - y / M) / Math.log(100f))) + mHeaderHeight) / mDragRate; - } - } else if (spinnerConvergence < 0 && (mState == RefreshState.Loading - || (mEnableFooterFollowWhenNoMoreData && mFooterNoMoreData && mFooterNoMoreDataEffective && isEnableRefreshOrLoadMore(mEnableLoadMore)) - || (mEnableAutoLoadMore && !mFooterNoMoreData && isEnableRefreshOrLoadMore(mEnableLoadMore)))) { - if (spinnerConvergence > -mFooterHeight) { - originSpinner = spinnerConvergence; - } else { - final float maxDragHeight = mFooterMaxDragRate < 10 ? mFooterHeight * mFooterMaxDragRate : mFooterMaxDragRate; - final double M = maxDragHeight - mFooterHeight; - final double H = Math.max(mScreenHeightPixels * 4 / 3, thisView.getHeight()) - mFooterHeight; - final double y = -spinnerConvergence; - originSpinner = -((-H * (Math.log(1 - y / M) / Math.log(100f))) - mFooterHeight) / mDragRate; - } - } else if (spinnerConvergence >= 0) { - final double M = mHeaderMaxDragRate < 10 ? mHeaderHeight * mHeaderMaxDragRate : mHeaderMaxDragRate; - final double H = Math.max(mScreenHeightPixels / 2, thisView.getHeight()); - final double y = spinnerConvergence * 1; - originSpinner = (-H * (Math.log(1 - y / M) / Math.log(100f))) / mDragRate; - } else { - final double M = mFooterMaxDragRate < 10 ? mFooterHeight * mFooterMaxDragRate : mFooterMaxDragRate; - final double H = Math.max(mScreenHeightPixels / 2, thisView.getHeight()); - final double y = -spinnerConvergence * 1; - originSpinner = -((-H * (Math.log(1 - y / M) / Math.log(100f))) - mFooterHeight) / mDragRate; - } - - return Math.round((float)originSpinner); - } - // // @@ -1936,7 +1887,7 @@ public void onNestedScrollAccepted(@NonNull View child, @NonNull View target, in // Dispatch up to the nested parent mNestedChild.startNestedScroll(axes & ViewCompat.SCROLL_AXIS_VERTICAL); - mTotalUnconsumed = reverseInfinitely(mSpinner); + mTotalUnconsumed = mSpinner; mNestedInProgress = true; interceptAnimatorByAction(MotionEvent.ACTION_DOWN); From 6c08375129648d36c3f7437a38ccc4e66bb643f1 Mon Sep 17 00:00:00 2001 From: wsc Date: Thu, 3 Oct 2024 13:10:22 +0800 Subject: [PATCH 55/67] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/scwang/smart/refresh/layout/SmartRefreshLayout.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java index 60d595fc..35963cba 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java @@ -2315,6 +2315,7 @@ public RefreshLayout setReboundDuration(int duration) { /** * Set whether to enable pull-up loading more (enabled by default). * 设置是否启用上拉加载更多(默认启用) + * 注意:本方法仅仅支持初始化的时候调用,如过没有数据的时候,需要关闭请使用: finishLoadMoreWithNoMoreData 或者 finishRefreshWithNoMoreData * @param enabled 是否启用 * @return RefreshLayout */ @@ -3360,6 +3361,7 @@ public boolean autoRefresh(int delayed) { /** * Display refresh animation without triggering events. * 显示刷新动画,不触发事件 + * 注意:本方法只会开启动画,不会触发刷新事件。所以需要自己在外部适当的时机调用 finishRefresh 来关闭刷新动画 * @return true or false, Status non-compliance will fail. * 是否成功(状态不符合会失败) */ From 8ce6e3ed0407f87f9f202ea401090194722503c6 Mon Sep 17 00:00:00 2001 From: wsc Date: Sat, 5 Oct 2024 14:13:50 +0800 Subject: [PATCH 56/67] =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 18 +++++++++--------- README_EN.md | 18 +++++++++--------- gradle.properties | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 0f463444..c86ffdb6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![License](https://img.shields.io/badge/License%20-Apache%202-337ab7.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![Arsenal](https://img.shields.io/badge/Arsenal%20-%20SmartRefresh-4cae4c.svg)](https://android-arsenal.com/details/1/6001) -[![Maven](https://img.shields.io/badge/%20Maven%20-2.1.0-5bc0de.svg)](https://s01.oss.sonatype.org/#nexus-search;quick~refresh-layout-kernel) +[![Maven](https://img.shields.io/badge/%20Maven%20-2.1.1-5bc0de.svg)](https://s01.oss.sonatype.org/#nexus-search;quick~refresh-layout-kernel) [![MinSdk](https://img.shields.io/badge/%20MinSdk%20-%2012%2B%20-f0ad4e.svg)](https://android-arsenal.com/api?level=12) [![Methods](https://img.shields.io/badge/Methods%20%7C%20Size%20-%20784%20%7C%20121%20KB-d9534f.svg)](http://www.methodscount.com/?lib=io.github.scwang90:refresh%3ASmartRefreshLayout%3A1.0.4) @@ -124,14 +124,14 @@ V2.x 版本已经把依赖库拆分成8个包啦,用到的时候自行引用 ```gradle implementation 'androidx.appcompat:appcompat:1.0.0' //必须 1.0.0 以上 -implementation 'io.github.scwang90:refresh-layout-kernel:2.1.0' //核心必须依赖 -implementation 'io.github.scwang90:refresh-header-classics:2.1.0' //经典刷新头 -implementation 'io.github.scwang90:refresh-header-radar:2.1.0' //雷达刷新头 -implementation 'io.github.scwang90:refresh-header-falsify:2.1.0' //虚拟刷新头 -implementation 'io.github.scwang90:refresh-header-material:2.1.0' //谷歌刷新头 -implementation 'io.github.scwang90:refresh-header-two-level:2.1.0' //二级刷新头 -implementation 'io.github.scwang90:refresh-footer-ball:2.1.0' //球脉冲加载 -implementation 'io.github.scwang90:refresh-footer-classics:2.1.0' //经典加载 +implementation 'io.github.scwang90:refresh-layout-kernel:2.1.1' //核心必须依赖 +implementation 'io.github.scwang90:refresh-header-classics:2.1.1' //经典刷新头 +implementation 'io.github.scwang90:refresh-header-radar:2.1.1' //雷达刷新头 +implementation 'io.github.scwang90:refresh-header-falsify:2.1.1' //虚拟刷新头 +implementation 'io.github.scwang90:refresh-header-material:2.1.1' //谷歌刷新头 +implementation 'io.github.scwang90:refresh-header-two-level:2.1.1' //二级刷新头 +implementation 'io.github.scwang90:refresh-footer-ball:2.1.1' //球脉冲加载 +implementation 'io.github.scwang90:refresh-footer-classics:2.1.1' //经典加载 ``` diff --git a/README_EN.md b/README_EN.md index bf4878e3..5342afcb 100644 --- a/README_EN.md +++ b/README_EN.md @@ -2,7 +2,7 @@ [![License](https://img.shields.io/badge/License%20-Apache%202-337ab7.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![Arsenal](https://img.shields.io/badge/Arsenal%20-%20SmartRefresh-4cae4c.svg)](https://android-arsenal.com/details/1/6001) -[![Maven](https://img.shields.io/badge/%20Maven%20-2.1.0-5bc0de.svg)](https://s01.oss.sonatype.org/#nexus-search;quick~refresh-layout-kernel) +[![Maven](https://img.shields.io/badge/%20Maven%20-2.1.1-5bc0de.svg)](https://s01.oss.sonatype.org/#nexus-search;quick~refresh-layout-kernel) [![MinSdk](https://img.shields.io/badge/%20MinSdk%20-%2012%2B%20-f0ad4e.svg)](https://android-arsenal.com/api?level=12) [![Methods](https://img.shields.io/badge/Methods%20%7C%20Size%20-%20784%20%7C%20121%20KB-d9534f.svg)](http://www.methodscount.com/?lib=io.github.scwang90:refresh%3ASmartRefreshLayout%3A1.0.4) @@ -120,14 +120,14 @@ It is recommended that you copy the source code into the project whenever you ne // Note: There will be no default Header and Footer after subcontracting. It needs to be added manually! // To search lastest version by https://search.maven.org/search?q=g:io.github.scwang90 -implementation 'io.github.scwang90:refresh-layout-kernel:2.1.0' //core -implementation 'io.github.scwang90:refresh-header-classics:2.1.0' //ClassicsHeader -implementation 'io.github.scwang90:refresh-header-radar:2.1.0' //BezierRadarHeader -implementation 'io.github.scwang90:refresh-header-falsify:2.1.0' //FalsifyHeader -implementation 'io.github.scwang90:refresh-header-material:2.1.0' //MaterialHeader -implementation 'io.github.scwang90:refresh-header-two-level:2.1.0' //TwoLevelHeader -implementation 'io.github.scwang90:refresh-footer-ball:2.1.0' //BallPulseFooter -implementation 'io.github.scwang90:refresh-footer-classics:2.1.0' //ClassicsFooter +implementation 'io.github.scwang90:refresh-layout-kernel:2.1.1' //core +implementation 'io.github.scwang90:refresh-header-classics:2.1.1' //ClassicsHeader +implementation 'io.github.scwang90:refresh-header-radar:2.1.1' //BezierRadarHeader +implementation 'io.github.scwang90:refresh-header-falsify:2.1.1' //FalsifyHeader +implementation 'io.github.scwang90:refresh-header-material:2.1.1' //MaterialHeader +implementation 'io.github.scwang90:refresh-header-two-level:2.1.1' //TwoLevelHeader +implementation 'io.github.scwang90:refresh-footer-ball:2.1.1' //BallPulseFooter +implementation 'io.github.scwang90:refresh-footer-classics:2.1.1' //ClassicsFooter ``` diff --git a/gradle.properties b/gradle.properties index aab1bab5..57fc998f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,7 +21,7 @@ android.enableJetifier=true SMART_USER=scwang90 SMART_GROUP=com.scwang.smart -SMART_VERSION=2.1.0 +SMART_VERSION=2.1.1 # -SNAPSHOT SMART_PUBLISH=false SMART_GROUP_MVN=io.github.scwang90 From 61cc34a1aedf2a20efb4b166f89a60a480e7241b Mon Sep 17 00:00:00 2001 From: wsc Date: Tue, 15 Oct 2024 13:49:31 +0800 Subject: [PATCH 57/67] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=8F=91=E5=B8=83=20V3?= =?UTF-8?q?.0.0-alpha=20=E7=89=88=E6=9C=AC=EF=BC=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 27 ++++++---------- README_EN.md | 23 ++++++-------- app/build.gradle | 44 +++++++++++++-------------- bintrayUpload.bat | 1 - build.gradle | 14 ++++++--- gradle.properties | 4 +-- refresh-drawable-paint/build.gradle | 6 ++-- refresh-drawable-path/build.gradle | 6 ++-- refresh-footer-ball/build.gradle | 10 ++++-- refresh-footer-classics/build.gradle | 10 ++++-- refresh-footer/build.gradle | 14 ++++----- refresh-header-classics/build.gradle | 10 ++++-- refresh-header-falsify/build.gradle | 9 ++++-- refresh-header-material/build.gradle | 10 ++++-- refresh-header-radar/build.gradle | 10 ++++-- refresh-header-two-level/build.gradle | 6 ++-- refresh-header/build.gradle | 22 +++++++------- refresh-layout-kernel/build.gradle | 6 ++-- refresh-layout/build.gradle | 26 ++++++++-------- 19 files changed, 135 insertions(+), 123 deletions(-) delete mode 100644 bintrayUpload.bat diff --git a/README.md b/README.md index c86ffdb6..2aa4de4c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![License](https://img.shields.io/badge/License%20-Apache%202-337ab7.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![Arsenal](https://img.shields.io/badge/Arsenal%20-%20SmartRefresh-4cae4c.svg)](https://android-arsenal.com/details/1/6001) -[![Maven](https://img.shields.io/badge/%20Maven%20-2.1.1-5bc0de.svg)](https://s01.oss.sonatype.org/#nexus-search;quick~refresh-layout-kernel) +[![Maven](https://img.shields.io/badge/%20Maven%20-3.0.0-5bc0de.svg)](https://s01.oss.sonatype.org/#nexus-search;quick~refresh-layout-kernel) [![MinSdk](https://img.shields.io/badge/%20MinSdk%20-%2012%2B%20-f0ad4e.svg)](https://android-arsenal.com/api?level=12) [![Methods](https://img.shields.io/badge/Methods%20%7C%20Size%20-%20784%20%7C%20121%20KB-d9534f.svg)](http://www.methodscount.com/?lib=io.github.scwang90:refresh%3ASmartRefreshLayout%3A1.0.4) @@ -124,26 +124,17 @@ V2.x 版本已经把依赖库拆分成8个包啦,用到的时候自行引用 ```gradle implementation 'androidx.appcompat:appcompat:1.0.0' //必须 1.0.0 以上 -implementation 'io.github.scwang90:refresh-layout-kernel:2.1.1' //核心必须依赖 -implementation 'io.github.scwang90:refresh-header-classics:2.1.1' //经典刷新头 -implementation 'io.github.scwang90:refresh-header-radar:2.1.1' //雷达刷新头 -implementation 'io.github.scwang90:refresh-header-falsify:2.1.1' //虚拟刷新头 -implementation 'io.github.scwang90:refresh-header-material:2.1.1' //谷歌刷新头 -implementation 'io.github.scwang90:refresh-header-two-level:2.1.1' //二级刷新头 -implementation 'io.github.scwang90:refresh-footer-ball:2.1.1' //球脉冲加载 -implementation 'io.github.scwang90:refresh-footer-classics:2.1.1' //经典加载 +implementation 'io.github.scwang90:refresh-layout-kernel:3.0.0-alpha' //核心必须依赖 +implementation 'io.github.scwang90:refresh-header-classics:3.0.0-alpha' //经典刷新头 +implementation 'io.github.scwang90:refresh-header-radar:3.0.0-alpha' //雷达刷新头 +implementation 'io.github.scwang90:refresh-header-falsify:3.0.0-alpha' //虚拟刷新头 +implementation 'io.github.scwang90:refresh-header-material:3.0.0-alpha' //谷歌刷新头 +implementation 'io.github.scwang90:refresh-header-two-level:3.0.0-alpha' //二级刷新头 +implementation 'io.github.scwang90:refresh-footer-ball:3.0.0-alpha' //球脉冲加载 +implementation 'io.github.scwang90:refresh-footer-classics:3.0.0-alpha' //经典加载 ``` - -如果使用 AndroidX 先在 gradle.properties 中添加,两行都不能少噢~ - -``` -android.useAndroidX=true -android.enableJetifier=true - -``` - #### 2.在XML布局文件中添加 SmartRefreshLayout ```xml diff --git a/README_EN.md b/README_EN.md index 5342afcb..5a1929c8 100644 --- a/README_EN.md +++ b/README_EN.md @@ -2,7 +2,7 @@ [![License](https://img.shields.io/badge/License%20-Apache%202-337ab7.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![Arsenal](https://img.shields.io/badge/Arsenal%20-%20SmartRefresh-4cae4c.svg)](https://android-arsenal.com/details/1/6001) -[![Maven](https://img.shields.io/badge/%20Maven%20-2.1.1-5bc0de.svg)](https://s01.oss.sonatype.org/#nexus-search;quick~refresh-layout-kernel) +[![Maven](https://img.shields.io/badge/%20Maven%20-3.0.0-5bc0de.svg)](https://s01.oss.sonatype.org/#nexus-search;quick~refresh-layout-kernel) [![MinSdk](https://img.shields.io/badge/%20MinSdk%20-%2012%2B%20-f0ad4e.svg)](https://android-arsenal.com/api?level=12) [![Methods](https://img.shields.io/badge/Methods%20%7C%20Size%20-%20784%20%7C%20121%20KB-d9534f.svg)](http://www.methodscount.com/?lib=io.github.scwang90:refresh%3ASmartRefreshLayout%3A1.0.4) @@ -120,21 +120,16 @@ It is recommended that you copy the source code into the project whenever you ne // Note: There will be no default Header and Footer after subcontracting. It needs to be added manually! // To search lastest version by https://search.maven.org/search?q=g:io.github.scwang90 -implementation 'io.github.scwang90:refresh-layout-kernel:2.1.1' //core -implementation 'io.github.scwang90:refresh-header-classics:2.1.1' //ClassicsHeader -implementation 'io.github.scwang90:refresh-header-radar:2.1.1' //BezierRadarHeader -implementation 'io.github.scwang90:refresh-header-falsify:2.1.1' //FalsifyHeader -implementation 'io.github.scwang90:refresh-header-material:2.1.1' //MaterialHeader -implementation 'io.github.scwang90:refresh-header-two-level:2.1.1' //TwoLevelHeader -implementation 'io.github.scwang90:refresh-footer-ball:2.1.1' //BallPulseFooter -implementation 'io.github.scwang90:refresh-footer-classics:2.1.1' //ClassicsFooter - +implementation 'io.github.scwang90:refresh-layout-kernel:3.0.0-alpha' //core +implementation 'io.github.scwang90:refresh-header-classics:3.0.0-alpha' //ClassicsHeader +implementation 'io.github.scwang90:refresh-header-radar:3.0.0-alpha' //BezierRadarHeader +implementation 'io.github.scwang90:refresh-header-falsify:3.0.0-alpha' //FalsifyHeader +implementation 'io.github.scwang90:refresh-header-material:3.0.0-alpha' //MaterialHeader +implementation 'io.github.scwang90:refresh-header-two-level:3.0.0-alpha' //TwoLevelHeader +implementation 'io.github.scwang90:refresh-footer-ball:3.0.0-alpha' //BallPulseFooter +implementation 'io.github.scwang90:refresh-footer-classics:3.0.0-alpha' //ClassicsFooter ``` - - - - If you use AndroidX, add it to gradle.properties diff --git a/app/build.gradle b/app/build.gradle index 369d6372..4449fb6d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -58,9 +58,9 @@ dependencies { // implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.cardview:cardview:1.0.0' - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation 'androidx.constraintlayout:constraintlayout:2.2.0' // implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation 'com.google.android.material:material:1.10.0' + implementation 'com.google.android.material:material:1.12.0' debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.10' @@ -68,24 +68,24 @@ dependencies { implementation project(':refresh-header') implementation project(':refresh-layout') - implementation project(':refresh-drawable-path') - implementation project(':refresh-layout-kernel') - implementation project(':refresh-header-classics') - implementation project(':refresh-header-radar') - implementation project(':refresh-header-falsify') - implementation project(':refresh-header-material') - implementation project(':refresh-header-two-level') - implementation project(':refresh-footer-ball') - -// implementation 'io.github.scwang90:refresh-drawable-path:2.1.0' //矢量路径 -// implementation 'io.github.scwang90:refresh-layout-kernel:2.1.0' //核心必须依赖 -// implementation 'io.github.scwang90:refresh-header-classics:2.1.0' //经典刷新头 -// implementation 'io.github.scwang90:refresh-header-radar:2.1.0' //雷达刷新头 -// implementation 'io.github.scwang90:refresh-header-falsify:2.1.0' //虚拟刷新头 -// implementation 'io.github.scwang90:refresh-header-material:2.1.0' //谷歌刷新头 -// implementation 'io.github.scwang90:refresh-header-two-level:2.1.0' //二级刷新头 -// implementation 'io.github.scwang90:refresh-footer-ball:2.1.0' //球脉冲加载 -// implementation 'io.github.scwang90:refresh-footer-classics:2.1.0' //经典加载 +// implementation project(':refresh-drawable-path') +// implementation project(':refresh-layout-kernel') +// implementation project(':refresh-header-classics') +// implementation project(':refresh-header-radar') +// implementation project(':refresh-header-falsify') +// implementation project(':refresh-header-material') +// implementation project(':refresh-header-two-level') +// implementation project(':refresh-footer-ball') + + implementation 'io.github.scwang90:refresh-drawable-path:3.0.0-alpha' //矢量路径 + implementation 'io.github.scwang90:refresh-layout-kernel:3.0.0-alpha' //核心必须依赖 + implementation 'io.github.scwang90:refresh-header-classics:3.0.0-alpha' //经典刷新头 + implementation 'io.github.scwang90:refresh-header-radar:3.0.0-alpha' //雷达刷新头 + implementation 'io.github.scwang90:refresh-header-falsify:3.0.0-alpha' //虚拟刷新头 + implementation 'io.github.scwang90:refresh-header-material:3.0.0-alpha' //谷歌刷新头 + implementation 'io.github.scwang90:refresh-header-two-level:3.0.0-alpha' //二级刷新头 + implementation 'io.github.scwang90:refresh-footer-ball:3.0.0-alpha' //球脉冲加载 + implementation 'io.github.scwang90:refresh-footer-classics:3.0.0-alpha' //经典加载 implementation 'com.flyco.roundview:FlycoRoundView_Lib:1.1.4@aar' implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.50' @@ -103,6 +103,6 @@ dependencies { annotationProcessor 'com.github.bumptech.glide:compiler:4.13.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } diff --git a/bintrayUpload.bat b/bintrayUpload.bat deleted file mode 100644 index 12c7480a..00000000 --- a/bintrayUpload.bat +++ /dev/null @@ -1 +0,0 @@ -gradlew clean build bintrayUpload -PbintrayUser=scwang90 -PbintrayKey=%1 -PdryRun=false \ No newline at end of file diff --git a/build.gradle b/build.gradle index d35edfa6..8c3030a6 100644 --- a/build.gradle +++ b/build.gradle @@ -5,8 +5,6 @@ buildscript { google() mavenCentral() gradlePluginPortal() -// jcenter() -// maven { url 'https://maven.aliyun.com/repository/jcenter' } } dependencies { classpath 'com.android.tools.build:gradle:7.2.2' @@ -40,7 +38,7 @@ task clean(type: Delete) { delete rootProject.buildDir } -def file = 'local.properties' +def file = "${rootProject.projectDir}\\local.properties" if (new File(file).exists()) { Properties properties = new Properties() properties.load(new FileInputStream(file)) @@ -140,8 +138,14 @@ if (new File(file).exists()) { url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl credentials { // 这里就是之前在 issues.sonatype.org 注册的账号 - username "${properties["sonatype.username"]}" - password new String(Base64.mimeDecoder.decode("${properties["sonatype.password"]}"), "UTF-8") + // username "${properties["sonatype.username"]}" + // password new String(Base64.mimeDecoder.decode("${properties["sonatype.password"]}"), "UTF-8") + // 后期改用 Token 认证 + def tokenUsername = "${System.getenv('ossrhUsername')}" + def tokenPassword = "${System.getenv('ossrhPassword')}" + println "tokenUsername=\u001B[32m$tokenUsername\u001B[0m;tokenPassword=\u001B[32m$tokenPassword\u001B[0m" + username tokenUsername + password tokenPassword } } } diff --git a/gradle.properties b/gradle.properties index 57fc998f..3ba267b3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,8 +21,8 @@ android.enableJetifier=true SMART_USER=scwang90 SMART_GROUP=com.scwang.smart -SMART_VERSION=2.1.1 -# -SNAPSHOT +SMART_VERSION=3.0.0-alpha + SMART_PUBLISH=false SMART_GROUP_MVN=io.github.scwang90 SMART_EMAIL=scwang90@hotmail.com diff --git a/refresh-drawable-paint/build.gradle b/refresh-drawable-paint/build.gradle index d6d153c5..a1fda499 100644 --- a/refresh-drawable-paint/build.gradle +++ b/refresh-drawable-paint/build.gradle @@ -28,9 +28,9 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - compileOnly 'androidx.annotation:annotation:1.7.0' + compileOnly 'androidx.annotation:annotation:1.9.1' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } diff --git a/refresh-drawable-path/build.gradle b/refresh-drawable-path/build.gradle index 9ad35f39..4845124a 100644 --- a/refresh-drawable-path/build.gradle +++ b/refresh-drawable-path/build.gradle @@ -30,9 +30,9 @@ dependencies { api project(':refresh-drawable-paint') - compileOnly 'androidx.appcompat:appcompat:1.6.1' + compileOnly 'androidx.appcompat:appcompat:1.7.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } diff --git a/refresh-footer-ball/build.gradle b/refresh-footer-ball/build.gradle index e2db6d91..d1277013 100644 --- a/refresh-footer-ball/build.gradle +++ b/refresh-footer-ball/build.gradle @@ -22,6 +22,10 @@ android { } } + lintOptions { + abortOnError false + } + } dependencies { @@ -29,9 +33,9 @@ dependencies { compileOnly project(':refresh-layout-kernel') - compileOnly 'androidx.appcompat:appcompat:1.6.1' + compileOnly 'androidx.appcompat:appcompat:1.7.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } diff --git a/refresh-footer-classics/build.gradle b/refresh-footer-classics/build.gradle index f9c8badb..261c3b8a 100644 --- a/refresh-footer-classics/build.gradle +++ b/refresh-footer-classics/build.gradle @@ -22,6 +22,10 @@ android { } } + lintOptions { + abortOnError false + } + } dependencies { @@ -30,9 +34,9 @@ dependencies { api project(':refresh-drawable-paint') compileOnly project(':refresh-layout-kernel') - compileOnly 'androidx.appcompat:appcompat:1.6.1' + compileOnly 'androidx.appcompat:appcompat:1.7.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } diff --git a/refresh-footer/build.gradle b/refresh-footer/build.gradle index fbfedd4e..ee8f7c21 100644 --- a/refresh-footer/build.gradle +++ b/refresh-footer/build.gradle @@ -28,15 +28,15 @@ dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') compileOnly project(':refresh-layout') - compileOnly project(':refresh-footer-ball') - compileOnly project(':refresh-footer-classics') +// compileOnly project(':refresh-footer-ball') +// compileOnly project(':refresh-footer-classics') -// implementation 'io.github.scwang90:refresh-footer-ball:2.1.0' //球脉冲加载 -// implementation 'io.github.scwang90:refresh-footer-classics:2.1.0' //经典加载 + compileOnly 'io.github.scwang90:refresh-footer-ball:3.0.0-alpha' //球脉冲加载 + compileOnly 'io.github.scwang90:refresh-footer-classics:3.0.0-alpha' //经典加载 - compileOnly 'androidx.appcompat:appcompat:1.6.1' + compileOnly 'androidx.appcompat:appcompat:1.7.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } diff --git a/refresh-header-classics/build.gradle b/refresh-header-classics/build.gradle index 3527e6d7..7b3f4371 100644 --- a/refresh-header-classics/build.gradle +++ b/refresh-header-classics/build.gradle @@ -22,6 +22,10 @@ android { } } + lintOptions { + abortOnError false + } + } dependencies { @@ -30,10 +34,10 @@ dependencies { api project(':refresh-footer-classics') compileOnly project(':refresh-layout-kernel') - compileOnly 'androidx.appcompat:appcompat:1.6.1' + compileOnly 'androidx.appcompat:appcompat:1.7.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } diff --git a/refresh-header-falsify/build.gradle b/refresh-header-falsify/build.gradle index 96c906fe..7c8e09cf 100644 --- a/refresh-header-falsify/build.gradle +++ b/refresh-header-falsify/build.gradle @@ -22,6 +22,9 @@ android { } } + lintOptions { + abortOnError false + } } dependencies { @@ -29,9 +32,9 @@ dependencies { compileOnly project(':refresh-layout-kernel') - compileOnly 'androidx.appcompat:appcompat:1.6.1' + compileOnly 'androidx.appcompat:appcompat:1.7.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } diff --git a/refresh-header-material/build.gradle b/refresh-header-material/build.gradle index decd8c91..abc7bdcb 100644 --- a/refresh-header-material/build.gradle +++ b/refresh-header-material/build.gradle @@ -22,6 +22,10 @@ android { } } + lintOptions { + abortOnError false + } + } dependencies { @@ -29,9 +33,9 @@ dependencies { compileOnly project(':refresh-layout-kernel') - compileOnly 'androidx.appcompat:appcompat:1.6.1' + compileOnly 'androidx.appcompat:appcompat:1.7.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } diff --git a/refresh-header-radar/build.gradle b/refresh-header-radar/build.gradle index 1f5aad38..da97673a 100644 --- a/refresh-header-radar/build.gradle +++ b/refresh-header-radar/build.gradle @@ -22,6 +22,10 @@ android { } } + lintOptions { + abortOnError false + } + } dependencies { @@ -29,9 +33,9 @@ dependencies { compileOnly project(':refresh-layout-kernel') - compileOnly 'androidx.appcompat:appcompat:1.6.1' + compileOnly 'androidx.appcompat:appcompat:1.7.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } diff --git a/refresh-header-two-level/build.gradle b/refresh-header-two-level/build.gradle index 4eb1735b..146f133e 100644 --- a/refresh-header-two-level/build.gradle +++ b/refresh-header-two-level/build.gradle @@ -33,9 +33,9 @@ dependencies { api project(':refresh-header-classics') compileOnly project(':refresh-layout-kernel') - compileOnly 'androidx.appcompat:appcompat:1.6.1' + compileOnly 'androidx.appcompat:appcompat:1.7.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } diff --git a/refresh-header/build.gradle b/refresh-header/build.gradle index f9f23d0b..66abbe02 100644 --- a/refresh-header/build.gradle +++ b/refresh-header/build.gradle @@ -27,19 +27,19 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) compileOnly project(':refresh-layout') - compileOnly project(':refresh-drawable-path') - compileOnly project(':refresh-header-material') - compileOnly project(':refresh-layout-kernel') - compileOnly project(':refresh-header-falsify') +// compileOnly project(':refresh-drawable-path') +// compileOnly project(':refresh-header-material') +// compileOnly project(':refresh-layout-kernel') +// compileOnly project(':refresh-header-falsify') -// implementation 'io.github.scwang90:refresh-drawable-path:2.1.0' //矢量路径 -// implementation 'io.github.scwang90:refresh-layout-kernel:2.1.0' //核心必须依赖 -// implementation 'io.github.scwang90:refresh-header-falsify:2.1.0' //虚拟刷新头 -// implementation 'io.github.scwang90:refresh-header-material:2.1.0' //谷歌刷新头 + compileOnly 'io.github.scwang90:refresh-drawable-path:3.0.0-alpha' //矢量路径 + compileOnly 'io.github.scwang90:refresh-layout-kernel:3.0.0-alpha' //核心必须依赖 + compileOnly 'io.github.scwang90:refresh-header-falsify:3.0.0-alpha' //虚拟刷新头 + compileOnly 'io.github.scwang90:refresh-header-material:3.0.0-alpha' //谷歌刷新头 - compileOnly 'androidx.appcompat:appcompat:1.6.1' + compileOnly 'androidx.appcompat:appcompat:1.7.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } diff --git a/refresh-layout-kernel/build.gradle b/refresh-layout-kernel/build.gradle index bca4606e..73ed667a 100644 --- a/refresh-layout-kernel/build.gradle +++ b/refresh-layout-kernel/build.gradle @@ -28,9 +28,9 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - compileOnly 'com.google.android.material:material:1.10.0' + compileOnly 'com.google.android.material:material:1.12.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } diff --git a/refresh-layout/build.gradle b/refresh-layout/build.gradle index 15e0c78c..65ea1c16 100644 --- a/refresh-layout/build.gradle +++ b/refresh-layout/build.gradle @@ -26,21 +26,21 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - compileOnly project(':refresh-layout-kernel') - compileOnly project(':refresh-footer-ball') - compileOnly project(':refresh-header-falsify') - compileOnly project(':refresh-header-radar') - compileOnly project(':refresh-header-two-level') +// compileOnly project(':refresh-layout-kernel') +// compileOnly project(':refresh-footer-ball') +// compileOnly project(':refresh-header-falsify') +// compileOnly project(':refresh-header-radar') +// compileOnly project(':refresh-header-two-level') -// implementation 'io.github.scwang90:refresh-layout-kernel:2.1.0' //核心必须依赖 -// implementation 'io.github.scwang90:refresh-header-radar:2.1.0' //雷达刷新头 -// implementation 'io.github.scwang90:refresh-header-falsify:2.1.0' //虚拟刷新头 -// implementation 'io.github.scwang90:refresh-header-two-level:2.1.0' //二级刷新头 -// implementation 'io.github.scwang90:refresh-footer-ball:2.1.0' //球脉冲加载 + compileOnly 'io.github.scwang90:refresh-layout-kernel:3.0.0-alpha' //核心必须依赖 + compileOnly 'io.github.scwang90:refresh-header-radar:3.0.0-alpha' //雷达刷新头 + compileOnly 'io.github.scwang90:refresh-header-falsify:3.0.0-alpha' //虚拟刷新头 + compileOnly 'io.github.scwang90:refresh-header-two-level:3.0.0-alpha' //二级刷新头 + compileOnly 'io.github.scwang90:refresh-footer-ball:3.0.0-alpha' //球脉冲加载 - compileOnly 'com.google.android.material:material:1.10.0' + compileOnly 'com.google.android.material:material:1.12.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' } From b6647b2617497853bb9a524e6360acfec47e4842 Mon Sep 17 00:00:00 2001 From: wsc Date: Sun, 20 Oct 2024 20:32:34 +0800 Subject: [PATCH 58/67] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E7=89=88API=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 21 +- README_EN.md | 14 +- app/build.gradle | 2 +- .../java/com/scwang/refreshlayout/App.java | 14 +- .../example/AssignCodeExampleActivity.java | 16 +- .../example/AssignDefaultExampleActivity.java | 26 +-- .../example/AssignXmlExampleActivity.java | 10 +- .../example/BasicExampleActivity.java | 12 +- .../activity/example/I18nExampleActivity.java | 6 +- .../example/ListenerExampleActivity.java | 13 +- .../example/NestedLayoutExampleActivity.java | 2 +- .../example/OverScrollExampleActivity.java | 4 +- .../example/SnapHelperExampleActivity.java | 4 +- .../practice/BannerPracticeActivity.java | 6 +- .../practice/FeedListPracticeActivity.java | 2 +- .../practice/RepastPracticeActivity.java | 4 +- .../practice/WebViewPracticeActivity.java | 4 +- .../practice/WeiboPracticeActivity.java | 8 +- .../style/BezierCircleStyleActivity.java | 2 +- .../style/BezierRadarStyleActivity.java | 4 +- .../activity/style/ClassicsStyleActivity.java | 6 +- .../activity/style/DeliveryStyleActivity.java | 2 +- .../activity/style/DropBoxStyleActivity.java | 2 +- .../style/FlyRefreshStyleActivity.java | 11 +- .../style/FunGameBattleCityStyleActivity.java | 2 +- .../style/FunGameHitBlockStyleActivity.java | 2 +- .../activity/style/MaterialStyleActivity.java | 2 +- .../activity/style/PhoenixStyleActivity.java | 2 +- .../style/StoreHouseStyleActivity.java | 4 +- .../activity/style/TaurusStyleActivity.java | 2 +- .../style/WaterDropStyleActivity.java | 2 +- .../style/WaveSwipeStyleActivity.java | 2 +- .../example/BottomSheetExampleFragment.java | 8 +- .../example/EmptyLayoutExampleFragment.java | 14 +- .../EmptyLayoutExampleFragmentInner.java | 15 +- .../EmptyLayoutExampleFragmentOuter.java | 8 +- .../example/HorizontalExampleFragment.java | 4 +- .../example/NestedScrollExampleFragment.java | 4 +- .../NestedScrollExampleFragmentIntegral.java | 4 +- .../NestedScrollExampleFragmentViewPager.java | 2 +- .../example/NoMoreDataExampleFragment.java | 6 +- .../PureScrollExampleFragmentFooter.java | 2 +- .../PureScrollExampleFragmentHeader.java | 4 +- .../example/StaggeredGridExampleFragment.java | 4 +- .../example/ViewPagerExampleFragment.java | 8 +- .../practice/InstantPracticeFragment.java | 4 +- .../practice/SecondFloorPracticeFragment.java | 17 +- .../practice/TwoLevelPracticeFragment.java | 8 +- .../layout/activity_example_assign_xml.xml | 2 +- .../main/res/layout/activity_experiment.xml | 4 +- .../res/layout/activity_practice_feedlist.xml | 2 +- .../res/layout/activity_practice_weibo.xml | 2 +- .../main/res/layout/activity_style_bezier.xml | 2 +- .../res/layout/activity_style_classics.xml | 2 +- ...fragment_example_nestedscroll_integral.xml | 2 +- .../fragment_example_purescroll_header.xml | 2 +- .../layout/fragment_no_more_data_example.xml | 2 +- .../layout/fragment_practice_second_floor.xml | 6 +- .../res/layout/fragment_practice_twolevel.xml | 6 +- art/md_property.md | 4 +- art/md_update.md | 11 +- build.gradle | 2 + .../header/BezierCircleHeader.java | 4 +- .../smartrefresh/header/DeliveryHeader.java | 4 +- .../smartrefresh/header/DropBoxHeader.java | 4 +- .../smartrefresh/header/FlyRefreshHeader.java | 4 +- .../header/FunGameBattleCityHeader.java | 4 +- .../header/FunGameHitBlockHeader.java | 4 +- .../smartrefresh/header/MaterialHeader.java | 4 +- .../smartrefresh/header/PhoenixHeader.java | 4 +- .../smartrefresh/header/StoreHouseHeader.java | 4 +- .../smartrefresh/header/TaurusHeader.java | 4 +- .../smartrefresh/header/WaterDropHeader.java | 4 +- .../smartrefresh/header/WaveSwipeHeader.java | 4 +- .../layout/SmartRefreshLayout.java | 68 ++----- .../api/DefaultRefreshFooterCreator.java | 14 -- .../api/DefaultRefreshHeaderCreator.java | 14 -- .../layout/api/DefaultRefreshInitializer.java | 13 -- .../layout/api/OnTwoLevelListener.java | 15 -- .../layout/api/RefreshFooter.java | 9 - .../layout/api/RefreshHeader.java | 9 - .../layout/api/RefreshInternal.java | 21 -- .../layout/api/RefreshKernel.java | 10 - .../layout/api/RefreshLayout.java | 127 ------------ .../layout/api/ScrollBoundaryDecider.java | 8 - .../layout/constant/RefreshState.java | 57 ------ .../layout/constant/SpinnerStyle.java | 13 -- .../layout/footer/BallPulseFooter.java | 3 +- .../layout/footer/ClassicsFooter.java | 3 +- .../layout/footer/FalsifyFooter.java | 4 +- .../layout/header/BezierRadarHeader.java | 6 +- .../layout/header/ClassicsHeader.java | 5 +- .../layout/header/FalsifyHeader.java | 6 +- .../layout/header/TwoLevelHeader.java | 11 +- .../layout/impl/RefreshFooterWrapper.java | 3 +- .../layout/impl/RefreshHeaderWrapper.java | 3 +- .../impl/ScrollBoundaryDeciderAdapter.java | 3 +- .../layout/internal/InternalAbstract.java | 4 +- .../layout/listener/OnLoadMoreListener.java | 13 -- .../listener/OnMultiPurposeListener.java | 40 ---- .../layout/listener/OnRefreshListener.java | 13 -- .../listener/OnRefreshLoadMoreListener.java | 8 - .../listener/OnStateChangedListener.java | 27 --- .../listener/SimpleMultiPurposeListener.java | 182 ------------------ 104 files changed, 255 insertions(+), 879 deletions(-) delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshFooterCreator.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshHeaderCreator.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshInitializer.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/OnTwoLevelListener.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshFooter.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshHeader.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshInternal.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshKernel.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshLayout.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/ScrollBoundaryDecider.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/constant/RefreshState.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/constant/SpinnerStyle.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnLoadMoreListener.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnMultiPurposeListener.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnRefreshListener.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnRefreshLoadMoreListener.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnStateChangedListener.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/SimpleMultiPurposeListener.java diff --git a/README.md b/README.md index 2aa4de4c..4a1c6b84 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ IOS版本:[链接](https://github.com/scwang90/SmartRefreshControl) ## 国内加速 -github 由于你懂的原因,下载速度缓慢,图片也无法查看,可以跳转 [国内镜像](https://gitee.com/scwang90/SmartRefreshLayout) +github 由于你懂的原因,下载速度缓慢,图片也无法查看,可以跳转 [Gitee镜像](https://gitee.com/scwang90/SmartRefreshLayout) ## 特点功能: @@ -117,9 +117,28 @@ V2.x 版本已经把依赖库拆分成8个包啦,用到的时候自行引用 - refresh-footer-ball 球脉冲加载 - refresh-footer-classics 经典加载 +> 注:在`Demo`中有些炫酷的 `Header`,他们并不具有实用性,所以没有打包上传仓库,所以无法直接添加依赖。 +如果你确实想要在`App`中集成它们,请自行找到对应个 `tag` 的分支,把对应版本的`Header`源码拷贝到自己的项目中,作为自定义Header来使用。 + +> 需要源码引用的`Header`如下: + +> [BezierCircleHeader](refresh-header/src/main/java/com/scwang/smart/refresh/header/BezierCircleHeader.java) +[DeliveryHeader](refresh-header/src/main/java/com/scwang/smart/refresh/header/DeliveryHeader.java) +[DropBoxHeader](refresh-header/src/main/java/com/scwang/smart/refresh/header/DropBoxHeader.java) +[FlyRefreshHeader](refresh-header/src/main/java/com/scwang/smart/refresh/header/FlyRefreshHeader.java) +[FunGameBattleCityHeader](refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameBattleCityHeader.java) +[FunGameHitBlockHeader](refresh-header/src/main/java/com/scwang/smart/refresh/header/FunGameHitBlockHeader.java) +[PhoenixHeader](refresh-header/src/main/java/com/scwang/smart/refresh/header/PhoenixHeader.java) +[StoreHouseHeader](refresh-header/src/main/java/com/scwang/smart/refresh/header/StoreHouseHeader.java) +[TaurusHeader](refresh-header/src/main/java/com/scwang/smart/refresh/header/TaurusHeader.java) +[WaterDropHeader](refresh-header/src/main/java/com/scwang/smart/refresh/header/WaterDropHeader.java) +[WaveSwipeHeader](refresh-header/src/main/java/com/scwang/smart/refresh/header/WaveSwipeHeader.java) + + ## 简单用例 #### 1.在 build.gradle 中添加依赖 +> 注:3.x 版本已经发布,主要升级为使用 `androidx` 替换 `support`, 并且目前尚未添加新功能, 如果你还需要使用 support 请使用 2.x 版本。 ```gradle implementation 'androidx.appcompat:appcompat:1.0.0' //必须 1.0.0 以上 diff --git a/README_EN.md b/README_EN.md index 5a1929c8..39b3d202 100644 --- a/README_EN.md +++ b/README_EN.md @@ -105,16 +105,16 @@ Please rest assured that I have divided it into eight packages, when used to ref - refresh-footer-ball BallPulseFooter - refresh-footer-classics ClassicsFooter +> Please note that in the `Demo`, there are some cool `Headers` that are not practical, so they have not been packaged and uploaded to the repository, and thus cannot be directly added as dependencies. +If you indeed want to integrate them into your `App`, please find the corresponding branch for each `tag`, copy the source code of the corresponding version of the `Header` into your own project, and use it as a custom `Header`. + +> The `Headers` that require source code reference are as follows: + ## Usage #### 1.Add a gradle dependency. -V 2.x changed the package name relative to 1.x, such as `com.scwang.smartrefresh` to `com.scwang.smart.refresh`. -It is suggested that in the new project, if the old project is upgraded, -the package name should be replaced, which is more troublesome. -But the main change is to subcontract SmartRefreshLayout to reduce unnecessary dependencies and avoid code redundancy. -However, there is no subcontracting to SmartRefreshHeader. -There are more than ten headers in it. -It is recommended that you copy the source code into the project whenever you need to use it. +> Please note: Version 3.x has been released, with the main upgrade being the replacement of `support` with `androidx`, and no new features have been added at this time. If you still need to use `support`, please use version 2.x. + ``` // Note: There will be no default Header and Footer after subcontracting. It needs to be added manually! diff --git a/app/build.gradle b/app/build.gradle index 4449fb6d..c0798831 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -58,7 +58,7 @@ dependencies { // implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.cardview:cardview:1.0.0' - implementation 'androidx.constraintlayout:constraintlayout:2.2.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' // implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'com.google.android.material:material:1.12.0' diff --git a/app/src/main/java/com/scwang/refreshlayout/App.java b/app/src/main/java/com/scwang/refreshlayout/App.java index 579a3a30..f64de5cf 100644 --- a/app/src/main/java/com/scwang/refreshlayout/App.java +++ b/app/src/main/java/com/scwang/refreshlayout/App.java @@ -7,15 +7,15 @@ import androidx.appcompat.app.AppCompatDelegate; import com.scwang.refreshlayout.util.DynamicTimeFormat; +import com.scwang.smart.refresh.layout.api.RefreshFooter; +import com.scwang.smart.refresh.layout.api.RefreshHeader; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.listener.DefaultRefreshFooterCreator; +import com.scwang.smart.refresh.layout.listener.DefaultRefreshHeaderCreator; +import com.scwang.smart.refresh.layout.listener.DefaultRefreshInitializer; import com.scwang.smartrefresh.layout.SmartRefreshLayout; -import com.scwang.smartrefresh.layout.api.DefaultRefreshFooterCreator; -import com.scwang.smartrefresh.layout.api.DefaultRefreshHeaderCreator; -import com.scwang.smartrefresh.layout.api.DefaultRefreshInitializer; -import com.scwang.smartrefresh.layout.api.RefreshFooter; -import com.scwang.smartrefresh.layout.api.RefreshHeader; -import com.scwang.smartrefresh.layout.api.RefreshLayout; import com.scwang.smartrefresh.layout.footer.ClassicsFooter; -import com.scwang.smartrefresh.layout.header.ClassicsHeader; +import com.scwang.smart.refresh.layout.header.ClassicsHeader; /** * diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignCodeExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignCodeExampleActivity.java index 23948dc3..92fcf8d6 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignCodeExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignCodeExampleActivity.java @@ -7,12 +7,12 @@ import androidx.appcompat.widget.Toolbar; import com.scwang.refreshlayout.R; -import com.scwang.smartrefresh.header.MaterialHeader; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.constant.RefreshState; -import com.scwang.smartrefresh.layout.constant.SpinnerStyle; -import com.scwang.smartrefresh.layout.footer.BallPulseFooter; -import com.scwang.smartrefresh.layout.listener.SimpleMultiPurposeListener; +import com.scwang.smart.refresh.header.MaterialHeader; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.constant.RefreshState; +import com.scwang.smart.refresh.layout.constant.SpinnerStyle; +import com.scwang.smart.refresh.footer.BallPulseFooter; +import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; /** * 在Java代码中指定Header和Footer @@ -47,12 +47,12 @@ protected void onCreate(Bundle savedInstanceState) { // //触发上拉加载 // mRefreshLayout.autoLoadMore(250, 250, 1.5f); //通过多功能监听接口实现 在第一次加载完成之后 自动刷新 - refreshLayout.setOnMultiPurposeListener(new SimpleMultiPurposeListener(){ + refreshLayout.setOnMultiListener(new SimpleMultiListener(){ @Override public void onStateChanged(@NonNull RefreshLayout refreshLayout, @NonNull RefreshState oldState, @NonNull RefreshState newState) { if (oldState == RefreshState.LoadFinish && newState == RefreshState.None) { refreshLayout.autoRefresh(); - refreshLayout.setOnMultiPurposeListener(null); + refreshLayout.setOnMultiListener(null); } } @Override diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignDefaultExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignDefaultExampleActivity.java index e8f1ed57..f500c2f1 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignDefaultExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignDefaultExampleActivity.java @@ -9,17 +9,17 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.util.DynamicTimeFormat; -import com.scwang.smartrefresh.layout.SmartRefreshLayout; -import com.scwang.smartrefresh.layout.api.DefaultRefreshFooterCreator; -import com.scwang.smartrefresh.layout.api.DefaultRefreshHeaderCreator; -import com.scwang.smartrefresh.layout.api.RefreshFooter; -import com.scwang.smartrefresh.layout.api.RefreshHeader; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.constant.RefreshState; -import com.scwang.smartrefresh.layout.constant.SpinnerStyle; -import com.scwang.smartrefresh.layout.footer.ClassicsFooter; -import com.scwang.smartrefresh.layout.header.ClassicsHeader; -import com.scwang.smartrefresh.layout.listener.SimpleMultiPurposeListener; +import com.scwang.smart.refresh.layout.SmartRefreshLayout; +import com.scwang.smart.refresh.layout.api.RefreshFooter; +import com.scwang.smart.refresh.layout.api.RefreshHeader; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.constant.RefreshState; +import com.scwang.smart.refresh.layout.constant.SpinnerStyle; +import com.scwang.smart.refresh.footer.ClassicsFooter; +import com.scwang.smart.refresh.header.ClassicsHeader; +import com.scwang.smart.refresh.layout.listener.DefaultRefreshFooterCreator; +import com.scwang.smart.refresh.layout.listener.DefaultRefreshHeaderCreator; +import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; /** * 全局指定默认的Header和Footer @@ -48,13 +48,13 @@ protected void onCreate(Bundle savedInstanceState) { // //触发上拉加载 // mRefreshLayout.autoLoadMore(); //通过多功能监听接口实现 在第一次加载完成之后 自动刷新 - refreshLayout.setOnMultiPurposeListener(new SimpleMultiPurposeListener(){ + refreshLayout.setOnMultiListener(new SimpleMultiListener(){ @Override public void onStateChanged(@NonNull RefreshLayout refreshLayout, @NonNull RefreshState oldState, @NonNull RefreshState newState) { if (oldState == RefreshState.LoadFinish && newState == RefreshState.None) { refreshLayout.autoRefresh(); - refreshLayout.setOnMultiPurposeListener(null); + refreshLayout.setOnMultiListener(null); } } @Override diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignXmlExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignXmlExampleActivity.java index 0b7cfced..01cc433e 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignXmlExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignXmlExampleActivity.java @@ -7,9 +7,9 @@ import androidx.appcompat.widget.Toolbar; import com.scwang.refreshlayout.R; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.constant.RefreshState; -import com.scwang.smartrefresh.layout.listener.SimpleMultiPurposeListener; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.constant.RefreshState; +import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; /** * 在XML中指定Header和Footer @@ -36,12 +36,12 @@ protected void onCreate(Bundle savedInstanceState) { // //触发上拉加载 // mRefreshLayout.autoLoadMore(250, 250, 1.5f); //通过多功能监听接口实现 在第一次加载完成之后 自动刷新 - refreshLayout.setOnMultiPurposeListener(new SimpleMultiPurposeListener(){ + refreshLayout.setOnMultiListener(new SimpleMultiListener(){ @Override public void onStateChanged(@NonNull RefreshLayout refreshLayout, @NonNull RefreshState oldState, @NonNull RefreshState newState) { if (oldState == RefreshState.LoadFinish && newState == RefreshState.None) { refreshLayout.autoRefresh(); - refreshLayout.setOnMultiPurposeListener(null); + refreshLayout.setOnMultiListener(null); } } @Override diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java index d49325c1..2912a618 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java @@ -15,8 +15,8 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshFooter; -import com.scwang.smartrefresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.api.RefreshFooter; +import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smartrefresh.layout.footer.ClassicsFooter; import java.util.Arrays; @@ -36,7 +36,7 @@ public class BasicExampleActivity extends AppCompatActivity { private final Random random = new Random(); private BaseRecyclerAdapter mAdapter; private LoadingLayout mLoadingLayout; - private com.scwang.smartrefresh.layout.api.RefreshLayout mRefreshLayout; + private RefreshLayout mRefreshLayout; @Override protected void onCreate(Bundle savedInstanceState) { @@ -93,7 +93,7 @@ public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCoun mAdapter.setOnItemClickListener((parent, view, position, id) -> { BottomSheetDialog dialog=new BottomSheetDialog(BasicExampleActivity.this); View dialogView = View.inflate(getBaseContext(), R.layout.activity_example_basic, null); - com.scwang.smartrefresh.layout.api.RefreshLayout refreshLayout1 = dialogView.findViewById(R.id.refreshLayout); + RefreshLayout refreshLayout1 = dialogView.findViewById(R.id.refreshLayout); RecyclerView recyclerView = new RecyclerView(getBaseContext()); recyclerView.setLayoutManager(new LinearLayoutManager(getBaseContext())); recyclerView.setAdapter(mAdapter); @@ -106,12 +106,12 @@ public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCoun //点击测试 RefreshFooter footer = mRefreshLayout.getRefreshFooter(); - if (footer instanceof com.scwang.smartrefresh.layout.footer.ClassicsFooter) { + if (footer instanceof ClassicsFooter) { mRefreshLayout.getRefreshFooter().getView().findViewById(ClassicsFooter.ID_TEXT_TITLE).setOnClickListener(v -> Toast.makeText(getBaseContext(), "点击测试", Toast.LENGTH_SHORT).show()); } } - private void loadMore(com.scwang.smartrefresh.layout.api.RefreshLayout layout) { + private void loadMore(RefreshLayout layout) { layout.getLayout().postDelayed(() -> { if (random.nextBoolean()) { //如果刷新成功 diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java index 2c1a6567..e2d53dea 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java @@ -17,9 +17,9 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.header.ClassicsHeader; -import com.scwang.smartrefresh.layout.listener.OnRefreshListener; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.header.ClassicsHeader; +import com.scwang.smart.refresh.layout.listener.OnRefreshListener; import java.util.ArrayList; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/ListenerExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/ListenerExampleActivity.java index 5a5effcb..9f927789 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/ListenerExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/ListenerExampleActivity.java @@ -9,11 +9,12 @@ import androidx.appcompat.widget.Toolbar; import com.scwang.refreshlayout.R; -import com.scwang.smartrefresh.layout.api.RefreshFooter; -import com.scwang.smartrefresh.layout.api.RefreshHeader; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.constant.RefreshState; -import com.scwang.smartrefresh.layout.listener.SimpleMultiPurposeListener; +import com.scwang.smart.refresh.layout.api.RefreshFooter; +import com.scwang.smart.refresh.layout.api.RefreshHeader; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.constant.RefreshState; +import com.scwang.smart.refresh.layout.listener.OnMultiListener; +import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; import java.text.DateFormat; import java.text.SimpleDateFormat; @@ -56,7 +57,7 @@ protected void onCreate(Bundle savedInstanceState) { mTvContent.setMovementMethod(ScrollingMovementMethod.getInstance()); final RefreshLayout refreshLayout = findViewById(R.id.refreshLayout); - refreshLayout.setOnMultiPurposeListener(new SimpleMultiPurposeListener() { + refreshLayout.setOnMultiListener(new SimpleMultiListener() { @Override public void onHeaderMoving(RefreshHeader header, boolean isDragging, float percent, int offset, int headerHeight, int maxDragHeight) { diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/NestedLayoutExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/NestedLayoutExampleActivity.java index 7a7f1960..de93a431 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/NestedLayoutExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/NestedLayoutExampleActivity.java @@ -17,7 +17,7 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.text.DateFormat; import java.text.SimpleDateFormat; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/OverScrollExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/OverScrollExampleActivity.java index 9525e9d0..0f17d7f6 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/OverScrollExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/OverScrollExampleActivity.java @@ -8,8 +8,8 @@ import androidx.appcompat.widget.Toolbar; import com.scwang.refreshlayout.R; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.listener.OnRefreshListener; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.listener.OnRefreshListener; /** * 越界回弹使用演示 diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/SnapHelperExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/SnapHelperExampleActivity.java index 15628859..e65f4ff0 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/SnapHelperExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/SnapHelperExampleActivity.java @@ -16,8 +16,8 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; import java.util.Arrays; import java.util.Collection; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/BannerPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/BannerPracticeActivity.java index 2c00c1dc..c20eedca 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/BannerPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/BannerPracticeActivity.java @@ -22,9 +22,9 @@ import com.google.gson.reflect.TypeToken; import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.util.StatusBarUtil; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener; -import com.scwang.smartrefresh.layout.listener.OnRefreshListener; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener; +import com.scwang.smart.refresh.layout.listener.OnRefreshListener; import com.youth.banner.Banner; import com.youth.banner.BannerConfig; import com.youth.banner.listener.OnBannerListener; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/FeedListPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/FeedListPracticeActivity.java index fdbc4cd6..275212a7 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/FeedListPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/FeedListPracticeActivity.java @@ -6,7 +6,7 @@ import androidx.appcompat.widget.Toolbar; import com.scwang.refreshlayout.R; -import com.scwang.smartrefresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.api.RefreshLayout; /** * 微博列表 diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/RepastPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/RepastPracticeActivity.java index 2c89dafb..953dc6c6 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/RepastPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/RepastPracticeActivity.java @@ -15,8 +15,8 @@ import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; import com.scwang.refreshlayout.util.StatusBarUtil; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; import com.scwang.smartrefresh.layout.util.SmartUtil; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WebViewPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/WebViewPracticeActivity.java index 44e22989..96915c6c 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WebViewPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/WebViewPracticeActivity.java @@ -10,8 +10,8 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.util.StatusBarUtil; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.listener.OnRefreshListener; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.listener.OnRefreshListener; import com.scwang.smartrefresh.layout.util.SmartUtil; import java.util.Locale; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java index 2f6f6cd1..97288bcc 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java @@ -12,9 +12,9 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.util.StatusBarUtil; -import com.scwang.smartrefresh.layout.api.RefreshHeader; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.listener.SimpleMultiPurposeListener; +import com.scwang.smart.refresh.layout.api.RefreshHeader; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; import com.scwang.smartrefresh.layout.util.SmartUtil; /** @@ -46,7 +46,7 @@ protected void onCreate(Bundle savedInstanceState) { findViewById(R.id.attention).setOnClickListener(view -> Toast.makeText(view.getContext(),"点击了关注",Toast.LENGTH_SHORT).show()); findViewById(R.id.leaveword).setOnClickListener(view -> Toast.makeText(view.getContext(),"点击了留言",Toast.LENGTH_SHORT).show()); - refreshLayout.setOnMultiPurposeListener(new SimpleMultiPurposeListener() { + refreshLayout.setOnMultiListener(new SimpleMultiListener() { @Override public void onRefresh(@NonNull RefreshLayout refreshLayout) { refreshLayout.finishRefresh(3000); diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java index 32a27be5..b879d2a3 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java @@ -16,7 +16,7 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.util.ArrayList; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java index f2a0dbe1..5f427191 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java @@ -16,8 +16,8 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.header.BezierRadarHeader; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.header.BezierRadarHeader; import java.util.ArrayList; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java index 1d0540ec..d1cc1df7 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java @@ -20,9 +20,9 @@ import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; import com.scwang.refreshlayout.util.DynamicTimeFormat; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.constant.SpinnerStyle; -import com.scwang.smartrefresh.layout.header.ClassicsHeader; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.constant.SpinnerStyle; +import com.scwang.smart.refresh.layout.header.ClassicsHeader; import java.text.SimpleDateFormat; import java.util.ArrayList; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java index 339c340f..138a47e3 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java @@ -17,7 +17,7 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.util.ArrayList; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java index a0b94295..8ba1ca97 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java @@ -16,7 +16,7 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java index f60708a0..0e875a55 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java @@ -31,11 +31,12 @@ import com.scwang.refreshlayout.util.StatusBarUtil; import com.scwang.smart.refresh.header.flyrefresh.FlyView; import com.scwang.smart.refresh.header.flyrefresh.MountainSceneView; +import com.scwang.smart.refresh.layout.api.RefreshHeader; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.listener.OnRefreshListener; +import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; import com.scwang.smartrefresh.header.FlyRefreshHeader; -import com.scwang.smartrefresh.layout.api.RefreshHeader; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.listener.OnRefreshListener; -import com.scwang.smartrefresh.layout.listener.SimpleMultiPurposeListener; +import com.scwang.smart.refresh.layout.listener.OnMultiListener; import com.scwang.smartrefresh.layout.util.SmartUtil; import java.text.DateFormat; @@ -105,7 +106,7 @@ public void onAnimationEnd(Animator animation) { }); //设置 让 AppBarLayout 和 RefreshLayout 的滚动同步 并不保持 toolbar 位置不变 final AppBarLayout appBar = findViewById(R.id.appbar); - mRefreshLayout.setOnMultiPurposeListener(new SimpleMultiPurposeListener() { + mRefreshLayout.setOnMultiListener(new SimpleMultiListener() { @Override public void onHeaderMoving(RefreshHeader header, boolean isDragging, float percent, int offset, int headerHeight, int maxDragHeight) { appBar.setTranslationY(offset); diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java index 2fb7dca8..5246e926 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java @@ -16,7 +16,7 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.util.ArrayList; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java index 7e947bfc..f7b43fd3 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java @@ -16,7 +16,7 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.util.ArrayList; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java index 04ea4059..7fb63294 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java @@ -16,8 +16,8 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smartrefresh.header.MaterialHeader; -import com.scwang.smartrefresh.layout.api.RefreshLayout; import java.util.ArrayList; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java index 8e031010..4f953874 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java @@ -20,7 +20,7 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.util.ArrayList; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java index 7f5e986b..9514accd 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java @@ -17,9 +17,9 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.smart.refresh.layout.api.RefreshHeader; +import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smartrefresh.header.StoreHouseHeader; -import com.scwang.smartrefresh.layout.api.RefreshHeader; -import com.scwang.smartrefresh.layout.api.RefreshLayout; import java.util.ArrayList; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java index 20e507d2..55e5745a 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java @@ -20,7 +20,7 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.util.ArrayList; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java index 6b76bf2c..c09785e8 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java @@ -16,7 +16,7 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.util.ArrayList; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java index deb92f19..2e9f768f 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java @@ -16,7 +16,7 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.util.ArrayList; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java index 4610f6ff..3bed4a37 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java @@ -19,10 +19,10 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.constant.SpinnerStyle; -import com.scwang.smartrefresh.layout.header.ClassicsHeader; -import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.constant.SpinnerStyle; +import com.scwang.smart.refresh.layout.header.ClassicsHeader; +import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener; import java.util.Arrays; import java.util.Collection; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java index 2eafe841..296e51e9 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java @@ -22,12 +22,12 @@ import com.scwang.refreshlayout.activity.FragmentActivity; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.constant.RefreshState; -import com.scwang.smartrefresh.layout.constant.SpinnerStyle; -import com.scwang.smartrefresh.layout.header.ClassicsHeader; -import com.scwang.smartrefresh.layout.listener.OnRefreshListener; -import com.scwang.smartrefresh.layout.listener.SimpleMultiPurposeListener; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.constant.RefreshState; +import com.scwang.smart.refresh.layout.constant.SpinnerStyle; +import com.scwang.smart.refresh.layout.header.ClassicsHeader; +import com.scwang.smart.refresh.layout.listener.OnRefreshListener; +import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; import java.util.Arrays; @@ -93,7 +93,7 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat mRefreshLayout.autoRefresh(); } }, 3000); - mRefreshLayout.setOnMultiPurposeListener(new SimpleMultiPurposeListener() { + mRefreshLayout.setOnMultiListener(new SimpleMultiListener() { @Override public void onStateChanged(@NonNull RefreshLayout refreshLayout, @NonNull RefreshState oldState, @NonNull RefreshState newState) { mIsNeedDemo = false; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java index d292351f..2dd8f627 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java @@ -25,12 +25,13 @@ import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; import com.scwang.refreshlayout.fragment.example.EmptyLayoutExampleFragment.Item; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.constant.RefreshState; -import com.scwang.smartrefresh.layout.constant.SpinnerStyle; -import com.scwang.smartrefresh.layout.header.ClassicsHeader; -import com.scwang.smartrefresh.layout.listener.OnRefreshListener; -import com.scwang.smartrefresh.layout.listener.SimpleMultiPurposeListener; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.listener.OnRefreshListener; +import com.scwang.smart.refresh.layout.constant.RefreshState; +import com.scwang.smart.refresh.layout.constant.SpinnerStyle; +import com.scwang.smart.refresh.layout.header.ClassicsHeader; +import com.scwang.smart.refresh.layout.listener.OnMultiListener; +import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; import java.util.ArrayList; import java.util.Arrays; @@ -93,7 +94,7 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position mRefreshLayout.autoRefresh(); } }, 3000); - mRefreshLayout.setOnMultiPurposeListener(new SimpleMultiPurposeListener() { + mRefreshLayout.setOnMultiListener(new SimpleMultiListener() { @Override public void onStateChanged(@NonNull RefreshLayout refreshLayout, @NonNull RefreshState oldState, @NonNull RefreshState newState) { mIsNeedDemo = false; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java index a25443a1..669c0537 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java @@ -25,10 +25,10 @@ import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; import com.scwang.refreshlayout.fragment.example.EmptyLayoutExampleFragment.Item; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.constant.SpinnerStyle; -import com.scwang.smartrefresh.layout.header.ClassicsHeader; -import com.scwang.smartrefresh.layout.listener.OnRefreshListener; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.constant.SpinnerStyle; +import com.scwang.smart.refresh.layout.header.ClassicsHeader; +import com.scwang.smart.refresh.layout.listener.OnRefreshListener; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/HorizontalExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/HorizontalExampleFragment.java index 7fd25e97..69fdf984 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/HorizontalExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/HorizontalExampleFragment.java @@ -15,8 +15,8 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; import java.util.Arrays; import java.util.Collection; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java index fc81295d..0d518f19 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java @@ -23,9 +23,9 @@ import com.scwang.refreshlayout.activity.FragmentActivity; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener; import com.scwang.smartrefresh.layout.footer.ClassicsFooter; -import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java index 5a603829..cf1ba798 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java @@ -26,8 +26,8 @@ import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; import com.scwang.refreshlayout.fragment.example.NestedScrollExampleFragment.Item; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; import com.youth.banner.Banner; import com.youth.banner.loader.ImageLoader; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java index 001e72e4..95986581 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java @@ -22,9 +22,9 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smartrefresh.header.PhoenixHeader; import com.scwang.smartrefresh.layout.SmartRefreshLayout; -import com.scwang.smartrefresh.layout.api.RefreshLayout; import java.util.Arrays; import java.util.Collection; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NoMoreDataExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NoMoreDataExampleFragment.java index ff60a55c..3fa9ac0f 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NoMoreDataExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NoMoreDataExampleFragment.java @@ -16,9 +16,9 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener; -import com.scwang.smartrefresh.layout.listener.OnRefreshListener; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener; +import com.scwang.smart.refresh.layout.listener.OnRefreshListener; import java.util.ArrayList; import java.util.Collection; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentFooter.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentFooter.java index f5c386a1..95425f1b 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentFooter.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentFooter.java @@ -23,7 +23,7 @@ import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; import com.scwang.refreshlayout.fragment.example.PureScrollExampleFragment.Item; -import com.scwang.smartrefresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java index 3b2c7d5a..7d1f0100 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java @@ -23,8 +23,8 @@ import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; import com.scwang.refreshlayout.fragment.example.PureScrollExampleFragment.Item; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.header.FalsifyHeader; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.header.FalsifyHeader; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/StaggeredGridExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/StaggeredGridExampleFragment.java index 8b7f0dfb..9761ae46 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/StaggeredGridExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/StaggeredGridExampleFragment.java @@ -14,8 +14,8 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; import java.util.Arrays; import java.util.Collection; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java index 829c31be..88809a0b 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java @@ -24,11 +24,11 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.listener.OnRefreshListener; import com.scwang.smartrefresh.layout.footer.ClassicsFooter; -import com.scwang.smartrefresh.layout.header.ClassicsHeader; -import com.scwang.smartrefresh.layout.listener.OnRefreshListener; -import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener; +import com.scwang.smart.refresh.layout.header.ClassicsHeader; +import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; import java.util.Arrays; import java.util.Collection; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java index 703566f8..a8514f56 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java @@ -16,10 +16,10 @@ import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; import com.scwang.refreshlayout.util.DynamicTimeFormat; -import com.scwang.smartrefresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener; import com.scwang.smartrefresh.layout.footer.ClassicsFooter; import com.scwang.smartrefresh.layout.impl.ScrollBoundaryDeciderAdapter; -import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener; import java.util.Arrays; import java.util.Collection; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java index ba386b6a..7ef79315 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java @@ -16,13 +16,14 @@ import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; import com.scwang.refreshlayout.util.StatusBarUtil; -import com.scwang.smartrefresh.layout.api.OnTwoLevelListener; -import com.scwang.smartrefresh.layout.api.RefreshHeader; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.constant.RefreshState; -import com.scwang.smartrefresh.layout.header.TwoLevelHeader; -import com.scwang.smartrefresh.layout.listener.OnRefreshListener; -import com.scwang.smartrefresh.layout.listener.SimpleMultiPurposeListener; +import com.scwang.smart.refresh.header.listener.OnTwoLevelListener; +import com.scwang.smart.refresh.layout.api.RefreshHeader; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.constant.RefreshState; +import com.scwang.smart.refresh.layout.header.TwoLevelHeader; +import com.scwang.smart.refresh.layout.listener.OnMultiListener; +import com.scwang.smart.refresh.layout.listener.OnRefreshListener; +import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; import java.util.Arrays; import java.util.List; @@ -55,7 +56,7 @@ public void onClick(View v) { }); final RefreshLayout refreshLayout = root.findViewById(R.id.refreshLayout); - refreshLayout.setOnMultiPurposeListener(new SimpleMultiPurposeListener() { + refreshLayout.setOnMultiListener(new SimpleMultiListener() { @Override public void onLoadMore(@NonNull RefreshLayout refreshLayout) { refreshLayout.finishLoadMore(2000); diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java index 4f94228d..cbb9c1e1 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java @@ -13,10 +13,10 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.util.StatusBarUtil; -import com.scwang.smartrefresh.layout.api.OnTwoLevelListener; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.header.TwoLevelHeader; -import com.scwang.smartrefresh.layout.listener.OnRefreshListener; +import com.scwang.smart.refresh.header.listener.OnTwoLevelListener; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.header.TwoLevelHeader; +import com.scwang.smart.refresh.layout.listener.OnRefreshListener; /** * 二级刷新 diff --git a/app/src/main/res/layout/activity_example_assign_xml.xml b/app/src/main/res/layout/activity_example_assign_xml.xml index 9d8264d4..bbe004e9 100644 --- a/app/src/main/res/layout/activity_example_assign_xml.xml +++ b/app/src/main/res/layout/activity_example_assign_xml.xml @@ -21,7 +21,7 @@ app:srlEnablePreviewInEditMode="true" app:srlEnableLoadMoreWhenContentNotFull="true"> - diff --git a/app/src/main/res/layout/activity_experiment.xml b/app/src/main/res/layout/activity_experiment.xml index 3fe27d5b..7beefebb 100644 --- a/app/src/main/res/layout/activity_experiment.xml +++ b/app/src/main/res/layout/activity_experiment.xml @@ -22,13 +22,13 @@ android:layout_height="match_parent" android:gravity="center" android:text="@string/experiment_footer"/> - + - + diff --git a/app/src/main/res/layout/activity_practice_feedlist.xml b/app/src/main/res/layout/activity_practice_feedlist.xml index b1a50413..58633144 100644 --- a/app/src/main/res/layout/activity_practice_feedlist.xml +++ b/app/src/main/res/layout/activity_practice_feedlist.xml @@ -23,7 +23,7 @@ app:srlFooterTranslationViewId="@+id/scrollView" app:srlEnableLoadMoreWhenContentNotFull="false"> - diff --git a/app/src/main/res/layout/activity_practice_weibo.xml b/app/src/main/res/layout/activity_practice_weibo.xml index f4c2dcee..5421afb4 100644 --- a/app/src/main/res/layout/activity_practice_weibo.xml +++ b/app/src/main/res/layout/activity_practice_weibo.xml @@ -24,7 +24,7 @@ android:layout_height="match_parent" app:srlEnablePreviewInEditMode="false"> - - diff --git a/app/src/main/res/layout/activity_style_classics.xml b/app/src/main/res/layout/activity_style_classics.xml index 1f7f1119..4b11634a 100644 --- a/app/src/main/res/layout/activity_style_classics.xml +++ b/app/src/main/res/layout/activity_style_classics.xml @@ -21,7 +21,7 @@ app:srlPrimaryColor="@android:color/transparent" app:srlEnableLoadMore="true" app:srlEnableAutoLoadMore="false"> - - - - - @@ -40,12 +40,12 @@ android:layout_height="match_parent" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/> - - + - - - + 抛弃 support 使用 androidx +>修复问题:复制kernel代码另外起包名后,加载更多时候recyclerview无法流畅滚动 +>修复问题:V2.1.0版本,demo案例,使用官方主题下拉刷新操作的时候,视图不可以滑动,但是响应点击,v2.0.6,v2.0.5没有这样的问题 +>修复问题:NullPointerException: Attempt to invoke interface method 'onAutoRefreshAnimationEnd()' on a null object reference +>修复问题:当场递归死循环, java.lang.StackOverflowError + +## V 2.0.0 >添加:srlStyle 主题支持 >分包:layout = kernel + two-level + header-classics + header-radar + header-falsify + footer-classics + footer-ball >修改:方法 OnMultiPurposeListener -> setOnMultiListener >修改:包名 com.scwang.smartrefresh -> com.scwang.smart.refresh >修改:类名 smartrefresh.layout.listener.OnMultiPurposeListener -> smart.refresh.layout.listener.OnMultiListener ->修改:类名 smartrefresh.layout.listener.SimpleMultiPurposeListener -> smart.refresh.layout.simple.SimpleMultiListener +>修改:类名 smartrefresh.layout.listener.SimpleMultiListener -> smart.refresh.layout.simple.SimpleMultiListener >添加:属性 srlBottomPullUpToCloseRate setBottomPullUpToCloseRate >回归:回归部分被去掉的API如:isRefreshing isLoading diff --git a/build.gradle b/build.gradle index 8c3030a6..4a467485 100644 --- a/build.gradle +++ b/build.gradle @@ -5,6 +5,8 @@ buildscript { google() mavenCentral() gradlePluginPortal() + maven { url 'https://maven.aliyun.com/repository/google' } // 兼容旧版 google + maven { url 'https://maven.aliyun.com/repository/jcenter' } // 兼容旧版 jcenter } dependencies { classpath 'com.android.tools.build:gradle:7.2.2' diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/BezierCircleHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/BezierCircleHeader.java index 5083029a..d28d7c65 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/BezierCircleHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/BezierCircleHeader.java @@ -3,14 +3,12 @@ import android.content.Context; import android.util.AttributeSet; -import com.scwang.smartrefresh.layout.api.RefreshHeader; - /** * CircleRefresh * Created by scwang on 2018/7/18. * from ... */ -public class BezierCircleHeader extends com.scwang.smart.refresh.header.BezierCircleHeader implements RefreshHeader { +public class BezierCircleHeader extends com.scwang.smart.refresh.header.BezierCircleHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { // public BezierCircleHeader(Context context) { diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/DeliveryHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/DeliveryHeader.java index 044791e4..80d53761 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/DeliveryHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/DeliveryHeader.java @@ -5,14 +5,12 @@ import androidx.annotation.Nullable; -import com.scwang.smartrefresh.layout.api.RefreshHeader; - /** * Refresh your delivery! * Created by scwang on 2017/6/25. * design ... */ -public class DeliveryHeader extends com.scwang.smart.refresh.header.DeliveryHeader implements RefreshHeader { +public class DeliveryHeader extends com.scwang.smart.refresh.header.DeliveryHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { // public DeliveryHeader(Context context) { diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/DropBoxHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/DropBoxHeader.java index ce0967ff..34505e6e 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/DropBoxHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/DropBoxHeader.java @@ -5,14 +5,12 @@ import androidx.annotation.Nullable; -import com.scwang.smartrefresh.layout.api.RefreshHeader; - /** * DropBoxRefresh * Created by scwang on 2017/6/24. * design ... */ -public class DropBoxHeader extends com.scwang.smart.refresh.header.DropBoxHeader implements RefreshHeader { +public class DropBoxHeader extends com.scwang.smart.refresh.header.DropBoxHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { // public DropBoxHeader(Context context) { diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/FlyRefreshHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/FlyRefreshHeader.java index 07fa3abb..9e584444 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/FlyRefreshHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/FlyRefreshHeader.java @@ -3,14 +3,12 @@ import android.content.Context; import android.util.AttributeSet; -import com.scwang.smartrefresh.layout.api.RefreshHeader; - /** * 纸飞机和山丘 * Created by scwang on 2017/6/6. * from ... */ -public class FlyRefreshHeader extends com.scwang.smart.refresh.header.FlyRefreshHeader implements RefreshHeader { +public class FlyRefreshHeader extends com.scwang.smart.refresh.header.FlyRefreshHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { // public FlyRefreshHeader(Context context) { diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameBattleCityHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameBattleCityHeader.java index a12d53ab..83853023 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameBattleCityHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameBattleCityHeader.java @@ -3,15 +3,13 @@ import android.content.Context; import android.util.AttributeSet; -import com.scwang.smartrefresh.layout.api.RefreshHeader; - import java.util.Random; /** * Created by scwang on 2018/3/09. * from ... */ -public class FunGameBattleCityHeader extends com.scwang.smart.refresh.header.FunGameBattleCityHeader implements RefreshHeader { +public class FunGameBattleCityHeader extends com.scwang.smart.refresh.header.FunGameBattleCityHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { // public FunGameBattleCityHeader(Context context) { diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameHitBlockHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameHitBlockHeader.java index 6724fa9e..07d77a62 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameHitBlockHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameHitBlockHeader.java @@ -3,13 +3,11 @@ import android.content.Context; import android.util.AttributeSet; -import com.scwang.smartrefresh.layout.api.RefreshHeader; - /** * Created by scwang on 2018/2/29. * from ... */ -public class FunGameHitBlockHeader extends com.scwang.smart.refresh.header.FunGameHitBlockHeader implements RefreshHeader { +public class FunGameHitBlockHeader extends com.scwang.smart.refresh.header.FunGameHitBlockHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { // public FunGameHitBlockHeader(Context context) { diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/MaterialHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/MaterialHeader.java index 63b93fa4..636a5aaa 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/MaterialHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/MaterialHeader.java @@ -3,13 +3,11 @@ import android.content.Context; import android.util.AttributeSet; -import com.scwang.smartrefresh.layout.api.RefreshHeader; - /** * Material 主题下拉头 * Created by scwang on 2017/6/2. */ -public class MaterialHeader extends com.scwang.smart.refresh.header.MaterialHeader implements RefreshHeader { +public class MaterialHeader extends com.scwang.smart.refresh.header.MaterialHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { // public MaterialHeader(Context context) { diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/PhoenixHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/PhoenixHeader.java index c6b41e32..d0da6af7 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/PhoenixHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/PhoenixHeader.java @@ -3,14 +3,12 @@ import android.content.Context; import android.util.AttributeSet; -import com.scwang.smartrefresh.layout.api.RefreshHeader; - /** * Phoenix * Created by scwang on 2017/5/31. * from ... */ -public class PhoenixHeader extends com.scwang.smart.refresh.header.PhoenixHeader implements RefreshHeader { +public class PhoenixHeader extends com.scwang.smart.refresh.header.PhoenixHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { // public PhoenixHeader(Context context) { diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/StoreHouseHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/StoreHouseHeader.java index 5216b8d4..1aca82ec 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/StoreHouseHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/StoreHouseHeader.java @@ -3,14 +3,12 @@ import android.content.Context; import android.util.AttributeSet; -import com.scwang.smartrefresh.layout.api.RefreshHeader; - /** * StoreHouseHeader * Created by scwang on 2017/5/31. * from ... */ -public class StoreHouseHeader extends com.scwang.smart.refresh.header.StoreHouseHeader implements RefreshHeader { +public class StoreHouseHeader extends com.scwang.smart.refresh.header.StoreHouseHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { // public StoreHouseHeader(Context context) { diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/TaurusHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/TaurusHeader.java index 612ffed1..8ae8eabe 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/TaurusHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/TaurusHeader.java @@ -3,14 +3,12 @@ import android.content.Context; import android.util.AttributeSet; -import com.scwang.smartrefresh.layout.api.RefreshHeader; - /** * Taurus * Created by scwang on 2017/5/31. * from ... */ -public class TaurusHeader extends com.scwang.smart.refresh.header.TaurusHeader implements RefreshHeader { +public class TaurusHeader extends com.scwang.smart.refresh.header.TaurusHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { // public TaurusHeader(Context context) { diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaterDropHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaterDropHeader.java index e67e6277..57393cf6 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaterDropHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaterDropHeader.java @@ -3,14 +3,12 @@ import android.content.Context; import android.util.AttributeSet; -import com.scwang.smartrefresh.layout.api.RefreshHeader; - /** * WaterDropHeader * Created by scwang on 2017/5/31. * from ... */ -public class WaterDropHeader extends com.scwang.smart.refresh.header.WaterDropHeader implements RefreshHeader { +public class WaterDropHeader extends com.scwang.smart.refresh.header.WaterDropHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { // public WaterDropHeader(Context context) { diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaveSwipeHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaveSwipeHeader.java index dba0f1a5..ea7a6c43 100644 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaveSwipeHeader.java +++ b/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaveSwipeHeader.java @@ -3,14 +3,12 @@ import android.content.Context; import android.util.AttributeSet; -import com.scwang.smartrefresh.layout.api.RefreshHeader; - /** * 全屏水滴下拉头 * Created by scwang on 2017/6/4. * from ... */ -public class WaveSwipeHeader extends com.scwang.smart.refresh.header.WaveSwipeHeader implements RefreshHeader { +public class WaveSwipeHeader extends com.scwang.smart.refresh.header.WaveSwipeHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { // public WaveSwipeHeader(Context context) { diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java index a027fc21..7a7d8299 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java @@ -8,20 +8,20 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.scwang.smartrefresh.layout.api.DefaultRefreshFooterCreator; -import com.scwang.smartrefresh.layout.api.DefaultRefreshHeaderCreator; -import com.scwang.smartrefresh.layout.api.DefaultRefreshInitializer; -import com.scwang.smartrefresh.layout.api.RefreshFooter; -import com.scwang.smartrefresh.layout.api.RefreshHeader; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.api.ScrollBoundaryDecider; +import com.scwang.smart.refresh.layout.api.RefreshFooter; +import com.scwang.smart.refresh.layout.api.RefreshHeader; +import com.scwang.smart.refresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.layout.listener.DefaultRefreshFooterCreator; +import com.scwang.smart.refresh.layout.listener.DefaultRefreshHeaderCreator; +import com.scwang.smart.refresh.layout.listener.DefaultRefreshInitializer; +import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener; +import com.scwang.smart.refresh.layout.listener.OnMultiListener; +import com.scwang.smart.refresh.layout.listener.OnRefreshListener; +import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; +import com.scwang.smart.refresh.layout.listener.ScrollBoundaryDecider; +import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; import com.scwang.smartrefresh.layout.footer.BallPulseFooter; -import com.scwang.smartrefresh.layout.header.BezierRadarHeader; -import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener; -import com.scwang.smartrefresh.layout.listener.OnMultiPurposeListener; -import com.scwang.smartrefresh.layout.listener.OnRefreshListener; -import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener; -import com.scwang.smartrefresh.layout.listener.SimpleMultiPurposeListener; +import com.scwang.smart.refresh.layout.header.BezierRadarHeader; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; @@ -183,15 +183,15 @@ public void onRefresh(@NonNull com.scwang.smart.refresh.layout.api.RefreshLayout /** * Set up a multi-function listener. - * Recommended {@link com.scwang.smartrefresh.layout.listener.SimpleMultiPurposeListener} + * Recommended {@link OnMultiListener} * 设置多功能监听器 - * 建议使用 {@link com.scwang.smartrefresh.layout.listener.SimpleMultiPurposeListener} + * 建议使用 {@link SimpleMultiListener} * @param listener OnMultiPurposeListener 多功能监听器 * @return RefreshLayout */ @Override - public RefreshLayout setOnMultiPurposeListener(OnMultiPurposeListener listener) { - super.setOnMultiListener(new SimpleMultiPurposeListener(listener, this)); + public RefreshLayout setOnMultiListener(OnMultiListener listener) { + super.setOnMultiListener(listener); return this; } @@ -205,17 +205,7 @@ public RefreshLayout setOnMultiPurposeListener(OnMultiPurposeListener listener) */ @Override public RefreshLayout setScrollBoundaryDecider(final ScrollBoundaryDecider boundary) { - super.setScrollBoundaryDecider(new ScrollBoundaryDecider() { - @Override - public boolean canRefresh(View content) { - return boundary.canRefresh(content); - } - - @Override - public boolean canLoadMore(View content) { - return boundary.canLoadMore(content); - } - }); + super.setScrollBoundaryDecider(boundary); return this; } @@ -224,13 +214,7 @@ public boolean canLoadMore(View content) { * @param creator Header构建器 */ public static void setDefaultRefreshHeaderCreator(@NonNull final DefaultRefreshHeaderCreator creator) { - com.scwang.smart.refresh.layout.SmartRefreshLayout.setDefaultRefreshHeaderCreator((context, layout) -> { - if (layout instanceof RefreshLayout) { - return creator.createRefreshHeader(context, (RefreshLayout) layout); - } else { - return new BezierRadarHeader(context); - } - }); + com.scwang.smart.refresh.layout.SmartRefreshLayout.setDefaultRefreshHeaderCreator(creator); } /** @@ -238,13 +222,7 @@ public static void setDefaultRefreshHeaderCreator(@NonNull final DefaultRefreshH * @param creator Footer构建器 */ public static void setDefaultRefreshFooterCreator(@NonNull final DefaultRefreshFooterCreator creator) { - com.scwang.smart.refresh.layout.SmartRefreshLayout.setDefaultRefreshFooterCreator((context, layout) -> { - if (layout instanceof RefreshLayout) { - return creator.createRefreshFooter(context, (RefreshLayout) layout); - } else { - return new BallPulseFooter(context); - } - }); + com.scwang.smart.refresh.layout.SmartRefreshLayout.setDefaultRefreshFooterCreator(creator); } /** @@ -252,11 +230,7 @@ public static void setDefaultRefreshFooterCreator(@NonNull final DefaultRefreshF * @param initializer 全局初始化器 */ public static void setDefaultRefreshInitializer(@NonNull final DefaultRefreshInitializer initializer) { - com.scwang.smart.refresh.layout.SmartRefreshLayout.setDefaultRefreshInitializer((context, layout) -> { - if (layout instanceof RefreshLayout) { - initializer.initialize(context, (RefreshLayout)layout); - } - }); + com.scwang.smart.refresh.layout.SmartRefreshLayout.setDefaultRefreshInitializer(initializer); } // diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshFooterCreator.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshFooterCreator.java deleted file mode 100644 index 78b742f8..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshFooterCreator.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.scwang.smartrefresh.layout.api; - -import android.content.Context; - -import androidx.annotation.NonNull; - -/** - * 默认Footer创建器 - * Created by scwang on 2018/1/26. - */ -public interface DefaultRefreshFooterCreator { - @NonNull - RefreshFooter createRefreshFooter(@NonNull Context context, @NonNull RefreshLayout layout); -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshHeaderCreator.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshHeaderCreator.java deleted file mode 100644 index 691673f3..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshHeaderCreator.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.scwang.smartrefresh.layout.api; - -import android.content.Context; - -import androidx.annotation.NonNull; - -/** - * 默认Header创建器 - * Created by scwang on 2018/1/26. - */ -public interface DefaultRefreshHeaderCreator { - @NonNull - RefreshHeader createRefreshHeader(@NonNull Context context, @NonNull RefreshLayout layout); -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshInitializer.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshInitializer.java deleted file mode 100644 index e206d916..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/DefaultRefreshInitializer.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.scwang.smartrefresh.layout.api; - -import android.content.Context; - -import androidx.annotation.NonNull; - -/** - * 默认全局初始化器 - * Created by scwang on 2018/5/29 0029. - */ -public interface DefaultRefreshInitializer { - void initialize(@NonNull Context context, @NonNull RefreshLayout layout); -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/OnTwoLevelListener.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/OnTwoLevelListener.java deleted file mode 100644 index f7fd25d0..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/OnTwoLevelListener.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.scwang.smartrefresh.layout.api; - -import androidx.annotation.NonNull; - -/** - * 二级刷新监听器 - */ -public interface OnTwoLevelListener { - /** - * 二级刷新触发 - * @param refreshLayout 刷新布局 - * @return true 将会展开二楼状态 false 关闭刷新 - */ - boolean onTwoLevel(@NonNull RefreshLayout refreshLayout); -} \ No newline at end of file diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshFooter.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshFooter.java deleted file mode 100644 index 8983c83e..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshFooter.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.scwang.smartrefresh.layout.api; - -/** - * 刷新底部 - * Created by scwang on 2017/5/26. - */ -public interface RefreshFooter extends com.scwang.smart.refresh.layout.api.RefreshFooter { - -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshHeader.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshHeader.java deleted file mode 100644 index 8fd9b26b..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshHeader.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.scwang.smartrefresh.layout.api; - -/** - * 刷新头部 - * Created by scwang on 2017/5/26. - */ -public interface RefreshHeader extends com.scwang.smart.refresh.layout.api.RefreshHeader { - -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshInternal.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshInternal.java deleted file mode 100644 index c09f73c0..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshInternal.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.scwang.smartrefresh.layout.api; - -import androidx.annotation.NonNull; - -import com.scwang.smart.refresh.layout.api.RefreshComponent; -import com.scwang.smartrefresh.layout.constant.SpinnerStyle; - - -/** - * 刷新内部组件 - * Created by scwang on 2017/5/26. - */ -public interface RefreshInternal extends RefreshComponent { - - /** - * 获取变换方式 {@link SpinnerStyle} 必须返回 非空 - * @return 变换方式 - */ - @NonNull - SpinnerStyle getSpinnerStyle(); -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshKernel.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshKernel.java deleted file mode 100644 index c68dd02b..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshKernel.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.scwang.smartrefresh.layout.api; - -/** - * 刷新布局核心功能接口 - * 为功能复杂的 Header 或者 Footer 开放的接口 - * Created by scwang on 2017/5/26. - */ -public interface RefreshKernel extends com.scwang.smart.refresh.layout.api.RefreshKernel { - -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshLayout.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshLayout.java deleted file mode 100644 index 200dc0a2..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/RefreshLayout.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.scwang.smartrefresh.layout.api; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; - -import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener; -import com.scwang.smartrefresh.layout.listener.OnMultiPurposeListener; -import com.scwang.smartrefresh.layout.listener.OnRefreshListener; -import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener; - -/** - * 刷新布局 - * interface of the refresh layout - * Created by scwang on 2017/5/26. - */ -@SuppressWarnings("UnusedReturnValue") -public interface RefreshLayout extends com.scwang.smart.refresh.layout.api.RefreshLayout { - - /** - * Set the footer of RefreshLayout. - * 设置指定的 Footer - * @param footer RefreshFooter 刷新尾巴 - * @return RefreshLayout - */ - RefreshLayout setRefreshFooter(@NonNull RefreshFooter footer); - - /** - * Set the footer of RefreshLayout. - * 设置指定的 Footer - * @param footer RefreshFooter 刷新尾巴 - * @param width the width in px, can use MATCH_PARENT and WRAP_CONTENT. - * 宽度 可以使用 MATCH_PARENT, WRAP_CONTENT - * @param height the height in px, can use MATCH_PARENT and WRAP_CONTENT. - * 高度 可以使用 MATCH_PARENT, WRAP_CONTENT - * @return RefreshLayout - */ - RefreshLayout setRefreshFooter(@NonNull RefreshFooter footer, int width, int height); - - /** - * Set the header of RefreshLayout. - * 设置指定的 Header - * @param header RefreshHeader 刷新头 - * @return RefreshLayout - */ - RefreshLayout setRefreshHeader(@NonNull RefreshHeader header); - - /** - * Set the header of RefreshLayout. - * 设置指定的 Header - * @param header RefreshHeader 刷新头 - * @param width the width in px, can use MATCH_PARENT and WRAP_CONTENT. - * 宽度 可以使用 MATCH_PARENT, WRAP_CONTENT - * @param height the height in px, can use MATCH_PARENT and WRAP_CONTENT. - * 高度 可以使用 MATCH_PARENT, WRAP_CONTENT - * @return RefreshLayout - */ - RefreshLayout setRefreshHeader(@NonNull RefreshHeader header, int width, int height); - - /** - * Set refresh listener separately. - * 单独设置刷新监听器 - * @param listener OnRefreshListener 刷新监听器 - * @return RefreshLayout - */ - RefreshLayout setOnRefreshListener(OnRefreshListener listener); - - /** - * Set load more listener separately. - * 单独设置加载监听器 - * @param listener OnLoadMoreListener 加载监听器 - * @return RefreshLayout - */ - RefreshLayout setOnLoadMoreListener(OnLoadMoreListener listener); - - /** - * Set refresh and load listeners at the same time. - * 同时设置刷新和加载监听器 - * @param listener OnRefreshLoadMoreListener 刷新加载监听器 - * @return RefreshLayout - */ - RefreshLayout setOnRefreshLoadMoreListener(OnRefreshLoadMoreListener listener); - - /** - * Set up a multi-function listener. - * Recommended {@link com.scwang.smartrefresh.layout.listener.SimpleMultiPurposeListener} - * 设置多功能监听器 - * 建议使用 {@link com.scwang.smartrefresh.layout.listener.SimpleMultiPurposeListener} - * @param listener OnMultiPurposeListener 多功能监听器 - * @return RefreshLayout - */ - RefreshLayout setOnMultiPurposeListener(OnMultiPurposeListener listener); - - /** - * Set the scroll boundary Decider, Can customize when you can refresh. - * Recommended {@link com.scwang.smartrefresh.layout.impl.ScrollBoundaryDeciderAdapter} - * 设置滚动边界判断器 - * 建议使用 {@link com.scwang.smartrefresh.layout.impl.ScrollBoundaryDeciderAdapter} - * @param boundary ScrollBoundaryDecider 判断器 - * @return RefreshLayout - */ - RefreshLayout setScrollBoundaryDecider(ScrollBoundaryDecider boundary); - - /** - * Get header of RefreshLayout - * 获取当前 Header - * @return RefreshLayout - */ - @Nullable - RefreshHeader getRefreshHeader(); - - /** - * Get footer of RefreshLayout - * 获取当前 Footer - * @return RefreshLayout - */ - @Nullable - RefreshFooter getRefreshFooter(); - -// /** -// * Get the current state of RefreshLayout -// * 获取当前状态 -// * @return RefreshLayout -// */ -// @NonNull -// RefreshState getState(); - -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/ScrollBoundaryDecider.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/ScrollBoundaryDecider.java deleted file mode 100644 index e5c5dc28..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/api/ScrollBoundaryDecider.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.scwang.smartrefresh.layout.api; - -/** - * 滚动边界 - * Created by scwang on 2017/7/8. - */ -public interface ScrollBoundaryDecider extends com.scwang.smart.refresh.layout.listener.ScrollBoundaryDecider { -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/constant/RefreshState.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/constant/RefreshState.java deleted file mode 100644 index 840538aa..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/constant/RefreshState.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.scwang.smartrefresh.layout.constant; - -/** - * 刷新状态 - */ -@SuppressWarnings("unused") -public enum RefreshState { - None(0,false,false,false,false,false), - PullDownToRefresh(1,true,false,false,false,false), PullUpToLoad(2,true,false,false,false,false), - PullDownCanceled(1,false,false,false,false,false), PullUpCanceled(2,false,false,false,false,false), - ReleaseToRefresh(1,true,false,false,false,true), ReleaseToLoad(2,true,false,false,false,true), - ReleaseToTwoLevel(1,true,false,false,true,true), TwoLevelReleased(1,false,false,false,true,false), - RefreshReleased(1,false,false,false,false,false), LoadReleased(2,false,false,false,false,false), - Refreshing(1,false,true,false,false,false), Loading(2,false,true,false,false,false), TwoLevel(1, false, true,false,true,false), - RefreshFinish(1,false,false,true,false,false), LoadFinish(2,false,false,true,false,false), TwoLevelFinish(1,false,false,true,true,false); - - public final boolean isHeader; - public final boolean isFooter; - public final boolean isTwoLevel;// 二级刷新 ReleaseToTwoLevel TwoLevelReleased TwoLevel - public final boolean isDragging;// 正在拖动状态:PullDownToRefresh PullUpToLoad ReleaseToRefresh ReleaseToLoad ReleaseToTwoLevel - public final boolean isOpening;// 正在刷新状态:Refreshing Loading TwoLevel - public final boolean isFinishing;//正在完成状态:RefreshFinish LoadFinish TwoLevelFinish - public final boolean isReleaseToOpening;// 释放立马打开 ReleaseToRefresh ReleaseToLoad ReleaseToTwoLevel - - RefreshState(int role, boolean dragging, boolean opening, boolean finishing, boolean twoLevel, boolean releaseToOpening) { - this.isHeader = role == 1; - this.isFooter = role == 2; - this.isDragging = dragging; - this.isOpening = opening; - this.isFinishing = finishing; - this.isTwoLevel = twoLevel; - this.isReleaseToOpening = releaseToOpening; - } - - public static RefreshState from(com.scwang.smart.refresh.layout.constant.RefreshState newState) { - for (RefreshState state : values()) { - if (state.ordinal() == newState.ordinal()) { - return state; - } - } - return None; - } - - public RefreshState toFooter() { - if (isHeader && !isTwoLevel) { - return values()[ordinal() + 1]; - } - return this; - } - - public RefreshState toHeader() { - if (isFooter && !isTwoLevel) { - return values()[ordinal()-1]; - } - return this; - } -} \ No newline at end of file diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/constant/SpinnerStyle.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/constant/SpinnerStyle.java deleted file mode 100644 index de41e328..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/constant/SpinnerStyle.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.scwang.smartrefresh.layout.constant; - -/** - * 顶部和底部的组件在拖动时候的变换方式 - * Created by scwang on 2017/5/26. - */ -public class SpinnerStyle extends com.scwang.smart.refresh.layout.constant.SpinnerStyle { - - private SpinnerStyle() { - super(-1, false, false); - } - -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/BallPulseFooter.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/BallPulseFooter.java index 3a46479e..79b9b594 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/BallPulseFooter.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/BallPulseFooter.java @@ -6,7 +6,6 @@ import androidx.annotation.Nullable; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; -import com.scwang.smartrefresh.layout.api.RefreshFooter; /** @@ -14,7 +13,7 @@ * Created by scwang on 2017/5/30. */ @SuppressWarnings({"unused", "UnusedReturnValue"}) -public class BallPulseFooter extends com.scwang.smart.refresh.footer.BallPulseFooter implements RefreshFooter { +public class BallPulseFooter extends com.scwang.smart.refresh.footer.BallPulseFooter implements com.scwang.smart.refresh.layout.api.RefreshFooter { // public BallPulseFooter(Context context) { diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/ClassicsFooter.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/ClassicsFooter.java index 4f68fad9..1a282aa9 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/ClassicsFooter.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/ClassicsFooter.java @@ -4,14 +4,13 @@ import android.util.AttributeSet; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; -import com.scwang.smartrefresh.layout.api.RefreshFooter; /** * 经典上拉底部-兼容【1.x】版本-包名位置 * Created by scwang on 2017/5/28. */ @SuppressWarnings({"unused", "UnusedReturnValue"}) -public class ClassicsFooter extends com.scwang.smart.refresh.footer.ClassicsFooter implements RefreshFooter { +public class ClassicsFooter extends com.scwang.smart.refresh.footer.ClassicsFooter implements com.scwang.smart.refresh.layout.api.RefreshFooter { public ClassicsFooter(Context context) { super(context); diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/FalsifyFooter.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/FalsifyFooter.java index 1ce4377c..df2f3f65 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/FalsifyFooter.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/FalsifyFooter.java @@ -3,15 +3,13 @@ import android.content.Context; import android.util.AttributeSet; -import com.scwang.smartrefresh.layout.api.RefreshFooter; - /** * 虚假的 Footer * 用于 正真的 Footer 在 RefreshLayout 外部时, * Created by scwang on 2017/6/14. */ @SuppressWarnings("unused") -public class FalsifyFooter extends com.scwang.smart.refresh.header.FalsifyFooter implements RefreshFooter { +public class FalsifyFooter extends com.scwang.smart.refresh.header.FalsifyFooter implements com.scwang.smart.refresh.layout.api.RefreshFooter { // public FalsifyFooter(Context context) { diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/BezierRadarHeader.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/BezierRadarHeader.java index 299c50b1..6d6b9790 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/BezierRadarHeader.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/BezierRadarHeader.java @@ -1,16 +1,14 @@ -package com.scwang.smartrefresh.layout.header; +package com.scwang.smart.refresh.layout.header; import android.content.Context; import android.util.AttributeSet; -import com.scwang.smartrefresh.layout.api.RefreshHeader; - /** * 贝塞尔曲线类雷达风格刷新组件 * Created by scwang on 2017/5/28. */ @SuppressWarnings({"UnusedReturnValue", "unused"}) -public class BezierRadarHeader extends com.scwang.smart.refresh.header.BezierRadarHeader implements RefreshHeader { +public class BezierRadarHeader extends com.scwang.smart.refresh.header.BezierRadarHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { // public BezierRadarHeader(Context context) { diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/ClassicsHeader.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/ClassicsHeader.java index 36aae02f..7e8a38e8 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/ClassicsHeader.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/ClassicsHeader.java @@ -1,4 +1,4 @@ -package com.scwang.smartrefresh.layout.header; +package com.scwang.smart.refresh.layout.header; import android.content.Context; import android.graphics.Bitmap; @@ -7,7 +7,6 @@ import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; -import com.scwang.smartrefresh.layout.api.RefreshHeader; import java.text.DateFormat; import java.util.Date; @@ -17,7 +16,7 @@ * Created by scwang on 2017/5/28. */ @SuppressWarnings({"unused", "UnusedReturnValue"}) -public class ClassicsHeader extends com.scwang.smart.refresh.header.ClassicsHeader implements RefreshHeader { +public class ClassicsHeader extends com.scwang.smart.refresh.header.ClassicsHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { public ClassicsHeader(Context context) { super(context); diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/FalsifyHeader.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/FalsifyHeader.java index d105ce53..b233bf38 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/FalsifyHeader.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/FalsifyHeader.java @@ -1,10 +1,8 @@ -package com.scwang.smartrefresh.layout.header; +package com.scwang.smart.refresh.layout.header; import android.content.Context; import android.util.AttributeSet; -import com.scwang.smartrefresh.layout.api.RefreshHeader; - /** * 虚假的 Header * 用于 正真的 Header 在 RefreshLayout 外部时, @@ -12,7 +10,7 @@ * 具体使用方法 参考 纸飞机(FlyRefreshHeader) * Created by scwang on 2017/6/14. */ -public class FalsifyHeader extends com.scwang.smart.refresh.header.FalsifyHeader implements RefreshHeader { +public class FalsifyHeader extends com.scwang.smart.refresh.header.FalsifyHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { // public FalsifyHeader(Context context) { diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java index d6dad851..706ae843 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java @@ -1,20 +1,19 @@ -package com.scwang.smartrefresh.layout.header; +package com.scwang.smart.refresh.layout.header; import android.content.Context; import android.util.AttributeSet; import androidx.annotation.Nullable; -import com.scwang.smartrefresh.layout.api.OnTwoLevelListener; -import com.scwang.smartrefresh.layout.api.RefreshHeader; -import com.scwang.smartrefresh.layout.api.RefreshLayout; +import com.scwang.smart.refresh.header.listener.OnTwoLevelListener; +import com.scwang.smart.refresh.layout.api.RefreshLayout; /** * 二级刷新 * Created by scwang on 2017/5/26. */ @SuppressWarnings("UnusedReturnValue") -public class TwoLevelHeader extends com.scwang.smart.refresh.header.TwoLevelHeader implements RefreshHeader { +public class TwoLevelHeader extends com.scwang.smart.refresh.header.TwoLevelHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { // @@ -28,7 +27,7 @@ public TwoLevelHeader(Context context, @Nullable AttributeSet attrs) { // public TwoLevelHeader setOnTwoLevelListener(final OnTwoLevelListener listener) { - super.setOnTwoLevelListener(layout -> listener.onTwoLevel((RefreshLayout) layout)); + super.setOnTwoLevelListener(listener); return this; } diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/RefreshFooterWrapper.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/RefreshFooterWrapper.java index 6bf8f505..03ae2564 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/RefreshFooterWrapper.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/RefreshFooterWrapper.java @@ -3,7 +3,6 @@ import android.annotation.SuppressLint; import android.view.View; -import com.scwang.smartrefresh.layout.api.RefreshFooter; import com.scwang.smartrefresh.layout.internal.InternalAbstract; /** @@ -11,7 +10,7 @@ * Created by scwang on 2017/5/26. */ @SuppressLint("ViewConstructor") -public class RefreshFooterWrapper extends InternalAbstract implements RefreshFooter { +public class RefreshFooterWrapper extends InternalAbstract implements com.scwang.smart.refresh.layout.api.RefreshFooter { public RefreshFooterWrapper(View wrapper) { super(wrapper); diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/RefreshHeaderWrapper.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/RefreshHeaderWrapper.java index 3f1c1893..8c2c93fb 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/RefreshHeaderWrapper.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/RefreshHeaderWrapper.java @@ -3,7 +3,6 @@ import android.annotation.SuppressLint; import android.view.View; -import com.scwang.smartrefresh.layout.api.RefreshHeader; import com.scwang.smartrefresh.layout.internal.InternalAbstract; /** @@ -11,7 +10,7 @@ * Created by scwang on 2017/5/26. */ @SuppressLint("ViewConstructor") -public class RefreshHeaderWrapper extends InternalAbstract implements RefreshHeader { +public class RefreshHeaderWrapper extends InternalAbstract implements com.scwang.smart.refresh.layout.api.RefreshHeader { public RefreshHeaderWrapper(View wrapper) { super(wrapper); diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/ScrollBoundaryDeciderAdapter.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/ScrollBoundaryDeciderAdapter.java index fabaecc5..a580920a 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/ScrollBoundaryDeciderAdapter.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/ScrollBoundaryDeciderAdapter.java @@ -1,12 +1,11 @@ package com.scwang.smartrefresh.layout.impl; import com.scwang.smart.refresh.layout.simple.SimpleBoundaryDecider; -import com.scwang.smartrefresh.layout.api.ScrollBoundaryDecider; /** * 滚动边界 * Created by scwang on 2017/7/8. */ -public class ScrollBoundaryDeciderAdapter extends SimpleBoundaryDecider implements ScrollBoundaryDecider { +public class ScrollBoundaryDeciderAdapter extends SimpleBoundaryDecider implements com.scwang.smart.refresh.layout.listener.ScrollBoundaryDecider { } diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/InternalAbstract.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/InternalAbstract.java index a350bbc9..c974e3e2 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/InternalAbstract.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/InternalAbstract.java @@ -7,8 +7,8 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import com.scwang.smart.refresh.layout.api.RefreshComponent; import com.scwang.smart.refresh.layout.simple.SimpleComponent; -import com.scwang.smartrefresh.layout.api.RefreshInternal; /** * Internal 初步实现 @@ -23,7 +23,7 @@ protected InternalAbstract(@NonNull View wrapped) { super(wrapped); } - protected InternalAbstract(@NonNull View wrappedView, @Nullable RefreshInternal wrappedInternal) { + protected InternalAbstract(@NonNull View wrappedView, @Nullable RefreshComponent wrappedInternal) { super(wrappedView, wrappedInternal); } diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnLoadMoreListener.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnLoadMoreListener.java deleted file mode 100644 index fa5b7856..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnLoadMoreListener.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.scwang.smartrefresh.layout.listener; - -import androidx.annotation.NonNull; - -import com.scwang.smartrefresh.layout.api.RefreshLayout; - -/** - * 加载更多监听器 - * Created by scwang on 2017/5/26. - */ -public interface OnLoadMoreListener { - void onLoadMore(@NonNull RefreshLayout refreshLayout); -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnMultiPurposeListener.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnMultiPurposeListener.java deleted file mode 100644 index 6f16d289..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnMultiPurposeListener.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.scwang.smartrefresh.layout.listener; - -import com.scwang.smartrefresh.layout.api.RefreshFooter; -import com.scwang.smartrefresh.layout.api.RefreshHeader; - -/** - * 多功能监听器 - * Created by scwang on 2017/5/26. - */ -public interface OnMultiPurposeListener extends OnRefreshLoadMoreListener, OnStateChangedListener { - /** - * 手指拖动下拉(会连续多次调用,添加isDragging并取代之前的onPulling、onReleasing) - * @param header 头部 - * @param isDragging true 手指正在拖动 false 回弹动画 - * @param percent 下拉的百分比 值 = offset/footerHeight (0 - percent - (footerHeight+maxDragHeight) / footerHeight ) - * @param offset 下拉的像素偏移量 0 - offset - (footerHeight+maxDragHeight) - * @param headerHeight 高度 HeaderHeight or FooterHeight - * @param maxDragHeight 最大拖动高度 - */ - void onHeaderMoving(RefreshHeader header, boolean isDragging, float percent, int offset, int headerHeight, int maxDragHeight); - - void onHeaderReleased(RefreshHeader header, int headerHeight, int maxDragHeight); - void onHeaderStartAnimator(RefreshHeader header, int headerHeight, int maxDragHeight); - void onHeaderFinish(RefreshHeader header, boolean success); - - /** - * 手指拖动上拉(会连续多次调用,添加isDragging并取代之前的onPulling、onReleasing) - * @param footer 尾部 - * @param isDragging true 手指正在拖动 false 回弹动画 - * @param percent 下拉的百分比 值 = offset/footerHeight (0 - percent - (footerHeight+maxDragHeight) / footerHeight ) - * @param offset 下拉的像素偏移量 0 - offset - (footerHeight+maxDragHeight) - * @param footerHeight 高度 HeaderHeight or FooterHeight - * @param maxDragHeight 最大拖动高度 - */ - void onFooterMoving(RefreshFooter footer, boolean isDragging, float percent, int offset, int footerHeight, int maxDragHeight); - - void onFooterReleased(RefreshFooter footer, int footerHeight, int maxDragHeight); - void onFooterStartAnimator(RefreshFooter footer, int footerHeight, int maxDragHeight); - void onFooterFinish(RefreshFooter footer, boolean success); -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnRefreshListener.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnRefreshListener.java deleted file mode 100644 index 5d986488..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnRefreshListener.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.scwang.smartrefresh.layout.listener; - -import androidx.annotation.NonNull; - -import com.scwang.smartrefresh.layout.api.RefreshLayout; - -/** - * 刷新监听器 - * Created by scwang on 2017/5/26. - */ -public interface OnRefreshListener { - void onRefresh(@NonNull RefreshLayout refreshLayout); -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnRefreshLoadMoreListener.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnRefreshLoadMoreListener.java deleted file mode 100644 index 60394b77..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnRefreshLoadMoreListener.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.scwang.smartrefresh.layout.listener; - -/** - * 刷新加载组合监听器 - * Created by scwang on 2017/5/26. - */ -public interface OnRefreshLoadMoreListener extends OnRefreshListener, OnLoadMoreListener { -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnStateChangedListener.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnStateChangedListener.java deleted file mode 100644 index 71b78e5a..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/OnStateChangedListener.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.scwang.smartrefresh.layout.listener; - - -import androidx.annotation.NonNull; -import androidx.annotation.RestrictTo; - -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.constant.RefreshState; - -import static androidx.annotation.RestrictTo.Scope.LIBRARY; -import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP; -import static androidx.annotation.RestrictTo.Scope.SUBCLASSES; - -/** - * 刷新状态改变监听器 - * Created by scwang on 2017/5/26. - */ -public interface OnStateChangedListener { - /** - * 【仅限框架内调用】状态改变事件 {@link RefreshState} - * @param refreshLayout RefreshLayout - * @param oldState 改变之前的状态 - * @param newState 改变之后的状态 - */ - @RestrictTo({LIBRARY,LIBRARY_GROUP,SUBCLASSES}) - void onStateChanged(@NonNull RefreshLayout refreshLayout, @NonNull RefreshState oldState, @NonNull RefreshState newState); -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/SimpleMultiPurposeListener.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/SimpleMultiPurposeListener.java deleted file mode 100644 index 92a3d7b8..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/listener/SimpleMultiPurposeListener.java +++ /dev/null @@ -1,182 +0,0 @@ -package com.scwang.smartrefresh.layout.listener; - -import androidx.annotation.NonNull; - -import com.scwang.smart.refresh.layout.listener.OnMultiListener; -import com.scwang.smartrefresh.layout.api.RefreshFooter; -import com.scwang.smartrefresh.layout.api.RefreshHeader; -import com.scwang.smartrefresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.constant.RefreshState; - -/** - * 多功能监听器 - * Created by scwang on 2017/5/26. - */ -public class SimpleMultiPurposeListener implements OnMultiPurposeListener, OnMultiListener { - - private RefreshLayout refreshLayout; - private OnMultiPurposeListener listener; - - public SimpleMultiPurposeListener() { - - } - - public SimpleMultiPurposeListener(OnMultiPurposeListener listener, RefreshLayout refreshLayout) { - this.listener = listener; - this.refreshLayout = refreshLayout; - } - - @Override - public void onHeaderMoving(RefreshHeader header, boolean isDragging, float percent, int offset, int headerHeight, int maxDragHeight) { - if (listener != null) { - listener.onHeaderMoving(header, isDragging, percent, offset, headerHeight, maxDragHeight); - } - } - - @Override - public void onHeaderReleased(RefreshHeader header, int headerHeight, int maxDragHeight) { - if (listener != null) { - listener.onHeaderReleased(header, headerHeight, maxDragHeight); - } - } - - @Override - public void onHeaderStartAnimator(RefreshHeader header, int footerHeight, int maxDragHeight) { - if (listener != null) { - listener.onHeaderStartAnimator(header, footerHeight, maxDragHeight); - } - } - - @Override - public void onHeaderFinish(RefreshHeader header, boolean success) { - if (listener != null) { - listener.onHeaderFinish(header, success); - } - } - - @Override - public void onFooterMoving(RefreshFooter footer, boolean isDragging, float percent, int offset, int footerHeight, int maxDragHeight) { - if (listener != null) { - listener.onFooterMoving(footer, isDragging, percent, offset, footerHeight, maxDragHeight); - } - } - - @Override - public void onFooterReleased(RefreshFooter footer, int footerHeight, int maxDragHeight) { - if (listener != null) { - listener.onFooterReleased(footer, footerHeight, maxDragHeight); - } - } - - @Override - public void onFooterStartAnimator(RefreshFooter footer, int headerHeight, int maxDragHeight) { - if (listener != null) { - listener.onFooterStartAnimator(footer, headerHeight, maxDragHeight); - } - } - - @Override - public void onFooterFinish(RefreshFooter footer, boolean success) { - if (listener != null) { - listener.onFooterFinish(footer, success); - } - } - - @Override - public void onRefresh(@NonNull RefreshLayout refreshLayout) { - if (listener != null) { - listener.onRefresh(refreshLayout); - } - } - - @Override - public void onLoadMore(@NonNull RefreshLayout refreshLayout) { - if (listener != null) { - listener.onLoadMore(refreshLayout); - } - } - - @Override - public void onStateChanged(@NonNull RefreshLayout refreshLayout, @NonNull RefreshState oldState, @NonNull RefreshState newState) { - if (listener != null) { - listener.onStateChanged(refreshLayout, oldState, newState); - } - } - - @Override - public void onHeaderMoving(com.scwang.smart.refresh.layout.api.RefreshHeader header, boolean isDragging, float percent, int offset, int headerHeight, int maxDragHeight) { - if (refreshLayout != null) { - onHeaderMoving(refreshLayout.getRefreshHeader(), isDragging, percent, offset, headerHeight, maxDragHeight); - } - } - - @Override - public void onHeaderReleased(com.scwang.smart.refresh.layout.api.RefreshHeader header, int headerHeight, int maxDragHeight) { - if (refreshLayout != null) { - onHeaderReleased(refreshLayout.getRefreshHeader(), headerHeight, maxDragHeight); - } - } - - @Override - public void onHeaderStartAnimator(com.scwang.smart.refresh.layout.api.RefreshHeader header, int headerHeight, int maxDragHeight) { - if (refreshLayout != null) { - onHeaderStartAnimator(refreshLayout.getRefreshHeader(), headerHeight, maxDragHeight); - } - } - - @Override - public void onHeaderFinish(com.scwang.smart.refresh.layout.api.RefreshHeader header, boolean success) { - if (refreshLayout != null) { - onHeaderFinish(refreshLayout.getRefreshHeader(), success); - } - } - - @Override - public void onFooterMoving(com.scwang.smart.refresh.layout.api.RefreshFooter footer, boolean isDragging, float percent, int offset, int footerHeight, int maxDragHeight) { - if (refreshLayout != null) { - onFooterMoving(refreshLayout.getRefreshFooter(), isDragging, percent, offset, footerHeight, maxDragHeight); - } - } - - @Override - public void onFooterReleased(com.scwang.smart.refresh.layout.api.RefreshFooter footer, int footerHeight, int maxDragHeight) { - if (refreshLayout != null) { - onFooterReleased(refreshLayout.getRefreshFooter(), footerHeight, maxDragHeight); - } - } - - @Override - public void onFooterStartAnimator(com.scwang.smart.refresh.layout.api.RefreshFooter footer, int footerHeight, int maxDragHeight) { - if (refreshLayout != null) { - onFooterStartAnimator(refreshLayout.getRefreshFooter(), footerHeight, maxDragHeight); - } - } - - @Override - public void onFooterFinish(com.scwang.smart.refresh.layout.api.RefreshFooter footer, boolean success) { - if (refreshLayout != null) { - onFooterFinish(refreshLayout.getRefreshFooter(), success); - } - } - - @Override - public void onLoadMore(@NonNull com.scwang.smart.refresh.layout.api.RefreshLayout refreshLayout) { - if (this.refreshLayout != null) { - onLoadMore(this.refreshLayout); - } - } - - @Override - public void onRefresh(@NonNull com.scwang.smart.refresh.layout.api.RefreshLayout refreshLayout) { - if (this.refreshLayout != null) { - onRefresh(this.refreshLayout); - } - } - - @Override - public void onStateChanged(@NonNull com.scwang.smart.refresh.layout.api.RefreshLayout refreshLayout, @NonNull com.scwang.smart.refresh.layout.constant.RefreshState oldState, @NonNull com.scwang.smart.refresh.layout.constant.RefreshState newState) { - if (this.refreshLayout != null) { - onStateChanged(this.refreshLayout, RefreshState.from(oldState), RefreshState.from(newState)); - } - } -} From 119ed62027a913112b6d61dc4b7b5630890d3cbe Mon Sep 17 00:00:00 2001 From: wsc Date: Fri, 25 Oct 2024 20:43:32 +0800 Subject: [PATCH 59/67] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E7=8F=AD=20Header=20=E5=92=8C=20Footer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/scwang/refreshlayout/App.java | 4 +- .../example/BasicExampleActivity.java | 2 +- .../activity/example/I18nExampleActivity.java | 2 +- .../practice/RepastPracticeActivity.java | 2 +- .../practice/WebViewPracticeActivity.java | 2 +- .../practice/WeiboPracticeActivity.java | 2 +- .../style/BezierRadarStyleActivity.java | 2 +- .../activity/style/ClassicsStyleActivity.java | 2 +- .../style/FlyRefreshStyleActivity.java | 2 +- .../example/BottomSheetExampleFragment.java | 2 +- .../example/EmptyLayoutExampleFragment.java | 2 +- .../EmptyLayoutExampleFragmentInner.java | 2 +- .../EmptyLayoutExampleFragmentOuter.java | 2 +- .../example/FlexBoxLayoutManagerFragment.java | 2 +- .../example/NestedScrollExampleFragment.java | 2 +- .../PureScrollExampleFragmentHeader.java | 2 +- .../example/ViewPagerExampleFragment.java | 4 +- .../practice/InstantPracticeFragment.java | 6 +- .../practice/SecondFloorPracticeFragment.java | 3 +- .../practice/TwoLevelPracticeFragment.java | 2 +- .../widget/RefreshContentHorizontal.java | 4 +- .../widget/ScrollBoundaryHorizontal.java | 2 +- .../widget/SmartRefreshHorizontal.java | 5 +- .../main/res/layout/activity_style_bezier.xml | 2 +- art/md_property.md | 2 +- .../layout/SmartRefreshLayout.java | 8 +- .../layout/footer/BallPulseFooter.java | 46 ---- .../layout/footer/ClassicsFooter.java | 118 ---------- .../layout/footer/FalsifyFooter.java | 24 -- .../layout/header/BezierRadarHeader.java | 52 ----- .../layout/header/ClassicsHeader.java | 219 ------------------ .../layout/header/FalsifyHeader.java | 24 -- .../layout/header/TwoLevelHeader.java | 81 ------- .../layout/impl/RefreshFooterWrapper.java | 19 -- .../layout/impl/RefreshHeaderWrapper.java | 19 -- .../impl/ScrollBoundaryDeciderAdapter.java | 11 - .../layout/internal/ArrowDrawable.java | 10 - .../layout/internal/InternalAbstract.java | 35 --- .../layout/internal/PaintDrawable.java | 9 - .../layout/internal/ProgressDrawable.java | 9 - .../smartrefresh/layout/util/SmartUtil.java | 13 -- 41 files changed, 35 insertions(+), 726 deletions(-) delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/BallPulseFooter.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/ClassicsFooter.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/FalsifyFooter.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/BezierRadarHeader.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/ClassicsHeader.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/FalsifyHeader.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/RefreshFooterWrapper.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/RefreshHeaderWrapper.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/ScrollBoundaryDeciderAdapter.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/ArrowDrawable.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/InternalAbstract.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/PaintDrawable.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/ProgressDrawable.java delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/util/SmartUtil.java diff --git a/app/src/main/java/com/scwang/refreshlayout/App.java b/app/src/main/java/com/scwang/refreshlayout/App.java index f64de5cf..1aa1eff2 100644 --- a/app/src/main/java/com/scwang/refreshlayout/App.java +++ b/app/src/main/java/com/scwang/refreshlayout/App.java @@ -14,8 +14,8 @@ import com.scwang.smart.refresh.layout.listener.DefaultRefreshHeaderCreator; import com.scwang.smart.refresh.layout.listener.DefaultRefreshInitializer; import com.scwang.smartrefresh.layout.SmartRefreshLayout; -import com.scwang.smartrefresh.layout.footer.ClassicsFooter; -import com.scwang.smart.refresh.layout.header.ClassicsHeader; +import com.scwang.smart.refresh.footer.ClassicsFooter; +import com.scwang.smart.refresh.header.ClassicsHeader; /** * diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java index 2912a618..666dab2e 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java @@ -15,9 +15,9 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.smart.refresh.footer.ClassicsFooter; import com.scwang.smart.refresh.layout.api.RefreshFooter; import com.scwang.smart.refresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.layout.footer.ClassicsFooter; import java.util.Arrays; import java.util.Collection; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java index e2d53dea..1df26bce 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java @@ -18,7 +18,7 @@ import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; -import com.scwang.smart.refresh.layout.header.ClassicsHeader; +import com.scwang.smart.refresh.header.ClassicsHeader; import com.scwang.smart.refresh.layout.listener.OnRefreshListener; import java.util.ArrayList; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/RepastPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/RepastPracticeActivity.java index 953dc6c6..8c6ec930 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/RepastPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/RepastPracticeActivity.java @@ -17,7 +17,7 @@ import com.scwang.refreshlayout.util.StatusBarUtil; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; -import com.scwang.smartrefresh.layout.util.SmartUtil; +import com.scwang.smart.refresh.layout.util.SmartUtil; import java.util.Arrays; import java.util.Collection; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WebViewPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/WebViewPracticeActivity.java index 96915c6c..4ea5b776 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WebViewPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/WebViewPracticeActivity.java @@ -12,7 +12,7 @@ import com.scwang.refreshlayout.util.StatusBarUtil; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.listener.OnRefreshListener; -import com.scwang.smartrefresh.layout.util.SmartUtil; +import com.scwang.smart.refresh.layout.util.SmartUtil; import java.util.Locale; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java index 97288bcc..a21b12b6 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java @@ -15,7 +15,7 @@ import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; -import com.scwang.smartrefresh.layout.util.SmartUtil; +import com.scwang.smart.refresh.layout.util.SmartUtil; /** * 微博主页 diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java index 5f427191..cb35c08c 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java @@ -17,7 +17,7 @@ import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; -import com.scwang.smart.refresh.layout.header.BezierRadarHeader; +import com.scwang.smart.refresh.header.BezierRadarHeader; import java.util.ArrayList; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java index d1cc1df7..3ec3c4e9 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java @@ -22,7 +22,7 @@ import com.scwang.refreshlayout.util.DynamicTimeFormat; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; -import com.scwang.smart.refresh.layout.header.ClassicsHeader; +import com.scwang.smart.refresh.header.ClassicsHeader; import java.text.SimpleDateFormat; import java.util.ArrayList; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java index 0e875a55..89a51c37 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java @@ -37,7 +37,7 @@ import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; import com.scwang.smartrefresh.header.FlyRefreshHeader; import com.scwang.smart.refresh.layout.listener.OnMultiListener; -import com.scwang.smartrefresh.layout.util.SmartUtil; +import com.scwang.smart.refresh.layout.util.SmartUtil; import java.text.DateFormat; import java.text.ParseException; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java index 3bed4a37..723f0d73 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java @@ -21,7 +21,7 @@ import com.scwang.refreshlayout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; -import com.scwang.smart.refresh.layout.header.ClassicsHeader; +import com.scwang.smart.refresh.header.ClassicsHeader; import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java index 296e51e9..9eea0188 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java @@ -25,7 +25,7 @@ import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.RefreshState; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; -import com.scwang.smart.refresh.layout.header.ClassicsHeader; +import com.scwang.smart.refresh.header.ClassicsHeader; import com.scwang.smart.refresh.layout.listener.OnRefreshListener; import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java index 2dd8f627..b35e15b0 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java @@ -29,7 +29,7 @@ import com.scwang.smart.refresh.layout.listener.OnRefreshListener; import com.scwang.smart.refresh.layout.constant.RefreshState; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; -import com.scwang.smart.refresh.layout.header.ClassicsHeader; +import com.scwang.smart.refresh.header.ClassicsHeader; import com.scwang.smart.refresh.layout.listener.OnMultiListener; import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java index 669c0537..38697668 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java @@ -27,7 +27,7 @@ import com.scwang.refreshlayout.fragment.example.EmptyLayoutExampleFragment.Item; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; -import com.scwang.smart.refresh.layout.header.ClassicsHeader; +import com.scwang.smart.refresh.header.ClassicsHeader; import com.scwang.smart.refresh.layout.listener.OnRefreshListener; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/FlexBoxLayoutManagerFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/FlexBoxLayoutManagerFragment.java index ef501f43..8184da98 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/FlexBoxLayoutManagerFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/FlexBoxLayoutManagerFragment.java @@ -20,7 +20,7 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.smartrefresh.layout.util.SmartUtil; +import com.scwang.smart.refresh.layout.util.SmartUtil; import java.util.Arrays; import java.util.Random; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java index 0d518f19..cfa1d176 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java @@ -25,7 +25,7 @@ import com.scwang.refreshlayout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener; -import com.scwang.smartrefresh.layout.footer.ClassicsFooter; +import com.scwang.smart.refresh.footer.ClassicsFooter; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java index 7d1f0100..87a14c72 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java @@ -24,7 +24,7 @@ import com.scwang.refreshlayout.adapter.SmartViewHolder; import com.scwang.refreshlayout.fragment.example.PureScrollExampleFragment.Item; import com.scwang.smart.refresh.layout.api.RefreshLayout; -import com.scwang.smart.refresh.layout.header.FalsifyHeader; +import com.scwang.smart.refresh.header.FalsifyHeader; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java index 88809a0b..ebd0401a 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java @@ -26,8 +26,8 @@ import com.scwang.refreshlayout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.listener.OnRefreshListener; -import com.scwang.smartrefresh.layout.footer.ClassicsFooter; -import com.scwang.smart.refresh.layout.header.ClassicsHeader; +import com.scwang.smart.refresh.footer.ClassicsFooter; +import com.scwang.smart.refresh.header.ClassicsHeader; import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java index a8514f56..fb143563 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java @@ -18,8 +18,8 @@ import com.scwang.refreshlayout.util.DynamicTimeFormat; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener; -import com.scwang.smartrefresh.layout.footer.ClassicsFooter; -import com.scwang.smartrefresh.layout.impl.ScrollBoundaryDeciderAdapter; +import com.scwang.smart.refresh.footer.ClassicsFooter; +import com.scwang.smart.refresh.layout.simple.SimpleBoundaryDecider; import java.util.Arrays; import java.util.Collection; @@ -65,7 +65,7 @@ public void onClick(View v) { refreshLayout.setEnableNestedScroll(false);//必须关闭 refreshLayout.setEnableScrollContentWhenLoaded(true);//必须关闭 refreshLayout.getLayout().setScaleY(-1);//必须设置 - refreshLayout.setScrollBoundaryDecider(new ScrollBoundaryDeciderAdapter() { + refreshLayout.setScrollBoundaryDecider(new SimpleBoundaryDecider() { @Override public boolean canLoadMore(View content) { return super.canRefresh(content);//必须替换 diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java index 7ef79315..719ae233 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java @@ -17,11 +17,10 @@ import com.scwang.refreshlayout.adapter.SmartViewHolder; import com.scwang.refreshlayout.util.StatusBarUtil; import com.scwang.smart.refresh.header.listener.OnTwoLevelListener; +import com.scwang.smart.refresh.header.TwoLevelHeader; import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.RefreshState; -import com.scwang.smart.refresh.layout.header.TwoLevelHeader; -import com.scwang.smart.refresh.layout.listener.OnMultiListener; import com.scwang.smart.refresh.layout.listener.OnRefreshListener; import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java index cbb9c1e1..8c4dba43 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java @@ -14,8 +14,8 @@ import com.scwang.refreshlayout.R; import com.scwang.refreshlayout.util.StatusBarUtil; import com.scwang.smart.refresh.header.listener.OnTwoLevelListener; +import com.scwang.smart.refresh.header.TwoLevelHeader; import com.scwang.smart.refresh.layout.api.RefreshLayout; -import com.scwang.smart.refresh.layout.header.TwoLevelHeader; import com.scwang.smart.refresh.layout.listener.OnRefreshListener; /** diff --git a/app/src/main/java/com/scwang/refreshlayout/widget/RefreshContentHorizontal.java b/app/src/main/java/com/scwang/refreshlayout/widget/RefreshContentHorizontal.java index 4298e6da..30f4e0d0 100644 --- a/app/src/main/java/com/scwang/refreshlayout/widget/RefreshContentHorizontal.java +++ b/app/src/main/java/com/scwang/refreshlayout/widget/RefreshContentHorizontal.java @@ -6,9 +6,9 @@ import androidx.annotation.NonNull; +import com.scwang.smart.refresh.layout.util.SmartUtil; import com.scwang.smart.refresh.layout.wrapper.RefreshContentWrapper; -import static com.scwang.smartrefresh.layout.util.SmartUtil.scrollListBy; public class RefreshContentHorizontal extends RefreshContentWrapper { @@ -32,7 +32,7 @@ public void onAnimationUpdate(@NonNull ValueAnimator animation) { int value = (int) animation.getAnimatedValue(); try { if (mScrollableView instanceof AbsListView) { - scrollListBy((AbsListView) mScrollableView, value - mLastSpinner); + SmartUtil.scrollListBy((AbsListView) mScrollableView, value - mLastSpinner); } else { mScrollableView.scrollBy(value - mLastSpinner, 0); } diff --git a/app/src/main/java/com/scwang/refreshlayout/widget/ScrollBoundaryHorizontal.java b/app/src/main/java/com/scwang/refreshlayout/widget/ScrollBoundaryHorizontal.java index 8b9c8247..f6285f13 100644 --- a/app/src/main/java/com/scwang/refreshlayout/widget/ScrollBoundaryHorizontal.java +++ b/app/src/main/java/com/scwang/refreshlayout/widget/ScrollBoundaryHorizontal.java @@ -6,7 +6,7 @@ import androidx.annotation.NonNull; -import com.scwang.smartrefresh.layout.util.SmartUtil; +import com.scwang.smart.refresh.layout.util.SmartUtil; /** * 滚动边界 diff --git a/app/src/main/java/com/scwang/refreshlayout/widget/SmartRefreshHorizontal.java b/app/src/main/java/com/scwang/refreshlayout/widget/SmartRefreshHorizontal.java index 317b966c..bba92ce0 100644 --- a/app/src/main/java/com/scwang/refreshlayout/widget/SmartRefreshHorizontal.java +++ b/app/src/main/java/com/scwang/refreshlayout/widget/SmartRefreshHorizontal.java @@ -7,8 +7,9 @@ import com.scwang.refreshlayout.R; import com.scwang.smart.refresh.layout.api.RefreshComponent; +import com.scwang.smart.refresh.layout.listener.ScrollBoundaryDecider; +import com.scwang.smart.refresh.layout.simple.SimpleBoundaryDecider; import com.scwang.smartrefresh.layout.SmartRefreshLayout; -import com.scwang.smartrefresh.layout.impl.ScrollBoundaryDeciderAdapter; public class SmartRefreshHorizontal extends SmartRefreshLayout { @@ -21,7 +22,7 @@ public SmartRefreshHorizontal(Context context) { public SmartRefreshHorizontal(Context context, AttributeSet attrs) { super(context, attrs); setEnableAutoLoadMore(false); - setScrollBoundaryDecider(new ScrollBoundaryDeciderAdapter(){ + setScrollBoundaryDecider(new SimpleBoundaryDecider(){ @Override public boolean canRefresh(View content) { return ScrollBoundaryHorizontal.canRefresh(content, mActionEvent); diff --git a/app/src/main/res/layout/activity_style_bezier.xml b/app/src/main/res/layout/activity_style_bezier.xml index 663290c5..2147962f 100644 --- a/app/src/main/res/layout/activity_style_bezier.xml +++ b/app/src/main/res/layout/activity_style_bezier.xml @@ -21,7 +21,7 @@ app:srlAccentColor="@android:color/white" app:srlEnableHeaderTranslationContent="true" app:srlEnableLoadMore="false"> - diff --git a/art/md_property.md b/art/md_property.md index 027722f5..237d6bc8 100644 --- a/art/md_property.md +++ b/art/md_property.md @@ -49,7 +49,7 @@ public class RefreshActivity extends Activity { refreshLayout.setOnMultiListener(new SimpleMultiListener());//设置多功能监听器 refreshLayout.setScrollBoundaryDecider(new ScrollBoundaryDecider());//设置滚动边界判断 - refreshLayout.setScrollBoundaryDecider(new ScrollBoundaryDeciderAdapter());//自定义滚动边界 + refreshLayout.setScrollBoundaryDecider(new SimpleBoundaryDecider());//自定义滚动边界 refreshLayout.setRefreshHeader(new ClassicsHeader(context));//设置Header refreshLayout.setRefreshFooter(new ClassicsFooter(context));//设置Footer diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java index 7a7d8299..ef08e852 100644 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java +++ b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java @@ -3,7 +3,6 @@ import android.annotation.SuppressLint; import android.content.Context; import android.util.AttributeSet; -import android.view.View; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -19,9 +18,8 @@ import com.scwang.smart.refresh.layout.listener.OnRefreshListener; import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; import com.scwang.smart.refresh.layout.listener.ScrollBoundaryDecider; +import com.scwang.smart.refresh.layout.simple.SimpleBoundaryDecider; import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; -import com.scwang.smartrefresh.layout.footer.BallPulseFooter; -import com.scwang.smart.refresh.layout.header.BezierRadarHeader; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; @@ -197,9 +195,9 @@ public RefreshLayout setOnMultiListener(OnMultiListener listener) { /** * Set the scroll boundary Decider, Can customize when you can refresh. - * Recommended {@link com.scwang.smartrefresh.layout.impl.ScrollBoundaryDeciderAdapter} + * Recommended {@link SimpleBoundaryDecider} * 设置滚动边界判断器 - * 建议使用 {@link com.scwang.smartrefresh.layout.impl.ScrollBoundaryDeciderAdapter} + * 建议使用 {@link SimpleBoundaryDecider} * @param boundary ScrollBoundaryDecider 判断器 * @return RefreshLayout */ diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/BallPulseFooter.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/BallPulseFooter.java deleted file mode 100644 index 79b9b594..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/BallPulseFooter.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.scwang.smartrefresh.layout.footer; - -import android.content.Context; -import android.util.AttributeSet; - -import androidx.annotation.Nullable; - -import com.scwang.smart.refresh.layout.constant.SpinnerStyle; - - -/** - * 球脉冲底部加载组件 - * Created by scwang on 2017/5/30. - */ -@SuppressWarnings({"unused", "UnusedReturnValue"}) -public class BallPulseFooter extends com.scwang.smart.refresh.footer.BallPulseFooter implements com.scwang.smart.refresh.layout.api.RefreshFooter { - - // - public BallPulseFooter(Context context) { - this(context, null); - } - - public BallPulseFooter(Context context, @Nullable AttributeSet attrs) { - super(context, attrs); - } - // - - - @Override - public BallPulseFooter setSpinnerStyle(SpinnerStyle mSpinnerStyle) { - super.setSpinnerStyle(mSpinnerStyle); - return this; - } - - @Override - public BallPulseFooter setNormalColor(int color) { - super.setNormalColor(color); - return this; - } - - @Override - public BallPulseFooter setAnimatingColor(int color) { - super.setAnimatingColor(color); - return this; - } -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/ClassicsFooter.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/ClassicsFooter.java deleted file mode 100644 index 1a282aa9..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/ClassicsFooter.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.scwang.smartrefresh.layout.footer; - -import android.content.Context; -import android.util.AttributeSet; - -import com.scwang.smart.refresh.layout.constant.SpinnerStyle; - -/** - * 经典上拉底部-兼容【1.x】版本-包名位置 - * Created by scwang on 2017/5/28. - */ -@SuppressWarnings({"unused", "UnusedReturnValue"}) -public class ClassicsFooter extends com.scwang.smart.refresh.footer.ClassicsFooter implements com.scwang.smart.refresh.layout.api.RefreshFooter { - - public ClassicsFooter(Context context) { - super(context); - } - - public ClassicsFooter(Context context, AttributeSet attrs) { - super(context, attrs); - } - - @Override - public ClassicsFooter setSpinnerStyle(SpinnerStyle style) { - super.setSpinnerStyle(style); - return this; - } - - @Override - public ClassicsFooter setPrimaryColor(int primaryColor) { - super.setPrimaryColor(primaryColor); - return this; - } - - @Override - public ClassicsFooter setAccentColor(int accentColor) { - super.setAccentColor(accentColor); - return this; - } - - @Override - public ClassicsFooter setPrimaryColorId(int colorId) { - super.setPrimaryColorId(colorId); - return this; - } - - @Override - public ClassicsFooter setAccentColorId(int colorId) { - super.setAccentColorId(colorId); - return this; - } - - @Override - public ClassicsFooter setFinishDuration(int delay) { - super.setFinishDuration(delay); - return this; - } - - @Override - public ClassicsFooter setTextSizeTitle(float size) { - super.setTextSizeTitle(size); - return this; - } - - @Override - public ClassicsFooter setTextSizeTitle(int unit, float size) { - super.setTextSizeTitle(unit, size); - return this; - } - - @Override - public ClassicsFooter setDrawableMarginRight(float dp) { - super.setDrawableMarginRight(dp); - return this; - } - - @Override - public ClassicsFooter setDrawableMarginRightPx(int px) { - super.setDrawableMarginRightPx(px); - return this; - } - - @Override - public ClassicsFooter setDrawableSize(float dp) { - super.setDrawableSize(dp); - return this; - } - - @Override - public ClassicsFooter setDrawableSizePx(int px) { - super.setDrawableSizePx(px); - return this; - } - - @Override - public ClassicsFooter setDrawableArrowSize(float dp) { - super.setDrawableArrowSize(dp); - return this; - } - - @Override - public ClassicsFooter setDrawableArrowSizePx(int px) { - super.setDrawableArrowSizePx(px); - return this; - } - - @Override - public ClassicsFooter setDrawableProgressSize(float dp) { - super.setDrawableProgressSize(dp); - return this; - } - - @Override - public ClassicsFooter setDrawableProgressSizePx(int px) { - super.setDrawableProgressSizePx(px); - return this; - } -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/FalsifyFooter.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/FalsifyFooter.java deleted file mode 100644 index df2f3f65..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/footer/FalsifyFooter.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.scwang.smartrefresh.layout.footer; - -import android.content.Context; -import android.util.AttributeSet; - -/** - * 虚假的 Footer - * 用于 正真的 Footer 在 RefreshLayout 外部时, - * Created by scwang on 2017/6/14. - */ -@SuppressWarnings("unused") -public class FalsifyFooter extends com.scwang.smart.refresh.header.FalsifyFooter implements com.scwang.smart.refresh.layout.api.RefreshFooter { - - // - public FalsifyFooter(Context context) { - this(context, null); - } - - public FalsifyFooter(Context context, AttributeSet attrs) { - super(context, attrs); - } - // - -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/BezierRadarHeader.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/BezierRadarHeader.java deleted file mode 100644 index 6d6b9790..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/BezierRadarHeader.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.scwang.smart.refresh.layout.header; - -import android.content.Context; -import android.util.AttributeSet; - -/** - * 贝塞尔曲线类雷达风格刷新组件 - * Created by scwang on 2017/5/28. - */ -@SuppressWarnings({"UnusedReturnValue", "unused"}) -public class BezierRadarHeader extends com.scwang.smart.refresh.header.BezierRadarHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { - - // - public BezierRadarHeader(Context context) { - this(context,null); - } - - public BezierRadarHeader(Context context, AttributeSet attrs) { - super(context, attrs); - } - // - - @Override - public BezierRadarHeader setPrimaryColor(int color) { - super.setPrimaryColor(color); - return this; - } - - @Override - public BezierRadarHeader setAccentColor(int color) { - super.setAccentColor(color); - return this; - } - - @Override - public BezierRadarHeader setPrimaryColorId(int colorId) { - super.setPrimaryColorId(colorId); - return this; - } - - @Override - public BezierRadarHeader setAccentColorId(int colorId) { - super.setAccentColorId(colorId); - return this; - } - - @Override - public BezierRadarHeader setEnableHorizontalDrag(boolean enable) { - super.setEnableHorizontalDrag(enable); - return this; - } -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/ClassicsHeader.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/ClassicsHeader.java deleted file mode 100644 index 7e8a38e8..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/ClassicsHeader.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.scwang.smart.refresh.layout.header; - -import android.content.Context; -import android.graphics.Bitmap; -import android.graphics.drawable.Drawable; -import android.util.AttributeSet; - -import com.scwang.smart.refresh.layout.api.RefreshLayout; -import com.scwang.smart.refresh.layout.constant.SpinnerStyle; - -import java.text.DateFormat; -import java.util.Date; - -/** - * 经典下拉头部-兼容【1.x】版本-包名位置 - * Created by scwang on 2017/5/28. - */ -@SuppressWarnings({"unused", "UnusedReturnValue"}) -public class ClassicsHeader extends com.scwang.smart.refresh.header.ClassicsHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { - - public ClassicsHeader(Context context) { - super(context); - } - - public ClassicsHeader(Context context, AttributeSet attrs) { - super(context, attrs); - } - - @Override - public ClassicsHeader setLastUpdateTime(Date time) { - super.setLastUpdateTime(time); - return this; - } - - @Override - public ClassicsHeader setTimeFormat(DateFormat format) { - super.setTimeFormat(format); - return this; - } - - @Override - public ClassicsHeader setLastUpdateText(CharSequence text) { - super.setLastUpdateText(text); - return this; - } - - @Override - public ClassicsHeader setAccentColor(int accentColor) { - super.setAccentColor(accentColor); - return this; - } - - @Override - public ClassicsHeader setEnableLastTime(boolean enable) { - super.setEnableLastTime(enable); - return this; - } - - @Override - public ClassicsHeader setTextSizeTime(float size) { - super.setTextSizeTime(size); - return this; - } - - @Override - public ClassicsHeader setTextSizeTime(int unit, float size) { - super.setTextSizeTime(unit, size); - return this; - } - - @Override - public ClassicsHeader setTextTimeMarginTop(float dp) { - super.setTextTimeMarginTop(dp); - return this; - } - - @Override - public ClassicsHeader setTextTimeMarginTopPx(int px) { - super.setTextTimeMarginTopPx(px); - return this; - } - - /** - * @param colors 对应Xml中配置的 srlPrimaryColor srlAccentColor - * @deprecated 只由框架调用 - * 使用者使用 {@link RefreshLayout#setPrimaryColorsId(int...)} - */ - @Override - @Deprecated - public void setPrimaryColors(int... colors) { - super.setPrimaryColors(colors); - } - - @Override - public ClassicsHeader setProgressBitmap(Bitmap bitmap) { - super.setProgressBitmap(bitmap); - return this; - } - - @Override - public ClassicsHeader setProgressDrawable(Drawable drawable) { - super.setProgressDrawable(drawable); - return this; - } - - @Override - public ClassicsHeader setProgressResource(int resId) { - super.setProgressResource(resId); - return this; - } - - @Override - public ClassicsHeader setArrowBitmap(Bitmap bitmap) { - super.setArrowBitmap(bitmap); - return this; - } - - @Override - public ClassicsHeader setArrowDrawable(Drawable drawable) { - super.setArrowDrawable(drawable); - return this; - } - - @Override - public ClassicsHeader setArrowResource(int resId) { - super.setArrowResource(resId); - return this; - } - - @Override - public ClassicsHeader setSpinnerStyle(SpinnerStyle style) { - super.setSpinnerStyle(style); - return this; - } - - @Override - public ClassicsHeader setPrimaryColor(int primaryColor) { - super.setPrimaryColor(primaryColor); - return this; - } - - @Override - public ClassicsHeader setPrimaryColorId(int colorId) { - super.setPrimaryColorId(colorId); - return this; - } - - @Override - public ClassicsHeader setAccentColorId(int colorId) { - super.setAccentColorId(colorId); - return this; - } - - @Override - public ClassicsHeader setFinishDuration(int delay) { - super.setFinishDuration(delay); - return this; - } - - @Override - public ClassicsHeader setTextSizeTitle(float size) { - super.setTextSizeTitle(size); - return this; - } - - @Override - public ClassicsHeader setTextSizeTitle(int unit, float size) { - super.setTextSizeTitle(unit, size); - return this; - } - - @Override - public ClassicsHeader setDrawableMarginRight(float dp) { - super.setDrawableMarginRight(dp); - return this; - } - - @Override - public ClassicsHeader setDrawableMarginRightPx(int px) { - super.setDrawableMarginRightPx(px); - return this; - } - - @Override - public ClassicsHeader setDrawableSize(float dp) { - super.setDrawableSize(dp); - return this; - } - - @Override - public ClassicsHeader setDrawableSizePx(int px) { - super.setDrawableSizePx(px); - return this; - } - - @Override - public ClassicsHeader setDrawableArrowSize(float dp) { - super.setDrawableArrowSize(dp); - return this; - } - - @Override - public ClassicsHeader setDrawableArrowSizePx(int px) { - super.setDrawableArrowSizePx(px); - return this; - } - - @Override - public ClassicsHeader setDrawableProgressSize(float dp) { - super.setDrawableProgressSize(dp); - return this; - } - - @Override - public ClassicsHeader setDrawableProgressSizePx(int px) { - super.setDrawableProgressSizePx(px); - return this; - } -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/FalsifyHeader.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/FalsifyHeader.java deleted file mode 100644 index b233bf38..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/FalsifyHeader.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.scwang.smart.refresh.layout.header; - -import android.content.Context; -import android.util.AttributeSet; - -/** - * 虚假的 Header - * 用于 正真的 Header 在 RefreshLayout 外部时, - * 使用本虚假的 FalsifyHeader 填充在 RefreshLayout 内部 - * 具体使用方法 参考 纸飞机(FlyRefreshHeader) - * Created by scwang on 2017/6/14. - */ -public class FalsifyHeader extends com.scwang.smart.refresh.header.FalsifyHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { - - // - public FalsifyHeader(Context context) { - this(context, null); - } - - public FalsifyHeader(Context context, AttributeSet attrs) { - super(context, attrs); - } - // -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java deleted file mode 100644 index 706ae843..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/header/TwoLevelHeader.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.scwang.smart.refresh.layout.header; - -import android.content.Context; -import android.util.AttributeSet; - -import androidx.annotation.Nullable; - -import com.scwang.smart.refresh.header.listener.OnTwoLevelListener; -import com.scwang.smart.refresh.layout.api.RefreshLayout; - -/** - * 二级刷新 - * Created by scwang on 2017/5/26. - */ -@SuppressWarnings("UnusedReturnValue") -public class TwoLevelHeader extends com.scwang.smart.refresh.header.TwoLevelHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { - - - // - public TwoLevelHeader(Context context) { - this(context, null); - } - - public TwoLevelHeader(Context context, @Nullable AttributeSet attrs) { - super(context, attrs); - } - // - - public TwoLevelHeader setOnTwoLevelListener(final OnTwoLevelListener listener) { - super.setOnTwoLevelListener(listener); - return this; - } - - @Override - public TwoLevelHeader setRefreshHeader(com.scwang.smart.refresh.layout.api.RefreshHeader header) { - super.setRefreshHeader(header); - return this; - } - - @Override - public TwoLevelHeader setRefreshHeader(com.scwang.smart.refresh.layout.api.RefreshHeader header, int width, int height) { - super.setRefreshHeader(header, width, height); - return this; - } - - @Override - public TwoLevelHeader setMaxRate(float rate) { - super.setMaxRate(rate); - return this; - } - - @Override - public TwoLevelHeader setEnablePullToCloseTwoLevel(boolean enabled) { - super.setEnablePullToCloseTwoLevel(enabled); - return this; - } - - @Override - public TwoLevelHeader setFloorRate(float rate) { - super.setFloorRate(rate); - return this; - } - - @Override - public TwoLevelHeader setRefreshRate(float rate) { - super.setRefreshRate(rate); - return this; - } - - @Override - public TwoLevelHeader setEnableTwoLevel(boolean enabled) { - super.setEnableTwoLevel(enabled); - return this; - } - - @Override - public TwoLevelHeader setFloorDuration(int duration) { - super.setFloorDuration(duration); - return this; - } -} \ No newline at end of file diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/RefreshFooterWrapper.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/RefreshFooterWrapper.java deleted file mode 100644 index 03ae2564..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/RefreshFooterWrapper.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.scwang.smartrefresh.layout.impl; - -import android.annotation.SuppressLint; -import android.view.View; - -import com.scwang.smartrefresh.layout.internal.InternalAbstract; - -/** - * 刷新底部包装 - * Created by scwang on 2017/5/26. - */ -@SuppressLint("ViewConstructor") -public class RefreshFooterWrapper extends InternalAbstract implements com.scwang.smart.refresh.layout.api.RefreshFooter { - - public RefreshFooterWrapper(View wrapper) { - super(wrapper); - } - -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/RefreshHeaderWrapper.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/RefreshHeaderWrapper.java deleted file mode 100644 index 8c2c93fb..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/RefreshHeaderWrapper.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.scwang.smartrefresh.layout.impl; - -import android.annotation.SuppressLint; -import android.view.View; - -import com.scwang.smartrefresh.layout.internal.InternalAbstract; - -/** - * 刷新头部包装 - * Created by scwang on 2017/5/26. - */ -@SuppressLint("ViewConstructor") -public class RefreshHeaderWrapper extends InternalAbstract implements com.scwang.smart.refresh.layout.api.RefreshHeader { - - public RefreshHeaderWrapper(View wrapper) { - super(wrapper); - } - -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/ScrollBoundaryDeciderAdapter.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/ScrollBoundaryDeciderAdapter.java deleted file mode 100644 index a580920a..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/impl/ScrollBoundaryDeciderAdapter.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.scwang.smartrefresh.layout.impl; - -import com.scwang.smart.refresh.layout.simple.SimpleBoundaryDecider; - -/** - * 滚动边界 - * Created by scwang on 2017/7/8. - */ -public class ScrollBoundaryDeciderAdapter extends SimpleBoundaryDecider implements com.scwang.smart.refresh.layout.listener.ScrollBoundaryDecider { - -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/ArrowDrawable.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/ArrowDrawable.java deleted file mode 100644 index 4d8ba11e..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/ArrowDrawable.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.scwang.smartrefresh.layout.internal; - -/** - * 箭头图像 - * Created by scwang on 2018/2/5. - */ -@SuppressWarnings("unused") -public class ArrowDrawable extends com.scwang.smart.refresh.classics.ArrowDrawable { - -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/InternalAbstract.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/InternalAbstract.java deleted file mode 100644 index c974e3e2..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/InternalAbstract.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.scwang.smartrefresh.layout.internal; - -import android.content.Context; -import android.util.AttributeSet; -import android.view.View; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; - -import com.scwang.smart.refresh.layout.api.RefreshComponent; -import com.scwang.smart.refresh.layout.simple.SimpleComponent; - -/** - * Internal 初步实现 - * 实现 Header 和 Footer 时,继承 InternalAbstract 的话可以少写很多接口方法 - * Created by scwang on 2018/2/6. - * @noinspection unused - */ -public abstract class InternalAbstract extends SimpleComponent { - - - protected InternalAbstract(@NonNull View wrapped) { - super(wrapped); - } - - protected InternalAbstract(@NonNull View wrappedView, @Nullable RefreshComponent wrappedInternal) { - super(wrappedView, wrappedInternal); - } - - protected InternalAbstract(Context context, AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); - } - - -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/PaintDrawable.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/PaintDrawable.java deleted file mode 100644 index 53ad8bd3..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/PaintDrawable.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.scwang.smartrefresh.layout.internal; - -/** - * 画笔 Drawable - * Created by scwang on 2017/6/16. - */ -public abstract class PaintDrawable extends com.scwang.smart.drawable.PaintDrawable { - -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/ProgressDrawable.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/ProgressDrawable.java deleted file mode 100644 index 43c7e49b..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/internal/ProgressDrawable.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.scwang.smartrefresh.layout.internal; - -/** - * 旋转动画 - * Created by scwang on 2017/6/16. - */ -public class ProgressDrawable extends com.scwang.smart.drawable.ProgressDrawable { - -} diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/util/SmartUtil.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/util/SmartUtil.java deleted file mode 100644 index 571ef74e..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/util/SmartUtil.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.scwang.smartrefresh.layout.util; - -/** - * SmartUtil - * Created by scwang on 2018/3/5. - */ -public class SmartUtil extends com.scwang.smart.refresh.layout.util.SmartUtil { - - private SmartUtil(int type) { - super(type); - } - -} From 8f67645754fb52c8d008a7a0448bb597d04d5cb4 Mon Sep 17 00:00:00 2001 From: wsc Date: Thu, 31 Oct 2024 12:39:31 +0800 Subject: [PATCH 60/67] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E7=89=88=E6=9C=AC=20SmartRefreshLayout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/scwang/refreshlayout/App.java | 2 +- .../NestedScrollExampleFragmentViewPager.java | 2 +- .../widget/SmartRefreshHorizontal.java | 2 +- .../layout/activity_example_assign_code.xml | 4 +- .../activity_example_assign_default.xml | 4 +- .../layout/activity_example_assign_xml.xml | 4 +- .../res/layout/activity_example_basic.xml | 4 +- .../res/layout/activity_example_custom.xml | 4 +- .../main/res/layout/activity_example_i18n.xml | 4 +- .../res/layout/activity_example_listener.xml | 4 +- .../layout/activity_example_overscroll.xml | 4 +- .../res/layout/activity_example_region.xml | 4 +- .../layout/activity_example_snaphelper.xml | 4 +- .../main/res/layout/activity_experiment.xml | 4 +- .../main/res/layout/activity_fly_refresh.xml | 4 +- .../res/layout/activity_practice_banner.xml | 4 +- .../res/layout/activity_practice_feedlist.xml | 4 +- .../res/layout/activity_practice_profile.xml | 4 +- .../layout/activity_practice_qqbrowser.xml | 4 +- .../res/layout/activity_practice_repast.xml | 4 +- .../res/layout/activity_practice_webview.xml | 4 +- .../res/layout/activity_practice_weibo.xml | 4 +- .../main/res/layout/activity_style_bezier.xml | 4 +- .../main/res/layout/activity_style_circle.xml | 4 +- .../res/layout/activity_style_classics.xml | 4 +- .../res/layout/activity_style_delivery.xml | 4 +- .../res/layout/activity_style_dropbox.xml | 4 +- .../activity_style_fungame_battlecity.xml | 4 +- .../activity_style_fungame_hitblock.xml | 4 +- .../res/layout/activity_style_material.xml | 4 +- .../res/layout/activity_style_phoenix.xml | 4 +- .../res/layout/activity_style_storehouse.xml | 4 +- .../main/res/layout/activity_style_taurus.xml | 4 +- .../res/layout/activity_style_water_drop.xml | 4 +- .../res/layout/activity_style_wave_swipe.xml | 4 +- .../layout/common_independence_recycler.xml | 4 +- .../layout/fragment_example_bottom_sheet.xml | 4 +- .../fragment_example_disallow_intercept.xml | 4 +- .../layout/fragment_example_emptylayout.xml | 4 +- .../fragment_example_emptylayout_inner.xml | 4 +- .../fragment_example_emptylayout_outer.xml | 4 +- .../layout/fragment_example_nestedscroll.xml | 4 +- ...fragment_example_nestedscroll_integral.xml | 4 +- ...agment_example_nestedscroll_view_pager.xml | 4 +- .../layout/fragment_example_purescroll.xml | 4 +- .../fragment_example_purescroll_header.xml | 4 +- .../fragment_example_staggered_grid.xml | 4 +- .../res/layout/fragment_example_viewpager.xml | 4 +- .../fragment_flexbox_layout_manager.xml | 4 +- .../layout/fragment_no_more_data_example.xml | 4 +- .../res/layout/fragment_practice_instant.xml | 4 +- .../layout/fragment_practice_second_floor.xml | 4 +- .../res/layout/fragment_practice_twolevel.xml | 4 +- .../layout/SmartRefreshLayout.java | 235 ------------------ 54 files changed, 103 insertions(+), 338 deletions(-) delete mode 100644 refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java diff --git a/app/src/main/java/com/scwang/refreshlayout/App.java b/app/src/main/java/com/scwang/refreshlayout/App.java index 1aa1eff2..2910f120 100644 --- a/app/src/main/java/com/scwang/refreshlayout/App.java +++ b/app/src/main/java/com/scwang/refreshlayout/App.java @@ -13,7 +13,7 @@ import com.scwang.smart.refresh.layout.listener.DefaultRefreshFooterCreator; import com.scwang.smart.refresh.layout.listener.DefaultRefreshHeaderCreator; import com.scwang.smart.refresh.layout.listener.DefaultRefreshInitializer; -import com.scwang.smartrefresh.layout.SmartRefreshLayout; +import com.scwang.smart.refresh.layout.SmartRefreshLayout; import com.scwang.smart.refresh.footer.ClassicsFooter; import com.scwang.smart.refresh.header.ClassicsHeader; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java index 95986581..79cd0e9e 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java @@ -24,7 +24,7 @@ import com.scwang.refreshlayout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smartrefresh.header.PhoenixHeader; -import com.scwang.smartrefresh.layout.SmartRefreshLayout; +import com.scwang.smart.refresh.layout.SmartRefreshLayout; import java.util.Arrays; import java.util.Collection; diff --git a/app/src/main/java/com/scwang/refreshlayout/widget/SmartRefreshHorizontal.java b/app/src/main/java/com/scwang/refreshlayout/widget/SmartRefreshHorizontal.java index bba92ce0..68471291 100644 --- a/app/src/main/java/com/scwang/refreshlayout/widget/SmartRefreshHorizontal.java +++ b/app/src/main/java/com/scwang/refreshlayout/widget/SmartRefreshHorizontal.java @@ -9,7 +9,7 @@ import com.scwang.smart.refresh.layout.api.RefreshComponent; import com.scwang.smart.refresh.layout.listener.ScrollBoundaryDecider; import com.scwang.smart.refresh.layout.simple.SimpleBoundaryDecider; -import com.scwang.smartrefresh.layout.SmartRefreshLayout; +import com.scwang.smart.refresh.layout.SmartRefreshLayout; public class SmartRefreshHorizontal extends SmartRefreshLayout { diff --git a/app/src/main/res/layout/activity_example_assign_code.xml b/app/src/main/res/layout/activity_example_assign_code.xml index bd1fc4af..274a8e58 100644 --- a/app/src/main/res/layout/activity_example_assign_code.xml +++ b/app/src/main/res/layout/activity_example_assign_code.xml @@ -12,7 +12,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/title_activity_example_assign_code"/> - - + diff --git a/app/src/main/res/layout/activity_example_assign_default.xml b/app/src/main/res/layout/activity_example_assign_default.xml index c67ef260..a2c0b497 100644 --- a/app/src/main/res/layout/activity_example_assign_default.xml +++ b/app/src/main/res/layout/activity_example_assign_default.xml @@ -12,7 +12,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/title_activity_example_assign_default"/> - @@ -22,6 +22,6 @@ android:padding="@dimen/dimenPaddingCommon" android:background="@android:color/white" android:text="@string/description_set_default_creator"/> - + diff --git a/app/src/main/res/layout/activity_example_assign_xml.xml b/app/src/main/res/layout/activity_example_assign_xml.xml index bbe004e9..fdfc2108 100644 --- a/app/src/main/res/layout/activity_example_assign_xml.xml +++ b/app/src/main/res/layout/activity_example_assign_xml.xml @@ -12,7 +12,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/title_activity_example_assign_xml"/> - - + diff --git a/app/src/main/res/layout/activity_example_basic.xml b/app/src/main/res/layout/activity_example_basic.xml index 6a91c78c..fd400c3f 100644 --- a/app/src/main/res/layout/activity_example_basic.xml +++ b/app/src/main/res/layout/activity_example_basic.xml @@ -24,7 +24,7 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintBottom_toBottomOf="parent" android:background="@android:color/white"> - - + diff --git a/app/src/main/res/layout/activity_example_custom.xml b/app/src/main/res/layout/activity_example_custom.xml index 0c3f871c..652ce012 100644 --- a/app/src/main/res/layout/activity_example_custom.xml +++ b/app/src/main/res/layout/activity_example_custom.xml @@ -12,7 +12,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/title_activity_example_custom"/> - @@ -23,6 +23,6 @@ android:background="@android:color/white" android:overScrollMode="never" tools:listitem="@android:layout/simple_list_item_2"/> - + diff --git a/app/src/main/res/layout/activity_example_i18n.xml b/app/src/main/res/layout/activity_example_i18n.xml index e4683c62..d4aaa7f3 100644 --- a/app/src/main/res/layout/activity_example_i18n.xml +++ b/app/src/main/res/layout/activity_example_i18n.xml @@ -12,7 +12,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/title_activity_example_i18n"/> - @@ -23,6 +23,6 @@ android:background="@android:color/white" android:overScrollMode="never" tools:listitem="@android:layout/simple_list_item_2"/> - + diff --git a/app/src/main/res/layout/activity_example_listener.xml b/app/src/main/res/layout/activity_example_listener.xml index cada019b..bef72322 100644 --- a/app/src/main/res/layout/activity_example_listener.xml +++ b/app/src/main/res/layout/activity_example_listener.xml @@ -12,7 +12,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/title_activity_example_listener"/> - - + diff --git a/app/src/main/res/layout/activity_example_overscroll.xml b/app/src/main/res/layout/activity_example_overscroll.xml index 4340a172..5b2a88e2 100644 --- a/app/src/main/res/layout/activity_example_overscroll.xml +++ b/app/src/main/res/layout/activity_example_overscroll.xml @@ -12,7 +12,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/title_activity_example_over_scroll"/> - @@ -38,6 +38,6 @@ android:id="@+id/webView" android:layout_width="match_parent" android:layout_height="match_parent"/> - + diff --git a/app/src/main/res/layout/activity_example_region.xml b/app/src/main/res/layout/activity_example_region.xml index edcfdffe..8104b66e 100644 --- a/app/src/main/res/layout/activity_example_region.xml +++ b/app/src/main/res/layout/activity_example_region.xml @@ -12,7 +12,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="选择地区" /> - - + diff --git a/app/src/main/res/layout/activity_example_snaphelper.xml b/app/src/main/res/layout/activity_example_snaphelper.xml index bd809f37..b79d18a3 100644 --- a/app/src/main/res/layout/activity_example_snaphelper.xml +++ b/app/src/main/res/layout/activity_example_snaphelper.xml @@ -23,7 +23,7 @@ android:text="@string/switch_scroll_content_when_loaded" android:checked="true"/> - @@ -36,6 +36,6 @@ - + diff --git a/app/src/main/res/layout/activity_experiment.xml b/app/src/main/res/layout/activity_experiment.xml index 7beefebb..ba4e7525 100644 --- a/app/src/main/res/layout/activity_experiment.xml +++ b/app/src/main/res/layout/activity_experiment.xml @@ -3,7 +3,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - @@ -45,6 +45,6 @@ - + diff --git a/app/src/main/res/layout/activity_fly_refresh.xml b/app/src/main/res/layout/activity_fly_refresh.xml index 6fd6d747..ad254388 100644 --- a/app/src/main/res/layout/activity_fly_refresh.xml +++ b/app/src/main/res/layout/activity_fly_refresh.xml @@ -45,7 +45,7 @@ - - + - - + - - + diff --git a/app/src/main/res/layout/activity_practice_profile.xml b/app/src/main/res/layout/activity_practice_profile.xml index 52051b3b..af636443 100644 --- a/app/src/main/res/layout/activity_practice_profile.xml +++ b/app/src/main/res/layout/activity_practice_profile.xml @@ -8,7 +8,7 @@ android:background="@color/colorPrimary" tools:context="com.scwang.refreshlayout.activity.practice.ProfilePracticeActivity"> - - + - - + diff --git a/app/src/main/res/layout/activity_practice_repast.xml b/app/src/main/res/layout/activity_practice_repast.xml index 4498792f..6aa4d321 100644 --- a/app/src/main/res/layout/activity_practice_repast.xml +++ b/app/src/main/res/layout/activity_practice_repast.xml @@ -7,7 +7,7 @@ android:background="@color/colorBackgroundDark" tools:context="com.scwang.refreshlayout.activity.practice.RepastPracticeActivity"> - - + - - + - - + - - + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_style_circle.xml b/app/src/main/res/layout/activity_style_circle.xml index 9707d5eb..d86842b6 100644 --- a/app/src/main/res/layout/activity_style_circle.xml +++ b/app/src/main/res/layout/activity_style_circle.xml @@ -12,7 +12,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/title_activity_style_circle"/> - - + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_style_classics.xml b/app/src/main/res/layout/activity_style_classics.xml index 4b11634a..f2fa1429 100644 --- a/app/src/main/res/layout/activity_style_classics.xml +++ b/app/src/main/res/layout/activity_style_classics.xml @@ -13,7 +13,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/title_activity_style_classics"/> - - + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_style_delivery.xml b/app/src/main/res/layout/activity_style_delivery.xml index 61b2024f..9ad5a989 100644 --- a/app/src/main/res/layout/activity_style_delivery.xml +++ b/app/src/main/res/layout/activity_style_delivery.xml @@ -15,7 +15,7 @@ app:navigationIcon="@drawable/ic_arrow_back_gray_24dp" app:title="@string/title_activity_style_delivery"/> - - + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_style_dropbox.xml b/app/src/main/res/layout/activity_style_dropbox.xml index c8306d10..73d25fc9 100644 --- a/app/src/main/res/layout/activity_style_dropbox.xml +++ b/app/src/main/res/layout/activity_style_dropbox.xml @@ -12,7 +12,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/title_activity_style_drop_box"/> - - + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_style_fungame_battlecity.xml b/app/src/main/res/layout/activity_style_fungame_battlecity.xml index 65c0d96b..a17234da 100644 --- a/app/src/main/res/layout/activity_style_fungame_battlecity.xml +++ b/app/src/main/res/layout/activity_style_fungame_battlecity.xml @@ -12,7 +12,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/title_activity_style_battle_city"/> - - + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_style_fungame_hitblock.xml b/app/src/main/res/layout/activity_style_fungame_hitblock.xml index 303e5933..1da8e4a4 100644 --- a/app/src/main/res/layout/activity_style_fungame_hitblock.xml +++ b/app/src/main/res/layout/activity_style_fungame_hitblock.xml @@ -12,7 +12,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/title_activity_style_hit_block"/> - - + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_style_material.xml b/app/src/main/res/layout/activity_style_material.xml index 2371e649..b749970d 100644 --- a/app/src/main/res/layout/activity_style_material.xml +++ b/app/src/main/res/layout/activity_style_material.xml @@ -12,7 +12,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/title_activity_style_material"/> - - + diff --git a/app/src/main/res/layout/activity_style_phoenix.xml b/app/src/main/res/layout/activity_style_phoenix.xml index e4d7048f..9dc89d67 100644 --- a/app/src/main/res/layout/activity_style_phoenix.xml +++ b/app/src/main/res/layout/activity_style_phoenix.xml @@ -32,7 +32,7 @@ - - + - - + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_style_taurus.xml b/app/src/main/res/layout/activity_style_taurus.xml index 1a06b178..7f7b706d 100644 --- a/app/src/main/res/layout/activity_style_taurus.xml +++ b/app/src/main/res/layout/activity_style_taurus.xml @@ -32,7 +32,7 @@ - - + - - + diff --git a/app/src/main/res/layout/activity_style_wave_swipe.xml b/app/src/main/res/layout/activity_style_wave_swipe.xml index 1db51c09..db9ebfef 100644 --- a/app/src/main/res/layout/activity_style_wave_swipe.xml +++ b/app/src/main/res/layout/activity_style_wave_swipe.xml @@ -12,7 +12,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/title_activity_style_wave_swipe"/> - - + diff --git a/app/src/main/res/layout/common_independence_recycler.xml b/app/src/main/res/layout/common_independence_recycler.xml index dd3a6b54..1f7f2e8b 100644 --- a/app/src/main/res/layout/common_independence_recycler.xml +++ b/app/src/main/res/layout/common_independence_recycler.xml @@ -11,7 +11,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/app_name"/> - - + diff --git a/app/src/main/res/layout/fragment_example_bottom_sheet.xml b/app/src/main/res/layout/fragment_example_bottom_sheet.xml index 8e984f1e..9806c8e8 100644 --- a/app/src/main/res/layout/fragment_example_bottom_sheet.xml +++ b/app/src/main/res/layout/fragment_example_bottom_sheet.xml @@ -11,7 +11,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/fragment_example_bottom_sheet"/> - @@ -21,6 +21,6 @@ android:layout_height="match_parent" android:overScrollMode="never" tools:listitem="@android:layout/simple_list_item_2"/> - + diff --git a/app/src/main/res/layout/fragment_example_disallow_intercept.xml b/app/src/main/res/layout/fragment_example_disallow_intercept.xml index bdf62840..c5d04991 100644 --- a/app/src/main/res/layout/fragment_example_disallow_intercept.xml +++ b/app/src/main/res/layout/fragment_example_disallow_intercept.xml @@ -16,7 +16,7 @@ android:text="需求是内容控件长按后显示当前手指移动的坐标,比如股票分时k线图" android:layout_height="wrap_content" /> - @@ -26,6 +26,6 @@ android:layout_height="match_parent" android:nestedScrollingEnabled="true"/> - + diff --git a/app/src/main/res/layout/fragment_example_emptylayout.xml b/app/src/main/res/layout/fragment_example_emptylayout.xml index 350c0231..276d4713 100644 --- a/app/src/main/res/layout/fragment_example_emptylayout.xml +++ b/app/src/main/res/layout/fragment_example_emptylayout.xml @@ -11,7 +11,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/fragment_example_empty_layout"/> - @@ -27,6 +27,6 @@ android:overScrollMode="never" tools:listitem="@android:layout/simple_list_item_2"/> - + diff --git a/app/src/main/res/layout/fragment_example_emptylayout_inner.xml b/app/src/main/res/layout/fragment_example_emptylayout_inner.xml index 45dd00ac..a2668e48 100644 --- a/app/src/main/res/layout/fragment_example_emptylayout_inner.xml +++ b/app/src/main/res/layout/fragment_example_emptylayout_inner.xml @@ -11,7 +11,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/fragment_example_empty_layout_inner"/> - @@ -28,6 +28,6 @@ - + diff --git a/app/src/main/res/layout/fragment_example_emptylayout_outer.xml b/app/src/main/res/layout/fragment_example_emptylayout_outer.xml index 2eb55af8..7b25684a 100644 --- a/app/src/main/res/layout/fragment_example_emptylayout_outer.xml +++ b/app/src/main/res/layout/fragment_example_emptylayout_outer.xml @@ -14,7 +14,7 @@ - @@ -25,7 +25,7 @@ android:background="@android:color/white" android:overScrollMode="never" tools:listitem="@android:layout/simple_list_item_2"/> - + diff --git a/app/src/main/res/layout/fragment_example_nestedscroll.xml b/app/src/main/res/layout/fragment_example_nestedscroll.xml index c6d00d35..aeeea855 100644 --- a/app/src/main/res/layout/fragment_example_nestedscroll.xml +++ b/app/src/main/res/layout/fragment_example_nestedscroll.xml @@ -32,7 +32,7 @@ - - + - - + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_example_nestedscroll_view_pager.xml b/app/src/main/res/layout/fragment_example_nestedscroll_view_pager.xml index b77325ee..92bacbea 100644 --- a/app/src/main/res/layout/fragment_example_nestedscroll_view_pager.xml +++ b/app/src/main/res/layout/fragment_example_nestedscroll_view_pager.xml @@ -38,7 +38,7 @@ android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior"/> - + @@ -55,7 +55,7 @@ - + - - + diff --git a/app/src/main/res/layout/fragment_example_purescroll_header.xml b/app/src/main/res/layout/fragment_example_purescroll_header.xml index 209e5cb0..fdf25c8e 100644 --- a/app/src/main/res/layout/fragment_example_purescroll_header.xml +++ b/app/src/main/res/layout/fragment_example_purescroll_header.xml @@ -11,7 +11,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/fragment_example_pure_scroll_header"/> - - + diff --git a/app/src/main/res/layout/fragment_example_staggered_grid.xml b/app/src/main/res/layout/fragment_example_staggered_grid.xml index 05270bbb..81cf5fdf 100644 --- a/app/src/main/res/layout/fragment_example_staggered_grid.xml +++ b/app/src/main/res/layout/fragment_example_staggered_grid.xml @@ -11,7 +11,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/fragment_example_staggered_grid"/> - - + diff --git a/app/src/main/res/layout/fragment_example_viewpager.xml b/app/src/main/res/layout/fragment_example_viewpager.xml index 60db7531..68d0b7c7 100644 --- a/app/src/main/res/layout/fragment_example_viewpager.xml +++ b/app/src/main/res/layout/fragment_example_viewpager.xml @@ -11,7 +11,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/fragment_example_viewpager"/> - - + diff --git a/app/src/main/res/layout/fragment_flexbox_layout_manager.xml b/app/src/main/res/layout/fragment_flexbox_layout_manager.xml index f0a385ac..fc3dcf96 100644 --- a/app/src/main/res/layout/fragment_flexbox_layout_manager.xml +++ b/app/src/main/res/layout/fragment_flexbox_layout_manager.xml @@ -11,7 +11,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/fragment_example_flex_box_layout"/> - - + diff --git a/app/src/main/res/layout/fragment_no_more_data_example.xml b/app/src/main/res/layout/fragment_no_more_data_example.xml index 95bfe58e..3aa7c2dc 100644 --- a/app/src/main/res/layout/fragment_no_more_data_example.xml +++ b/app/src/main/res/layout/fragment_no_more_data_example.xml @@ -12,7 +12,7 @@ app:navigationIcon="?attr/homeAsUpIndicator" app:title="@string/fragment_example_no_more_data" /> - - + diff --git a/app/src/main/res/layout/fragment_practice_instant.xml b/app/src/main/res/layout/fragment_practice_instant.xml index 7df7b0f9..5f61e4a3 100644 --- a/app/src/main/res/layout/fragment_practice_instant.xml +++ b/app/src/main/res/layout/fragment_practice_instant.xml @@ -14,7 +14,7 @@ app:title="@string/fragment_practice_instant"> - - + diff --git a/app/src/main/res/layout/fragment_practice_second_floor.xml b/app/src/main/res/layout/fragment_practice_second_floor.xml index 2bbca9db..d6ee1572 100644 --- a/app/src/main/res/layout/fragment_practice_second_floor.xml +++ b/app/src/main/res/layout/fragment_practice_second_floor.xml @@ -6,7 +6,7 @@ android:orientation="vertical" tools:context="com.scwang.refreshlayout.fragment.practice.SecondFloorPracticeFragment"> - - + - @@ -33,6 +33,6 @@ android:layout_height="match_parent" android:overScrollMode="never" tools:listitem="@layout/item_movie_item"/> - + diff --git a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java b/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java deleted file mode 100644 index ef08e852..00000000 --- a/refresh-layout/src/main/java/com/scwang/smartrefresh/layout/SmartRefreshLayout.java +++ /dev/null @@ -1,235 +0,0 @@ -package com.scwang.smartrefresh.layout; - -import android.annotation.SuppressLint; -import android.content.Context; -import android.util.AttributeSet; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; - -import com.scwang.smart.refresh.layout.api.RefreshFooter; -import com.scwang.smart.refresh.layout.api.RefreshHeader; -import com.scwang.smart.refresh.layout.api.RefreshLayout; -import com.scwang.smart.refresh.layout.listener.DefaultRefreshFooterCreator; -import com.scwang.smart.refresh.layout.listener.DefaultRefreshHeaderCreator; -import com.scwang.smart.refresh.layout.listener.DefaultRefreshInitializer; -import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener; -import com.scwang.smart.refresh.layout.listener.OnMultiListener; -import com.scwang.smart.refresh.layout.listener.OnRefreshListener; -import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; -import com.scwang.smart.refresh.layout.listener.ScrollBoundaryDecider; -import com.scwang.smart.refresh.layout.simple.SimpleBoundaryDecider; -import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; - -import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; -import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; - -/** - * 智能刷新布局 - * Intelligent RefreshLayout - * Created by scwang on 2017/5/26. - */ -@SuppressLint("RestrictedApi") -@SuppressWarnings({"unused"}) -public class SmartRefreshLayout extends com.scwang.smart.refresh.layout.SmartRefreshLayout implements RefreshLayout { - - // - public SmartRefreshLayout(Context context) { - this(context, null); - } - - public SmartRefreshLayout(Context context, AttributeSet attrs) { - super(context, attrs); - } - // - - // - - /** - * Set the header of RefreshLayout. - * 设置指定的 Header - * @param header RefreshHeader 刷新头 - * @return RefreshLayout - */ - @Override - public RefreshLayout setRefreshHeader(@NonNull RefreshHeader header) { - return setRefreshHeader(header, MATCH_PARENT, WRAP_CONTENT); - } - - /** - * Set the header of RefreshLayout. - * 设置指定的 Header - * @param header RefreshHeader 刷新头 - * @param width the width in px, can use MATCH_PARENT and WRAP_CONTENT. - * 宽度 可以使用 MATCH_PARENT, WRAP_CONTENT - * @param height the height in px, can use MATCH_PARENT and WRAP_CONTENT. - * 高度 可以使用 MATCH_PARENT, WRAP_CONTENT - * @return RefreshLayout - */ - @Override - public RefreshLayout setRefreshHeader(@NonNull RefreshHeader header, int width, int height) { - super.setRefreshHeader(header, width, height); - return this; - } - - /** - * Set the footer of RefreshLayout. - * 设置指定的 Footer - * @param footer RefreshFooter 刷新尾巴 - * @return RefreshLayout - */ - @Override - public RefreshLayout setRefreshFooter(@NonNull RefreshFooter footer) { - return setRefreshFooter(footer, MATCH_PARENT, WRAP_CONTENT); - } - - /** - * Set the footer of RefreshLayout. - * 设置指定的 Footer - * @param footer RefreshFooter 刷新尾巴 - * @param width the width in px, can use MATCH_PARENT and WRAP_CONTENT. - * 宽度 可以使用 MATCH_PARENT, WRAP_CONTENT - * @param height the height in px, can use MATCH_PARENT and WRAP_CONTENT. - * 高度 可以使用 MATCH_PARENT, WRAP_CONTENT - * @return RefreshLayout - */ - @Override - public RefreshLayout setRefreshFooter(@NonNull RefreshFooter footer, int width, int height) { - super.setRefreshFooter(footer, width, height); - return this; - } - - /** - * Get footer of RefreshLayout - * 获取当前 Footer - * @return RefreshLayout - */ - @Nullable - @Override - public RefreshFooter getRefreshFooter() { - return mRefreshFooter instanceof RefreshFooter ? (RefreshFooter) mRefreshFooter : null; - } - - /** - * Get header of RefreshLayout - * 获取当前 Header - * @return RefreshLayout - */ - @Nullable - @Override - public RefreshHeader getRefreshHeader() { - return mRefreshHeader instanceof RefreshHeader ? (RefreshHeader) mRefreshHeader : null; - } - -// /** -// * Get the current state of RefreshLayout -// * 获取当前状态 -// * @return RefreshLayout -// */ -// @NonNull -// @Override -// public RefreshState getState() { -// return mState; -// } - - - /** - * Set refresh listener separately. - * 单独设置刷新监听器 - * @param listener OnRefreshListener 刷新监听器 - * @return RefreshLayout - */ - @Override - public RefreshLayout setOnRefreshListener(final OnRefreshListener listener) { - super.setOnRefreshListener(refreshLayout -> listener.onRefresh(SmartRefreshLayout.this)); - return this; - } - - /** - * Set load more listener separately. - * 单独设置加载监听器 - * @param listener OnLoadMoreListener 加载监听器 - * @return RefreshLayout - */ - @Override - public RefreshLayout setOnLoadMoreListener(final OnLoadMoreListener listener) { - super.setOnLoadMoreListener(refreshLayout -> listener.onLoadMore(SmartRefreshLayout.this)); - return this; - } - - /** - * Set refresh and load listeners at the same time. - * 同时设置刷新和加载监听器 - * @param listener OnRefreshLoadMoreListener 刷新加载监听器 - * @return RefreshLayout - */ - @Override - public RefreshLayout setOnRefreshLoadMoreListener(final OnRefreshLoadMoreListener listener) { - super.setOnRefreshLoadMoreListener(new com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener() { - @Override - public void onLoadMore(@NonNull com.scwang.smart.refresh.layout.api.RefreshLayout refreshLayout) { - listener.onLoadMore(SmartRefreshLayout.this); - } - - @Override - public void onRefresh(@NonNull com.scwang.smart.refresh.layout.api.RefreshLayout refreshLayout) { - listener.onRefresh(SmartRefreshLayout.this); - } - }); - return this; - } - - /** - * Set up a multi-function listener. - * Recommended {@link OnMultiListener} - * 设置多功能监听器 - * 建议使用 {@link SimpleMultiListener} - * @param listener OnMultiPurposeListener 多功能监听器 - * @return RefreshLayout - */ - @Override - public RefreshLayout setOnMultiListener(OnMultiListener listener) { - super.setOnMultiListener(listener); - return this; - } - - /** - * Set the scroll boundary Decider, Can customize when you can refresh. - * Recommended {@link SimpleBoundaryDecider} - * 设置滚动边界判断器 - * 建议使用 {@link SimpleBoundaryDecider} - * @param boundary ScrollBoundaryDecider 判断器 - * @return RefreshLayout - */ - @Override - public RefreshLayout setScrollBoundaryDecider(final ScrollBoundaryDecider boundary) { - super.setScrollBoundaryDecider(boundary); - return this; - } - - /** - * 设置默认 Header 构建器 - * @param creator Header构建器 - */ - public static void setDefaultRefreshHeaderCreator(@NonNull final DefaultRefreshHeaderCreator creator) { - com.scwang.smart.refresh.layout.SmartRefreshLayout.setDefaultRefreshHeaderCreator(creator); - } - - /** - * 设置默认 Footer 构建器 - * @param creator Footer构建器 - */ - public static void setDefaultRefreshFooterCreator(@NonNull final DefaultRefreshFooterCreator creator) { - com.scwang.smart.refresh.layout.SmartRefreshLayout.setDefaultRefreshFooterCreator(creator); - } - - /** - * 设置默认 Refresh 初始化器 - * @param initializer 全局初始化器 - */ - public static void setDefaultRefreshInitializer(@NonNull final DefaultRefreshInitializer initializer) { - com.scwang.smart.refresh.layout.SmartRefreshLayout.setDefaultRefreshInitializer(initializer); - } - // - -} From ae35653496eede1e46391f16f05d4c788d2a0c4c Mon Sep 17 00:00:00 2001 From: wsc Date: Mon, 4 Nov 2024 17:35:59 +0800 Subject: [PATCH 61/67] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E7=89=88=E6=9C=AC=20=E8=87=AA=E5=AE=9A=E4=B9=89Header?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/FlyRefreshStyleActivity.java | 3 +-- .../activity/style/MaterialStyleActivity.java | 2 +- .../style/StoreHouseStyleActivity.java | 2 +- .../NestedScrollExampleFragmentViewPager.java | 2 +- .../main/res/layout/activity_fly_refresh.xml | 2 +- .../res/layout/activity_practice_banner.xml | 2 +- .../res/layout/activity_practice_webview.xml | 2 +- .../main/res/layout/activity_style_circle.xml | 2 +- .../res/layout/activity_style_delivery.xml | 2 +- .../res/layout/activity_style_dropbox.xml | 2 +- .../activity_style_fungame_battlecity.xml | 2 +- .../activity_style_fungame_hitblock.xml | 2 +- .../res/layout/activity_style_material.xml | 2 +- .../res/layout/activity_style_phoenix.xml | 2 +- .../res/layout/activity_style_storehouse.xml | 2 +- .../main/res/layout/activity_style_taurus.xml | 2 +- .../res/layout/activity_style_water_drop.xml | 2 +- .../res/layout/activity_style_wave_swipe.xml | 2 +- .../layout/fragment_example_horizontal.xml | 2 +- .../layout/fragment_example_nestedscroll.xml | 2 +- ...agment_example_nestedscroll_view_pager.xml | 2 +- app/src/main/res/values-zh/strings.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- .../header/ExampleInstrumentedTest.java | 4 +-- .../header/BezierCircleHeader.java | 22 ---------------- .../smartrefresh/header/DeliveryHeader.java | 24 ------------------ .../smartrefresh/header/DropBoxHeader.java | 24 ------------------ .../smartrefresh/header/FlyRefreshHeader.java | 22 ---------------- .../header/FunGameBattleCityHeader.java | 25 ------------------- .../header/FunGameHitBlockHeader.java | 22 ---------------- .../smartrefresh/header/MaterialHeader.java | 21 ---------------- .../smartrefresh/header/PhoenixHeader.java | 25 ------------------- .../smartrefresh/header/StoreHouseHeader.java | 22 ---------------- .../smartrefresh/header/TaurusHeader.java | 22 ---------------- .../smartrefresh/header/WaterDropHeader.java | 22 ---------------- .../smartrefresh/header/WaveSwipeHeader.java | 22 ---------------- .../smartrefresh/header/ExampleUnitTest.java | 2 +- 37 files changed, 26 insertions(+), 300 deletions(-) delete mode 100644 refresh-header/src/main/java/com/scwang/smartrefresh/header/BezierCircleHeader.java delete mode 100644 refresh-header/src/main/java/com/scwang/smartrefresh/header/DeliveryHeader.java delete mode 100644 refresh-header/src/main/java/com/scwang/smartrefresh/header/DropBoxHeader.java delete mode 100644 refresh-header/src/main/java/com/scwang/smartrefresh/header/FlyRefreshHeader.java delete mode 100644 refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameBattleCityHeader.java delete mode 100644 refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameHitBlockHeader.java delete mode 100644 refresh-header/src/main/java/com/scwang/smartrefresh/header/MaterialHeader.java delete mode 100644 refresh-header/src/main/java/com/scwang/smartrefresh/header/PhoenixHeader.java delete mode 100644 refresh-header/src/main/java/com/scwang/smartrefresh/header/StoreHouseHeader.java delete mode 100644 refresh-header/src/main/java/com/scwang/smartrefresh/header/TaurusHeader.java delete mode 100644 refresh-header/src/main/java/com/scwang/smartrefresh/header/WaterDropHeader.java delete mode 100644 refresh-header/src/main/java/com/scwang/smartrefresh/header/WaveSwipeHeader.java diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java index 89a51c37..4ef7878b 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java @@ -35,8 +35,7 @@ import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.listener.OnRefreshListener; import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; -import com.scwang.smartrefresh.header.FlyRefreshHeader; -import com.scwang.smart.refresh.layout.listener.OnMultiListener; +import com.scwang.smart.refresh.header.FlyRefreshHeader; import com.scwang.smart.refresh.layout.util.SmartUtil; import java.text.DateFormat; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java index 7fb63294..609b3004 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java @@ -17,7 +17,7 @@ import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.header.MaterialHeader; +import com.scwang.smart.refresh.header.MaterialHeader; import java.util.ArrayList; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java b/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java index 9514accd..d8cdabf6 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java +++ b/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java @@ -19,7 +19,7 @@ import com.scwang.refreshlayout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.header.StoreHouseHeader; +import com.scwang.smart.refresh.header.StoreHouseHeader; import java.util.ArrayList; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java index 79cd0e9e..959253fa 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java +++ b/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java @@ -23,7 +23,7 @@ import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; import com.scwang.refreshlayout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; -import com.scwang.smartrefresh.header.PhoenixHeader; +import com.scwang.smart.refresh.header.PhoenixHeader; import com.scwang.smart.refresh.layout.SmartRefreshLayout; import java.util.Arrays; diff --git a/app/src/main/res/layout/activity_fly_refresh.xml b/app/src/main/res/layout/activity_fly_refresh.xml index ad254388..e7dfe0bf 100644 --- a/app/src/main/res/layout/activity_fly_refresh.xml +++ b/app/src/main/res/layout/activity_fly_refresh.xml @@ -56,7 +56,7 @@ app:srlEnablePreviewInEditMode="true" app:srlEnableOverScrollBounce="false" app:layout_behavior="@string/appbar_scrolling_view_behavior"> - diff --git a/app/src/main/res/layout/activity_practice_banner.xml b/app/src/main/res/layout/activity_practice_banner.xml index 2352edb7..0f0e7a4a 100644 --- a/app/src/main/res/layout/activity_practice_banner.xml +++ b/app/src/main/res/layout/activity_practice_banner.xml @@ -17,7 +17,7 @@ app:srlEnableHeaderTranslationContent="false" app:srlEnablePreviewInEditMode="false" app:srlEnableNestedScrolling="true"> - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/fragment_example_nestedscroll.xml b/app/src/main/res/layout/fragment_example_nestedscroll.xml index aeeea855..b0be77d3 100644 --- a/app/src/main/res/layout/fragment_example_nestedscroll.xml +++ b/app/src/main/res/layout/fragment_example_nestedscroll.xml @@ -39,7 +39,7 @@ app:layout_behavior="@string/appbar_scrolling_view_behavior" app:srlPrimaryColor="@color/colorPrimary" app:srlEnableLoadMore="true"> - - + diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 20732f6c..30671ae8 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -158,7 +158,7 @@ \n - \t\n \t\n - \t\n \t... - */ -public class BezierCircleHeader extends com.scwang.smart.refresh.header.BezierCircleHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { - - // - public BezierCircleHeader(Context context) { - this(context, null); - } - - public BezierCircleHeader(Context context, AttributeSet attrs) { - super(context, attrs); - } - // -} \ No newline at end of file diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/DeliveryHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/DeliveryHeader.java deleted file mode 100644 index 80d53761..00000000 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/DeliveryHeader.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.scwang.smartrefresh.header; - -import android.content.Context; -import android.util.AttributeSet; - -import androidx.annotation.Nullable; - -/** - * Refresh your delivery! - * Created by scwang on 2017/6/25. - * design ... - */ -public class DeliveryHeader extends com.scwang.smart.refresh.header.DeliveryHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { - - // - public DeliveryHeader(Context context) { - this(context, null); - } - - public DeliveryHeader(Context context, @Nullable AttributeSet attrs) { - super(context, attrs); - } - // -} diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/DropBoxHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/DropBoxHeader.java deleted file mode 100644 index 34505e6e..00000000 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/DropBoxHeader.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.scwang.smartrefresh.header; - -import android.content.Context; -import android.util.AttributeSet; - -import androidx.annotation.Nullable; - -/** - * DropBoxRefresh - * Created by scwang on 2017/6/24. - * design ... - */ -public class DropBoxHeader extends com.scwang.smart.refresh.header.DropBoxHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { - - // - public DropBoxHeader(Context context) { - this(context, null); - } - - public DropBoxHeader(Context context, @Nullable AttributeSet attrs) { - super(context, attrs); - } - // -} diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/FlyRefreshHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/FlyRefreshHeader.java deleted file mode 100644 index 9e584444..00000000 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/FlyRefreshHeader.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.scwang.smartrefresh.header; - -import android.content.Context; -import android.util.AttributeSet; - -/** - * 纸飞机和山丘 - * Created by scwang on 2017/6/6. - * from ... - */ -public class FlyRefreshHeader extends com.scwang.smart.refresh.header.FlyRefreshHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { - - // - public FlyRefreshHeader(Context context) { - super(context); - } - - public FlyRefreshHeader(Context context, AttributeSet attrs) { - super(context, attrs); - } - // -} diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameBattleCityHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameBattleCityHeader.java deleted file mode 100644 index 83853023..00000000 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameBattleCityHeader.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.scwang.smartrefresh.header; - -import android.content.Context; -import android.util.AttributeSet; - -import java.util.Random; - -/** - * Created by scwang on 2018/3/09. - * from ... - */ -public class FunGameBattleCityHeader extends com.scwang.smart.refresh.header.FunGameBattleCityHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { - - // - public FunGameBattleCityHeader(Context context) { - this(context, null); - } - - public FunGameBattleCityHeader(Context context, AttributeSet attrs) { - super(context, attrs); - random = new Random(); - } - // - -} diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameHitBlockHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameHitBlockHeader.java deleted file mode 100644 index 07d77a62..00000000 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/FunGameHitBlockHeader.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.scwang.smartrefresh.header; - -import android.content.Context; -import android.util.AttributeSet; - -/** - * Created by scwang on 2018/2/29. - * from ... - */ -public class FunGameHitBlockHeader extends com.scwang.smart.refresh.header.FunGameHitBlockHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { - - // - public FunGameHitBlockHeader(Context context) { - this(context, null); - } - - public FunGameHitBlockHeader(Context context, AttributeSet attrs) { - super(context, attrs); - } - // - -} diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/MaterialHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/MaterialHeader.java deleted file mode 100644 index 636a5aaa..00000000 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/MaterialHeader.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.scwang.smartrefresh.header; - -import android.content.Context; -import android.util.AttributeSet; - -/** - * Material 主题下拉头 - * Created by scwang on 2017/6/2. - */ -public class MaterialHeader extends com.scwang.smart.refresh.header.MaterialHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { - - // - public MaterialHeader(Context context) { - this(context, null); - } - - public MaterialHeader(Context context, AttributeSet attrs) { - super(context, attrs); - } - // -} diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/PhoenixHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/PhoenixHeader.java deleted file mode 100644 index d0da6af7..00000000 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/PhoenixHeader.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.scwang.smartrefresh.header; - -import android.content.Context; -import android.util.AttributeSet; - -/** - * Phoenix - * Created by scwang on 2017/5/31. - * from ... - */ -public class PhoenixHeader extends com.scwang.smart.refresh.header.PhoenixHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { - - // - public PhoenixHeader(Context context) { - this(context, null); - } - - public PhoenixHeader(Context context, AttributeSet attrs) { - super(context, attrs); - } - // - -} - - diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/StoreHouseHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/StoreHouseHeader.java deleted file mode 100644 index 1aca82ec..00000000 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/StoreHouseHeader.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.scwang.smartrefresh.header; - -import android.content.Context; -import android.util.AttributeSet; - -/** - * StoreHouseHeader - * Created by scwang on 2017/5/31. - * from ... - */ -public class StoreHouseHeader extends com.scwang.smart.refresh.header.StoreHouseHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { - - // - public StoreHouseHeader(Context context) { - this(context, null); - } - - public StoreHouseHeader(Context context, AttributeSet attrs) { - super(context, attrs); - } - // -} \ No newline at end of file diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/TaurusHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/TaurusHeader.java deleted file mode 100644 index 8ae8eabe..00000000 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/TaurusHeader.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.scwang.smartrefresh.header; - -import android.content.Context; -import android.util.AttributeSet; - -/** - * Taurus - * Created by scwang on 2017/5/31. - * from ... - */ -public class TaurusHeader extends com.scwang.smart.refresh.header.TaurusHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { - - // - public TaurusHeader(Context context) { - this(context, null); - } - - public TaurusHeader(Context context, AttributeSet attrs) { - super(context, attrs); - } - // -} diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaterDropHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaterDropHeader.java deleted file mode 100644 index 57393cf6..00000000 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaterDropHeader.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.scwang.smartrefresh.header; - -import android.content.Context; -import android.util.AttributeSet; - -/** - * WaterDropHeader - * Created by scwang on 2017/5/31. - * from ... - */ -public class WaterDropHeader extends com.scwang.smart.refresh.header.WaterDropHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { - - // - public WaterDropHeader(Context context) { - this(context, null); - } - - public WaterDropHeader(Context context, AttributeSet attrs) { - super(context, attrs); - } - // -} \ No newline at end of file diff --git a/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaveSwipeHeader.java b/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaveSwipeHeader.java deleted file mode 100644 index ea7a6c43..00000000 --- a/refresh-header/src/main/java/com/scwang/smartrefresh/header/WaveSwipeHeader.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.scwang.smartrefresh.header; - -import android.content.Context; -import android.util.AttributeSet; - -/** - * 全屏水滴下拉头 - * Created by scwang on 2017/6/4. - * from ... - */ -public class WaveSwipeHeader extends com.scwang.smart.refresh.header.WaveSwipeHeader implements com.scwang.smart.refresh.layout.api.RefreshHeader { - - // - public WaveSwipeHeader(Context context) { - this(context, null); - } - - public WaveSwipeHeader(Context context, AttributeSet attrs) { - super(context, attrs); - } - // -} diff --git a/refresh-header/src/test/java/com/scwang/smartrefresh/header/ExampleUnitTest.java b/refresh-header/src/test/java/com/scwang/smartrefresh/header/ExampleUnitTest.java index 5045cedb..14e752a1 100644 --- a/refresh-header/src/test/java/com/scwang/smartrefresh/header/ExampleUnitTest.java +++ b/refresh-header/src/test/java/com/scwang/smartrefresh/header/ExampleUnitTest.java @@ -1,4 +1,4 @@ -package com.scwang.smartrefresh.header; +package com.scwang.smart.refresh.header; import org.junit.Test; From d5e6d8e8dee75726f1872dacf2f23620436a2d5f Mon Sep 17 00:00:00 2001 From: wsc Date: Thu, 7 Nov 2024 15:28:04 +0800 Subject: [PATCH 62/67] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20xml=20=E4=B8=AD?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84=E5=8C=85=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/activity_example_assign_xml.xml | 4 ++-- app/src/main/res/layout/activity_example_basic.xml | 2 +- app/src/main/res/layout/activity_example_snaphelper.xml | 2 +- app/src/main/res/layout/activity_experiment.xml | 6 +++--- app/src/main/res/layout/activity_practice_feedlist.xml | 4 ++-- app/src/main/res/layout/activity_practice_repast.xml | 2 +- app/src/main/res/layout/activity_practice_weibo.xml | 2 +- app/src/main/res/layout/activity_style_classics.xml | 4 ++-- .../res/layout/fragment_example_nestedscroll_integral.xml | 2 +- .../res/layout/fragment_example_purescroll_header.xml | 2 +- app/src/main/res/layout/fragment_no_more_data_example.xml | 4 ++-- app/src/main/res/layout/fragment_practice_instant.xml | 4 ++-- .../main/res/layout/fragment_practice_second_floor.xml | 8 ++++---- app/src/main/res/layout/fragment_practice_twolevel.xml | 6 +++--- app/src/main/res/values-zh/strings.xml | 6 +++--- app/src/main/res/values/strings.xml | 6 +++--- .../smartrefresh/footer/ExampleInstrumentedTest.java | 2 +- .../smart/refresh/layout/ExampleInstrumentedTest.java | 2 +- .../smartrefresh/layout/ExampleInstrumentedTest.java | 2 +- 19 files changed, 35 insertions(+), 35 deletions(-) diff --git a/app/src/main/res/layout/activity_example_assign_xml.xml b/app/src/main/res/layout/activity_example_assign_xml.xml index fdfc2108..771a0609 100644 --- a/app/src/main/res/layout/activity_example_assign_xml.xml +++ b/app/src/main/res/layout/activity_example_assign_xml.xml @@ -21,7 +21,7 @@ app:srlEnablePreviewInEditMode="true" app:srlEnableLoadMoreWhenContentNotFull="true"> - @@ -32,7 +32,7 @@ android:padding="@dimen/dimenPaddingCommon" android:background="@android:color/white" android:text="@string/description_define_in_xml"/> - diff --git a/app/src/main/res/layout/activity_example_basic.xml b/app/src/main/res/layout/activity_example_basic.xml index fd400c3f..519a1bbb 100644 --- a/app/src/main/res/layout/activity_example_basic.xml +++ b/app/src/main/res/layout/activity_example_basic.xml @@ -37,7 +37,7 @@ android:background="@android:color/white" android:overScrollMode="never" tools:listitem="@android:layout/simple_list_item_2"/> - - diff --git a/app/src/main/res/layout/activity_experiment.xml b/app/src/main/res/layout/activity_experiment.xml index ba4e7525..7b66a687 100644 --- a/app/src/main/res/layout/activity_experiment.xml +++ b/app/src/main/res/layout/activity_experiment.xml @@ -22,13 +22,13 @@ android:layout_height="match_parent" android:gravity="center" android:text="@string/experiment_footer"/> - + - + @@ -40,7 +40,7 @@ - + diff --git a/app/src/main/res/layout/activity_practice_feedlist.xml b/app/src/main/res/layout/activity_practice_feedlist.xml index 34e3ae35..a4e9f7ee 100644 --- a/app/src/main/res/layout/activity_practice_feedlist.xml +++ b/app/src/main/res/layout/activity_practice_feedlist.xml @@ -23,7 +23,7 @@ app:srlFooterTranslationViewId="@+id/scrollView" app:srlEnableLoadMoreWhenContentNotFull="false"> - @@ -952,7 +952,7 @@ - diff --git a/app/src/main/res/layout/activity_practice_repast.xml b/app/src/main/res/layout/activity_practice_repast.xml index 6aa4d321..f67947e2 100644 --- a/app/src/main/res/layout/activity_practice_repast.xml +++ b/app/src/main/res/layout/activity_practice_repast.xml @@ -35,7 +35,7 @@ android:clipToPadding="false" android:overScrollMode="never" tools:listitem="@layout/item_practice_repast"/> - - - - diff --git a/app/src/main/res/layout/fragment_example_nestedscroll_integral.xml b/app/src/main/res/layout/fragment_example_nestedscroll_integral.xml index 60e86c28..29129c68 100644 --- a/app/src/main/res/layout/fragment_example_nestedscroll_integral.xml +++ b/app/src/main/res/layout/fragment_example_nestedscroll_integral.xml @@ -20,7 +20,7 @@ android:layout_height="match_parent" app:srlFooterTranslationViewId="@+id/viewPager"> - - - - diff --git a/app/src/main/res/layout/fragment_practice_instant.xml b/app/src/main/res/layout/fragment_practice_instant.xml index 5f61e4a3..c7e576b0 100644 --- a/app/src/main/res/layout/fragment_practice_instant.xml +++ b/app/src/main/res/layout/fragment_practice_instant.xml @@ -36,13 +36,13 @@ android:scaleY="-1" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" tools:listitem="@layout/item_practice_instant"/> - - + diff --git a/app/src/main/res/layout/fragment_practice_second_floor.xml b/app/src/main/res/layout/fragment_practice_second_floor.xml index d6ee1572..2b30e357 100644 --- a/app/src/main/res/layout/fragment_practice_second_floor.xml +++ b/app/src/main/res/layout/fragment_practice_second_floor.xml @@ -12,7 +12,7 @@ android:layout_height="match_parent" android:clipChildren="false" app:srlAccentColor="@android:color/white"> - @@ -40,12 +40,12 @@ android:layout_height="match_parent" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/> - - + - diff --git a/app/src/main/res/layout/fragment_practice_twolevel.xml b/app/src/main/res/layout/fragment_practice_twolevel.xml index d4b4a15f..d3c68794 100644 --- a/app/src/main/res/layout/fragment_practice_twolevel.xml +++ b/app/src/main/res/layout/fragment_practice_twolevel.xml @@ -18,15 +18,15 @@ android:id="@+id/refreshLayout" android:layout_width="match_parent" android:layout_height="match_parent"> - - - + \n \t\n - \t\n - \n + \n ]]> 这是使用定制Header和Footer的第三种方法-代码设置\n\n 本方法是实际项目中比较少用的方法,其特点有:\n\n diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 681b7733..bc3ebdf9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -151,7 +151,7 @@ 1.Can preview in Android Studio\n 2.Priority is higher than [global default] but below [JavaCode]\n\n Usage:\n - \n \t\n - \t\n - \n + \n ]]> \n Usage: \n diff --git a/refresh-footer/src/androidTest/java/com/scwang/smartrefresh/footer/ExampleInstrumentedTest.java b/refresh-footer/src/androidTest/java/com/scwang/smartrefresh/footer/ExampleInstrumentedTest.java index 98c8551d..e5380ecc 100644 --- a/refresh-footer/src/androidTest/java/com/scwang/smartrefresh/footer/ExampleInstrumentedTest.java +++ b/refresh-footer/src/androidTest/java/com/scwang/smartrefresh/footer/ExampleInstrumentedTest.java @@ -22,6 +22,6 @@ public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); - assertEquals("com.scwang.smartrefresh.footer.test", appContext.getPackageName()); + assertEquals("com.scwang.smart.refresh.footer.test", appContext.getPackageName()); } } diff --git a/refresh-layout-kernel/src/androidTest/java/com/scwang/smart/refresh/layout/ExampleInstrumentedTest.java b/refresh-layout-kernel/src/androidTest/java/com/scwang/smart/refresh/layout/ExampleInstrumentedTest.java index e0d43010..d1361457 100644 --- a/refresh-layout-kernel/src/androidTest/java/com/scwang/smart/refresh/layout/ExampleInstrumentedTest.java +++ b/refresh-layout-kernel/src/androidTest/java/com/scwang/smart/refresh/layout/ExampleInstrumentedTest.java @@ -22,6 +22,6 @@ public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); - assertEquals("com.scwang.smartrefresh.layout.test", appContext.getPackageName()); + assertEquals("com.scwang.smart.refresh.layout.test", appContext.getPackageName()); } } diff --git a/refresh-layout/src/androidTest/java/com/scwang/smartrefresh/layout/ExampleInstrumentedTest.java b/refresh-layout/src/androidTest/java/com/scwang/smartrefresh/layout/ExampleInstrumentedTest.java index b1812fdb..da2dcbc8 100644 --- a/refresh-layout/src/androidTest/java/com/scwang/smartrefresh/layout/ExampleInstrumentedTest.java +++ b/refresh-layout/src/androidTest/java/com/scwang/smartrefresh/layout/ExampleInstrumentedTest.java @@ -22,6 +22,6 @@ public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); - assertEquals("com.scwang.smartrefresh.layout.test", appContext.getPackageName()); + assertEquals("com.scwang.smart.refresh.layout.test", appContext.getPackageName()); } } From e1cee2db7704632530e0189727a79b854003e7e9 Mon Sep 17 00:00:00 2001 From: wsc Date: Sun, 10 Nov 2024 18:27:38 +0800 Subject: [PATCH 63/67] =?UTF-8?q?=E8=B0=83=E6=95=B4=20demo=20=E5=8C=85?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 2 +- app/proguard-rules.pro | 2 +- .../ExampleInstrumentedTest.java | 2 +- app/src/main/AndroidManifest.xml | 2 +- .../layout}/App.java | 4 +- .../layout}/activity/FragmentActivity.java | 2 +- .../layout}/activity/IndexMainActivity.java | 12 ++--- .../example/AssignCodeExampleActivity.java | 4 +- .../example/AssignDefaultExampleActivity.java | 6 +-- .../example/AssignXmlExampleActivity.java | 4 +- .../example/BasicExampleActivity.java | 8 ++-- .../example/CustomExampleActivity.java | 8 ++-- .../activity/example/I18nExampleActivity.java | 8 ++-- .../example/ListenerExampleActivity.java | 5 +- .../example/NestedLayoutExampleActivity.java | 8 ++-- .../example/OverScrollExampleActivity.java | 4 +- .../example/SnapHelperExampleActivity.java | 8 ++-- .../practice/BannerPracticeActivity.java | 6 +-- .../practice/FeedListPracticeActivity.java | 4 +- .../practice/ProfilePracticeActivity.java | 6 +-- .../practice/QQBrowserPracticeActivity.java | 6 +-- .../practice/RepastPracticeActivity.java | 10 ++-- .../practice/WebViewPracticeActivity.java | 6 +-- .../practice/WeiboPracticeActivity.java | 6 +-- .../style/BezierCircleStyleActivity.java | 8 ++-- .../style/BezierRadarStyleActivity.java | 8 ++-- .../activity/style/ClassicsStyleActivity.java | 10 ++-- .../activity/style/DeliveryStyleActivity.java | 10 ++-- .../activity/style/DropBoxStyleActivity.java | 8 ++-- .../style/FlyRefreshStyleActivity.java | 6 +-- .../style/FunGameBattleCityStyleActivity.java | 8 ++-- .../style/FunGameHitBlockStyleActivity.java | 8 ++-- .../activity/style/MaterialStyleActivity.java | 8 ++-- .../activity/style/PhoenixStyleActivity.java | 8 ++-- .../style/StoreHouseStyleActivity.java | 8 ++-- .../activity/style/TaurusStyleActivity.java | 8 ++-- .../style/WaterDropStyleActivity.java | 8 ++-- .../style/WaveSwipeStyleActivity.java | 8 ++-- .../layout}/adapter/BaseRecyclerAdapter.java | 2 +- .../layout}/adapter/SmartViewHolder.java | 2 +- .../example/BottomSheetExampleFragment.java | 8 ++-- .../DisallowInterceptExampleFragment.java | 4 +- .../example/EmptyLayoutExampleFragment.java | 14 +++--- .../EmptyLayoutExampleFragmentInner.java | 13 +++-- .../EmptyLayoutExampleFragmentOuter.java | 16 +++---- .../example/FlexBoxLayoutManagerFragment.java | 8 ++-- .../example/HorizontalExampleFragment.java | 8 ++-- .../example/NestedScrollExampleFragment.java | 10 ++-- .../NestedScrollExampleFragmentIntegral.java | 25 +++++----- .../NestedScrollExampleFragmentViewPager.java | 8 ++-- .../example/NoMoreDataExampleFragment.java | 8 ++-- .../example/PureScrollExampleFragment.java | 10 ++-- .../PureScrollExampleFragmentFooter.java | 17 ++++--- .../PureScrollExampleFragmentHeader.java | 17 ++++--- .../example/SpecifyStyleExampleFragment.java | 16 +++---- .../example/StaggeredGridExampleFragment.java | 8 ++-- .../example/ViewPagerExampleFragment.java | 8 ++-- .../index/RefreshExampleFragment.java | 48 +++++++++---------- .../index/RefreshPracticeFragment.java | 30 ++++++------ .../fragment/index/RefreshStylesFragment.java | 42 ++++++++-------- .../practice/InstantPracticeFragment.java | 10 ++-- .../practice/SecondFloorPracticeFragment.java | 10 ++-- .../practice/TwoLevelPracticeFragment.java | 6 +-- .../layout}/util/DynamicTimeFormat.java | 2 +- .../layout}/util/StatusBarUtil.java | 2 +- .../widget/RefreshContentHorizontal.java | 2 +- .../widget/ScrollBoundaryHorizontal.java | 2 +- .../widget/SmartRefreshHorizontal.java | 5 +- .../layout/activity_example_assign_code.xml | 2 +- .../activity_example_assign_default.xml | 2 +- .../layout/activity_example_assign_xml.xml | 2 +- .../res/layout/activity_example_basic.xml | 2 +- .../res/layout/activity_example_custom.xml | 2 +- .../main/res/layout/activity_example_i18n.xml | 2 +- .../res/layout/activity_example_listener.xml | 2 +- .../layout/activity_example_overscroll.xml | 2 +- .../res/layout/activity_example_region.xml | 2 +- .../layout/activity_example_snaphelper.xml | 2 +- .../main/res/layout/activity_fly_refresh.xml | 2 +- .../main/res/layout/activity_index_main.xml | 2 +- .../res/layout/activity_practice_banner.xml | 2 +- .../res/layout/activity_practice_feedlist.xml | 2 +- .../res/layout/activity_practice_profile.xml | 2 +- .../layout/activity_practice_qqbrowser.xml | 2 +- .../res/layout/activity_practice_repast.xml | 2 +- .../res/layout/activity_practice_webview.xml | 2 +- .../res/layout/activity_practice_weibo.xml | 2 +- .../main/res/layout/activity_style_bezier.xml | 2 +- .../main/res/layout/activity_style_circle.xml | 2 +- .../res/layout/activity_style_classics.xml | 2 +- .../res/layout/activity_style_delivery.xml | 2 +- .../res/layout/activity_style_dropbox.xml | 2 +- .../activity_style_fungame_battlecity.xml | 2 +- .../activity_style_fungame_hitblock.xml | 2 +- .../res/layout/activity_style_material.xml | 2 +- .../res/layout/activity_style_phoenix.xml | 2 +- .../res/layout/activity_style_storehouse.xml | 2 +- .../main/res/layout/activity_style_taurus.xml | 2 +- .../res/layout/activity_style_water_drop.xml | 2 +- .../res/layout/activity_style_wave_swipe.xml | 2 +- .../layout/common_independence_recycler.xml | 2 +- app/src/main/res/layout/common_loading.xml | 2 +- .../layout/fragment_example_bottom_sheet.xml | 2 +- .../fragment_example_disallow_intercept.xml | 4 +- .../layout/fragment_example_emptylayout.xml | 2 +- .../fragment_example_emptylayout_inner.xml | 2 +- .../fragment_example_emptylayout_outer.xml | 2 +- .../layout/fragment_example_horizontal.xml | 6 +-- .../layout/fragment_example_nestedscroll.xml | 2 +- ...fragment_example_nestedscroll_integral.xml | 2 +- ...agment_example_nestedscroll_view_pager.xml | 2 +- .../layout/fragment_example_purescroll.xml | 2 +- .../fragment_example_purescroll_header.xml | 2 +- .../fragment_example_staggered_grid.xml | 2 +- .../res/layout/fragment_example_viewpager.xml | 2 +- .../fragment_flexbox_layout_manager.xml | 2 +- .../layout/fragment_no_more_data_example.xml | 2 +- .../res/layout/fragment_practice_instant.xml | 2 +- .../layout/fragment_practice_second_floor.xml | 2 +- .../res/layout/fragment_practice_twolevel.xml | 2 +- .../res/layout/fragment_refresh_example.xml | 2 +- .../res/layout/fragment_refresh_practive.xml | 2 +- .../res/layout/fragment_refresh_styles.xml | 2 +- .../main/res/layout/item_style_delivery.xml | 2 +- .../ExampleUnitTest.java | 2 +- 125 files changed, 361 insertions(+), 367 deletions(-) rename app/src/androidTest/java/com/scwang/{refreshlayout => refresh}/ExampleInstrumentedTest.java (95%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/App.java (96%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/FragmentActivity.java (98%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/IndexMainActivity.java (92%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/example/AssignCodeExampleActivity.java (96%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/example/AssignDefaultExampleActivity.java (97%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/example/AssignXmlExampleActivity.java (96%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/example/BasicExampleActivity.java (97%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/example/CustomExampleActivity.java (97%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/example/I18nExampleActivity.java (94%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/example/ListenerExampleActivity.java (98%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/example/NestedLayoutExampleActivity.java (94%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/example/OverScrollExampleActivity.java (94%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/example/SnapHelperExampleActivity.java (94%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/practice/BannerPracticeActivity.java (98%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/practice/FeedListPracticeActivity.java (90%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/practice/ProfilePracticeActivity.java (84%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/practice/QQBrowserPracticeActivity.java (91%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/practice/RepastPracticeActivity.java (95%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/practice/WebViewPracticeActivity.java (93%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/practice/WeiboPracticeActivity.java (96%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/style/BezierCircleStyleActivity.java (95%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/style/BezierRadarStyleActivity.java (96%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/style/ClassicsStyleActivity.java (96%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/style/DeliveryStyleActivity.java (95%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/style/DropBoxStyleActivity.java (96%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/style/FlyRefreshStyleActivity.java (99%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/style/FunGameBattleCityStyleActivity.java (95%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/style/FunGameHitBlockStyleActivity.java (95%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/style/MaterialStyleActivity.java (96%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/style/PhoenixStyleActivity.java (96%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/style/StoreHouseStyleActivity.java (97%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/style/TaurusStyleActivity.java (96%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/style/WaterDropStyleActivity.java (95%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/activity/style/WaveSwipeStyleActivity.java (95%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/adapter/BaseRecyclerAdapter.java (99%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/adapter/SmartViewHolder.java (98%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/example/BottomSheetExampleFragment.java (94%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/example/DisallowInterceptExampleFragment.java (97%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/example/EmptyLayoutExampleFragment.java (93%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/example/EmptyLayoutExampleFragmentInner.java (92%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/example/EmptyLayoutExampleFragmentOuter.java (89%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/example/FlexBoxLayoutManagerFragment.java (94%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/example/HorizontalExampleFragment.java (94%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/example/NestedScrollExampleFragment.java (95%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/example/NestedScrollExampleFragmentIntegral.java (88%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/example/NestedScrollExampleFragmentViewPager.java (96%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/example/NoMoreDataExampleFragment.java (95%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/example/PureScrollExampleFragment.java (92%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/example/PureScrollExampleFragmentFooter.java (83%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/example/PureScrollExampleFragmentHeader.java (82%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/example/SpecifyStyleExampleFragment.java (86%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/example/StaggeredGridExampleFragment.java (94%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/example/ViewPagerExampleFragment.java (97%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/index/RefreshExampleFragment.java (73%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/index/RefreshPracticeFragment.java (80%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/index/RefreshStylesFragment.java (86%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/practice/InstantPracticeFragment.java (97%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/practice/SecondFloorPracticeFragment.java (95%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/fragment/practice/TwoLevelPracticeFragment.java (94%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/util/DynamicTimeFormat.java (99%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/util/StatusBarUtil.java (99%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/widget/RefreshContentHorizontal.java (97%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/widget/ScrollBoundaryHorizontal.java (98%) rename app/src/main/java/com/scwang/{refreshlayout => refresh/layout}/widget/SmartRefreshHorizontal.java (96%) rename app/src/test/java/com/scwang/{refreshlayout => refresh}/ExampleUnitTest.java (91%) diff --git a/app/build.gradle b/app/build.gradle index c0798831..2ca1fc97 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,7 +5,7 @@ android { compileSdkVersion 34 defaultConfig { - applicationId "com.scwang.refreshlayout.app" + applicationId "com.scwang.refresh.layout.app" minSdkVersion 21 targetSdkVersion 34 versionCode 1 diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index a0a48efb..08c6bbb6 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -36,4 +36,4 @@ -keep class com.wang.avi.** { *; } -keep class com.wang.avi.indicators.** { *; } --keep class com.scwang.refreshlayout.activity.practice.BannerPracticeActivity$Movie {*;} \ No newline at end of file +-keep class com.scwang.refresh.activity.practice.BannerPracticeActivity$Movie {*;} \ No newline at end of file diff --git a/app/src/androidTest/java/com/scwang/refreshlayout/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/scwang/refresh/ExampleInstrumentedTest.java similarity index 95% rename from app/src/androidTest/java/com/scwang/refreshlayout/ExampleInstrumentedTest.java rename to app/src/androidTest/java/com/scwang/refresh/ExampleInstrumentedTest.java index 2d01d925..08e6f982 100644 --- a/app/src/androidTest/java/com/scwang/refreshlayout/ExampleInstrumentedTest.java +++ b/app/src/androidTest/java/com/scwang/refresh/ExampleInstrumentedTest.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout; +package com.scwang.refresh; import android.content.Context; diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 90f9ac73..cf5867a9 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ + package="com.scwang.refresh.layout"> diff --git a/app/src/main/java/com/scwang/refreshlayout/App.java b/app/src/main/java/com/scwang/refresh/layout/App.java similarity index 96% rename from app/src/main/java/com/scwang/refreshlayout/App.java rename to app/src/main/java/com/scwang/refresh/layout/App.java index 2910f120..abfe3f9d 100644 --- a/app/src/main/java/com/scwang/refreshlayout/App.java +++ b/app/src/main/java/com/scwang/refresh/layout/App.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout; +package com.scwang.refresh.layout; import android.app.Application; import android.content.Context; @@ -6,7 +6,7 @@ import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatDelegate; -import com.scwang.refreshlayout.util.DynamicTimeFormat; +import com.scwang.refresh.layout.util.DynamicTimeFormat; import com.scwang.smart.refresh.layout.api.RefreshFooter; import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.api.RefreshLayout; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/FragmentActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/FragmentActivity.java similarity index 98% rename from app/src/main/java/com/scwang/refreshlayout/activity/FragmentActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/FragmentActivity.java index 0f0cc357..42d7fb7e 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/FragmentActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/FragmentActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity; +package com.scwang.refresh.layout.activity; import android.app.Activity; import android.content.Context; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/IndexMainActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/IndexMainActivity.java similarity index 92% rename from app/src/main/java/com/scwang/refreshlayout/activity/IndexMainActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/IndexMainActivity.java index bcad5820..5f733aaf 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/IndexMainActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/IndexMainActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity; +package com.scwang.refresh.layout.activity; import android.animation.ValueAnimator; import android.os.Bundle; @@ -13,11 +13,11 @@ import com.google.android.material.bottomnavigation.BottomNavigationView; import com.google.android.material.navigation.NavigationBarView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.fragment.index.RefreshExampleFragment; -import com.scwang.refreshlayout.fragment.index.RefreshPracticeFragment; -import com.scwang.refreshlayout.fragment.index.RefreshStylesFragment; -import com.scwang.refreshlayout.util.StatusBarUtil; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.fragment.index.RefreshExampleFragment; +import com.scwang.refresh.layout.fragment.index.RefreshPracticeFragment; +import com.scwang.refresh.layout.fragment.index.RefreshStylesFragment; +import com.scwang.refresh.layout.util.StatusBarUtil; import java.lang.reflect.Field; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignCodeExampleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/example/AssignCodeExampleActivity.java similarity index 96% rename from app/src/main/java/com/scwang/refreshlayout/activity/example/AssignCodeExampleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/example/AssignCodeExampleActivity.java index 92fcf8d6..b3c910a9 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignCodeExampleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/example/AssignCodeExampleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.example; +package com.scwang.refresh.layout.activity.example; import android.os.Bundle; @@ -6,7 +6,7 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; -import com.scwang.refreshlayout.R; +import com.scwang.refresh.layout.R; import com.scwang.smart.refresh.header.MaterialHeader; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.RefreshState; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignDefaultExampleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/example/AssignDefaultExampleActivity.java similarity index 97% rename from app/src/main/java/com/scwang/refreshlayout/activity/example/AssignDefaultExampleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/example/AssignDefaultExampleActivity.java index f500c2f1..f6167206 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignDefaultExampleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/example/AssignDefaultExampleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.example; +package com.scwang.refresh.layout.activity.example; import android.content.Context; import android.os.Bundle; @@ -7,8 +7,8 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.util.DynamicTimeFormat; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.util.DynamicTimeFormat; import com.scwang.smart.refresh.layout.SmartRefreshLayout; import com.scwang.smart.refresh.layout.api.RefreshFooter; import com.scwang.smart.refresh.layout.api.RefreshHeader; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignXmlExampleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/example/AssignXmlExampleActivity.java similarity index 96% rename from app/src/main/java/com/scwang/refreshlayout/activity/example/AssignXmlExampleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/example/AssignXmlExampleActivity.java index 01cc433e..7fc9a0d5 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/AssignXmlExampleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/example/AssignXmlExampleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.example; +package com.scwang.refresh.layout.activity.example; import android.os.Bundle; @@ -6,7 +6,7 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; -import com.scwang.refreshlayout.R; +import com.scwang.refresh.layout.R; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.RefreshState; import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/example/BasicExampleActivity.java similarity index 97% rename from app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/example/BasicExampleActivity.java index 666dab2e..cbd10db8 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/BasicExampleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/example/BasicExampleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.example; +package com.scwang.refresh.layout.activity.example; import android.os.Bundle; import android.view.View; @@ -12,9 +12,9 @@ import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.bottomsheet.BottomSheetDialog; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.footer.ClassicsFooter; import com.scwang.smart.refresh.layout.api.RefreshFooter; import com.scwang.smart.refresh.layout.api.RefreshLayout; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/example/CustomExampleActivity.java similarity index 97% rename from app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/example/CustomExampleActivity.java index 79506862..7f3a9e0a 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/CustomExampleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/example/CustomExampleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.example; +package com.scwang.refresh.layout.activity.example; import android.content.Context; import android.os.Bundle; @@ -15,9 +15,9 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.drawable.ProgressDrawable; import com.scwang.smart.refresh.classics.ArrowDrawable; import com.scwang.smart.refresh.layout.api.RefreshHeader; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/example/I18nExampleActivity.java similarity index 94% rename from app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/example/I18nExampleActivity.java index 1df26bce..e75af8be 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/I18nExampleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/example/I18nExampleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.example; +package com.scwang.refresh.layout.activity.example; import android.content.Intent; import android.content.res.Configuration; @@ -14,9 +14,9 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.header.ClassicsHeader; import com.scwang.smart.refresh.layout.listener.OnRefreshListener; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/ListenerExampleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/example/ListenerExampleActivity.java similarity index 98% rename from app/src/main/java/com/scwang/refreshlayout/activity/example/ListenerExampleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/example/ListenerExampleActivity.java index 9f927789..dfdaefd5 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/ListenerExampleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/example/ListenerExampleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.example; +package com.scwang.refresh.layout.activity.example; import android.os.Bundle; import android.text.method.ScrollingMovementMethod; @@ -8,12 +8,11 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; -import com.scwang.refreshlayout.R; +import com.scwang.refresh.layout.R; import com.scwang.smart.refresh.layout.api.RefreshFooter; import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.RefreshState; -import com.scwang.smart.refresh.layout.listener.OnMultiListener; import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; import java.text.DateFormat; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/NestedLayoutExampleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/example/NestedLayoutExampleActivity.java similarity index 94% rename from app/src/main/java/com/scwang/refreshlayout/activity/example/NestedLayoutExampleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/example/NestedLayoutExampleActivity.java index de93a431..656d61b0 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/NestedLayoutExampleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/example/NestedLayoutExampleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.example; +package com.scwang.refresh.layout.activity.example; import android.os.Bundle; import android.util.Log; @@ -14,9 +14,9 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.text.DateFormat; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/OverScrollExampleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/example/OverScrollExampleActivity.java similarity index 94% rename from app/src/main/java/com/scwang/refreshlayout/activity/example/OverScrollExampleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/example/OverScrollExampleActivity.java index 0f17d7f6..6ab8971a 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/OverScrollExampleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/example/OverScrollExampleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.example; +package com.scwang.refresh.layout.activity.example; import android.os.Bundle; import android.webkit.WebView; @@ -7,7 +7,7 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; -import com.scwang.refreshlayout.R; +import com.scwang.refresh.layout.R; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.listener.OnRefreshListener; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/example/SnapHelperExampleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/example/SnapHelperExampleActivity.java similarity index 94% rename from app/src/main/java/com/scwang/refreshlayout/activity/example/SnapHelperExampleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/example/SnapHelperExampleActivity.java index e65f4ff0..09e74bf5 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/example/SnapHelperExampleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/example/SnapHelperExampleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.example; +package com.scwang.refresh.layout.activity.example; import android.os.Bundle; import android.view.View; @@ -13,9 +13,9 @@ import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.SnapHelper; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/BannerPracticeActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/practice/BannerPracticeActivity.java similarity index 98% rename from app/src/main/java/com/scwang/refreshlayout/activity/practice/BannerPracticeActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/practice/BannerPracticeActivity.java index c20eedca..940229aa 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/BannerPracticeActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/practice/BannerPracticeActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.practice; +package com.scwang.refresh.layout.activity.practice; import android.content.Context; import android.os.Build; @@ -20,8 +20,8 @@ import com.chad.library.adapter.base.BaseViewHolder; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.util.StatusBarUtil; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.util.StatusBarUtil; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener; import com.scwang.smart.refresh.layout.listener.OnRefreshListener; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/FeedListPracticeActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/practice/FeedListPracticeActivity.java similarity index 90% rename from app/src/main/java/com/scwang/refreshlayout/activity/practice/FeedListPracticeActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/practice/FeedListPracticeActivity.java index 275212a7..9c7f8e2d 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/FeedListPracticeActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/practice/FeedListPracticeActivity.java @@ -1,11 +1,11 @@ -package com.scwang.refreshlayout.activity.practice; +package com.scwang.refresh.layout.activity.practice; import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; -import com.scwang.refreshlayout.R; +import com.scwang.refresh.layout.R; import com.scwang.smart.refresh.layout.api.RefreshLayout; /** diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/ProfilePracticeActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/practice/ProfilePracticeActivity.java similarity index 84% rename from app/src/main/java/com/scwang/refreshlayout/activity/practice/ProfilePracticeActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/practice/ProfilePracticeActivity.java index c459b04c..b153ac4a 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/ProfilePracticeActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/practice/ProfilePracticeActivity.java @@ -1,12 +1,12 @@ -package com.scwang.refreshlayout.activity.practice; +package com.scwang.refresh.layout.activity.practice; import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.util.StatusBarUtil; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.util.StatusBarUtil; /** * 个人中心 diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/QQBrowserPracticeActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/practice/QQBrowserPracticeActivity.java similarity index 91% rename from app/src/main/java/com/scwang/refreshlayout/activity/practice/QQBrowserPracticeActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/practice/QQBrowserPracticeActivity.java index 5aada02d..50cc782a 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/QQBrowserPracticeActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/practice/QQBrowserPracticeActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.practice; +package com.scwang.refresh.layout.activity.practice; import android.annotation.SuppressLint; import android.os.Bundle; @@ -8,8 +8,8 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.util.StatusBarUtil; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.util.StatusBarUtil; import ezy.ui.layout.LoadingLayout; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/RepastPracticeActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/practice/RepastPracticeActivity.java similarity index 95% rename from app/src/main/java/com/scwang/refreshlayout/activity/practice/RepastPracticeActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/practice/RepastPracticeActivity.java index 8c6ec930..bd50c46e 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/RepastPracticeActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/practice/RepastPracticeActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.practice; +package com.scwang.refresh.layout.activity.practice; import android.os.Bundle; import android.view.View; @@ -11,10 +11,10 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.refreshlayout.util.StatusBarUtil; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.util.StatusBarUtil; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; import com.scwang.smart.refresh.layout.util.SmartUtil; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WebViewPracticeActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/practice/WebViewPracticeActivity.java similarity index 93% rename from app/src/main/java/com/scwang/refreshlayout/activity/practice/WebViewPracticeActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/practice/WebViewPracticeActivity.java index 4ea5b776..a7111e34 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WebViewPracticeActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/practice/WebViewPracticeActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.practice; +package com.scwang.refresh.layout.activity.practice; import android.annotation.SuppressLint; import android.os.Bundle; @@ -8,8 +8,8 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.util.StatusBarUtil; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.util.StatusBarUtil; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.listener.OnRefreshListener; import com.scwang.smart.refresh.layout.util.SmartUtil; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/practice/WeiboPracticeActivity.java similarity index 96% rename from app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/practice/WeiboPracticeActivity.java index a21b12b6..2bd3cb23 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/practice/WeiboPracticeActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/practice/WeiboPracticeActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.practice; +package com.scwang.refresh.layout.activity.practice; import android.os.Bundle; import android.view.View; @@ -10,8 +10,8 @@ import androidx.core.content.ContextCompat; import androidx.core.widget.NestedScrollView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.util.StatusBarUtil; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.util.StatusBarUtil; import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/style/BezierCircleStyleActivity.java similarity index 95% rename from app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/style/BezierCircleStyleActivity.java index b879d2a3..03f561bf 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierCircleStyleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/style/BezierCircleStyleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.style; +package com.scwang.refresh.layout.activity.style; import android.os.Bundle; import android.view.View; @@ -13,9 +13,9 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.util.ArrayList; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/style/BezierRadarStyleActivity.java similarity index 96% rename from app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/style/BezierRadarStyleActivity.java index cb35c08c..7efb555a 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/BezierRadarStyleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/style/BezierRadarStyleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.style; +package com.scwang.refresh.layout.activity.style; import android.os.Bundle; import android.view.View; @@ -13,9 +13,9 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.header.BezierRadarHeader; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/style/ClassicsStyleActivity.java similarity index 96% rename from app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/style/ClassicsStyleActivity.java index 3ec3c4e9..6f8f7afc 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/style/ClassicsStyleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.style; +package com.scwang.refresh.layout.activity.style; import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; @@ -16,10 +16,10 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.refreshlayout.util.DynamicTimeFormat; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.util.DynamicTimeFormat; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; import com.scwang.smart.refresh.header.ClassicsHeader; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/style/DeliveryStyleActivity.java similarity index 95% rename from app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/style/DeliveryStyleActivity.java index 138a47e3..219ebe1a 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/DeliveryStyleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/style/DeliveryStyleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.style; +package com.scwang.refresh.layout.activity.style; import android.os.Build; import android.os.Bundle; @@ -14,16 +14,16 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import static com.scwang.refreshlayout.R.layout.item_style_delivery; +import static com.scwang.refresh.layout.R.layout.item_style_delivery; public class DeliveryStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/style/DropBoxStyleActivity.java similarity index 96% rename from app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/style/DropBoxStyleActivity.java index 8ba1ca97..3062784d 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/DropBoxStyleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/style/DropBoxStyleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.style; +package com.scwang.refresh.layout.activity.style; import android.os.Bundle; import android.view.View; @@ -13,9 +13,9 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/style/FlyRefreshStyleActivity.java similarity index 99% rename from app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/style/FlyRefreshStyleActivity.java index 4ef7878b..c9239cfc 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/FlyRefreshStyleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/style/FlyRefreshStyleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.style; +package com.scwang.refresh.layout.activity.style; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -27,8 +27,8 @@ import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.CollapsingToolbarLayout; import com.google.android.material.floatingactionbutton.FloatingActionButton; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.util.StatusBarUtil; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.util.StatusBarUtil; import com.scwang.smart.refresh.header.flyrefresh.FlyView; import com.scwang.smart.refresh.header.flyrefresh.MountainSceneView; import com.scwang.smart.refresh.layout.api.RefreshHeader; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/style/FunGameBattleCityStyleActivity.java similarity index 95% rename from app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/style/FunGameBattleCityStyleActivity.java index 5246e926..f128a9e8 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/style/FunGameBattleCityStyleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.style; +package com.scwang.refresh.layout.activity.style; import android.os.Bundle; import android.view.View; @@ -13,9 +13,9 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.util.ArrayList; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/style/FunGameHitBlockStyleActivity.java similarity index 95% rename from app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/style/FunGameHitBlockStyleActivity.java index f7b43fd3..57c5ed5b 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/style/FunGameHitBlockStyleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.style; +package com.scwang.refresh.layout.activity.style; import android.os.Bundle; import android.view.View; @@ -13,9 +13,9 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.util.ArrayList; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/style/MaterialStyleActivity.java similarity index 96% rename from app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/style/MaterialStyleActivity.java index 609b3004..4237cc47 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/MaterialStyleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/style/MaterialStyleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.style; +package com.scwang.refresh.layout.activity.style; import android.os.Bundle; import android.view.View; @@ -13,9 +13,9 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.header.MaterialHeader; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/style/PhoenixStyleActivity.java similarity index 96% rename from app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/style/PhoenixStyleActivity.java index 4f953874..e6b743e3 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/PhoenixStyleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/style/PhoenixStyleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.style; +package com.scwang.refresh.layout.activity.style; import android.content.res.ColorStateList; import android.os.Bundle; @@ -17,9 +17,9 @@ import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.CollapsingToolbarLayout; import com.google.android.material.floatingactionbutton.FloatingActionButton; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.util.ArrayList; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/style/StoreHouseStyleActivity.java similarity index 97% rename from app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/style/StoreHouseStyleActivity.java index d8cdabf6..b0493d9a 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/style/StoreHouseStyleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.style; +package com.scwang.refresh.layout.activity.style; import android.graphics.Point; import android.os.Bundle; @@ -14,9 +14,9 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshHeader; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.header.StoreHouseHeader; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/style/TaurusStyleActivity.java similarity index 96% rename from app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/style/TaurusStyleActivity.java index 55e5745a..17350367 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/TaurusStyleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/style/TaurusStyleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.style; +package com.scwang.refresh.layout.activity.style; import android.content.res.ColorStateList; import android.os.Bundle; @@ -17,9 +17,9 @@ import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.CollapsingToolbarLayout; import com.google.android.material.floatingactionbutton.FloatingActionButton; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.util.ArrayList; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/style/WaterDropStyleActivity.java similarity index 95% rename from app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/style/WaterDropStyleActivity.java index c09785e8..82efc086 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaterDropStyleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/style/WaterDropStyleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.style; +package com.scwang.refresh.layout.activity.style; import android.os.Bundle; import android.view.View; @@ -13,9 +13,9 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.util.ArrayList; diff --git a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/style/WaveSwipeStyleActivity.java similarity index 95% rename from app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java rename to app/src/main/java/com/scwang/refresh/layout/activity/style/WaveSwipeStyleActivity.java index 2e9f768f..9da77d40 100644 --- a/app/src/main/java/com/scwang/refreshlayout/activity/style/WaveSwipeStyleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/style/WaveSwipeStyleActivity.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.activity.style; +package com.scwang.refresh.layout.activity.style; import android.os.Bundle; import android.view.View; @@ -13,9 +13,9 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.util.ArrayList; diff --git a/app/src/main/java/com/scwang/refreshlayout/adapter/BaseRecyclerAdapter.java b/app/src/main/java/com/scwang/refresh/layout/adapter/BaseRecyclerAdapter.java similarity index 99% rename from app/src/main/java/com/scwang/refreshlayout/adapter/BaseRecyclerAdapter.java rename to app/src/main/java/com/scwang/refresh/layout/adapter/BaseRecyclerAdapter.java index 588fa390..ee6b4dc6 100644 --- a/app/src/main/java/com/scwang/refreshlayout/adapter/BaseRecyclerAdapter.java +++ b/app/src/main/java/com/scwang/refresh/layout/adapter/BaseRecyclerAdapter.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.adapter; +package com.scwang.refresh.layout.adapter; import android.database.DataSetObservable; import android.database.DataSetObserver; diff --git a/app/src/main/java/com/scwang/refreshlayout/adapter/SmartViewHolder.java b/app/src/main/java/com/scwang/refresh/layout/adapter/SmartViewHolder.java similarity index 98% rename from app/src/main/java/com/scwang/refreshlayout/adapter/SmartViewHolder.java rename to app/src/main/java/com/scwang/refresh/layout/adapter/SmartViewHolder.java index 28671507..5dc43844 100644 --- a/app/src/main/java/com/scwang/refreshlayout/adapter/SmartViewHolder.java +++ b/app/src/main/java/com/scwang/refresh/layout/adapter/SmartViewHolder.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.adapter; +package com.scwang.refresh.layout.adapter; import android.content.res.Resources; import android.util.TypedValue; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java b/app/src/main/java/com/scwang/refresh/layout/fragment/example/BottomSheetExampleFragment.java similarity index 94% rename from app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/example/BottomSheetExampleFragment.java index 723f0d73..4b30a7b3 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/BottomSheetExampleFragment.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/example/BottomSheetExampleFragment.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.example; +package com.scwang.refresh.layout.fragment.example; import android.os.Bundle; @@ -16,9 +16,9 @@ import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.bottomsheet.BottomSheetDialog; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; import com.scwang.smart.refresh.header.ClassicsHeader; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/DisallowInterceptExampleFragment.java b/app/src/main/java/com/scwang/refresh/layout/fragment/example/DisallowInterceptExampleFragment.java similarity index 97% rename from app/src/main/java/com/scwang/refreshlayout/fragment/example/DisallowInterceptExampleFragment.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/example/DisallowInterceptExampleFragment.java index 96617a2d..207f2f06 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/DisallowInterceptExampleFragment.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/example/DisallowInterceptExampleFragment.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.example; +package com.scwang.refresh.layout.fragment.example; import android.annotation.SuppressLint; import android.content.Context; @@ -16,7 +16,7 @@ import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; -import com.scwang.refreshlayout.R; +import com.scwang.refresh.layout.R; /** * A simple {@link Fragment} subclass. diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java b/app/src/main/java/com/scwang/refresh/layout/fragment/example/EmptyLayoutExampleFragment.java similarity index 93% rename from app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/example/EmptyLayoutExampleFragment.java index 9eea0188..57f424d3 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragment.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/example/EmptyLayoutExampleFragment.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.example; +package com.scwang.refresh.layout.fragment.example; import android.app.Activity; @@ -18,10 +18,10 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.activity.FragmentActivity; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.activity.FragmentActivity; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.RefreshState; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; @@ -35,8 +35,8 @@ import static android.R.layout.simple_list_item_2; import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; -import static com.scwang.refreshlayout.R.id.recyclerView; -import static com.scwang.refreshlayout.R.id.refreshLayout; +import static com.scwang.refresh.layout.R.id.recyclerView; +import static com.scwang.refresh.layout.R.id.refreshLayout; /** * 使用示例-空布页面 diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java b/app/src/main/java/com/scwang/refresh/layout/fragment/example/EmptyLayoutExampleFragmentInner.java similarity index 92% rename from app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/example/EmptyLayoutExampleFragmentInner.java index b35e15b0..a50116fa 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentInner.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/example/EmptyLayoutExampleFragmentInner.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.example; +package com.scwang.refresh.layout.fragment.example; import android.app.Activity; @@ -20,17 +20,16 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.activity.FragmentActivity; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.refreshlayout.fragment.example.EmptyLayoutExampleFragment.Item; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.activity.FragmentActivity; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.fragment.example.EmptyLayoutExampleFragment.Item; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.listener.OnRefreshListener; import com.scwang.smart.refresh.layout.constant.RefreshState; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; import com.scwang.smart.refresh.header.ClassicsHeader; -import com.scwang.smart.refresh.layout.listener.OnMultiListener; import com.scwang.smart.refresh.layout.simple.SimpleMultiListener; import java.util.ArrayList; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java b/app/src/main/java/com/scwang/refresh/layout/fragment/example/EmptyLayoutExampleFragmentOuter.java similarity index 89% rename from app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/example/EmptyLayoutExampleFragmentOuter.java index 38697668..67ffed27 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/EmptyLayoutExampleFragmentOuter.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/example/EmptyLayoutExampleFragmentOuter.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.example; +package com.scwang.refresh.layout.fragment.example; import android.app.Activity; @@ -20,11 +20,11 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.activity.FragmentActivity; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.refreshlayout.fragment.example.EmptyLayoutExampleFragment.Item; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.activity.FragmentActivity; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.fragment.example.EmptyLayoutExampleFragment.Item; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.constant.SpinnerStyle; import com.scwang.smart.refresh.header.ClassicsHeader; @@ -34,8 +34,8 @@ import static android.R.layout.simple_list_item_2; import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; -import static com.scwang.refreshlayout.R.id.recyclerView; -import static com.scwang.refreshlayout.R.id.refreshLayout; +import static com.scwang.refresh.layout.R.id.recyclerView; +import static com.scwang.refresh.layout.R.id.refreshLayout; /** * 使用示例-空布页面 diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/FlexBoxLayoutManagerFragment.java b/app/src/main/java/com/scwang/refresh/layout/fragment/example/FlexBoxLayoutManagerFragment.java similarity index 94% rename from app/src/main/java/com/scwang/refreshlayout/fragment/example/FlexBoxLayoutManagerFragment.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/example/FlexBoxLayoutManagerFragment.java index 8184da98..422a5c9e 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/FlexBoxLayoutManagerFragment.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/example/FlexBoxLayoutManagerFragment.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.example; +package com.scwang.refresh.layout.fragment.example; import android.os.Bundle; @@ -17,9 +17,9 @@ import com.google.android.flexbox.FlexDirection; import com.google.android.flexbox.FlexWrap; import com.google.android.flexbox.FlexboxLayoutManager; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.util.SmartUtil; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/HorizontalExampleFragment.java b/app/src/main/java/com/scwang/refresh/layout/fragment/example/HorizontalExampleFragment.java similarity index 94% rename from app/src/main/java/com/scwang/refreshlayout/fragment/example/HorizontalExampleFragment.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/example/HorizontalExampleFragment.java index 69fdf984..955860ee 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/HorizontalExampleFragment.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/example/HorizontalExampleFragment.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.example; +package com.scwang.refresh.layout.fragment.example; import android.os.Bundle; @@ -12,9 +12,9 @@ import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java b/app/src/main/java/com/scwang/refresh/layout/fragment/example/NestedScrollExampleFragment.java similarity index 95% rename from app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/example/NestedScrollExampleFragment.java index cfa1d176..d5e1dd67 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragment.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/example/NestedScrollExampleFragment.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.example; +package com.scwang.refresh.layout.fragment.example; import android.app.Activity; @@ -19,10 +19,10 @@ import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.appbar.AppBarLayout; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.activity.FragmentActivity; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.activity.FragmentActivity; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener; import com.scwang.smart.refresh.footer.ClassicsFooter; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java b/app/src/main/java/com/scwang/refresh/layout/fragment/example/NestedScrollExampleFragmentIntegral.java similarity index 88% rename from app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/example/NestedScrollExampleFragmentIntegral.java index cf1ba798..692996c3 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentIntegral.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/example/NestedScrollExampleFragmentIntegral.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.example; +package com.scwang.refresh.layout.fragment.example; import android.content.Context; @@ -22,10 +22,9 @@ import androidx.viewpager2.adapter.FragmentStateAdapter; import androidx.viewpager2.widget.ViewPager2; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.refreshlayout.fragment.example.NestedScrollExampleFragment.Item; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; import com.youth.banner.Banner; @@ -37,8 +36,8 @@ import java.util.List; import static android.R.layout.simple_list_item_2; -import static com.scwang.refreshlayout.R.mipmap.image_weibo_home_1; -import static com.scwang.refreshlayout.R.mipmap.image_weibo_home_2; +import static com.scwang.refresh.layout.R.mipmap.image_weibo_home_1; +import static com.scwang.refresh.layout.R.mipmap.image_weibo_home_2; /** * 使用示例-嵌套滚动-整体 @@ -125,7 +124,7 @@ public int getItemCount() { public static class SmartFragment extends Fragment { private RecyclerView mRecyclerView; - private BaseRecyclerAdapter mAdapter; + private BaseRecyclerAdapter mAdapter; @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { @@ -138,9 +137,9 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat mRecyclerView.setItemAnimator(new DefaultItemAnimator()); mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext())); mRecyclerView.addItemDecoration(new DividerItemDecoration(view.getContext(),DividerItemDecoration.VERTICAL)); - mRecyclerView.setAdapter(mAdapter = new BaseRecyclerAdapter(buildItems(), simple_list_item_2) { + mRecyclerView.setAdapter(mAdapter = new BaseRecyclerAdapter(buildItems(), simple_list_item_2) { @Override - protected void onBindViewHolder(SmartViewHolder holder, Item model, int position) { + protected void onBindViewHolder(SmartViewHolder holder, NestedScrollExampleFragment.Item model, int position) { holder.text(android.R.id.text1, model.name()); holder.text(android.R.id.text2, model.name); holder.textColorId(android.R.id.text2, R.color.colorTextAssistant); @@ -148,10 +147,10 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position }); } - private Collection buildItems() { - List items = new ArrayList<>(); + private Collection buildItems() { + List items = new ArrayList<>(); for (int i = 0; i < 10; i++) { - items.addAll(Arrays.asList(Item.values())); + items.addAll(Arrays.asList(NestedScrollExampleFragment.Item.values())); } return items; } diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java b/app/src/main/java/com/scwang/refresh/layout/fragment/example/NestedScrollExampleFragmentViewPager.java similarity index 96% rename from app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/example/NestedScrollExampleFragmentViewPager.java index 959253fa..9b4d0898 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NestedScrollExampleFragmentViewPager.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/example/NestedScrollExampleFragmentViewPager.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.example; +package com.scwang.refresh.layout.fragment.example; import android.os.Bundle; @@ -19,9 +19,9 @@ import androidx.viewpager2.widget.ViewPager2; import com.google.android.material.appbar.AppBarLayout; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.header.PhoenixHeader; import com.scwang.smart.refresh.layout.SmartRefreshLayout; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NoMoreDataExampleFragment.java b/app/src/main/java/com/scwang/refresh/layout/fragment/example/NoMoreDataExampleFragment.java similarity index 95% rename from app/src/main/java/com/scwang/refreshlayout/fragment/example/NoMoreDataExampleFragment.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/example/NoMoreDataExampleFragment.java index 3fa9ac0f..3b7ac2e2 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/NoMoreDataExampleFragment.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/example/NoMoreDataExampleFragment.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.example; +package com.scwang.refresh.layout.fragment.example; import android.os.Bundle; @@ -13,9 +13,9 @@ import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener; import com.scwang.smart.refresh.layout.listener.OnRefreshListener; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragment.java b/app/src/main/java/com/scwang/refresh/layout/fragment/example/PureScrollExampleFragment.java similarity index 92% rename from app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragment.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/example/PureScrollExampleFragment.java index 4a7c752a..97e38dab 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragment.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/example/PureScrollExampleFragment.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.example; +package com.scwang.refresh.layout.fragment.example; import android.app.Activity; @@ -18,10 +18,10 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.activity.FragmentActivity; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.activity.FragmentActivity; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentFooter.java b/app/src/main/java/com/scwang/refresh/layout/fragment/example/PureScrollExampleFragmentFooter.java similarity index 83% rename from app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentFooter.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/example/PureScrollExampleFragmentFooter.java index 95425f1b..97827f12 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentFooter.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/example/PureScrollExampleFragmentFooter.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.example; +package com.scwang.refresh.layout.fragment.example; import android.app.Activity; @@ -18,11 +18,10 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.activity.FragmentActivity; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.refreshlayout.fragment.example.PureScrollExampleFragment.Item; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.activity.FragmentActivity; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import java.util.Arrays; @@ -61,9 +60,9 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat recyclerView.setItemAnimator(new DefaultItemAnimator()); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); recyclerView.addItemDecoration(new DividerItemDecoration(view.getContext(), VERTICAL)); - recyclerView.setAdapter(new BaseRecyclerAdapter(Arrays.asList(Item.values()), simple_list_item_2,this) { + recyclerView.setAdapter(new BaseRecyclerAdapter(Arrays.asList(PureScrollExampleFragment.Item.values()), simple_list_item_2,this) { @Override - protected void onBindViewHolder(SmartViewHolder holder, Item model, int position) { + protected void onBindViewHolder(SmartViewHolder holder, PureScrollExampleFragment.Item model, int position) { holder.text(android.R.id.text1, model.name()); holder.text(android.R.id.text2, model.name); holder.textColorId(android.R.id.text2, R.color.colorTextAssistant); @@ -74,7 +73,7 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position @Override public void onItemClick(AdapterView parent, View view, int position, long id) { - Item item = Item.values()[position]; + PureScrollExampleFragment.Item item = PureScrollExampleFragment.Item.values()[position]; if (Activity.class.isAssignableFrom(item.clazz)) { startActivity(new Intent(getContext(), item.clazz)); } else if (Fragment.class.isAssignableFrom(item.clazz)) { diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java b/app/src/main/java/com/scwang/refresh/layout/fragment/example/PureScrollExampleFragmentHeader.java similarity index 82% rename from app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/example/PureScrollExampleFragmentHeader.java index 87a14c72..ddcbdea0 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/PureScrollExampleFragmentHeader.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/example/PureScrollExampleFragmentHeader.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.example; +package com.scwang.refresh.layout.fragment.example; import android.app.Activity; @@ -18,11 +18,10 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.activity.FragmentActivity; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.refreshlayout.fragment.example.PureScrollExampleFragment.Item; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.activity.FragmentActivity; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.header.FalsifyHeader; @@ -58,9 +57,9 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat recyclerView.setItemAnimator(new DefaultItemAnimator()); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); recyclerView.addItemDecoration(new DividerItemDecoration(root.getContext(), VERTICAL)); - recyclerView.setAdapter(new BaseRecyclerAdapter(Arrays.asList(Item.values()), simple_list_item_2,this) { + recyclerView.setAdapter(new BaseRecyclerAdapter(Arrays.asList(PureScrollExampleFragment.Item.values()), simple_list_item_2,this) { @Override - protected void onBindViewHolder(SmartViewHolder holder, Item model, int position) { + protected void onBindViewHolder(SmartViewHolder holder, PureScrollExampleFragment.Item model, int position) { holder.text(android.R.id.text1, model.name()); holder.text(android.R.id.text2, model.name); holder.textColorId(android.R.id.text2, R.color.colorTextAssistant); @@ -71,7 +70,7 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position @Override public void onItemClick(AdapterView parent, View view, int position, long id) { - Item item = Item.values()[position]; + PureScrollExampleFragment.Item item = PureScrollExampleFragment.Item.values()[position]; if (Activity.class.isAssignableFrom(item.clazz)) { startActivity(new Intent(getContext(), item.clazz)); } else if (Fragment.class.isAssignableFrom(item.clazz)) { diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/SpecifyStyleExampleFragment.java b/app/src/main/java/com/scwang/refresh/layout/fragment/example/SpecifyStyleExampleFragment.java similarity index 86% rename from app/src/main/java/com/scwang/refreshlayout/fragment/example/SpecifyStyleExampleFragment.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/example/SpecifyStyleExampleFragment.java index 49457cb3..868de2f7 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/SpecifyStyleExampleFragment.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/example/SpecifyStyleExampleFragment.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.example; +package com.scwang.refresh.layout.fragment.example; import android.app.Activity; @@ -18,13 +18,13 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.activity.FragmentActivity; -import com.scwang.refreshlayout.activity.example.AssignCodeExampleActivity; -import com.scwang.refreshlayout.activity.example.AssignDefaultExampleActivity; -import com.scwang.refreshlayout.activity.example.AssignXmlExampleActivity; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.activity.FragmentActivity; +import com.scwang.refresh.layout.activity.example.AssignCodeExampleActivity; +import com.scwang.refresh.layout.activity.example.AssignDefaultExampleActivity; +import com.scwang.refresh.layout.activity.example.AssignXmlExampleActivity; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import java.util.Arrays; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/StaggeredGridExampleFragment.java b/app/src/main/java/com/scwang/refresh/layout/fragment/example/StaggeredGridExampleFragment.java similarity index 94% rename from app/src/main/java/com/scwang/refreshlayout/fragment/example/StaggeredGridExampleFragment.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/example/StaggeredGridExampleFragment.java index 9761ae46..28a07e3e 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/StaggeredGridExampleFragment.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/example/StaggeredGridExampleFragment.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.example; +package com.scwang.refresh.layout.fragment.example; import android.os.Bundle; import android.view.LayoutInflater; @@ -11,9 +11,9 @@ import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java b/app/src/main/java/com/scwang/refresh/layout/fragment/example/ViewPagerExampleFragment.java similarity index 97% rename from app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/example/ViewPagerExampleFragment.java index ebd0401a..dfb2cfe1 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/example/ViewPagerExampleFragment.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/example/ViewPagerExampleFragment.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.example; +package com.scwang.refresh.layout.fragment.example; import android.os.Bundle; @@ -21,9 +21,9 @@ import com.google.android.material.tabs.TabLayout; import com.google.android.material.tabs.TabLayoutMediator; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.listener.OnRefreshListener; import com.scwang.smart.refresh.footer.ClassicsFooter; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java b/app/src/main/java/com/scwang/refresh/layout/fragment/index/RefreshExampleFragment.java similarity index 73% rename from app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/index/RefreshExampleFragment.java index 4175298e..4cf0e9fe 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshExampleFragment.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/index/RefreshExampleFragment.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.index; +package com.scwang.refresh.layout.fragment.index; import android.app.Activity; @@ -18,28 +18,28 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.activity.FragmentActivity; -import com.scwang.refreshlayout.activity.example.BasicExampleActivity; -import com.scwang.refreshlayout.activity.example.CustomExampleActivity; -import com.scwang.refreshlayout.activity.example.I18nExampleActivity; -import com.scwang.refreshlayout.activity.example.ListenerExampleActivity; -import com.scwang.refreshlayout.activity.example.NestedLayoutExampleActivity; -import com.scwang.refreshlayout.activity.example.SnapHelperExampleActivity; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.refreshlayout.fragment.example.BottomSheetExampleFragment; -import com.scwang.refreshlayout.fragment.example.DisallowInterceptExampleFragment; -import com.scwang.refreshlayout.fragment.example.EmptyLayoutExampleFragment; -import com.scwang.refreshlayout.fragment.example.FlexBoxLayoutManagerFragment; -import com.scwang.refreshlayout.fragment.example.HorizontalExampleFragment; -import com.scwang.refreshlayout.fragment.example.NestedScrollExampleFragment; -import com.scwang.refreshlayout.fragment.example.NoMoreDataExampleFragment; -import com.scwang.refreshlayout.fragment.example.PureScrollExampleFragment; -import com.scwang.refreshlayout.fragment.example.SpecifyStyleExampleFragment; -import com.scwang.refreshlayout.fragment.example.StaggeredGridExampleFragment; -import com.scwang.refreshlayout.fragment.example.ViewPagerExampleFragment; -import com.scwang.refreshlayout.util.StatusBarUtil; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.activity.FragmentActivity; +import com.scwang.refresh.layout.activity.example.BasicExampleActivity; +import com.scwang.refresh.layout.activity.example.CustomExampleActivity; +import com.scwang.refresh.layout.activity.example.I18nExampleActivity; +import com.scwang.refresh.layout.activity.example.ListenerExampleActivity; +import com.scwang.refresh.layout.activity.example.NestedLayoutExampleActivity; +import com.scwang.refresh.layout.activity.example.SnapHelperExampleActivity; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.fragment.example.BottomSheetExampleFragment; +import com.scwang.refresh.layout.fragment.example.DisallowInterceptExampleFragment; +import com.scwang.refresh.layout.fragment.example.EmptyLayoutExampleFragment; +import com.scwang.refresh.layout.fragment.example.FlexBoxLayoutManagerFragment; +import com.scwang.refresh.layout.fragment.example.HorizontalExampleFragment; +import com.scwang.refresh.layout.fragment.example.NestedScrollExampleFragment; +import com.scwang.refresh.layout.fragment.example.NoMoreDataExampleFragment; +import com.scwang.refresh.layout.fragment.example.PureScrollExampleFragment; +import com.scwang.refresh.layout.fragment.example.SpecifyStyleExampleFragment; +import com.scwang.refresh.layout.fragment.example.StaggeredGridExampleFragment; +import com.scwang.refresh.layout.fragment.example.ViewPagerExampleFragment; +import com.scwang.refresh.layout.util.StatusBarUtil; import java.util.Arrays; @@ -65,7 +65,7 @@ private enum Item { I18N(R.string.index_example_custom, I18nExampleActivity.class), SnapHelper(R.string.index_example_snap_helper, SnapHelperExampleActivity.class), ViewPager(R.string.index_example_pager, ViewPagerExampleFragment.class), - BottomSheet(R.string.index_example_bottom_sheet,BottomSheetExampleFragment.class), + BottomSheet(R.string.index_example_bottom_sheet, BottomSheetExampleFragment.class), FlexBoxLayout(R.string.index_example_flex_box, FlexBoxLayoutManagerFragment.class), Horizontal(R.string.index_example_horizontal, HorizontalExampleFragment.class), DisallowIntercept(R.string.index_example_disallow_intercept, DisallowInterceptExampleFragment.class), diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java b/app/src/main/java/com/scwang/refresh/layout/fragment/index/RefreshPracticeFragment.java similarity index 80% rename from app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/index/RefreshPracticeFragment.java index 3ca53d41..34fb5808 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshPracticeFragment.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/index/RefreshPracticeFragment.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.index; +package com.scwang.refresh.layout.fragment.index; import android.app.Activity; @@ -18,20 +18,20 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.activity.FragmentActivity; -import com.scwang.refreshlayout.activity.practice.BannerPracticeActivity; -import com.scwang.refreshlayout.activity.practice.FeedListPracticeActivity; -import com.scwang.refreshlayout.activity.practice.ProfilePracticeActivity; -import com.scwang.refreshlayout.activity.practice.QQBrowserPracticeActivity; -import com.scwang.refreshlayout.activity.practice.RepastPracticeActivity; -import com.scwang.refreshlayout.activity.practice.WebViewPracticeActivity; -import com.scwang.refreshlayout.activity.practice.WeiboPracticeActivity; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.refreshlayout.fragment.practice.InstantPracticeFragment; -import com.scwang.refreshlayout.fragment.practice.SecondFloorPracticeFragment; -import com.scwang.refreshlayout.util.StatusBarUtil; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.activity.FragmentActivity; +import com.scwang.refresh.layout.activity.practice.BannerPracticeActivity; +import com.scwang.refresh.layout.activity.practice.FeedListPracticeActivity; +import com.scwang.refresh.layout.activity.practice.ProfilePracticeActivity; +import com.scwang.refresh.layout.activity.practice.QQBrowserPracticeActivity; +import com.scwang.refresh.layout.activity.practice.RepastPracticeActivity; +import com.scwang.refresh.layout.activity.practice.WebViewPracticeActivity; +import com.scwang.refresh.layout.activity.practice.WeiboPracticeActivity; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.fragment.practice.InstantPracticeFragment; +import com.scwang.refresh.layout.fragment.practice.SecondFloorPracticeFragment; +import com.scwang.refresh.layout.util.StatusBarUtil; import com.scwang.smart.refresh.layout.SmartRefreshLayout; import com.scwang.smart.refresh.layout.api.RefreshLayout; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshStylesFragment.java b/app/src/main/java/com/scwang/refresh/layout/fragment/index/RefreshStylesFragment.java similarity index 86% rename from app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshStylesFragment.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/index/RefreshStylesFragment.java index 4de1e6fb..b1a224ff 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/index/RefreshStylesFragment.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/index/RefreshStylesFragment.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.index; +package com.scwang.refresh.layout.fragment.index; import android.content.Intent; import android.os.Bundle; @@ -16,24 +16,24 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.activity.style.BezierCircleStyleActivity; -import com.scwang.refreshlayout.activity.style.BezierRadarStyleActivity; -import com.scwang.refreshlayout.activity.style.ClassicsStyleActivity; -import com.scwang.refreshlayout.activity.style.DeliveryStyleActivity; -import com.scwang.refreshlayout.activity.style.DropBoxStyleActivity; -import com.scwang.refreshlayout.activity.style.FlyRefreshStyleActivity; -import com.scwang.refreshlayout.activity.style.FunGameBattleCityStyleActivity; -import com.scwang.refreshlayout.activity.style.FunGameHitBlockStyleActivity; -import com.scwang.refreshlayout.activity.style.MaterialStyleActivity; -import com.scwang.refreshlayout.activity.style.PhoenixStyleActivity; -import com.scwang.refreshlayout.activity.style.StoreHouseStyleActivity; -import com.scwang.refreshlayout.activity.style.TaurusStyleActivity; -import com.scwang.refreshlayout.activity.style.WaterDropStyleActivity; -import com.scwang.refreshlayout.activity.style.WaveSwipeStyleActivity; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.refreshlayout.util.StatusBarUtil; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.activity.style.BezierCircleStyleActivity; +import com.scwang.refresh.layout.activity.style.BezierRadarStyleActivity; +import com.scwang.refresh.layout.activity.style.ClassicsStyleActivity; +import com.scwang.refresh.layout.activity.style.DeliveryStyleActivity; +import com.scwang.refresh.layout.activity.style.DropBoxStyleActivity; +import com.scwang.refresh.layout.activity.style.FlyRefreshStyleActivity; +import com.scwang.refresh.layout.activity.style.FunGameBattleCityStyleActivity; +import com.scwang.refresh.layout.activity.style.FunGameHitBlockStyleActivity; +import com.scwang.refresh.layout.activity.style.MaterialStyleActivity; +import com.scwang.refresh.layout.activity.style.PhoenixStyleActivity; +import com.scwang.refresh.layout.activity.style.StoreHouseStyleActivity; +import com.scwang.refresh.layout.activity.style.TaurusStyleActivity; +import com.scwang.refresh.layout.activity.style.WaterDropStyleActivity; +import com.scwang.refresh.layout.activity.style.WaveSwipeStyleActivity; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.util.StatusBarUtil; import com.scwang.smart.refresh.footer.BallPulseFooter; import com.scwang.smart.refresh.header.BezierCircleHeader; import com.scwang.smart.refresh.header.ClassicsHeader; @@ -55,7 +55,7 @@ import static android.R.layout.simple_list_item_2; import static androidx.recyclerview.widget.DividerItemDecoration.VERTICAL; -import static com.scwang.refreshlayout.R.id.recyclerView; +import static com.scwang.refresh.layout.R.id.recyclerView; /** * 风格展示 @@ -64,7 +64,7 @@ public class RefreshStylesFragment extends Fragment implements AdapterView.OnItemClickListener { private enum Item { - Hidden(R.string.title_activity_style_delivery,DeliveryStyleActivity.class), + Hidden(R.string.title_activity_style_delivery, DeliveryStyleActivity.class), Delivery(R.string.title_activity_style_delivery,DeliveryStyleActivity.class), DropBox(R.string.title_activity_style_drop_box, DropBoxStyleActivity.class), WaveSwipe(R.string.title_activity_style_wave_swipe, WaveSwipeStyleActivity.class), diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java b/app/src/main/java/com/scwang/refresh/layout/fragment/practice/InstantPracticeFragment.java similarity index 97% rename from app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/practice/InstantPracticeFragment.java index fb143563..ad2b9693 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/InstantPracticeFragment.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/practice/InstantPracticeFragment.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.practice; +package com.scwang.refresh.layout.fragment.practice; import android.os.Bundle; @@ -12,10 +12,10 @@ import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.refreshlayout.util.DynamicTimeFormat; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.util.DynamicTimeFormat; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener; import com.scwang.smart.refresh.footer.ClassicsFooter; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java b/app/src/main/java/com/scwang/refresh/layout/fragment/practice/SecondFloorPracticeFragment.java similarity index 95% rename from app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/practice/SecondFloorPracticeFragment.java index 719ae233..397b3384 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/SecondFloorPracticeFragment.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/practice/SecondFloorPracticeFragment.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.practice; +package com.scwang.refresh.layout.fragment.practice; import android.os.Bundle; import android.view.LayoutInflater; @@ -12,10 +12,10 @@ import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.RecyclerView; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter; -import com.scwang.refreshlayout.adapter.SmartViewHolder; -import com.scwang.refreshlayout.util.StatusBarUtil; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.adapter.BaseRecyclerAdapter; +import com.scwang.refresh.layout.adapter.SmartViewHolder; +import com.scwang.refresh.layout.util.StatusBarUtil; import com.scwang.smart.refresh.header.listener.OnTwoLevelListener; import com.scwang.smart.refresh.header.TwoLevelHeader; import com.scwang.smart.refresh.layout.api.RefreshHeader; diff --git a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java b/app/src/main/java/com/scwang/refresh/layout/fragment/practice/TwoLevelPracticeFragment.java similarity index 94% rename from app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java rename to app/src/main/java/com/scwang/refresh/layout/fragment/practice/TwoLevelPracticeFragment.java index 8c4dba43..564b8be2 100644 --- a/app/src/main/java/com/scwang/refreshlayout/fragment/practice/TwoLevelPracticeFragment.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/practice/TwoLevelPracticeFragment.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.fragment.practice; +package com.scwang.refresh.layout.fragment.practice; import android.os.Bundle; import android.view.LayoutInflater; @@ -11,8 +11,8 @@ import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; -import com.scwang.refreshlayout.R; -import com.scwang.refreshlayout.util.StatusBarUtil; +import com.scwang.refresh.layout.R; +import com.scwang.refresh.layout.util.StatusBarUtil; import com.scwang.smart.refresh.header.listener.OnTwoLevelListener; import com.scwang.smart.refresh.header.TwoLevelHeader; import com.scwang.smart.refresh.layout.api.RefreshLayout; diff --git a/app/src/main/java/com/scwang/refreshlayout/util/DynamicTimeFormat.java b/app/src/main/java/com/scwang/refresh/layout/util/DynamicTimeFormat.java similarity index 99% rename from app/src/main/java/com/scwang/refreshlayout/util/DynamicTimeFormat.java rename to app/src/main/java/com/scwang/refresh/layout/util/DynamicTimeFormat.java index 028803d7..dd66665a 100644 --- a/app/src/main/java/com/scwang/refreshlayout/util/DynamicTimeFormat.java +++ b/app/src/main/java/com/scwang/refresh/layout/util/DynamicTimeFormat.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.util; +package com.scwang.refresh.layout.util; import androidx.annotation.NonNull; diff --git a/app/src/main/java/com/scwang/refreshlayout/util/StatusBarUtil.java b/app/src/main/java/com/scwang/refresh/layout/util/StatusBarUtil.java similarity index 99% rename from app/src/main/java/com/scwang/refreshlayout/util/StatusBarUtil.java rename to app/src/main/java/com/scwang/refresh/layout/util/StatusBarUtil.java index 53d1bfb3..0b410e6a 100644 --- a/app/src/main/java/com/scwang/refreshlayout/util/StatusBarUtil.java +++ b/app/src/main/java/com/scwang/refresh/layout/util/StatusBarUtil.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.util; +package com.scwang.refresh.layout.util; import android.app.Activity; import android.content.Context; diff --git a/app/src/main/java/com/scwang/refreshlayout/widget/RefreshContentHorizontal.java b/app/src/main/java/com/scwang/refresh/layout/widget/RefreshContentHorizontal.java similarity index 97% rename from app/src/main/java/com/scwang/refreshlayout/widget/RefreshContentHorizontal.java rename to app/src/main/java/com/scwang/refresh/layout/widget/RefreshContentHorizontal.java index 30f4e0d0..d65b97be 100644 --- a/app/src/main/java/com/scwang/refreshlayout/widget/RefreshContentHorizontal.java +++ b/app/src/main/java/com/scwang/refresh/layout/widget/RefreshContentHorizontal.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.widget; +package com.scwang.refresh.layout.widget; import android.animation.ValueAnimator; import android.view.View; diff --git a/app/src/main/java/com/scwang/refreshlayout/widget/ScrollBoundaryHorizontal.java b/app/src/main/java/com/scwang/refresh/layout/widget/ScrollBoundaryHorizontal.java similarity index 98% rename from app/src/main/java/com/scwang/refreshlayout/widget/ScrollBoundaryHorizontal.java rename to app/src/main/java/com/scwang/refresh/layout/widget/ScrollBoundaryHorizontal.java index f6285f13..ae480a8a 100644 --- a/app/src/main/java/com/scwang/refreshlayout/widget/ScrollBoundaryHorizontal.java +++ b/app/src/main/java/com/scwang/refresh/layout/widget/ScrollBoundaryHorizontal.java @@ -1,4 +1,4 @@ -package com.scwang.refreshlayout.widget; +package com.scwang.refresh.layout.widget; import android.graphics.PointF; import android.view.View; diff --git a/app/src/main/java/com/scwang/refreshlayout/widget/SmartRefreshHorizontal.java b/app/src/main/java/com/scwang/refresh/layout/widget/SmartRefreshHorizontal.java similarity index 96% rename from app/src/main/java/com/scwang/refreshlayout/widget/SmartRefreshHorizontal.java rename to app/src/main/java/com/scwang/refresh/layout/widget/SmartRefreshHorizontal.java index 68471291..ce8975cc 100644 --- a/app/src/main/java/com/scwang/refreshlayout/widget/SmartRefreshHorizontal.java +++ b/app/src/main/java/com/scwang/refresh/layout/widget/SmartRefreshHorizontal.java @@ -1,13 +1,12 @@ -package com.scwang.refreshlayout.widget; +package com.scwang.refresh.layout.widget; import android.content.Context; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; -import com.scwang.refreshlayout.R; +import com.scwang.refresh.layout.R; import com.scwang.smart.refresh.layout.api.RefreshComponent; -import com.scwang.smart.refresh.layout.listener.ScrollBoundaryDecider; import com.scwang.smart.refresh.layout.simple.SimpleBoundaryDecider; import com.scwang.smart.refresh.layout.SmartRefreshLayout; diff --git a/app/src/main/res/layout/activity_example_assign_code.xml b/app/src/main/res/layout/activity_example_assign_code.xml index 274a8e58..87671281 100644 --- a/app/src/main/res/layout/activity_example_assign_code.xml +++ b/app/src/main/res/layout/activity_example_assign_code.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - tools:context="com.scwang.refreshlayout.activity.example.AssignCodeExampleActivity"> + tools:context="com.scwang.refresh.layout.activity.example.AssignCodeExampleActivity"> + tools:context="com.scwang.refresh.layout.activity.example.AssignDefaultExampleActivity"> + tools:context="com.scwang.refresh.layout.activity.example.AssignDefaultExampleActivity"> + tools:context="com.scwang.refresh.layout.activity.example.BasicExampleActivity"> + tools:context="com.scwang.refresh.layout.activity.example.CustomExampleActivity"> + tools:context="com.scwang.refresh.layout.activity.example.I18nExampleActivity"> + tools:context="com.scwang.refresh.layout.activity.example.ListenerExampleActivity"> + tools:context="com.scwang.refresh.layout.activity.example.OverScrollExampleActivity"> + tools:context="com.scwang.refresh.layout.activity.example.NestedLayoutExampleActivity"> + tools:context="com.scwang.refresh.layout.activity.example.SnapHelperExampleActivity"> + tools:context="com.scwang.refresh.layout.activity.style.FlyRefreshStyleActivity"> + tools:context="com.scwang.refresh.layout.activity.IndexMainActivity"> + tools:context="com.scwang.refresh.layout.activity.practice.BannerPracticeActivity"> + tools:context="com.scwang.refresh.layout.activity.practice.FeedListPracticeActivity"> + tools:context="com.scwang.refresh.layout.activity.practice.ProfilePracticeActivity"> + tools:context="com.scwang.refresh.layout.activity.practice.QQBrowserPracticeActivity"> + tools:context="com.scwang.refresh.layout.activity.practice.RepastPracticeActivity"> + tools:context="com.scwang.refresh.layout.activity.practice.WebViewPracticeActivity"> + tools:context="com.scwang.refresh.layout.activity.practice.WeiboPracticeActivity"> + tools:context="com.scwang.refresh.layout.activity.style.PhoenixStyleActivity"> + tools:context="com.scwang.refresh.layout.activity.style.TaurusStyleActivity"> + tools:context="com.scwang.refresh.layout.activity.style.WaveSwipeStyleActivity"> + tools:context="com.scwang.refresh.layout.fragment.example.PureScrollExampleFragment"> + tools:context="com.scwang.refresh.layout.fragment.example.PureScrollExampleFragment"> + tools:context="com.scwang.refresh.layout.fragment.example.BottomSheetExampleFragment"> + tools:context="com.scwang.refresh.layout.fragment.example.DisallowInterceptExampleFragment"> - + tools:context="com.scwang.refresh.layout.fragment.example.EmptyLayoutExampleFragment"> + tools:context="com.scwang.refresh.layout.fragment.example.EmptyLayoutExampleFragmentInner"> + tools:context="com.scwang.refresh.layout.fragment.example.EmptyLayoutExampleFragmentOuter"> + tools:context="com.scwang.refresh.layout.fragment.example.HorizontalExampleFragment"> - - + diff --git a/app/src/main/res/layout/fragment_example_nestedscroll.xml b/app/src/main/res/layout/fragment_example_nestedscroll.xml index b0be77d3..4aaa89f3 100644 --- a/app/src/main/res/layout/fragment_example_nestedscroll.xml +++ b/app/src/main/res/layout/fragment_example_nestedscroll.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context="com.scwang.refreshlayout.fragment.example.NestedScrollExampleFragment"> + tools:context="com.scwang.refresh.layout.fragment.example.NestedScrollExampleFragment"> + tools:context="com.scwang.refresh.layout.fragment.example.NestedScrollExampleFragmentIntegral"> + tools:context="com.scwang.refresh.layout.fragment.example.NestedScrollExampleFragmentViewPager"> + tools:context="com.scwang.refresh.layout.fragment.example.PureScrollExampleFragment"> + tools:context="com.scwang.refresh.layout.fragment.example.PureScrollExampleFragmentHeader"> + tools:context="com.scwang.refresh.layout.fragment.example.StaggeredGridExampleFragment"> + tools:context="com.scwang.refresh.layout.fragment.example.ViewPagerExampleFragment"> + tools:context="com.scwang.refresh.layout.fragment.example.FlexBoxLayoutManagerFragment"> + tools:context="com.scwang.refresh.layout.fragment.example.NoMoreDataExampleFragment"> + tools:context="com.scwang.refresh.layout.fragment.practice.InstantPracticeFragment"> + tools:context="com.scwang.refresh.layout.fragment.practice.SecondFloorPracticeFragment"> + tools:context="com.scwang.refresh.layout.fragment.practice.TwoLevelPracticeFragment"> + tools:context="com.scwang.refresh.layout.fragment.index.RefreshExampleFragment"> + tools:context="com.scwang.refresh.layout.fragment.index.RefreshPracticeFragment"> + tools:context="com.scwang.refresh.layout.fragment.index.RefreshStylesFragment"> + tools:context="com.scwang.refresh.layout.activity.example.ListenerExampleActivity"> Date: Thu, 14 Nov 2024 11:38:24 +0800 Subject: [PATCH 64/67] =?UTF-8?q?=E8=B0=83=E6=95=B4=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=20=E5=8C=85=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/scwang/refresh/ExampleInstrumentedTest.java | 2 +- .../refresh}/footer/ExampleInstrumentedTest.java | 2 +- .../java/com/scwang/smartrefresh/footer/ExampleUnitTest.java | 2 +- .../com/scwang/smart/refresh/header/fungame/FunGameView.java | 2 +- .../{smartrefresh => smart/refresh}/layout/ExampleUnitTest.java | 2 +- .../refresh}/layout/ExampleInstrumentedTest.java | 2 +- .../{smartrefresh => smart/refresh}/layout/ExampleUnitTest.java | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) rename refresh-footer/src/androidTest/java/com/scwang/{smartrefresh => smart/refresh}/footer/ExampleInstrumentedTest.java (94%) rename refresh-layout-kernel/src/test/java/com/scwang/{smartrefresh => smart/refresh}/layout/ExampleUnitTest.java (89%) rename refresh-layout/src/androidTest/java/com/scwang/{smartrefresh => smart/refresh}/layout/ExampleInstrumentedTest.java (94%) rename refresh-layout/src/test/java/com/scwang/{smartrefresh => smart/refresh}/layout/ExampleUnitTest.java (89%) diff --git a/app/src/androidTest/java/com/scwang/refresh/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/scwang/refresh/ExampleInstrumentedTest.java index 08e6f982..dcd00451 100644 --- a/app/src/androidTest/java/com/scwang/refresh/ExampleInstrumentedTest.java +++ b/app/src/androidTest/java/com/scwang/refresh/ExampleInstrumentedTest.java @@ -22,6 +22,6 @@ public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); - assertEquals("com.scwang.refreshlayout", appContext.getPackageName()); + assertEquals("com.scwang.refresh.layout", appContext.getPackageName()); } } diff --git a/refresh-footer/src/androidTest/java/com/scwang/smartrefresh/footer/ExampleInstrumentedTest.java b/refresh-footer/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java similarity index 94% rename from refresh-footer/src/androidTest/java/com/scwang/smartrefresh/footer/ExampleInstrumentedTest.java rename to refresh-footer/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java index e5380ecc..bbaf8c5e 100644 --- a/refresh-footer/src/androidTest/java/com/scwang/smartrefresh/footer/ExampleInstrumentedTest.java +++ b/refresh-footer/src/androidTest/java/com/scwang/smart/refresh/footer/ExampleInstrumentedTest.java @@ -1,4 +1,4 @@ -package com.scwang.smartrefresh.footer; +package com.scwang.smart.refresh.footer; import android.content.Context; diff --git a/refresh-footer/src/test/java/com/scwang/smartrefresh/footer/ExampleUnitTest.java b/refresh-footer/src/test/java/com/scwang/smartrefresh/footer/ExampleUnitTest.java index 0270426c..02e49e2c 100644 --- a/refresh-footer/src/test/java/com/scwang/smartrefresh/footer/ExampleUnitTest.java +++ b/refresh-footer/src/test/java/com/scwang/smartrefresh/footer/ExampleUnitTest.java @@ -1,4 +1,4 @@ -package com.scwang.smartrefresh.footer; +package com.scwang.smart.refresh.footer; import org.junit.Test; diff --git a/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameView.java b/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameView.java index c439a09f..cf8d8d1b 100644 --- a/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameView.java +++ b/refresh-header/src/main/java/com/scwang/smart/refresh/header/fungame/FunGameView.java @@ -393,7 +393,7 @@ public void onStateChanged(@NonNull RefreshLayout refreshLayout, @NonNull Refres mMaskViewTop.setText(mMaskTextTopRelease); break; // case ReleaseToTwoLevel: -// mMaskViewTop.setText(com.scwang.smartrefresh.layout.R.string.srl_header_secondary); +// mMaskViewTop.setText(com.scwang.smart.refresh.layout.R.string.srl_header_secondary); // break; } } diff --git a/refresh-layout-kernel/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java b/refresh-layout-kernel/src/test/java/com/scwang/smart/refresh/layout/ExampleUnitTest.java similarity index 89% rename from refresh-layout-kernel/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java rename to refresh-layout-kernel/src/test/java/com/scwang/smart/refresh/layout/ExampleUnitTest.java index 200a432e..2b5ddfec 100644 --- a/refresh-layout-kernel/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java +++ b/refresh-layout-kernel/src/test/java/com/scwang/smart/refresh/layout/ExampleUnitTest.java @@ -1,4 +1,4 @@ -package com.scwang.smartrefresh.layout; +package com.scwang.smart.refresh.layout; import org.junit.Test; diff --git a/refresh-layout/src/androidTest/java/com/scwang/smartrefresh/layout/ExampleInstrumentedTest.java b/refresh-layout/src/androidTest/java/com/scwang/smart/refresh/layout/ExampleInstrumentedTest.java similarity index 94% rename from refresh-layout/src/androidTest/java/com/scwang/smartrefresh/layout/ExampleInstrumentedTest.java rename to refresh-layout/src/androidTest/java/com/scwang/smart/refresh/layout/ExampleInstrumentedTest.java index da2dcbc8..d1361457 100644 --- a/refresh-layout/src/androidTest/java/com/scwang/smartrefresh/layout/ExampleInstrumentedTest.java +++ b/refresh-layout/src/androidTest/java/com/scwang/smart/refresh/layout/ExampleInstrumentedTest.java @@ -1,4 +1,4 @@ -package com.scwang.smartrefresh.layout; +package com.scwang.smart.refresh.layout; import android.content.Context; diff --git a/refresh-layout/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java b/refresh-layout/src/test/java/com/scwang/smart/refresh/layout/ExampleUnitTest.java similarity index 89% rename from refresh-layout/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java rename to refresh-layout/src/test/java/com/scwang/smart/refresh/layout/ExampleUnitTest.java index 200a432e..2b5ddfec 100644 --- a/refresh-layout/src/test/java/com/scwang/smartrefresh/layout/ExampleUnitTest.java +++ b/refresh-layout/src/test/java/com/scwang/smart/refresh/layout/ExampleUnitTest.java @@ -1,4 +1,4 @@ -package com.scwang.smartrefresh.layout; +package com.scwang.smart.refresh.layout; import org.junit.Test; From dd068bb7b926e4075fc5521d18b2b3aadc30fef6 Mon Sep 17 00:00:00 2001 From: wsc Date: Sun, 17 Nov 2024 11:51:04 +0800 Subject: [PATCH 65/67] =?UTF-8?q?=E5=88=A0=E9=99=A4=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=97=A0=E6=95=88=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/activity/FragmentActivity.java | 1 - .../example/CustomExampleActivity.java | 9 ----- .../example/ListenerExampleActivity.java | 40 ------------------- .../practice/WeiboPracticeActivity.java | 12 ------ .../activity/style/ClassicsStyleActivity.java | 19 --------- .../style/FlyRefreshStyleActivity.java | 12 ------ .../practice/SecondFloorPracticeFragment.java | 7 ---- .../refresh/layout/api/RefreshComponent.java | 14 +++---- .../refresh/layout/api/RefreshFooter.java | 2 +- .../listener/OnStateChangedListener.java | 2 +- 10 files changed, 9 insertions(+), 109 deletions(-) diff --git a/app/src/main/java/com/scwang/refresh/layout/activity/FragmentActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/FragmentActivity.java index 42d7fb7e..187a9561 100644 --- a/app/src/main/java/com/scwang/refresh/layout/activity/FragmentActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/FragmentActivity.java @@ -75,7 +75,6 @@ protected void replaceFragment() { transaction.commit(); } catch (Exception e) { e.printStackTrace(); -// AfExceptionHandler.handle(e, "AfFragmentActivity Fragment 类型错误:" + mFragmentClazz); } } diff --git a/app/src/main/java/com/scwang/refresh/layout/activity/example/CustomExampleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/example/CustomExampleActivity.java index 7f3a9e0a..3946699a 100644 --- a/app/src/main/java/com/scwang/refresh/layout/activity/example/CustomExampleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/example/CustomExampleActivity.java @@ -171,15 +171,6 @@ public void onMoving(boolean isDragging, float percent, int offset, int height, } -// @Override -// public void onPulling(float percent, int offset, int height, int maxDragHeight) { -// -// } -// @Override -// public void onReleasing(float percent, int offset, int height, int maxDragHeight) { -// -// } - @Override public void onReleased(@NonNull RefreshLayout refreshLayout, int height, int maxDragHeight) { diff --git a/app/src/main/java/com/scwang/refresh/layout/activity/example/ListenerExampleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/example/ListenerExampleActivity.java index dfdaefd5..1af3b8fb 100644 --- a/app/src/main/java/com/scwang/refresh/layout/activity/example/ListenerExampleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/example/ListenerExampleActivity.java @@ -29,11 +29,7 @@ public class ListenerExampleActivity extends AppCompatActivity { private TextView mTvContent; private String mHeaderMoving; -// private String mHeaderPulling; -// private String mHeaderReleasing; private String mFooterMoving; -// private String mFooterPulling; -// private String mFooterReleasing; private String mFooterStartAnimator; private String mHeaderStartAnimator; private String mFooterFinish; @@ -66,22 +62,6 @@ public void onHeaderMoving(RefreshHeader header, boolean isDragging, float perce updateContent(); } -// @Override -// public void onHeaderPulling(@NonNull RefreshHeader header, float percent, int offset, int headerHeight, int maxDragHeight) { -// mHeaderPulling = String.format(Locale.CHINA, "%s\npercent=%.02f offset=%03d\nheight=%03d extend=%03d", -// FORMAT.format(new Date()), -// percent,offset,headerHeight,maxDragHeight); -// updateContent(); -// } -// -// @Override -// public void onHeaderReleasing(@NonNull RefreshHeader header, float percent, int offset, int headerHeight, int maxDragHeight) { -// mHeaderReleasing = String.format(Locale.CHINA, "%s\npercent=%.02f offset=%03d\nheight=%03d extend=%03d", -// FORMAT.format(new Date()), -// percent,offset,headerHeight,maxDragHeight); -// updateContent(); -// } - @Override public void onHeaderStartAnimator(@NonNull RefreshHeader header, int headerHeight, int maxDragHeight) { mHeaderStartAnimator = String.format(Locale.CHINA, "%s\nheight=%03d extend=%03d", @@ -104,22 +84,6 @@ public void onFooterMoving(RefreshFooter footer, boolean isDragging, float perce updateContent(); } -// @Override -// public void onFooterPulling(@NonNull RefreshFooter footer, float percent, int offset, int footerHeight, int maxDragHeight) { -// mFooterPulling = String.format(Locale.CHINA, "%s\npercent=%.02f\noffset=%03d height=%03d\nextend=%03d", -// FORMAT.format(new Date()), -// percent,offset,footerHeight,maxDragHeight); -// updateContent(); -// } -// -// @Override -// public void onFooterReleasing(@NonNull RefreshFooter footer, float percent, int offset, int footerHeight, int maxDragHeight) { -// mFooterReleasing = String.format(Locale.CHINA, "%s\npercent=%.02f\noffset=%03d height=%03d\nextend=%03d", -// FORMAT.format(new Date()), -// percent,offset,footerHeight,maxDragHeight); -// updateContent(); -// } - @Override public void onFooterStartAnimator(@NonNull RefreshFooter footer, int footerHeight, int maxDragHeight) { mFooterStartAnimator = String.format(Locale.CHINA, "%s\nheight=%03d extend=%03d", @@ -171,13 +135,9 @@ private void updateContent() { mTvContent.setText(String.format(Locale.CHINA, "onStateChanged:%s\n\n" + "onHeaderMoving:%s\n\n" + -// "onHeaderPulling:%s\n\n" + -// "onHeaderReleasing:%s\n\n" + "onHeaderStartAnimator:%s\n\n" + "onHeaderFinish:%s\n\n" + "onFooterMoving:%s\n\n" + -// "onFooterPulling:%s\n\n" + -// "onFooterReleasing:%s\n\n" + "onFooterStartAnimator:%s\n\n" + "onFooterFinish:%s\n\n" + "onRefresh:%s\n\n" + diff --git a/app/src/main/java/com/scwang/refresh/layout/activity/practice/WeiboPracticeActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/practice/WeiboPracticeActivity.java index 2bd3cb23..4ac381b2 100644 --- a/app/src/main/java/com/scwang/refresh/layout/activity/practice/WeiboPracticeActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/practice/WeiboPracticeActivity.java @@ -62,18 +62,6 @@ public void onHeaderMoving(RefreshHeader header, boolean isDragging, float perce parallax.setTranslationY(mOffset - mScrollY); toolbar.setAlpha(1 - Math.min(percent, 1)); } -// @Override -// public void onHeaderPulling(@NonNull RefreshHeader header, float percent, int offset, int bottomHeight, int maxDragHeight) { -// mOffset = offset / 2; -// parallax.setTranslationY(mOffset - mScrollY); -// toolbar.setAlpha(1 - Math.min(percent, 1)); -// } -// @Override -// public void onHeaderReleasing(@NonNull RefreshHeader header, float percent, int offset, int bottomHeight, int maxDragHeight) { -// mOffset = offset / 2; -// parallax.setTranslationY(mOffset - mScrollY); -// toolbar.setAlpha(1 - Math.min(percent, 1)); -// } }); scrollView.setOnScrollChangeListener(new NestedScrollView.OnScrollChangeListener() { private int lastScrollY = 0; diff --git a/app/src/main/java/com/scwang/refresh/layout/activity/style/ClassicsStyleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/style/ClassicsStyleActivity.java index 6f8f7afc..82e4081d 100644 --- a/app/src/main/java/com/scwang/refresh/layout/activity/style/ClassicsStyleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/style/ClassicsStyleActivity.java @@ -114,25 +114,6 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position mRefreshLayout.autoRefresh(); } -// mRefreshLayout.autoRefresh();//开始刷新数据时无数据 -// mClassicsHeader.setFinishDuration(0);//关闭Header的完成延时 -// mRefreshLayout.setOnRefreshListener(new OnRefreshListener() { -// @Override -// public void onRefresh(@NonNull RefreshLayout refreshLayout) { -// //刷新启动一秒后 关闭刷新 -// refreshLayout.getLayout().postDelayed(()->{ -// refreshLayout.finishRefresh(); -// }, 1000); -// //启动刷新两秒后 添加数据 -// refreshLayout.getLayout().postDelayed(()->{ -// List items = new ArrayList<>(); -// items.addAll(Arrays.asList(Item.values())); -// items.addAll(Arrays.asList(Item.values())); -// mAdpater.refresh(items); -// }, 2000); -// } -// }); - } @Override diff --git a/app/src/main/java/com/scwang/refresh/layout/activity/style/FlyRefreshStyleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/style/FlyRefreshStyleActivity.java index c9239cfc..ff5e7df3 100644 --- a/app/src/main/java/com/scwang/refresh/layout/activity/style/FlyRefreshStyleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/style/FlyRefreshStyleActivity.java @@ -45,8 +45,6 @@ import java.util.Date; import java.util.Locale; -// import jp.wasabeef.recyclerview.animators.BaseItemAnimator; - public class FlyRefreshStyleActivity extends AppCompatActivity { private RecyclerView mListView; @@ -111,16 +109,6 @@ public void onHeaderMoving(RefreshHeader header, boolean isDragging, float perce appBar.setTranslationY(offset); toolbar.setTranslationY(-offset); } -// @Override -// public void onHeaderPulling(@NonNull RefreshHeader header, float percent, int offset, int footerHeight, int maxDragHeight) { -// appBar.setTranslationY(offset); -// toolbar.setTranslationY(-offset); -// } -// @Override -// public void onHeaderReleasing(@NonNull RefreshHeader header, float percent, int offset, int footerHeight, int maxDragHeight) { -// appBar.setTranslationY(offset); -// toolbar.setTranslationY(-offset); -// } }); /*----------------------------------------------------------- * 关键代码-结束 diff --git a/app/src/main/java/com/scwang/refresh/layout/fragment/practice/SecondFloorPracticeFragment.java b/app/src/main/java/com/scwang/refresh/layout/fragment/practice/SecondFloorPracticeFragment.java index 397b3384..bb6cc6cf 100644 --- a/app/src/main/java/com/scwang/refresh/layout/fragment/practice/SecondFloorPracticeFragment.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/practice/SecondFloorPracticeFragment.java @@ -93,13 +93,6 @@ public void onClick(View v) { public boolean onTwoLevel(@NonNull RefreshLayout refreshLayout) { Toast.makeText(getContext(),"触发二楼事件",Toast.LENGTH_SHORT).show(); root.findViewById(R.id.second_floor_content).animate().alpha(1).setDuration(2000); -// refreshLayout.getLayout().postDelayed(new Runnable() { -// @Override -// public void run() { -// header.finishTwoLevel(); -// root.findViewById(R.id.second_floor_content).animate().alpha(0).setDuration(1000); -// } -// },5000); return true;//true 将会展开二楼状态 false 关闭刷新 } }); diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java index fff11584..b27689d0 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshComponent.java @@ -37,7 +37,7 @@ public interface RefreshComponent extends OnStateChangedListener { * 【仅限框架内调用】设置主题颜色 * @param colors 对应Xml中配置的 srlPrimaryColor srlAccentColor */ - @RestrictTo({LIBRARY,LIBRARY_GROUP,SUBCLASSES}) +// @RestrictTo({LIBRARY,LIBRARY_GROUP,SUBCLASSES}) void setPrimaryColors(@ColorInt int... colors); /** @@ -46,7 +46,7 @@ public interface RefreshComponent extends OnStateChangedListener { * @param height HeaderHeight or FooterHeight * @param maxDragHeight 最大拖动高度 */ - @RestrictTo({LIBRARY,LIBRARY_GROUP,SUBCLASSES}) +// @RestrictTo({LIBRARY,LIBRARY_GROUP,SUBCLASSES}) void onInitialized(@NonNull RefreshKernel kernel, int height, int maxDragHeight); /** * 【仅限框架内调用】手指拖动下拉(会连续多次调用,添加isDragging并取代之前的onPulling、onReleasing) @@ -56,7 +56,7 @@ public interface RefreshComponent extends OnStateChangedListener { * @param height 高度 HeaderHeight or FooterHeight (offset 可以超过 height 此时 percent 大于 1) * @param maxDragHeight 最大拖动高度 offset 可以超过 height 参数 但是不会超过 maxDragHeight */ - @RestrictTo({LIBRARY,LIBRARY_GROUP,SUBCLASSES}) +// @RestrictTo({LIBRARY,LIBRARY_GROUP,SUBCLASSES}) void onMoving(boolean isDragging, float percent, int offset, int height, int maxDragHeight); /** @@ -65,7 +65,7 @@ public interface RefreshComponent extends OnStateChangedListener { * @param height 高度 HeaderHeight or FooterHeight * @param maxDragHeight 最大拖动高度 */ - @RestrictTo({LIBRARY,LIBRARY_GROUP,SUBCLASSES}) +// @RestrictTo({LIBRARY,LIBRARY_GROUP,SUBCLASSES}) void onReleased(@NonNull RefreshLayout refreshLayout, int height, int maxDragHeight); /** @@ -74,7 +74,7 @@ public interface RefreshComponent extends OnStateChangedListener { * @param height HeaderHeight or FooterHeight * @param maxDragHeight 最大拖动高度 */ - @RestrictTo({LIBRARY,LIBRARY_GROUP,SUBCLASSES}) +// @RestrictTo({LIBRARY,LIBRARY_GROUP,SUBCLASSES}) void onStartAnimator(@NonNull RefreshLayout refreshLayout, int height, int maxDragHeight); /** @@ -83,7 +83,7 @@ public interface RefreshComponent extends OnStateChangedListener { * @param success 数据是否成功刷新或加载 * @return 完成动画所需时间 如果返回 Integer.MAX_VALUE 将取消本次完成事件,继续保持原有状态 */ - @RestrictTo({LIBRARY,LIBRARY_GROUP,SUBCLASSES}) +// @RestrictTo({LIBRARY,LIBRARY_GROUP,SUBCLASSES}) int onFinish(@NonNull RefreshLayout refreshLayout, boolean success); /** @@ -92,7 +92,7 @@ public interface RefreshComponent extends OnStateChangedListener { * @param offsetX 下拉时,手指水平坐标对屏幕的偏移(0 - offsetX - LayoutWidth) * @param offsetMax 最大的偏移量 */ - @RestrictTo({LIBRARY,LIBRARY_GROUP,SUBCLASSES}) +// @RestrictTo({LIBRARY,LIBRARY_GROUP,SUBCLASSES}) void onHorizontalDrag(float percentX, int offsetX, int offsetMax); /** diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshFooter.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshFooter.java index b7c866cc..12ce6120 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshFooter.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/api/RefreshFooter.java @@ -18,6 +18,6 @@ public interface RefreshFooter extends RefreshComponent { * @param noMoreData 是否有更多数据 * @return true 支持全部加载完成的状态显示 false 不支持 */ - @RestrictTo({LIBRARY,LIBRARY_GROUP,SUBCLASSES}) +// @RestrictTo({LIBRARY,LIBRARY_GROUP,SUBCLASSES}) boolean setNoMoreData(boolean noMoreData); } diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/OnStateChangedListener.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/OnStateChangedListener.java index b4ad7c92..a9898ded 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/OnStateChangedListener.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/listener/OnStateChangedListener.java @@ -23,6 +23,6 @@ public interface OnStateChangedListener { * @param oldState 改变之前的状态 * @param newState 改变之后的状态 */ - @RestrictTo({LIBRARY,LIBRARY_GROUP,SUBCLASSES}) +// @RestrictTo({LIBRARY,LIBRARY_GROUP,SUBCLASSES}) void onStateChanged(@NonNull RefreshLayout refreshLayout, @NonNull RefreshState oldState, @NonNull RefreshState newState); } From 6c93a2a9578b0cf1a20b3df2971161f049b9e970 Mon Sep 17 00:00:00 2001 From: wsc Date: Wed, 20 Nov 2024 11:54:41 +0800 Subject: [PATCH 66/67] =?UTF-8?q?=E5=88=A0=E9=99=A4=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=97=A0=E6=95=88=E6=B3=A8=E9=87=8A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/activity/example/AssignCodeExampleActivity.java | 2 -- .../activity/example/AssignDefaultExampleActivity.java | 2 -- .../layout/activity/example/AssignXmlExampleActivity.java | 2 -- .../layout/activity/example/ListenerExampleActivity.java | 4 ---- .../layout/activity/example/OverScrollExampleActivity.java | 2 -- .../layout/activity/practice/BannerPracticeActivity.java | 7 ------- .../layout/activity/style/FlyRefreshStyleActivity.java | 1 - .../scwang/refresh/layout/adapter/BaseRecyclerAdapter.java | 4 ---- .../layout/fragment/example/HorizontalExampleFragment.java | 5 ----- .../fragment/example/PureScrollExampleFragmentFooter.java | 1 - 10 files changed, 30 deletions(-) diff --git a/app/src/main/java/com/scwang/refresh/layout/activity/example/AssignCodeExampleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/example/AssignCodeExampleActivity.java index b3c910a9..33f93849 100644 --- a/app/src/main/java/com/scwang/refresh/layout/activity/example/AssignCodeExampleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/example/AssignCodeExampleActivity.java @@ -44,8 +44,6 @@ protected void onCreate(Bundle savedInstanceState) { if (isFirstEnter) { isFirstEnter = false; -// //触发上拉加载 -// mRefreshLayout.autoLoadMore(250, 250, 1.5f); //通过多功能监听接口实现 在第一次加载完成之后 自动刷新 refreshLayout.setOnMultiListener(new SimpleMultiListener(){ @Override diff --git a/app/src/main/java/com/scwang/refresh/layout/activity/example/AssignDefaultExampleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/example/AssignDefaultExampleActivity.java index f6167206..1365f347 100644 --- a/app/src/main/java/com/scwang/refresh/layout/activity/example/AssignDefaultExampleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/example/AssignDefaultExampleActivity.java @@ -45,8 +45,6 @@ protected void onCreate(Bundle savedInstanceState) { final RefreshLayout refreshLayout = findViewById(R.id.refreshLayout); if (isFirstEnter) { isFirstEnter = false; -// //触发上拉加载 -// mRefreshLayout.autoLoadMore(); //通过多功能监听接口实现 在第一次加载完成之后 自动刷新 refreshLayout.setOnMultiListener(new SimpleMultiListener(){ @Override diff --git a/app/src/main/java/com/scwang/refresh/layout/activity/example/AssignXmlExampleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/example/AssignXmlExampleActivity.java index 7fc9a0d5..c3a7dfa1 100644 --- a/app/src/main/java/com/scwang/refresh/layout/activity/example/AssignXmlExampleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/example/AssignXmlExampleActivity.java @@ -33,8 +33,6 @@ protected void onCreate(Bundle savedInstanceState) { final RefreshLayout refreshLayout = findViewById(R.id.refreshLayout); if (isFirstEnter) { isFirstEnter = false; -// //触发上拉加载 -// mRefreshLayout.autoLoadMore(250, 250, 1.5f); //通过多功能监听接口实现 在第一次加载完成之后 自动刷新 refreshLayout.setOnMultiListener(new SimpleMultiListener(){ @Override diff --git a/app/src/main/java/com/scwang/refresh/layout/activity/example/ListenerExampleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/example/ListenerExampleActivity.java index 1af3b8fb..1461d5b9 100644 --- a/app/src/main/java/com/scwang/refresh/layout/activity/example/ListenerExampleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/example/ListenerExampleActivity.java @@ -144,13 +144,9 @@ private void updateContent() { "onLoadMore:%s\n\n", mStateChanged, mHeaderMoving, -// mHeaderPulling, -// mHeaderReleasing, mHeaderStartAnimator, mHeaderFinish, mFooterMoving, -// mFooterPulling, -// mFooterReleasing, mFooterStartAnimator, mFooterFinish, mRefresh, diff --git a/app/src/main/java/com/scwang/refresh/layout/activity/example/OverScrollExampleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/example/OverScrollExampleActivity.java index 6ab8971a..ebffe89b 100644 --- a/app/src/main/java/com/scwang/refresh/layout/activity/example/OverScrollExampleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/example/OverScrollExampleActivity.java @@ -42,8 +42,6 @@ public void onPageCommitVisible(WebView view, String url) { refreshLayout.finishRefresh(); } }); -// TextView textView = findViewById(R.id.textView); -// textView.setMovementMethod(new ScrollingMovementMethod()); } } diff --git a/app/src/main/java/com/scwang/refresh/layout/activity/practice/BannerPracticeActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/practice/BannerPracticeActivity.java index 940229aa..d0c6e868 100644 --- a/app/src/main/java/com/scwang/refresh/layout/activity/practice/BannerPracticeActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/practice/BannerPracticeActivity.java @@ -82,13 +82,6 @@ public void run() { },2000); } }); -// refreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() { -// @Override -// public void onLoadMore(@NonNull RefreshLayout refreshLayout) { -// mAdapter.addData(movies); -// refreshLayout.finishLoadMoreWithNoMoreData(); -// } -// }); refreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() { @Override public void onLoadMore(@NonNull RefreshLayout rl) { diff --git a/app/src/main/java/com/scwang/refresh/layout/activity/style/FlyRefreshStyleActivity.java b/app/src/main/java/com/scwang/refresh/layout/activity/style/FlyRefreshStyleActivity.java index ff5e7df3..e2265569 100644 --- a/app/src/main/java/com/scwang/refresh/layout/activity/style/FlyRefreshStyleActivity.java +++ b/app/src/main/java/com/scwang/refresh/layout/activity/style/FlyRefreshStyleActivity.java @@ -128,7 +128,6 @@ public void onHeaderMoving(RefreshHeader header, boolean isDragging, float perce mListView = findViewById(R.id.recyclerView); mListView.setLayoutManager(mLayoutManager); mListView.setAdapter(mAdapter); - // mListView.setItemAnimator(new SampleItemAnimator()); mToolbarLayout = findViewById(R.id.toolbarLayout); mActionButton = findViewById(R.id.fab); /* diff --git a/app/src/main/java/com/scwang/refresh/layout/adapter/BaseRecyclerAdapter.java b/app/src/main/java/com/scwang/refresh/layout/adapter/BaseRecyclerAdapter.java index ee6b4dc6..f408c51f 100644 --- a/app/src/main/java/com/scwang/refresh/layout/adapter/BaseRecyclerAdapter.java +++ b/app/src/main/java/com/scwang/refresh/layout/adapter/BaseRecyclerAdapter.java @@ -92,10 +92,6 @@ public void setOpenAnimationEnable(boolean enabled) { // private final DataSetObservable mDataSetObservable = new DataSetObservable(); -// public boolean hasStableIds() { -// return false; -// } - public void registerDataSetObserver(DataSetObserver observer) { mDataSetObservable.registerObserver(observer); } diff --git a/app/src/main/java/com/scwang/refresh/layout/fragment/example/HorizontalExampleFragment.java b/app/src/main/java/com/scwang/refresh/layout/fragment/example/HorizontalExampleFragment.java index 955860ee..64e0a618 100644 --- a/app/src/main/java/com/scwang/refresh/layout/fragment/example/HorizontalExampleFragment.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/example/HorizontalExampleFragment.java @@ -71,11 +71,6 @@ protected void onBindViewHolder(SmartViewHolder holder, Void model, int position mAdapter.refresh(initData()); RefreshLayout refreshLayout = root.findViewById(R.id.refreshLayout); -//// refreshLayout.setRefreshHeader(new MaterialHeader(root.getContext())); -// refreshLayout.setRefreshFooter(new RefreshFooterWrapper(new MaterialHeader(root.getContext())), -1, -2); -//// refreshLayout.setEnableHeaderTranslationContent(true); -// refreshLayout.setEnableFooterTranslationContent(true); -// refreshLayout.setEnableAutoLoadMore(false); refreshLayout.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() { @Override diff --git a/app/src/main/java/com/scwang/refresh/layout/fragment/example/PureScrollExampleFragmentFooter.java b/app/src/main/java/com/scwang/refresh/layout/fragment/example/PureScrollExampleFragmentFooter.java index 97827f12..4a079b5f 100644 --- a/app/src/main/java/com/scwang/refresh/layout/fragment/example/PureScrollExampleFragmentFooter.java +++ b/app/src/main/java/com/scwang/refresh/layout/fragment/example/PureScrollExampleFragmentFooter.java @@ -52,7 +52,6 @@ public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceStat refreshLayout.setEnablePureScrollMode(true); refreshLayout.setEnableRefresh(false); refreshLayout.setEnableLoadMore(true); -// refreshLayout.setRefreshFooter(new FalsifyFooter(getContext())); View view = root.findViewById(R.id.recyclerView); if (view instanceof RecyclerView) { From 224db48f8af897a930b810a6b6fc55af8cef0d57 Mon Sep 17 00:00:00 2001 From: wsc Date: Tue, 26 Nov 2024 11:57:10 +0800 Subject: [PATCH 67/67] =?UTF-8?q?=E5=88=87=E6=8D=A2=20=E4=B8=BA=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E9=A1=B9=E7=9B=AE=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 36 ++++++++++++++++++------------------ refresh-footer/build.gradle | 8 ++++---- refresh-header/build.gradle | 18 +++++++++--------- refresh-layout/build.gradle | 22 +++++++++++----------- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 2ca1fc97..e51bc990 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -68,24 +68,24 @@ dependencies { implementation project(':refresh-header') implementation project(':refresh-layout') -// implementation project(':refresh-drawable-path') -// implementation project(':refresh-layout-kernel') -// implementation project(':refresh-header-classics') -// implementation project(':refresh-header-radar') -// implementation project(':refresh-header-falsify') -// implementation project(':refresh-header-material') -// implementation project(':refresh-header-two-level') -// implementation project(':refresh-footer-ball') - - implementation 'io.github.scwang90:refresh-drawable-path:3.0.0-alpha' //矢量路径 - implementation 'io.github.scwang90:refresh-layout-kernel:3.0.0-alpha' //核心必须依赖 - implementation 'io.github.scwang90:refresh-header-classics:3.0.0-alpha' //经典刷新头 - implementation 'io.github.scwang90:refresh-header-radar:3.0.0-alpha' //雷达刷新头 - implementation 'io.github.scwang90:refresh-header-falsify:3.0.0-alpha' //虚拟刷新头 - implementation 'io.github.scwang90:refresh-header-material:3.0.0-alpha' //谷歌刷新头 - implementation 'io.github.scwang90:refresh-header-two-level:3.0.0-alpha' //二级刷新头 - implementation 'io.github.scwang90:refresh-footer-ball:3.0.0-alpha' //球脉冲加载 - implementation 'io.github.scwang90:refresh-footer-classics:3.0.0-alpha' //经典加载 + implementation project(':refresh-drawable-path') + implementation project(':refresh-layout-kernel') + implementation project(':refresh-header-classics') + implementation project(':refresh-header-radar') + implementation project(':refresh-header-falsify') + implementation project(':refresh-header-material') + implementation project(':refresh-header-two-level') + implementation project(':refresh-footer-ball') + +// implementation 'io.github.scwang90:refresh-drawable-path:3.0.0-alpha' //矢量路径 +// implementation 'io.github.scwang90:refresh-layout-kernel:3.0.0-alpha' //核心必须依赖 +// implementation 'io.github.scwang90:refresh-header-classics:3.0.0-alpha' //经典刷新头 +// implementation 'io.github.scwang90:refresh-header-radar:3.0.0-alpha' //雷达刷新头 +// implementation 'io.github.scwang90:refresh-header-falsify:3.0.0-alpha' //虚拟刷新头 +// implementation 'io.github.scwang90:refresh-header-material:3.0.0-alpha' //谷歌刷新头 +// implementation 'io.github.scwang90:refresh-header-two-level:3.0.0-alpha' //二级刷新头 +// implementation 'io.github.scwang90:refresh-footer-ball:3.0.0-alpha' //球脉冲加载 +// implementation 'io.github.scwang90:refresh-footer-classics:3.0.0-alpha' //经典加载 implementation 'com.flyco.roundview:FlycoRoundView_Lib:1.1.4@aar' implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.50' diff --git a/refresh-footer/build.gradle b/refresh-footer/build.gradle index ee8f7c21..2c7f70ce 100644 --- a/refresh-footer/build.gradle +++ b/refresh-footer/build.gradle @@ -28,11 +28,11 @@ dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') compileOnly project(':refresh-layout') -// compileOnly project(':refresh-footer-ball') -// compileOnly project(':refresh-footer-classics') + compileOnly project(':refresh-footer-ball') + compileOnly project(':refresh-footer-classics') - compileOnly 'io.github.scwang90:refresh-footer-ball:3.0.0-alpha' //球脉冲加载 - compileOnly 'io.github.scwang90:refresh-footer-classics:3.0.0-alpha' //经典加载 +// compileOnly 'io.github.scwang90:refresh-footer-ball:3.0.0-alpha' //球脉冲加载 +// compileOnly 'io.github.scwang90:refresh-footer-classics:3.0.0-alpha' //经典加载 compileOnly 'androidx.appcompat:appcompat:1.7.0' diff --git a/refresh-header/build.gradle b/refresh-header/build.gradle index 66abbe02..cef2f4bc 100644 --- a/refresh-header/build.gradle +++ b/refresh-header/build.gradle @@ -27,15 +27,15 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) compileOnly project(':refresh-layout') -// compileOnly project(':refresh-drawable-path') -// compileOnly project(':refresh-header-material') -// compileOnly project(':refresh-layout-kernel') -// compileOnly project(':refresh-header-falsify') - - compileOnly 'io.github.scwang90:refresh-drawable-path:3.0.0-alpha' //矢量路径 - compileOnly 'io.github.scwang90:refresh-layout-kernel:3.0.0-alpha' //核心必须依赖 - compileOnly 'io.github.scwang90:refresh-header-falsify:3.0.0-alpha' //虚拟刷新头 - compileOnly 'io.github.scwang90:refresh-header-material:3.0.0-alpha' //谷歌刷新头 + compileOnly project(':refresh-drawable-path') + compileOnly project(':refresh-header-material') + compileOnly project(':refresh-layout-kernel') + compileOnly project(':refresh-header-falsify') + +// compileOnly 'io.github.scwang90:refresh-drawable-path:3.0.0-alpha' //矢量路径 +// compileOnly 'io.github.scwang90:refresh-layout-kernel:3.0.0-alpha' //核心必须依赖 +// compileOnly 'io.github.scwang90:refresh-header-falsify:3.0.0-alpha' //虚拟刷新头 +// compileOnly 'io.github.scwang90:refresh-header-material:3.0.0-alpha' //谷歌刷新头 compileOnly 'androidx.appcompat:appcompat:1.7.0' diff --git a/refresh-layout/build.gradle b/refresh-layout/build.gradle index 65ea1c16..c7360311 100644 --- a/refresh-layout/build.gradle +++ b/refresh-layout/build.gradle @@ -26,17 +26,17 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) -// compileOnly project(':refresh-layout-kernel') -// compileOnly project(':refresh-footer-ball') -// compileOnly project(':refresh-header-falsify') -// compileOnly project(':refresh-header-radar') -// compileOnly project(':refresh-header-two-level') - - compileOnly 'io.github.scwang90:refresh-layout-kernel:3.0.0-alpha' //核心必须依赖 - compileOnly 'io.github.scwang90:refresh-header-radar:3.0.0-alpha' //雷达刷新头 - compileOnly 'io.github.scwang90:refresh-header-falsify:3.0.0-alpha' //虚拟刷新头 - compileOnly 'io.github.scwang90:refresh-header-two-level:3.0.0-alpha' //二级刷新头 - compileOnly 'io.github.scwang90:refresh-footer-ball:3.0.0-alpha' //球脉冲加载 + compileOnly project(':refresh-layout-kernel') + compileOnly project(':refresh-footer-ball') + compileOnly project(':refresh-header-falsify') + compileOnly project(':refresh-header-radar') + compileOnly project(':refresh-header-two-level') + +// compileOnly 'io.github.scwang90:refresh-layout-kernel:3.0.0-alpha' //核心必须依赖 +// compileOnly 'io.github.scwang90:refresh-header-radar:3.0.0-alpha' //雷达刷新头 +// compileOnly 'io.github.scwang90:refresh-header-falsify:3.0.0-alpha' //虚拟刷新头 +// compileOnly 'io.github.scwang90:refresh-header-two-level:3.0.0-alpha' //二级刷新头 +// compileOnly 'io.github.scwang90:refresh-footer-ball:3.0.0-alpha' //球脉冲加载 compileOnly 'com.google.android.material:material:1.12.0'