kofigyan / StateProgressBar

Android library to realize the various states and transitions in a ProgressBar.
1.55k stars 234 forks source link

Change number of items after creation #10

Open Frank1234 opened 7 years ago

Frank1234 commented 7 years ago

How do I change the number of items in the StateProgressBar after creation/display: the user checks a box on one of the pages, and has to fill in an extra page.

If I use setMaxStateNumber() the size of the StateProgressBar increases out of screen bounds. requestLayout() doesn't help.

kofigyan commented 7 years ago

Hi @Frank1234 . l must say this is not a feature l envisage during the design of this solution. Let me look at how well it fit in with the overall design and update you. Unless your use case is similar to this where you are doing all transitions in the same view you can consider the implementation of the "Real world example" in the sample included in the library project as an interim solution.

Frank1234 commented 7 years ago

Okay, where exactly can I find this "Real world example"? I'm using StateProgressBar in combination with a ViewPager. I think I'll just inflate the view again and remove the old one when the user checks the switch.

Frank1234 commented 7 years ago

Works like a charm, too bad it doesn't animate, but that's fine.

connyduck commented 7 years ago

I have the same problem, but the other way round. if I decrease the max State Number, the bar does not fill the screen anymore

screenshot_20170306-100429 screenshot_20170306-100435 ↑ works, but looks bad

kofigyan commented 7 years ago

Hi @Frank1234 , l will be updating the api tomorrow to enable animation in the particular context you described. Did you follow the real world example l mentioned ? Link Here

kofigyan commented 7 years ago

Hi @connyduck ,I am currently working on the feature you mentioned. I will keep you posted on the progress.

SopheakSem commented 6 years ago

6steps Hi @kofigyan How could I increase to 6 step?

lyvietson95 commented 6 years ago

Hi @kofigyan. This is lib very nice for me, i hope so you can add more feature in the future and i have a question why don't you allow user add more than 5 step number. I have task use more than 5 step but i can not do it with your lib ?