chrisbanes/Android-PullToRefresh — Issue #42: "refreshing" label not styled as the pull and refresh labels with ListView
Author: elroid
Created: 2012-03-06 17:27:41+00:00
State: open

When using the custom attribute "ptr:headerTextColor" to change the textColor, the colour only gets applied to the colour of the pullLabel and releaseLabel. This is because the LoadingLayout is called from the PullToRefreshListView to generate the loading text while it is called from PullToRefreshBase for the other two, and the equivalent styling code is missing from the former. This can be fixed by adding the following lines to PullToRefreshListView.java at line 136:

```Java
// Styleables from XML - adapted from PullToRefreshBase Line 540 and 572-591
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.PullToRefresh);
if (a.hasValue(R.styleable.PullToRefresh_headerTextColor)) {
final int color = a.getColor(R.styleable.PullToRefresh_headerTextColor, Color.BLACK);
if (null != headerLoadingView) {
headerLoadingView.setTextColor(color);
}
if (null != footerLoadingView) {
footerLoadingView.setTextColor(color);
}
}
if (a.hasValue(R.styleable.PullToRefresh_headerBackground)) {
this.setBackgroundResource(a.getResourceId(R.styleable.PullToRefresh_headerBackground, Color.WHITE));
}
a.recycle();
```
I've also noticed that when you use a background close to white, it's very difficult to see the ProgressBar (pull_to_refresh_progress), as it is close to white while the arrow image is black. If anyone has a suggestion how to style this, it would be appreciated!