diff --git a/.gitignore b/.gitignore
index afbdab33..79da7d71 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@
/.idea/libraries
.DS_Store
/build
+*.properties
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
deleted file mode 100644
index 217af471..00000000
--- a/.idea/compiler.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml
deleted file mode 100644
index e7bedf33..00000000
--- a/.idea/copyright/profiles_settings.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
deleted file mode 100644
index e206d70d..00000000
--- a/.idea/encodings.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
deleted file mode 100644
index 2071d1a6..00000000
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml
deleted file mode 100644
index 3b312839..00000000
--- a/.idea/inspectionProfiles/profiles_settings.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index b0a270f5..c665c8fe 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,36 +1,45 @@
-
-
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ Spelling
+
+
+
+
+ SpellCheckingInspection
+
+
+
+
+
+
+
+
+
+ 1.8
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index eb3197b3..00000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml
deleted file mode 100644
index 922003b8..00000000
--- a/.idea/scopes/scope_settings.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index c63efbb2..00000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000..5b5fc374
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,23 @@
+ language: android
+jdk:
+ - oraclejdk8
+android:
+ components:
+ - platform-tools
+ - tools
+ - build-tools-25.0.0
+ - android-21
+ - extra-android-support
+ - extra-android-m2repository
+ - extra-google-m2repository
+licenses:
+ - 'android-sdk-preview-license-.+'
+ - 'android-sdk-license-.+'
+ - 'google-gdk-license-.+'
+
+before_install:
+ - export JAVA7_HOME=/usr/lib/jvm/java-7-oracle
+ - export JAVA8_HOME=/usr/lib/jvm/java-8-oracle
+ - export JAVA_HOME=$JAVA8_HOME
+script:
+ - ./gradlew clean assemble || ./gradlew clean assemble
diff --git a/SoundRecorder.iml b/SoundRecorder.iml
index 40b8fc4a..b24f32f9 100644
--- a/SoundRecorder.iml
+++ b/SoundRecorder.iml
@@ -1,5 +1,5 @@
-
+
diff --git a/app/.idea/.name b/app/.idea/.name
new file mode 100644
index 00000000..5a046d03
--- /dev/null
+++ b/app/.idea/.name
@@ -0,0 +1 @@
+SoundRecorder
\ No newline at end of file
diff --git a/app/.idea/dictionaries/Inam.xml b/app/.idea/dictionaries/Inam.xml
new file mode 100644
index 00000000..02215030
--- /dev/null
+++ b/app/.idea/dictionaries/Inam.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/app/.idea/gradle.xml
similarity index 70%
rename from .idea/gradle.xml
rename to app/.idea/gradle.xml
index 2a7f5bfc..d417c89f 100644
--- a/.idea/gradle.xml
+++ b/app/.idea/gradle.xml
@@ -3,13 +3,12 @@
-
+
-
+
-
diff --git a/app/.idea/libraries/com_android_support_appcompat_v7_21_0_3.xml b/app/.idea/libraries/com_android_support_appcompat_v7_21_0_3.xml
new file mode 100644
index 00000000..c644ce38
--- /dev/null
+++ b/app/.idea/libraries/com_android_support_appcompat_v7_21_0_3.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.idea/libraries/com_android_support_cardview_v7_21_0_3.xml b/app/.idea/libraries/com_android_support_cardview_v7_21_0_3.xml
new file mode 100644
index 00000000..166dc08b
--- /dev/null
+++ b/app/.idea/libraries/com_android_support_cardview_v7_21_0_3.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.idea/libraries/com_android_support_recyclerview_v7_21_0_3.xml b/app/.idea/libraries/com_android_support_recyclerview_v7_21_0_3.xml
new file mode 100644
index 00000000..3f0d7fa5
--- /dev/null
+++ b/app/.idea/libraries/com_android_support_recyclerview_v7_21_0_3.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.idea/libraries/com_android_support_support_annotations_21_0_3_jar.xml b/app/.idea/libraries/com_android_support_support_annotations_21_0_3_jar.xml
new file mode 100644
index 00000000..ad316242
--- /dev/null
+++ b/app/.idea/libraries/com_android_support_support_annotations_21_0_3_jar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.idea/libraries/com_android_support_support_v4_21_0_3.xml b/app/.idea/libraries/com_android_support_support_v4_21_0_3.xml
new file mode 100644
index 00000000..ab0a197c
--- /dev/null
+++ b/app/.idea/libraries/com_android_support_support_v4_21_0_3.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.idea/libraries/com_jpardogo_materialtabstrip_library_1_0_6.xml b/app/.idea/libraries/com_jpardogo_materialtabstrip_library_1_0_6.xml
new file mode 100644
index 00000000..bff518c9
--- /dev/null
+++ b/app/.idea/libraries/com_jpardogo_materialtabstrip_library_1_0_6.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.idea/libraries/com_melnykov_floatingactionbutton_1_1_0.xml b/app/.idea/libraries/com_melnykov_floatingactionbutton_1_1_0.xml
new file mode 100644
index 00000000..1a6fdac3
--- /dev/null
+++ b/app/.idea/libraries/com_melnykov_floatingactionbutton_1_1_0.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.idea/libraries/com_nineoldandroids_library_2_4_0_jar.xml b/app/.idea/libraries/com_nineoldandroids_library_2_4_0_jar.xml
new file mode 100644
index 00000000..510e69cd
--- /dev/null
+++ b/app/.idea/libraries/com_nineoldandroids_library_2_4_0_jar.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.idea/misc.xml b/app/.idea/misc.xml
new file mode 100644
index 00000000..47d80301
--- /dev/null
+++ b/app/.idea/misc.xml
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Spelling
+
+
+
+
+ SpellCheckingInspection
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1.8
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.idea/modules.xml b/app/.idea/modules.xml
new file mode 100644
index 00000000..573f5ffa
--- /dev/null
+++ b/app/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/app/.idea/runConfigurations.xml
similarity index 100%
rename from .idea/runConfigurations.xml
rename to app/.idea/runConfigurations.xml
diff --git a/app/.idea/vcs.xml b/app/.idea/vcs.xml
new file mode 100644
index 00000000..6c0b8635
--- /dev/null
+++ b/app/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.idea/workspace.xml b/app/.idea/workspace.xml
new file mode 100644
index 00000000..f4f1a41a
--- /dev/null
+++ b/app/.idea/workspace.xml
@@ -0,0 +1,2632 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/app.iml b/app/app.iml
index 1cdca55a..52c16be4 100644
--- a/app/app.iml
+++ b/app/app.iml
@@ -1,5 +1,5 @@
-
+
@@ -22,7 +22,7 @@
-
+
@@ -62,13 +62,6 @@
-
-
-
-
-
-
-
@@ -76,13 +69,17 @@
+
+
+
+
+
+
+
-
-
-
@@ -92,8 +89,6 @@
-
-
@@ -101,20 +96,19 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/gradle/wrapper/gradle-wrapper.jar b/app/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000..13372aef
Binary files /dev/null and b/app/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/app/gradlew.bat b/app/gradlew.bat
new file mode 100644
index 00000000..8a0b282a
--- /dev/null
+++ b/app/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/app/src/main/java/com/danielkim/soundrecorder/fragments/RecordFragment.java b/app/src/main/java/com/danielkim/soundrecorder/fragments/RecordFragment.java
index 151822c0..e46f1a75 100644
--- a/app/src/main/java/com/danielkim/soundrecorder/fragments/RecordFragment.java
+++ b/app/src/main/java/com/danielkim/soundrecorder/fragments/RecordFragment.java
@@ -19,6 +19,8 @@
import com.melnykov.fab.FloatingActionButton;
import java.io.File;
+import java.io.IOError;
+import java.io.IOException;
/**
* A simple {@link Fragment} subclass.
@@ -88,6 +90,14 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
public void onClick(View v) {
onRecord(mStartRecording);
mStartRecording = !mStartRecording;
+
+ if(mPauseButton.getVisibility() == View.GONE){
+ mPauseButton.setVisibility(View.VISIBLE);
+ }else{
+ mPauseButton.setVisibility(View.GONE);
+ }
+
+
}
});
@@ -104,6 +114,21 @@ public void onClick(View v) {
return recordView;
}
+ private void createFolderForRecordings(){
+
+ boolean isStorageAvailable = Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED);
+ if(isStorageAvailable){
+ File folder = new File(Environment.getExternalStorageDirectory() + "/SoundRecorder");
+ if (!folder.exists()) {
+ //folder /SoundRecorder doesn't exist, create the folder
+ boolean isFolderCreated = folder.mkdir();
+ if (!isFolderCreated) {
+ Toast.makeText(getActivity(), "Unable to create directory!!", Toast.LENGTH_SHORT).show();
+ }
+
+ }
+ }
+ }
// Recording Start/Stop
//TODO: recording pause
private void onRecord(boolean start){
@@ -115,12 +140,7 @@ private void onRecord(boolean start){
mRecordButton.setImageResource(R.drawable.ic_media_stop);
//mPauseButton.setVisibility(View.VISIBLE);
Toast.makeText(getActivity(),R.string.toast_recording_start,Toast.LENGTH_SHORT).show();
- File folder = new File(Environment.getExternalStorageDirectory() + "/SoundRecorder");
- if (!folder.exists()) {
- //folder /SoundRecorder doesn't exist, create the folder
- folder.mkdir();
- }
-
+ createFolderForRecordings();
//start Chronometer
mChronometer.setBase(SystemClock.elapsedRealtime());
mChronometer.start();