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

Commit

Permalink
Added java sample + prepared for release
Browse files Browse the repository at this point in the history
  • Loading branch information
alxrm committed Nov 5, 2016
1 parent e6b36e4 commit 75ed3d0
Show file tree
Hide file tree
Showing 7 changed files with 268 additions and 205 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'com.android.support:appcompat-v7:24.2.1'
compile project(':audiowave')
compile 'com.github.alxrm:Audiogram:0.3'
}
repositories {
mavenCentral()
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".AnotherActivity">
</activity>
</application>

</manifest>
28 changes: 28 additions & 0 deletions app/src/main/java/rm/com/audiogram/AnotherActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package rm.com.audiogram;

import android.app.Activity;
import android.os.Bundle;

import rm.com.audiowave.AudioWaveView;

public class AnotherActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_another);

final AudioWaveView waveView = (AudioWaveView) findViewById(R.id.wave);
final byte[] data = { 1, 3, 37, 117, 69, 0, 0, 58 };

waveView.setScaledData(data);

// waveView.setRawData(data, new Function0<Unit>() {
// @Override
// public Unit invoke() {
// Log.d("Set raw data", "Callback called");
// return null;
// }
// });
}
}
30 changes: 30 additions & 0 deletions app/src/main/res/layout/activity_another.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/activity_another"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="rm.com.audiogram.AnotherActivity"
xmlns:app="http://schemas.android.com/apk/res-auto">

<rm.com.audiowave.AudioWaveView
android:id="@+id/wave"
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_centerInParent="true"
android:layout_margin="16dp"
app:chunkWidth="3dp"
app:chunkHeight="24dp"
app:minChunkHeight="2dp"
app:chunkSpacing="1dp"
app:chunkRadius="1dp"
app:waveColor="@android:color/black"
app:progress="0.0"
/>

</RelativeLayout>
2 changes: 1 addition & 1 deletion audiowave/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ android {
}

dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'org.jetbrains.kotlin:kotlin-stdlib:1.0.4'
}

repositories {
Expand Down
Loading

0 comments on commit 75ed3d0

Please sign in to comment.