Skip to content

Commit

Permalink
首次提交
Browse files Browse the repository at this point in the history
  • Loading branch information
JinJieGu committed Jul 29, 2017
1 parent b8f1fbd commit 932f3d3
Show file tree
Hide file tree
Showing 37 changed files with 1,488 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

### Android template
# Built application files
*.apk
*.ap_

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
build/
androidTest/
test/
# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# Intellij
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/dictionaries
.idea/libraries

# Keystore files
*.jks

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild

# Google Services (e.g. APIs or Firebase)
google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
33 changes: 33 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "jaygoo.wavelineview"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])

compile 'com.android.support:appcompat-v7:25.3.1'
testCompile 'junit:junit:4.12'
compile project(path: ':library')
compile 'com.github.Jay-Goo:AndroidMP3Recorder:v1.0.7'
//内存泄漏检测
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
}
25 changes: 25 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/mac/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
23 changes: 23 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="jaygoo.wavelineview">

<application
android:name=".App"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity"
>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>

</manifest>
25 changes: 25 additions & 0 deletions app/src/main/java/jaygoo/wavelineview/App.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package jaygoo.wavelineview;

import android.app.Application;

import com.squareup.leakcanary.LeakCanary;


/**
* ================================================
* 作 者:JayGoo
* 版 本:
* 创建日期:2017/7/28
* 描 述:
* ================================================
*/
public class App extends Application {
@Override
public void onCreate() {
super.onCreate();
if (LeakCanary.isInAnalyzerProcess(this)) {
return;
}
LeakCanary.install(this);
}
}
60 changes: 60 additions & 0 deletions app/src/main/java/jaygoo/wavelineview/MainActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package jaygoo.wavelineview;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import jaygoo.widget.wlv.WaveLineView;

public class MainActivity extends AppCompatActivity {

private WaveLineView waveLineView;
private WaveMp3Recorder waveMp3Recorder;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// waveLineView = (WaveLineView) findViewById(R.id.waveLineView);
waveMp3Recorder = (WaveMp3Recorder) findViewById(R.id.waveLineView);
findViewById(R.id.startBtn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!waveMp3Recorder.isRecording()){
waveMp3Recorder.startRecord();
}
}
});

findViewById(R.id.stopBtn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (waveMp3Recorder.isRecording()){
waveMp3Recorder.stopRecord(true);
}
}
});
}


@Override
protected void onResume() {
super.onResume();
// waveLineView.onResume(true);
waveMp3Recorder.onResume();
}

@Override
protected void onPause() {
super.onPause();
// waveLineView.onPause();
waveMp3Recorder.onPause();
}

@Override
protected void onDestroy() {
super.onDestroy();
// waveLineView.release();
// waveMp3Recorder.release();
}
}
Loading

0 comments on commit 932f3d3

Please sign in to comment.