Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
alxrm authored Nov 26, 2016
1 parent 22dce9b commit d29d4bb
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![](https://jitpack.io/v/alxrm/Audiogram.svg)](https://jitpack.io/#alxrm/Audiogram)
[![License](http://img.shields.io/badge/license-MIT-green.svg?style=flat)]()

Super lightweight component to create audiowaves written in Kotlin
Super lightweight audiowave progressbar written in Kotlin



Expand All @@ -24,7 +24,7 @@ allprojects {
Add the dependency:
```Groovy
dependencies {
compile 'com.github.alxrm:Audiogram:0.5'
compile 'com.github.alxrm:Audiogram:0.6'
}
```

Expand Down Expand Up @@ -58,27 +58,49 @@ Settle the wave somewhere in your XML like this:
/>
```

####There are 2 ways you can work with this component:
## API

* Set raw byte array asynchronously
Set raw byte array asynchronously

```java

// does downsampling in O(N) and shows the animation you see in a gif above (the inflation-like one)
setRawData(byte[] data);

// you also have the ability to listen, when does the downsampling complete
setRawData(byte[] data, Function0<Unit> callback);
setRawData(byte[] data, OnSamplingListener callback);
```

* In case you have scaled byte array you want to draw
In case you have scaled byte array you want to draw

```java

// instantly redraws the wave without async downsampling process
setScaledData(byte[] scaledData);
```

Now you can use it like a `Seekbar`, it reacts on touches, just attach listener

```java
setOnProgressListener(OnProgressListener listener);
```

This listener has 3 methods like a built-in `Seekbar`

```java
void onStartTracking(float progress) {
// invokes when user touches the view
}

void onStopTracking(float progress) {
// invokes when user releases the touch
}

void onProgressChanged(float progress, boolean byUser) {
// invokes every time the progress's been changed
}
```

## Contribution

There are some features(like seeking) I am about to implement, but a little bit later.
Expand Down

0 comments on commit d29d4bb

Please sign in to comment.