d-32 / segmentedprogressbar Goto Github PK
View Code? Open in Web Editor NEWSnapchat / Instagram Stories like progress indicator
License: MIT License
Snapchat / Instagram Stories like progress indicator
License: MIT License
Firstly great work. I have different videos of different durations and am looking for a solution where 1 segment of the bar represents 1 video. Thanks.
I am trying to load a previous story but cannot manage to do so.
Here is the function I am trying to implement which should be the opposite action to skip() :
func rewindOne() {
let currentSegment = segments[currentAnimationIndex]
currentSegment.topSegmentView.frame.size.width = 0
currentSegment.topSegmentView.layer.removeAllAnimations()
var newIndex = self.currentAnimationIndex - 1
if newIndex < 0 { newIndex = 0 }
if newIndex >= 0 {
self.delegate?.segmentedProgressBarChangedIndex(index: newIndex)
self.animate(animationIndex: newIndex)
}
}
The animation does not stop, I have 3 items, tried:
segments.forEach {
$0.topSegmentView.layer.removeAllAnimations()
}
The segment keeps being animated.
When I set the segmented bar with whatever number of segments, the first 2 start together
in swift 4.2 pause and resume not working.
I am trying to delete particular data from its index but at that time segmented progress bar not reload or reset , it shows previous index data. please let me know remove data from particular index and move to next.
I had used all functionalities of skip, pause and previous. all these functionalities works awesome.
I want to use this like Instagram stories.
I had trying method for delete is give as below
func delete() {
let currentSegment = segments[currentAnimationIndex]
currentSegment.topSegmentView.frame.size.width = currentSegment.bottomSegmentView.frame.width
let newIndex = max(currentAnimationIndex - 1, 0)
if newIndex < self.segments.count {
self.delegate?.segmentedProgressBarChangedIndex(index: newIndex)
self.animate(animationIndex: newIndex)
} else {
self.delegate?.segmentedProgressBarFinished()
}
}
If any changes let me know
Hello , I am using this progress in collection view cell because of reloading cell it is not working as instagram. Sometimes the progress bar is not moving. Can any one help me in this.
Thanks
The only workaround I can think of at the moment without testing it is initializing multiple SegmentedProgressBars and laying them out in the view, but that's pretty inefficient. Is there a way to modify the duration of each bar itself?
Suppose timer have 6 screns eqch having its own duration and now user is on 3 screen and goes in background, and when coming bck to foreground so in that case how to open timer from same screen with same duration. Please confirm.
Hi, this is an enhancement suggestion for this library.
We can have tap to each of the segment to move to that part as well as have tap gesture on the left edge and right edge of the screen to move between segments.
In addition to this, when doing long press on screen, the transition can pause and when finger is lifted, the transition can resume.
Inspired from status option in whats app.
Regards
Hooda
Is it possible to change the number of segments after initialize an SPB instance? For example, a user could delete an item in middle of viewing, thus, segment should update to reflect number of viewing items.
Thanks for a fantastic library btw!
When i'm story view and app in background is not pause is directly move to next story when i'm open app.
Hello,
I am using your demo for one of my requirement, and successfully done next story on tap instead of pause.
But issue is the progress is not fresh start from second image.
Like multiple instagram story and swipe to swipe next story check.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.