SwipeRefreshLayout does not show horizontal progress

I am using supportv4: 22.0.0 to work with SwipeRefreshLayout. His works are beautiful, but he always shows a circular view of progress, and not the horizontal course of the path.

I added a screenshot for a better understanding.

I have it enter image description here

But I want something like this enter image description here

The code that I use in Layout

<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ptr_layout" android:layout_width="match_parent" android:layout_height="match_parent" > <ListView android:id="@+id/lv_news_feed_details" android:layout_width="match_parent" android:layout_height="match_parent" android:divider="#dbdfea" android:dividerHeight="1dp" android:cacheColorHint="@null" android:listSelector="#00000000" /> </android.support.v4.widget.SwipeRefreshLayout> 

Java class

  mPullToRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.ptr_layout); mPullToRefreshLayout.setOnRefreshListener(this); mPullToRefreshLayout.setColorScheme(android.R.color.holo_blue_bright, android.R.color.holo_green_light, android.R.color.holo_orange_light, android.R.color.holo_red_light); 
+5
source share
1 answer

I am sure this is not possible with this class. You can always look at the source code to make sure that it works as it sees fit. setColorScheme sets only the color of the ring that rotates. setColorScheme is now deprecated - so let's see

 public void setColorSchemeColors(int... colors) { ensureTarget(); mProgress.setColorSchemeColors(colors); } 

and in MaterialProgressDrawable:

 public void setColorSchemeColors(int... colors) { mRing.setColors(colors); mRing.setColorIndex(0); } 

and field

 private final Ring mRing; 

As you can see, there is no classic ProgressBar that you like.

+3
source

All Articles