Skip to content

Commit 4d3e0e0

Browse files
committed
Initial Commit
0 parents  commit 4d3e0e0

File tree

77 files changed

+2674
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+2674
-0
lines changed

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/libraries
5+
/.idea/modules.xml
6+
/.idea/workspace.xml
7+
.DS_Store
8+
/build
9+
/captures
10+
.externalNativeBuild

.idea/assetWizardSettings.xml

+68
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/caches/build_file_checksums.ser

594 Bytes
Binary file not shown.

.idea/codeStyles/Project.xml

+29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion rootProject.ext.compileSdkVersion
5+
defaultConfig {
6+
applicationId "com.gauravk.audiovisualizersample"
7+
minSdkVersion rootProject.ext.minSdkVersion
8+
targetSdkVersion rootProject.ext.targetSdkVersion
9+
versionCode 1
10+
versionName "1.0"
11+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12+
}
13+
buildTypes {
14+
release {
15+
minifyEnabled false
16+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17+
}
18+
}
19+
}
20+
21+
dependencies {
22+
implementation fileTree(dir: 'libs', include: ['*.jar'])
23+
//support dependencies
24+
implementation "com.android.support:design:$supportLibraryVersion"
25+
implementation "com.android.support:appcompat-v7:$supportLibraryVersion"
26+
implementation "com.android.support:support-v4:$supportLibraryVersion"
27+
implementation "com.android.support.constraint:constraint-layout:$constraintLayoutVersion"
28+
29+
//test dependencies
30+
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
31+
testImplementation "junit:junit:$jUnitVersion"
32+
androidTestImplementation "com.android.support.test:runner:$testRunnerVersion"
33+
androidTestImplementation "com.android.support.test.espresso:espresso-core:$expressoVersion"
34+
35+
//other module dependencies
36+
implementation project(':audiovisualizer')
37+
}

app/proguard-rules.pro

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.gauravk.audiovisualizersample;
2+
3+
import android.content.Context;
4+
import android.support.test.InstrumentationRegistry;
5+
import android.support.test.runner.AndroidJUnit4;
6+
7+
import org.junit.Test;
8+
import org.junit.runner.RunWith;
9+
10+
import static org.junit.Assert.*;
11+
12+
/**
13+
* Instrumented test, which will execute on an Android device.
14+
*
15+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
16+
*/
17+
@RunWith(AndroidJUnit4.class)
18+
public class ExampleInstrumentedTest {
19+
@Test
20+
public void useAppContext() {
21+
// Context of the app under test.
22+
Context appContext = InstrumentationRegistry.getTargetContext();
23+
24+
assertEquals("com.gauravk.audiovisualizersample", appContext.getPackageName());
25+
}
26+
}

app/src/main/AndroidManifest.xml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.gauravk.audiovisualizersample">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:roundIcon="@mipmap/ic_launcher_round"
10+
android:supportsRtl="true"
11+
android:theme="@style/AppTheme">
12+
<activity android:name=".ui.MainActivity">
13+
<intent-filter>
14+
<action android:name="android.intent.action.MAIN" />
15+
16+
<category android:name="android.intent.category.LAUNCHER" />
17+
</intent-filter>
18+
</activity>
19+
<activity android:name=".ui.BlobActivity" />
20+
<activity android:name=".ui.BlastActivity" />
21+
<activity android:name=".ui.WaveActivity" />
22+
<activity android:name=".ui.BarActivity"></activity>
23+
</application>
24+
25+
</manifest>

app/src/main/ic_launcher-web.png

10 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
Copyright 2018 Gaurav Kumar
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
package com.gauravk.audiovisualizersample.ui;
17+
18+
import android.support.v7.app.AppCompatActivity;
19+
import android.os.Bundle;
20+
21+
import com.gauravk.audiovisualizersample.R;
22+
import com.gauravk.audiovisualizersample.utils.AudioPlayer;
23+
import com.gauravk.musicvisualizer.visualizer.BarVisualizer;
24+
25+
public class BarActivity extends AppCompatActivity {
26+
27+
private BarVisualizer mVisualizer;
28+
29+
private AudioPlayer mAudioPlayer;
30+
31+
@Override
32+
protected void onCreate(Bundle savedInstanceState) {
33+
super.onCreate(savedInstanceState);
34+
setContentView(R.layout.activity_bar);
35+
36+
mVisualizer = findViewById(R.id.bar);
37+
38+
mAudioPlayer = new AudioPlayer();
39+
mAudioPlayer.play(this, R.raw.sample, new AudioPlayer.AudioPlayerEvent() {
40+
@Override
41+
public void onCompleted() {
42+
if (mVisualizer != null)
43+
mVisualizer.hide();
44+
}
45+
});
46+
int audioSessionId = mAudioPlayer.getAudioSessionId();
47+
if (audioSessionId != -1)
48+
mVisualizer.setAudioSessionId(audioSessionId);
49+
}
50+
51+
@Override
52+
protected void onDestroy() {
53+
super.onDestroy();
54+
if (mAudioPlayer != null)
55+
mAudioPlayer.stop();
56+
if (mVisualizer != null)
57+
mVisualizer.release();
58+
}
59+
}

0 commit comments

Comments
 (0)