Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Pull To Refresh ListView: eliminate arrow hint

I am using this library from Chris Banes (I will never thank this man enough). It has two different behaviors depending on the android version. I want to get rid of the graphical hint on the PullToRefresListView (circled in the image below) that is shown only on devices with android lower than 4.0.

Does anybody knows how to do it?

enter image description here

SOLUTION:

for anybody in the future searching for the same solution here it is: in the PullToRefreshAdapterViewBase class change getShowIndicatorInternal method from this:

private boolean getShowIndicatorInternal() {

    return mShowIndicator && isPullToRefreshEnabled();
}

to this:

private boolean getShowIndicatorInternal() {

    return false;
}
like image 788
aveschini Avatar asked May 23 '13 09:05

aveschini


1 Answers

If you use a layout XML file, you can also specify ptr:ptrShowIndicator="false" inside the PullToRefreshView's declaration. For example:

    <com.handmark.pulltorefresh.library.PullToRefreshListView
        xmlns:ptr="http://schemas.android.com/apk/res-auto"
        android:id="@+id/pullToRefreshListView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        ptr:ptrShowIndicator="false" >
    </com.handmark.pulltorefresh.library.PullToRefreshListView> 

For other attributes, you can refer to /res/values/attrs.xml in the library, which is self-documented.

You may also find the sample project worth looking at.

like image 66
TactMayers Avatar answered Sep 28 '22 07:09

TactMayers