4

I want use smooth indeterminate horizontal progress bar like gmail or FB app. I want support api level 8+. I searched and i see a library but i want write this code not use lib. I find some question and answer about this but i cant understand and use this. I read this (Make a ProgressBar update smoothly), in accept answer what is incrementor and count? in last answer, how can i use this class and methods? please explain about use this class or method in program? Thanks and sorry for my stupid question :)

Community
  • 1
  • 1
user3209380
  • 169
  • 1
  • 2
  • 14

2 Answers2

5

I wrote a Blog Post about this a few months ago.

You can find the whole implementation HERE

if you want to reproduce exactly the gmail's progressbar, here is the source code

Hope this will help you.

AMerle
  • 4,354
  • 1
  • 28
  • 43
  • I want to ask you in your gmail progressbar source code. The class must `extends View` ? coz my main.java was already `extends ActionBarActivity` – Jiazzy user May 13 '14 at 09:16
  • What's different between yours and third link?! (https://android.googlesource.com/platform/packages/apps/UnifiedEmail/+/kitkat-release/src/com/android/mail/ui/ButteryProgressBar.java) – Dr.jacky Jul 01 '14 at 11:57
  • @Mr.Hyde here is a gif https://github.com/castorflex/SmoothProgressBar and here is a demo https://play.google.com/store/apps/details?id=fr.castorflex.android.smoothprogressbar.sample – AMerle Jul 01 '14 at 14:46
  • @CFlex Does it work on ProgressDialog too? I mean set SmoothProgressDrawable as IndeterminaterDrawable. In fact, how to show smooth horizontal progress in dialog? – Dr.jacky Jul 04 '14 at 13:19
  • @Mr.Hyde Can't see any reason why it wouldn't work. What have you tried. – AMerle Jul 07 '14 at 14:17
0

I believe there is a View to do that from google (LinearProgressIndicator). you can custom colors and height. I explained it in this post :

https://stackoverflow.com/a/68505259/2719243

Vahab Ghadiri
  • 2,016
  • 20
  • 26