forked from chrisbanes/Android-PullToRefresh
-
Notifications
You must be signed in to change notification settings - Fork 0
Customisation
Chris Banes edited this page Aug 17, 2012
·
7 revisions
There are a number of ways to customise the way that PullToRefresh behaves and looks.
There are a number of XML attributes you can use, the best way is to look at the attrs.xml file. Here I'll give a quick overview of the main ones:
-
ptrAdapterViewBackground. Background to the AdapterView. -
ptrHeaderBackground. Background of the Header/Footer Views. -
ptrHeaderTextColor. Text Colour of the top line of text in the Header/Footer Views. -
ptrHeaderSubTextColor. Text Colour of the bottom line of text in the Header/Footer Views. -
ptrMode. Sets the Mode in which the Views will operate. Values are eitherpullDownFromTop,pullUpFromBottomorboth. Defaults topullDownFromTop. -
ptrShowIndicator. Whether to show the Indicators showing the user whether a Pull-to-Refresh is possible. Defaults to true. -
ptrDrawable. Drawable to show in the Header/Footer Views. Defaults to a refresh icon. -
ptrOverScroll. Whether OverScroll support is enabled. Only takes affect when running on Android v2.3+ Defaults to true.
There are also a number of methods available, most of which accompany the XML attributes above. Aside from those, here are a number of calls which are important. I'll leave it as an excerise for the reader to find the documentation for each call in the code:
setPullToRefreshEnabledsetDisableScrollingWhileRefreshingsetShowViewWhileRefreshingsetLastUpdatedLabelsetFilterTouchEventssetReleaseLabelsetRefreshingLabelsetPullLabel