Skip to content

Commit

Permalink
Commit initial
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthieuCotton committed Sep 1, 2016
0 parents commit ae844a2
Show file tree
Hide file tree
Showing 51 changed files with 806 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
27 changes: 27 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
}
17 changes: 17 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -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 *;
#}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.orange.matthieu.soudbox;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
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="com.orange.matthieu.soudbox">

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

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

</manifest>
125 changes: 125 additions & 0 deletions app/src/main/java/com/orange/matthieu/soudbox/MainActivity.java
Original file line number Diff line number Diff line change
@@ -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);
}

}
26 changes: 26 additions & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.orange.matthieu.soudbox.MainActivity">

<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">

<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />

</android.support.design.widget.AppBarLayout>

<include layout="@layout/content_main" />

</android.support.design.widget.CoordinatorLayout>
Loading

0 comments on commit ae844a2

Please sign in to comment.