-1

Is there a way to change the color scheme of Chrisbanes PulToRefresh Actionbar? I have read the QuickStart (https://github.com/chrisbanes/ActionBar-PullToRefresh/wiki/QuickStart-Stock) but it is not mentioned.

Thanks in advance.

Derekyy
  • 1,018
  • 4
  • 18
  • 31
  • did you check the customization [here](https://github.com/chrisbanes/ActionBar-PullToRefresh/wiki/Customisation)??? – Kostas Drak Jan 22 '15 at 10:16
  • yes, I did notice there is a DefaultHeaderTransformer. But any way could I make the progressBar's color changing from blue to green to red to purple (e.g. showing the progress with 4 colors each time.) – Derekyy Jan 22 '15 at 10:28

1 Answers1

1

Since if you take a look at here you will see that the actionbar-pull-to-refresh method is deprecated you can use the following!

1) Check this example

2) Compile this dependency: compile 'com.android.support:support-v4:21.0.+'

3) Modify your layout file:

<android.support.v4.widget.SwipeRefreshLayout
        android:id="@+id/activity_main_swipe_refresh_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <ListView
            android:id="@+id/activity_main_listview"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            >
        </ListView>

    </android.support.v4.widget.SwipeRefreshLayout>

4) In your activity where you have your ListView:

SwipeRefreshLayout mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.activity_main_swipe_refresh_layout);
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
      @Override
      public void onRefresh() {
            //refresh your content and after your done call this method to stop refreshing
            mSwipeRefreshLayout.setRefreshing(false);
      });

5) You can also customize SwipeRefreshLayout’s appearance. To define your own custom color scheme to use with SwipeRefreshLayout’s animated loading icon, use the appropriately named setColorSchemeResources() method.

<resources>
    <color name="orange">#FF9900</color>
  <color name="green">#009900</color>
    <color name="blue">#000099</color>
</resources>

Hope it helps!!!

Kostas Drak
  • 3,222
  • 6
  • 28
  • 60
  • Thanks for your help. I have tried it. it does work, yet it is not what I really what. My fault not explaining it thorough enough, what I want the most is one with a progress bar indicating the progress, not an arrow. Just like Chrisbanes' Pull-To-Refresh Action Bar, yet with changing colors. – Derekyy Jan 22 '15 at 15:02