2014.01.07 (2)——— android开源库之Android-PullToRefresh
下载地址:
https://github.com/chrisbanes/Android-PullToRefresh
1、介绍一下xml属性
attrs.xml
<resources>
<declare-styleable name="PullToRefresh">
<!-- A drawable to use as the background of the Refreshable View -->
<attr name="ptrRefreshableViewBackground" format="reference|color" />
<!-- A drawable to use as the background of the Header and Footer Loading Views -->
<attr name="ptrHeaderBackground" format="reference|color" />
<!-- Text Color of the Header and Footer Loading Views -->
<attr name="ptrHeaderTextColor" format="reference|color" />
<!-- Text Color of the Header and Footer Loading Views Sub Header -->
<attr name="ptrHeaderSubTextColor" format="reference|color" />
<!-- Mode of Pull-to-Refresh that should be used -->
<attr name="ptrMode">
<flag name="disabled" value="0x0" />
<flag name="pullFromStart" value="0x1" />
<flag name="pullFromEnd" value="0x2" />
<flag name="both" value="0x3" />
<flag name="manualOnly" value="0x4" />
<!-- These last two are depreacted -->
<flag name="pullDownFromTop" value="0x1" />
<flag name="pullUpFromBottom" value="0x2" />
</attr>
<!-- Whether the Indicator overlay(s) should be used -->
<attr name="ptrShowIndicator" format="reference|boolean" />
<!-- Drawable to use as Loading Indicator. Changes both Header and Footer. -->
<attr name="ptrDrawable" format="reference" />
<!-- Drawable to use as Loading Indicator in the Header View. Overrides value set in ptrDrawable. -->
<attr name="ptrDrawableStart" format="reference" />
<!-- Drawable to use as Loading Indicator in the Footer View. Overrides value set in ptrDrawable. -->
<attr name="ptrDrawableEnd" format="reference" />
<!-- Whether Android's built-in Over Scroll should be utilised for Pull-to-Refresh. -->
<attr name="ptrOverScroll" format="reference|boolean" />
<!-- Base text color, typeface, size, and style for Header and Footer Loading Views -->
<attr name="ptrHeaderTextAppearance" format="reference" />
<!-- Base text color, typeface, size, and style for Header and Footer Loading Views Sub Header -->
<attr name="ptrSubHeaderTextAppearance" format="reference" />
<!-- Style of Animation should be used displayed when pulling. -->
<attr name="ptrAnimationStyle">
<flag name="rotate" value="0x0" />
<flag name="flip" value="0x1" />
</attr>
<!-- Whether the user can scroll while the View is Refreshing -->
<attr name="ptrScrollingWhileRefreshingEnabled" format="reference|boolean" />
<!--
Whether PullToRefreshListView has it's extras enabled. This allows the user to be
able to scroll while refreshing, and behaves better. It acheives this by adding
Header and/or Footer Views to the ListView.
-->
<attr name="ptrListViewExtrasEnabled" format="reference|boolean" />
<!--
Whether the Drawable should be continually rotated as you pull. This only
takes effect when using the 'Rotate' Animation Style.
-->
<attr name="ptrRotateDrawableWhilePulling" format="reference|boolean" />
<!-- BELOW HERE ARE DEPRECEATED. DO NOT USE. -->
<attr name="ptrAdapterViewBackground" format="reference|color" />
<attr name="ptrDrawableTop" format="reference" />
<attr name="ptrDrawableBottom" format="reference" />
</declare-styleable>
</resources>
1.1、ptr:ptrMode
disabled 不刷新
pullFromStart 下拉刷新
pullFromEnd 上拉加载
both 上拉和下拉
2、ptr:ptrAnimationStyle
参考:
https://github.com/chrisbanes/Android-PullToRefresh/wiki/Customisation
控制下拉刷新—>松开刷新时的 progress的变化
rotate 旋转,类似于圆形的progress那种
flip 最常见的那种,箭头翻转一下
3、ptr:ptrDrawable
就是上面提到的那个progress的图片
4、ptr:ptrHeaderBackground
就是header的背景图
一般常用到的也就这四个,其他的用到了 再补充
分享到:
相关推荐
Android Studio Koala Feature Drop 2024.1.2(android-studio-2024.1.2.12-windows.zip)适用于Windows系统,文件使用360压缩软件分割成两个压缩包,必须一起下载使用: part1: ...
Android Studio Bumblebee 2021.1.1 Patch 2 (android-studio-2021.1.1.22-windows.exe)大黄蜂,适用于Windows x86_64系统,是Android Studio 4.3(Android Studio Arctic Fox 2020.3.1.26新版本命名)版本之后的新...
Android Studio Hedgehog 2023.1.1 Patch 2(android-studio-2023.1.1.28-cros.deb)适用于Chrome OS系统。
Android Studio Dolphin (2021.3.1) Canary 3 (android-studio-2021.3.1.3-mac_arm.zip)海豚 适用于macOS Arm芯片系统,文件分割成两个压缩包,必须一起下载两个压缩包进行解压使用: android-studio-2021.3.1.3-...
Android Studio Giraffe 2022.3.1 Beta 1(android-studio-2022.3.1.12-windows....Android Studio Giraffe(android-studio-2022.3.1.12-windows.part2) https://download.csdn.net/download/weixin_43800734/87723715
Android Studio Giraffe 2022.3.1(android-studio-2022.3.1.14-mac_arm.zip...Android Studio Giraffe(android-studio-2022.3.1.14-mac_arm.part2.rar) https://download.csdn.net/download/weixin_43800734/87800398
通常,这种格式表示的是 Maven 或 Gradle 的依赖坐标,用于在构建 Android 项目时引入外部库。 描述 "implementation 'com.guo.android_extend:android-extend:1.0.6'失败,用这个替代就好了" 暗示可能存在一些问题...
Android Studio Hedgehog 2023.1.1 Patch 1(android-studio-2023.1.1.27-windows.exe) 适用于Windows系统,文件使用WinRAR分割成两个压缩包,必须一起下载使用: part1:...
Android Studio Chipmunk (2021.2.1) Beta 3 (android-studio-2021.2.1.10-mac.zip)花栗鼠 适用于macOS Intel芯片系统,文件分割成两个压缩包,必须一起解压使用: Android Studio Chipmunk (android-studio-2021...
目前为官网最新版本,需要翻墙下载 ...https://r6---sn-npoe7n7r.gvt1.com/edgedl/android/studio/install/2020.3.1.22/android...
Android Studio Koala 2024.1.1(android-studio-2024.1.1.12-linux.tar.gz)适用于Linux系统,文件使用360压缩软件分割成两个压缩包,必须一起下载使用: part1: ...
新版libammsdk.jar wechat-sdk-android-without-mta-5.5.8.jar
Android Studio Dolphin (2021.3.1) Canary 4 (android-studio-2021.3.1.4-mac.zip)海豚 适用于macOS Intel芯片系统,文件分割成两个压缩包,必须一起下载两个压缩包进行解压使用: Android Studio Dolphin ...
Android Studio Ladybug 2024.2.1(android-studio-2024.2.1.12-windows.exe)适用于Windows系统,文件使用360压缩软件分割成两个压缩包,必须一起下载使用: part1: ...
01 java面试——北京-百度-Java中级.pdf 02 java面试——北京-京东-Java中级.pdf 03 java面试——广州-唯品会-Java大数据开发工程师.pdf 04 java面试——杭州-阿里云-Java中级.pdf 05 java面试——杭州-蚂蚁金服-...
Android Studio Koala 2024.1.1(android-studio-2024.1.1.12-mac.dmg)适用于macOS Intel系统,文件使用360压缩软件分割成两个压缩包,必须一起下载使用: part1: ...
Android Studio Dolphin (2021.3.1) Beta 1 (android-studio-2021.3.1.10-windows.zip)海豚 适用于Windows x86_64系统。 Android Studio版本排序: Electric Eel | 2022.1.1 Dolphin | 2021.3.1 Chipmunk | 2021.2...
android-studio-2024.1.1.12-mac,Android Studio最新官方版本,因官网下载较慢,转存于CSDN。 共2个zip文件,要全部下载后才能解压成功! 共2个zip文件,要全部下载后才能解压成功! 共2个zip文件,要全部下载后...
Android Studio Bumblebee 稳定版(android-studio-2021.1.1.20-linux.tar.gz) 大黄蜂,适用于Linux x86_64系统,是Android Studio 4.3(Arctic Fox 2020.3.1.26新版本命名)版本之后的新版本Android Studio ...