carlosmuvi / SegmentedProgressBar

Instagram like segmented progress bar for Android, written in Kotlin!
132 stars 24 forks source link

Segment progressbar use with viewpager transform #3

Closed meghaandroidwmt closed 4 years ago

meghaandroidwmt commented 7 years ago

when first fragment open and it total segment count progress finish. it automatically change next page like instagram story.It works proper but when first screen is open ,in background next fragment progress also start with it . actually its wrong because of it process flow is not proper manage . please can you help me for how can i manage it properly.its progress start with visible fragment only and not in next fragment until it not visible.

carlosmuvi commented 7 years ago

I'm not sure I understand the issue you're having. Can you elaborate or provide your implementation?

tarunkonda commented 7 years ago

@meghaandroidwmt is it viewpager fragments ?? if it is viewpager fragments frag1 and frag2 also execute same time .. i think the issue bcoz of that..

meghaandroidwmt commented 7 years ago

yes i also think same and i also search for that also but i dont want it so there is any solution?

carlosmuvi commented 7 years ago

If you're working with view pager fragments, you just need it to have the progress bar in the activity that holds the viewpager, and manage it in the 'onPageSelected' callback.

https://developer.android.com/reference/android/support/v4/view/ViewPager.OnPageChangeListener.html

Parth20 commented 7 years ago

@meghaandroidwmt Can you please tell me how to set auto start while complete one part of segment for get next segment .e.g. I have added 6 part of segment count and I want to set autostart for completion of no. 1 segment and open no. 2 segment .

tarunkonda commented 7 years ago

still i didn't get your error .... but it may helps to u private static boolean m_iAmVisible;

@Override public void setUserVisibleHint(boolean isVisibleToUser) { super.setUserVisibleHint(isVisibleToUser); m_iAmVisible = isVisibleToUser;

if (m_iAmVisible) { 
    Log.d(localTAG, "this fragment is now visible");
} else {  
    Log.d(localTAG, "this fragment is now invisible");
}

} add this code in your viewpager fragment then excute then u will know the difference...

Parth20 commented 7 years ago

If once I start segment progress then it will continue till end without stopping or without click button for start progress of next segment. If first segment's progress is finish then automatically start next progress. I used Handler but it's not work properly. I want to do same as whats app status new feature for showing multiple status of one user.

carlosmuvi commented 4 years ago

The best way now is to use a listener (Added support in 0.8.3). Just call playNextSegment when the callback is triggered.