2

SEE THIS IMAGE

I need to style my progress bar to look like the one above. Any ideas? Thanks.

I actually was wondering if I could STYLE a ProgressBar to look like this WITHOUT using SwipeRefreshLayout. Sorry I wasn't clear enough

Makyen
  • 31,849
  • 12
  • 86
  • 121
agustinaliagac
  • 829
  • 10
  • 24

3 Answers3

3

What you want to achieve is against Material Design guidelines. You should use this indicator only to indicate refreshing which was caused by "swipe to refresh" pattern (see here). To indicate any other type of progress you should use different types of progress indicators. It is all written here: Progres & Activity - Material Design Guide

axd
  • 626
  • 5
  • 13
fragon
  • 3,391
  • 10
  • 39
  • 76
2

You should use SwipeRefreshLayout. It's included as android.support.v4.widget on the latest v4 Support Library.

Joaquin Iurchuk
  • 5,499
  • 2
  • 48
  • 64
  • I actually was wondering if I could STYLE a ProgressBar to look like this WITHOUT using SwipeRefreshLayout. Sorry I wasn't clear enough – agustinaliagac Jan 22 '15 at 19:43
  • What do you want to style? The colors? Because the only way of getting that kind of spinner as the user swipes down is using SwipeRefreshLayout. You add it via XML and then you set the `onRefresh()` method on your Activity. – Joaquin Iurchuk Jan 22 '15 at 19:48
  • 1
    I want to style colors and animation to look exactly like that, but without having to use SwipeRefreshLayout, because I don't need the user to do a swipe gesture. I just need a normal "Loading spinner" that looks like the one that SwipeRefreshLayout gives you. – agustinaliagac Jan 22 '15 at 19:53
  • Oh, now I understand what you need, but I cant help you. What I can suggest you is to use the method `isRefreshing(boolean)` that belongs to SwipeRefreshLayout and handle it programatically and with some basic research (like reading Android Developers in the link I left you in the original answer) you could easily override the gesture and touch (swipe) event consumption. – Joaquin Iurchuk Jan 22 '15 at 19:56
2

If you need a swipe-from-bottom-upward to show a circular progress indicator, the source for that is available at:

https://github.com/JohannBlake/SwipeRefreshLayoutBottom

If you need a linear linear (determinate/indeterminate) progress indicator with Material Design, the source code is available at:

https://github.com/JohannBlake/JBProgressIndicator

Johann
  • 27,536
  • 39
  • 165
  • 279
  • I dont' why google puts all these looks and designs in their guidelines but then doesn't provide the actually widget so people can implement it in code. Their goal is uniformity and now every developer is using some 3rd party library? – Zapnologica Jan 28 '16 at 07:20