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.
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.
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!!!