Show horizontal progress like Instagram stories
Instagram Stories appear in a bar at the top of your feed — and all Instagram accounts will be able to share stories, from your best friends to your favorite popular accounts. When there’s something new to see, their profile photo will have a colorful ring around it.
Once you’re viewing a story, you can tap to go back and forward or swipe to jump to another person’s story. Unlike regular posts, there are no likes or public comments.
So in this tutorial i will design the horizontal progress like Instagram stories by using the StoriesProgressView Library by shts
Firstly, we need to add Dependency of StoriesProgressView in the app/build.gradle file and add the maven {url 'https://jitpack.io'} in project/build.gradle file
project/build.gradle
app/build.gradle
After adding the dependency I place no of image assets in the drawable folder because i do it statically you can also fetch images from the url by using the picasso or glide library after i use this three images
After placing all the images in the drawable images then come to activity_main.xml and add the ImageView for showing the image and add the StoriesProgressView to show the progress of each image
Then implement some functionality in MainActivity.java like duration to show each stories and when we click on a story it will skip to next one after completing view of all stories then we generate a toast story completed
Some Basic Function of this StoriesProgressView Library
1. skip() : storiesProgressView.skip();
2. reverse() : storiesProgressView.reverse();
3. pause() : storiesProgressView.pause();
4. resume() : storiesProgressView.resume();
Finally Run Your Android App and you will see horizontal progress like Instagram Stories
Written By : Tushar Verma
StoriesProgressView Github : https://github.com/shts/StoriesProgressView/
Linkedin Profile : https://www.linkedin.com/in/tushar-verma-047329154/
If you have an query related to this tutorial let me know in the comment section
Once you’re viewing a story, you can tap to go back and forward or swipe to jump to another person’s story. Unlike regular posts, there are no likes or public comments.
So in this tutorial i will design the horizontal progress like Instagram stories by using the StoriesProgressView Library by shts
Firstly, we need to add Dependency of StoriesProgressView in the app/build.gradle file and add the maven {url 'https://jitpack.io'} in project/build.gradle file
project/build.gradle
app/build.gradle
After adding the dependency I place no of image assets in the drawable folder because i do it statically you can also fetch images from the url by using the picasso or glide library after i use this three images
After placing all the images in the drawable images then come to activity_main.xml and add the ImageView for showing the image and add the StoriesProgressView to show the progress of each image
Then implement some functionality in MainActivity.java like duration to show each stories and when we click on a story it will skip to next one after completing view of all stories then we generate a toast story completed
Some Basic Function of this StoriesProgressView Library
1. skip() : storiesProgressView.skip();
2. reverse() : storiesProgressView.reverse();
3. pause() : storiesProgressView.pause();
4. resume() : storiesProgressView.resume();
Finally Run Your Android App and you will see horizontal progress like Instagram Stories
Written By : Tushar Verma
StoriesProgressView Github : https://github.com/shts/StoriesProgressView/
Linkedin Profile : https://www.linkedin.com/in/tushar-verma-047329154/
If you have an query related to this tutorial let me know in the comment section
Komentar
Posting Komentar