diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c6cbe56 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..800b1cd --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +SoudBox \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..508b3d9 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..5d19981 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..35646bf --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..7f68460 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..7eb552e --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,27 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 24 + buildToolsVersion "24.0.1" + + defaultConfig { + applicationId "com.orange.matthieu.soudbox" + minSdkVersion 19 + targetSdkVersion 24 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + testCompile 'junit:junit:4.12' + compile 'com.android.support:appcompat-v7:24.2.0' + compile 'com.android.support:design:24.2.0' +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..0221ce8 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /home/matthieu/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 *; +#} diff --git a/app/src/androidTest/java/com/orange/matthieu/soudbox/ApplicationTest.java b/app/src/androidTest/java/com/orange/matthieu/soudbox/ApplicationTest.java new file mode 100644 index 0000000..044e9c6 --- /dev/null +++ b/app/src/androidTest/java/com/orange/matthieu/soudbox/ApplicationTest.java @@ -0,0 +1,13 @@ +package com.orange.matthieu.soudbox; + +import android.app.Application; +import android.test.ApplicationTestCase; + +/** + * Testing Fundamentals + */ +public class ApplicationTest extends ApplicationTestCase { + public ApplicationTest() { + super(Application.class); + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..378b943 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/orange/matthieu/soudbox/MainActivity.java b/app/src/main/java/com/orange/matthieu/soudbox/MainActivity.java new file mode 100644 index 0000000..ac72bf6 --- /dev/null +++ b/app/src/main/java/com/orange/matthieu/soudbox/MainActivity.java @@ -0,0 +1,125 @@ +package com.orange.matthieu.soudbox; + + +import android.media.MediaPlayer; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.util.Log; +import android.view.View; +import android.view.Menu; +import android.view.MenuItem; +import android.widget.Button; + +public class MainActivity extends AppCompatActivity implements View.OnClickListener { + + public final static String TAG = MainActivity.class.getSimpleName(); + + private Button mBtnOnSenBatLesCouillesCourt; + private Button mBtnMalou; + private Button mBtnMakelele; + private Button mBtnlambert; + private Button mBtnOnSenBatLesCouillesLong; + private Button mBtnFilmLesPieds; + private Button mBtnPasltps; + private Button mButton8; + + private MediaPlayer mMediaPlayer; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + initBtn(); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + // Inflate the menu; this adds items to the action bar if it is present. + getMenuInflater().inflate(R.menu.menu_main, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + // Handle action bar item clicks here. The action bar will + // automatically handle clicks on the Home/Up button, so long + // as you specify a parent activity in AndroidManifest.xml. + int id = item.getItemId(); + + //noinspection SimplifiableIfStatement + if (id == R.id.action_settings) { + return true; + } + + return super.onOptionsItemSelected(item); + } + + @Override + public void onClick(View view) { + + if (mMediaPlayer != null) { + if (mMediaPlayer.isPlaying()) + mMediaPlayer.stop(); + } + + switch (view.getId()) { + case R.id.onSenBatLesCouillesCourt: + mMediaPlayer = MediaPlayer.create(this, R.raw.onsenbatcourt); + mMediaPlayer.start(); + Log.d(TAG, "onClick: button1"); + break; + case R.id.Malou: + mMediaPlayer = MediaPlayer.create(this, R.raw.malou); + mMediaPlayer.start(); + Log.d(TAG, "onClick: button2"); + break; + case R.id.Makelele: + mMediaPlayer = MediaPlayer.create(this, R.raw.makelele); + mMediaPlayer.start(); + Log.d(TAG, "onClick: button3"); + break; + case R.id.lambert: + mMediaPlayer = MediaPlayer.create(this, R.raw.boitalambert); + mMediaPlayer.start(); + Log.d(TAG, "onClick: button4"); + break; + case R.id.onSenBatLesCouillesLong: + mMediaPlayer = MediaPlayer.create(this, R.raw.on_sen_bat_les_couilles); + mMediaPlayer.start(); + break; + case R.id.filmLesPieds: + mMediaPlayer = MediaPlayer.create(this, R.raw.filmpieds); + mMediaPlayer.start(); + break; + case R.id.pasltps: + mMediaPlayer = MediaPlayer.create(this, R.raw.pasltpsniaser); + mMediaPlayer.start(); + break; + + } + + } + + private void initBtn() { + mBtnOnSenBatLesCouillesCourt = (Button) findViewById(R.id.onSenBatLesCouillesCourt); + mBtnMalou = (Button) findViewById(R.id.Malou); + mBtnMakelele = (Button) findViewById(R.id.Makelele); + mBtnlambert = (Button) findViewById(R.id.lambert); + mBtnOnSenBatLesCouillesLong = (Button) findViewById(R.id.onSenBatLesCouillesLong); + mBtnFilmLesPieds = (Button) findViewById(R.id.filmLesPieds); + mBtnPasltps = (Button) findViewById(R.id.pasltps); + + + mBtnOnSenBatLesCouillesCourt.setOnClickListener(this); + mBtnMalou.setOnClickListener(this); + mBtnMakelele.setOnClickListener(this); + mBtnlambert.setOnClickListener(this); + mBtnOnSenBatLesCouillesLong.setOnClickListener(this); + mBtnFilmLesPieds.setOnClickListener(this); + mBtnPasltps.setOnClickListener(this); + } + +} diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..732ff7c --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml new file mode 100644 index 0000000..41381ae --- /dev/null +++ b/app/src/main/res/layout/content_main.xml @@ -0,0 +1,70 @@ + + + +