How to get a progress bar under the ActionBar in Material Design?
Asked Answered
H

1

14

The Material Design specifications for Progress and activity specifically show in several areas a horizontal progress indicator of only a few pixels (dips) thick below whatever it is we are calling the ActionBar these days (probably Toolbar).

However, I don't see any way to actually implement that portion of Material Design. There seems to be a disconnect between design and reality. To make things more complicated, all of the classic methods (e.g. setProgressBarIndeterminateVisibility()) are deprecated or gone (i.e. no-ops). Also, putting a horizontal ProgressBar below the Toolbar results in a very tall ProgressBar and all of the alternate AppCompat ProgressBar styles I've been able to find are also too tall. Attempting to force the height to '2dip' results in shrinking the width of whatever makes up the content of the ProgressBar.

So what is the correct, built-in AppCompat compliant method to putting a Material Design compliant horizontal ProgressBar at the bottom of either Toolbar or AppBarLayout?

I prefer it to be at the bottom of AppBarLayout because I'm adding more stuff after the Toolbar but before the end of AppBarLayout in my app. At the moment, I'm relegated to the circular indeterminate ProgressBar in a Toolbar but it is big and a bit ugly.

Hanforrd answered 26/5, 2016 at 19:27 Comment(2)
Have you found a solution? I am looking out for same... Plz let me know if you solved it and how.Nutting
#33563228Foiled
F
1

Try this answer. But I would also suggest that you extend your own class from ProgressBar and call it from activity.

Formaldehyde answered 12/1, 2018 at 16:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.