Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shts/storiesprogressview

show horizontal progress like instagram stories.
https://github.com/shts/storiesprogressview

android instagram library

Last synced: 5 days ago
JSON representation

show horizontal progress like instagram stories.

Awesome Lists containing this project

README

        

StoriesProgressView
====

Library that shows a horizontal progress like Instagram stories.

[![](https://jitpack.io/v/shts/StoriesProgressView.svg)](https://jitpack.io/#shts/StoriesProgressView)

^She is [Yui Kobayashi](http://www.keyakizaka46.com/s/k46o/artist/07)

How to Use
----

To see how a StoriesProgressView can be added to your xml layouts, check the sample project.

```xml

```
Overview

```java
public class YourActivity extends AppCompatActivity implements StoriesProgressView.StoriesListener {
private StoriesProgressView storiesProgressView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

storiesProgressView = (StoriesProgressView) findViewById(R.id.stories);
storiesProgressView.setStoriesCount(PROGRESS_COUNT); // <- set stories
storiesProgressView.setStoryDuration(1200L); // <- set a story duration
storiesProgressView.setStoriesListener(this); // <- set listener
storiesProgressView.startStories(); // <- start progress
}

@Override
public void onNext() {
Toast.makeText(this, "onNext", Toast.LENGTH_SHORT).show();
}

@Override
public void onPrev() {
// Call when finished revserse animation.
Toast.makeText(this, "onPrev", Toast.LENGTH_SHORT).show();
}

@Override
public void onComplete() {
Toast.makeText(this, "onComplete", Toast.LENGTH_SHORT).show();
}

@Override
protected void onDestroy() {
// Very important !
storiesProgressView.destroy();
super.onDestroy();
}
}
```

Skip and Reverse story
---

```java
storiesProgressView.skip();
storiesProgressView.reverse();
```

Pause and Resume story
---

```java
storiesProgressView.pause();
storiesProgressView.resume();
```

Install
---

Add it in your root build.gradle at the end of repositories:

```groovy
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}

```

Add the dependency

```
dependencies {
implementation 'com.github.shts:StoriesProgressView:3.0.0'
}

```

License
---

```
Copyright (C) 2017 Shota Saito(shts)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```